Double-precision floating point (±1.7E±308, ~15 decimal digits)
1st Parameter
The input value for which the error function is computed
Read more about parameters of erf in parameters section
The erffunction in C language Calculates the error function of the specified number.
The erf function computes the error function of x. The error function (also called the Gauss error function) is a special function of sigmoid shape that occurs in probability, statistics, and partial differential equations. It is defined as erf(x) = (2/√π) ∫(0 to x) exp(-t^2) dt. This function is used in various fields including physics, chemistry, and signal processing.
The erffunction takes 1
parameter:
•
double `x`: The input value for which the error function is computed
Computes the error function of the given value `x`. The error function is defined as the integral of e^(-t^2) from 0 to `x`, and it is used in statistics and probability theory.
The erf function return value :
Returns the error function value of x
The return value is always in the range [-1, 1]
Output
This example demonstrates the basic usage of the `erf` function for various input values, showing how the error function behaves for negative, zero, and positive inputs.