# \(\text{erfc}\)¶

You can use the \(\text{erfc}\) function to calculate the complementary error function of a value.

You can use the `\erfc`

backslash command to insert this function.

The following variants of this function are available:

\(\text{complex } \text{erfc} \left ( \text{<value>} \right )\)

Where \(\text{<value>}\) represents any basic type.

Note that run-time type conversion allows the result of this function to be assigned to any basic type provided the returned value is compatible with that type. The compiler will also select appropriate variants of the function if the return type can be determined at compile time based on the supplied parameters.

*Aion* includes distinct versions of the \(\text{erfc}\) function
optimized over \(value \in \mathbb{R}\) and optimized over
\(value \in \mathbb{C}\).

The \(\text{erfc}\) function uses either uses the power series described by [2], calculates \(\text{erfc}\) by continued fractions, or in the case of the real version, computes \(\text{erfc}\) function using the incomplete gamma function:

In all cases, the function relies on the reflection formulas:

The thresholds used to determine which approach is used and, for negative values, which reflection formula was used was determined based on the speed of computation to converge to a result with minimum error.

Below are two simple examples using the \(\text{erfc}\) function: