我要评分
获取效率
正确性
完整性
易理解

erfinv

Inverse error function. The input parameter is a real number.

Interface Definition

C interface:

float erfinvf(float x);

double erfinv(double x);

Parameters

Parameter

Type

Description

Input/Output

x

  • For erfinvf, x is of single-precision floating-point type.
  • For erfinv, x is of double-precision floating-point type.

Floating-point value of the input data.

Input

Return Value

  • The inverse error function computing result y of the input parameter x is returned. y ∈ [–inf, +inf]
  • If the input is NaN, the return value is NaN.
  • If the input is +∞, the return value is NaN.
  • If the input is –∞, the return value is NaN.
  • If the input is 1, the return value is +inf.
  • If the input is –1, the return value is –inf.
  • If the input x is greater than 1, the return value is NaN.
  • If the input x is smaller than –1, the return value is NaN.

Dependency

C: "km.h"

Example

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
     * 
     * */