The acosh functions (C99) - acosh, acoshf, acoshl

双曲線逆余弦 (arccosh) を計算します.

acosh (c99)

#include <math.h>
double acosh(
    double x
);

acosh 関数は x の双曲線逆余弦 (arccosh) を計算し,結果を double 型で返します.

acoshf (c99)

#include <math.h>
float acoshf(
    float x
);

acoshf 関数は x の双曲線逆余弦 (arccosh) を計算し,結果を float 型で返します.

acoshl (c99)

#include <math.h>
long double acoshl(
    long double x
);

acoshl 関数は x の双曲線逆余弦 (arccosh) を計算し,結果を long double 型で返します.

acosh,acoshf,acoshl 関数は,実引数が 1 未満の場合,定義域エラー (domain error) が発生します.

戻り値

  • 区間 [0, +infinity] の双曲線逆余弦値

数学上の表記

arccosh

C言語サンプルプログラム

以下にacosh 関数を使用したサンプルプログラムを示します.

/* header files */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

/* main */
int main(void) {
    double x = 2.0;
    double acosh_x01, acosh_x02;

    /* 双曲線逆余弦を求める */
    acosh_x01 = acosh(x);
    acosh_x02 = log(x + sqrt(x * x - 1.0));

    /* 表示 */
    printf("acosh 関数で求めた値:   %.10f\n", acosh_x01);
    printf("数学的定義から求めた値: %.10f\n", acosh_x02);

    return exit_success;
}

実行例

サンプルプログラムの実行結果は以下のようになります.

acosh 関数で求めた値: 1.3169578969
数学的定義から求めた値: 1.3169578969