C Standard Library

C <math.h> - erfc() Function



The C <math.h> erfc() function returns the complementary error function of the argument. The complementary error function of x is defined as:

erfc function

Where, erf(x) is an error function. Error functions usually occur in probability, statistics and partial differential equation describing diffusion.

Complementary Error Function

Syntax

double erfc (double x);
float erfcf (float x);
long double erfcl (long double x);

Parameters

x Specify the value.

Return Value

Returns the complementary error function of the argument.

Example:

In the example below, erfc() function returns the complementary error function of the given value.

#include <stdio.h>
#include <math.h>
 
int main (){
  printf("%lf\n", erfc(0));
  printf("%lf\n", erfc(1));
  printf("%lf\n", erfc(2));
  printf("%lf\n", erfc(-1));
  printf("%lf\n", erfc(-2));    
  return 0;
}

The output of the above code will be:

1.000000
0.157299
0.004678
1.842701
1.995322

❮ C <math.h> Library