最終更新日時(UTC):
が更新

履歴 編集

function
<cmath>

std::asinh

namespace std {
  float asinh(float x);             // (1) C++11からC++20まで
  double asinh(double x);           // (2) C++11からC++20まで
  long double asinh(long double x); // (3) C++11からC++20まで

  floating-point-type
    asinh(floating-point-type x);   // (4) C++23
  constexpr floating-point-type
    asinh(floating-point-type x);   // (4) C++26

  double
    asinh(Integral x);              // (5) C++11
  constexpr double
    asinh(Integral x);              // (5) C++26

  float
    asinhf(float x);                // (6) C++17
  constexpr float
    asinhf(float x);                // (6) C++26

  long double
    asinhl(long double x);          // (7) C++17
  constexpr long double
    asinhl(long double x);          // (7) C++26
}

概要

算術型の逆双曲線正弦(エリアハイパボリックサイン、area hyperbolic sine)を求める。

戻り値

引数 x の逆双曲線正弦を返す。

備考

#include <cmath>
#include <iostream>

int main() {
  std::cout << std::fixed;
  std::cout << "asinh(-1.0) = " << std::asinh(-1.0) << std::endl;
  std::cout << "asinh(0.0)  = " << std::asinh(0.0) << std::endl;
  std::cout << "asinh(1.0)  = " << std::asinh(1.0) << std::endl;
}

出力

asinh(-1.0) = -0.881374
asinh(0.0)  = 0.000000
asinh(1.0)  = 0.881374

バージョン

言語

  • C++11

処理系

  • Clang: 2.9 , 3.1
  • GCC: 4.3.4 , 4.4.5 , 4.5.2 , 4.6.1 , 4.7.0

備考

特定の環境では、早期に constexpr 対応されている場合がある:

  • GCC 4.6.1 以上

実装例

以下のマクローリン級数を適当な次数で打ち切ることで近似的に求めることができる。

arsinh x=n=0(1)n(2n)!4n(n!)2(2n+1)x2n+1for|x|<1

または対数に変換して求めることができる。

arsinh x=loge(x+x2+1)for allx

参照