erfinv
逆误差函数,输入参数为实数。
接口定义
C interface:
float erfinvf(float x);
double erfinv(double x);
参数
参数名 |
类型 |
描述 |
输入/输出 |
---|---|---|---|
x |
|
表示输入数据的浮点值。 |
输入 |
返回值
- 返回入参x的逆误差函数结果y,y ∈ [-inf, +inf]。
- 输入nan,返回nan。
- 输入+∞,返回nan。
- 输入-∞,返回nan。
- 输入1,返回+inf。
- 输入-1,返回-inf。
- 输入x > 1,返回nan。
- 输入x < -1,返回nan。
依赖
C: "km.h"
示例
C interface:
// print result printf("erfinv(0.0) = %.15f\n",erfinv(0.0)); printf("erfinv(-0.0) = %.15f\n",erfinv(-0.0)); printf("erfinv(0.25) = %.15f\n",erfinv(0.25)); printf("erfinv(-0.25) = %.15f\n",erfinv(-0.25)); printf("erfinv(0.5) = %.15f\n",erfinv(0.5)); printf("erfinv(-0.5) = %.15f\n",erfinv(-0.5)); printf("erfinv(1.0) = %.15f\n",erfinv(1.0)); printf("erfinv(-1.0) = %.15f\n",erfinv(-1.0)); printf("erfinv(2.0) = %.15f\n",erfinv(2.0)); printf("erfinv(-2.0) = %.15f\n",erfinv(-2.0)); printf("erfinv(INFINITY) = %.15f\n",erfinv(INFINITY)); printf("erfinv(-INFINITY) = %.15f\n",erfinv(-INFINITY)); printf("erfinv(NAN) = %.15f\n",erfinv(NAN)); printf("erfinv(-NAN) = %.15f\n",erfinv(-NAN)); /* * erfinv(0.0) = 0.000000000000000 * erfinv(-0.0) = -0.000000000000000 * erfinv(0.25) = 0.225312055012178 * erfinv(-0.25) = -0.225312055012178 * erfinv(0.5) = 0.476936276204470 * erfinv(-0.5) = -0.476936276204470 * erfinv(1.0) = inf * erfinv(-1.0) = -inf * erfinv(2.0) = nan * erfinv(-2.0) = nan * erfinv(INFINITY) = nan * erfinv(-INFINITY) = nan * erfinv(NAN) = nan * erfinv(-NAN) = -nan * * */
父主题: 特殊函数