erfcx
入参为实数。。
接口定义
C interface:
float erfcxf(float x);
double erfcx(double x);
参数
参数名 |
类型 |
描述 |
输入/输出 |
---|---|---|---|
x |
|
表示输入数据的浮点值。 |
输入 |
返回值
- 返回入参x的误差函数结果y,y ∈ [-1, +1]。
- 输入nan,返回nan。
- 输入+∞,返回0。
- 输入-∞,返回inf。
- float接口,输入x <= -0x1.2c3cbep3,返回inf。
- double接口,输入x <= -0x1.aa0f4d2e063cfp4,返回inf。
依赖
C: "km.h"
示例
C interface:
// print result printf("erfcx(0.0) = %.15f\n",erfcx(0.0)); printf("erfcx(-0.0) = %.15f\n",erfcx(-0.0)); printf("erfcx(0.25) = %.15f\n",erfcx(0.25)); printf("erfcx(-0.25) = %.15f\n",erfcx(-0.25)); printf("erfcx(0.5) = %.15f\n",erfcx(0.5)); printf("erfcx(-0.5) = %.15f\n",erfcx(-0.5)); printf("erfcx(1.0) = %.15f\n",erfcx(1.0)); printf("erfcx(-1.0) = %.15f\n",erfcx(-1.0)); printf("erfcx(2.0) = %.15f\n",erfcx(2.0)); printf("erfcx(-2.0) = %.15f\n",erfcx(-2.0)); printf("erfcx(INFINITY) = %.15f\n",erfcx(INFINITY)); printf("erfcx(-INFINITY) = %.15f\n",erfcx(-INFINITY)); printf("erfcx(NAN) = %.15f\n",erfcx(NAN)); printf("erfcx(-NAN) = %.15f\n",erfcx(-NAN)); /* * erfcx(0.0) = 1.000000000000000 * erfcx(-0.0) = 1.000000000000000 * erfcx(0.25) = 0.770346547730997 * erfcx(-0.25) = 1.358642370104722 * erfcx(0.5) = 0.615690344192926 * erfcx(-0.5) = 1.952360489182557 * erfcx(1.0) = 0.427583576155807 * erfcx(-1.0) = 5.008980080762283 * erfcx(2.0) = 0.255395676310506 * erfcx(-2.0) = 108.940904389977973 * erfcx(INFINITY) = 0.000000000000000 * erfcx(-INFINITY) = inf * erfcx(NAN) = nan * erfcx(-NAN) = -nan * * */
父主题: 特殊函数