erfc
互补误差函数,输入参数为实数。erfc(x) = 1 - erf(x)。
接口定义
C interface:
float erfcf(float x);
double erfc(double x);
参数
参数名  | 
类型  | 
描述  | 
输入/输出  | 
|---|---|---|---|
x  | 
  | 
表示输入数据的浮点值。  | 
输入  | 
返回值
- 返回入参x的互补误差函数结果y,y ∈ [0, +2]。
 - 输入nan,返回nan。
 - 输入+∞,返回0。
 - 输入-∞,返回2。
 - float接口,输入|x| <= 0x1p-26,返回1。
 - float接口,输入x >= 0x1.466666p+3,返回0。
 - float接口,输入x <= -0x1.f5a88ap+1,返回2。
 - double接口,输入|x| <= 0x1p-70,返回1。
 - double接口,输入x >= 0x1.b39dc41e48bfdp+4,返回0。
 - double接口,输入x <= -0x1.7744f8f74e94ap+2,返回2。
 
依赖
C: "km.h"
示例
C interface:
    // print result
    printf("erfc(0.0) = %.15f\n",erfc(0.0));
    printf("erfc(-0.0) = %.15f\n",erfc(-0.0));
    printf("erfc(0.25) = %.15f\n",erfc(0.25));
    printf("erfc(-0.25) = %.15f\n",erfc(-0.25));
    printf("erfc(0.5) = %.15f\n",erfc(0.5));
    printf("erfc(-0.5) = %.15f\n",erfc(-0.5));
    printf("erfc(1.0) = %.15f\n",erfc(1.0));
    printf("erfc(-1.0) = %.15f\n",erfc(-1.0));
    printf("erfc(2.0) = %.15f\n",erfc(2.0));
    printf("erfc(-2.0) = %.15f\n",erfc(-2.0));
    printf("erfc(INFINITY) = %.15f\n",erfc(INFINITY));
    printf("erfc(-INFINITY) = %.15f\n",erfc(-INFINITY));
    printf("erfc(NAN) = %.15f\n",erfc(NAN));
    printf("erfc(-NAN) = %.15f\n",erfc(-NAN));
    /* 
     * erfc(0.0) = 1.000000000000000
     * erfc(-0.0) = 1.000000000000000
     * erfc(0.25) = 0.723673609831763
     * erfc(-0.25) = 1.276326390168237
     * erfc(0.5) = 0.479500122186953
     * erfc(-0.5) = 1.520499877813047
     * erfc(1.0) = 0.157299207050285
     * erfc(-1.0) = 1.842700792949715
     * erfc(2.0) = 0.004677734981047
     * erfc(-2.0) = 1.995322265018953
     * erfc(INFINITY) = 0.000000000000000
     * erfc(-INFINITY) = 2.000000000000000
     * erfc(NAN) = nan
     * erfc(-NAN) = -nan
     * 
     * */
父主题: 特殊函数