function
<cmath> <ctgmath>
erfc
double erfc (double x);
float erfcf (float x);
long double erfcl (long double x);
double erfc (double x);
float erfc (float x);
long double erfc (long double x);
double erfc (T x); // additional overloads for integral types
Compute complementary error function
Returns the complementary error function value for x.
The complementary error function is equivalent to:
erfc(x) = 1-erf(x)
Header
<tgmath.h> provides a type-generic macro version of this function.
Additional overloads are provided in this header (
<cmath>
) for the
integral types: These overloads effectively cast
x to a
double
before calculations (defined for
T being any
integral type).
Parameters
- x
- Parameter for the complementary error function.
Example
1 2 3 4 5 6 7 8 9 10 11 12
|
/* erfc example */
#include <stdio.h> /* printf */
#include <math.h> /* erfc */
int main ()
{
double param, result;
param = 1.0;
result = erfc (param);
printf ("erfc(%f) = %f\n", param, result );
return 0;
}
|
Output:
erfc (1.000000) = 0.157299
|
See also
- erf
- Compute error function (function
)
- lgamma
- Compute log-gamma function (function
)
- tgamma
- Compute gamma function (function
)