Add ERFC, ERF.PRECISE and ERFC.PRECISE functions

This commit is contained in:
Steve Fanning
2025-01-18 14:30:12 +00:00
committed by Nicolás Hatcher Andrés
parent 3a001d96b8
commit 81d25b6ec9
8 changed files with 139 additions and 18 deletions

View File

@@ -28,9 +28,9 @@ All Engineering functions are already supported in IronCalc.
| DEC2HEX | <Badge type="tip" text="Available" /> | |
| DEC2OCT | <Badge type="tip" text="Available" /> | |
| ERF | <Badge type="tip" text="Available" /> | [ERF](engineering/erf) |
| ERF.PRECISE | <Badge type="tip" text="Available" /> | |
| ERFC | <Badge type="tip" text="Available" /> | |
| ERFC.PRECISE | <Badge type="tip" text="Available" /> | |
| ERF.PRECISE | <Badge type="tip" text="Available" /> | [ERF.PRECISE](engineering/erf-precise) |
| ERFC | <Badge type="tip" text="Available" /> | [ERFC](engineering/erfc) |
| ERFC.PRECISE | <Badge type="tip" text="Available" /> | [ERFC.PRECISE](engineering/erfc-precise) |
| GESTEP | <Badge type="tip" text="Available" /> | |
| HEX2BIN | <Badge type="tip" text="Available" /> | |
| HEX2DEC | <Badge type="tip" text="Available" /> | |

View File

@@ -3,9 +3,50 @@ layout: doc
outline: deep
lang: en-US
---
# ERF.PRECISE
# ERF.PRECISE function
::: warning
🚧 This function is implemented but currently lacks detailed documentation. For guidance, you may refer to the equivalent functionality in [Microsoft Excel documentation](https://support.microsoft.com/en-us/office/excel-functions-by-category-5f91f4e9-7b42-46d2-9bd1-63f26a86c0eb).
:::
**Note:** This draft page is under construction 🚧
:::
## Overview
ERF.PRECISE (<u>ER</u>ror <u>F</u>unction) is a function of the Engineering category that calculates a value for the _error function_. Also known as the _Gauss error function_, the error function represents the probability of a random variable falling within a certain range, given that it follows a specified normal distribution.
ERF.PRECISE is provided for compatibility with other spreadsheets. For all real values of $x$, $\text{ERF.PRECISE}(x)=\text{ERF}(x)$.
## Usage
### Syntax
**ERF.PRECISE(<span title="Number" style="color:#1E88E5">X</span>) => <span title="Number" style="color:#1E88E5">erf.precise</span>**
### Argument descriptions
* *X* ([number](/features/value-types#numbers), required). Integration limit. ERF.PRECISE integrates over the range [0, _X_].
### Additional guidance
None.
### Returned value
ERF.PRECISE returns a [number](/features/value-types#numbers) that is the error function probability for the specified argument. The returned value has a magnitude in the range [0, 1] but may be either positive (integration limit > 0) or negative (integration limit < 0).
### Error conditions
* In common with many other IronCalc functions, ERF.PRECISE propagates errors that are found in its argument.
* If no argument, or more than one argument, is supplied, then ERF.PRECISE returns the [`#ERROR!`](/features/error-types.md#error) error.
* If the value of the argument is not (or cannot be converted to) a [number](/features/value-types#numbers), then ERF.PRECISE returns the [`#VALUE!`](/features/error-types.md#value) error.
* For some argument values, ERF.PRECISE may return the [`#DIV/0!`](/features/error-types.md#div-0) error.
<!--@include: ../markdown-snippets/error-type-details.txt-->
## Details
* The error function arises in many scientific, engineering, and mathematical fields and is commonly defined by the following equation (applicable for any real number $x$):
$$
\text{erf}(x) = \frac{2}{\sqrt{\pi} }\: \int_{0}^{x} e^{-t^2}\:dt
$$
* The figure below illustrates the output of the ERF.PRECISE function for values of $x$ in the range -3 to +3.
<center><img src="/functions/images/error-function-curve.png" width="350" alt="Graph showing erf(x) for x between -3 and +3."></center>
* This figure illustrates some of the key characteristics of the error function:
* $\text{erf}(0) = 0$
* $\text{erf}(x) = -\text{erf}(x)$
* As $x \rightarrow \infty$, $\text{erf}(x) \rightarrow 1$
* As $x \rightarrow -\infty$, $\text{erf}(x) \rightarrow -1$
* The error function is a [transcendental](https://en.wikipedia.org/wiki/Transcendental_function), non-algebraic mathematical function. IronCalc implements the ERF.PRECISE function by numerical approximation using a power series.
## Examples
[See some examples in IronCalc](https://app.ironcalc.com/?example=erf-precise).
## Links
* See also IronCalc's [ERF](/functions/engineering/erf.md), [ERFC](/functions/engineering/erfc.md) and [ERFC.PRECISE](/functions/engineering/erfc-precise.md) functions.
* Visit Microsoft Excel's [ERF.PRECISE function](https://support.microsoft.com/en-gb/office/erf-precise-function-9a349593-705c-4278-9a98-e4122831a8e0) page.
* Both [Google Sheets](https://support.google.com/docs/answer/9386210) and [LibreOffice Calc](https://wiki.documentfoundation.org/Documentation/Calc_Functions/ERF.PRECISE) provide versions of the ERF.PROCESS function.

View File

@@ -3,9 +3,50 @@ layout: doc
outline: deep
lang: en-US
---
# ERFC.PRECISE
# ERFC.PRECISE function
::: warning
🚧 This function is implemented but currently lacks detailed documentation. For guidance, you may refer to the equivalent functionality in [Microsoft Excel documentation](https://support.microsoft.com/en-us/office/excel-functions-by-category-5f91f4e9-7b42-46d2-9bd1-63f26a86c0eb).
:::
**Note:** This draft page is under construction 🚧
:::
## Overview
ERFC.PRECISE (<u>ER</u>ror <u>F</u>unction <u>C</u>omplementary) is a function of the Engineering category that calculates a value for the _complementary error function_, defined by $\text{erfc}(x) = 1 - \text{erf}(x)$. Also known as the _complementary Gauss error function_, the complementary error function represents the probability of a random variable falling outside a certain range, given that it follows a specified normal distribution.
ERFC.PRECISE is provided for compatibility with other spreadsheets. For all real values of $x$, $\text{ERFC.PRECISE}(x)=\text{ERFC}(x)$.
## Usage
### Syntax
**ERFC.PRECISE(<span title="Number" style="color:#1E88E5">X</span>) => <span title="Number" style="color:#1E88E5">erfc.precise</span>**
### Argument descriptions
* *X* ([number](/features/value-types#numbers), required). The lower integration limit to be used to calculate the complementary error function. ERFC.PRECISE integrates over the range [X, $\infty$).
### Additional guidance
None.
### Returned value
ERFC.PRECISE returns a [number](/features/value-types#numbers) that is the complementary error function probability for the specified argument. The returned value lies in range [0, 2].
### Error conditions
* In common with many other IronCalc functions, ERFC.PRECISE propagates errors that are found in its argument.
* If no argument, or more than one argument, is supplied, then ERFC.PRECISE returns the [`#ERROR!`](/features/error-types.md#error) error.
* If the value of any argument is not (or cannot be converted to) a [number](/features/value-types#numbers), then ERFC.PRECISE returns the [`#VALUE!`](/features/error-types.md#value) error.
* For some argument values, ERFC.PRECISE may return the [`#DIV/0!`](/features/error-types.md#div-0) error.
<!--@include: ../markdown-snippets/error-type-details.txt-->
## Details
* The complementary error function arises in many scientific, engineering, and mathematical fields and is commonly defined by the following equation (applicable for any real number $x$):
$$
\text{erfc}(x) = \frac{2}{\sqrt{\pi} }\: \int_{x}^{\infty} e^{-t^2}\:dt
$$
* The figure below illustrates the output of the ERFC.PRECISE function for values of $x$ in the range -3 to +3.
<center><img src="/functions/images/complementary-error-function-curve.png" width="350" alt="Graph showing erfc(x) for x between -3 and +3."></center>
* This figure illustrates some of the key characteristics of the complementary error function:
* $\text{erfc}(0) = 1$
* $\text{erfc}(-x) = 2-\text{erfc}(x)$
* As $x \rightarrow \infty$, $\text{erfc}(x) \rightarrow 0$
* As $x \rightarrow -\infty$, $\text{erfc}(x) \rightarrow 2$
* The complementary error function is a [transcendental](https://en.wikipedia.org/wiki/Transcendental_function), non-algebraic mathematical function. IronCalc implements the ERFC.PRECISE function by numerical approximation using a power series.
## Examples
[See some examples in IronCalc](https://app.ironcalc.com/?example=erfc-precise).
## Links
* See also IronCalc's [ERF](/functions/engineering/erf.md), [ERFC](/functions/engineering/erfc.md) and [ERF.PRECISE](/functions/engineering/erf-precise.md) functions.
* Visit Microsoft Excel's [ERFC.PRECISE function](https://support.microsoft.com/en-gb/office/erfc-precise-function-e90e6bab-f45e-45df-b2ac-cd2eb4d4a273) page.
* Both [Google Sheets](https://support.google.com/docs/answer/9386303) and [LibreOffice Calc](https://wiki.documentfoundation.org/Documentation/Calc_Functions/ERFC.PRECISE) provide versions of the ERFC.PRECISE function.

View File

@@ -3,9 +3,48 @@ layout: doc
outline: deep
lang: en-US
---
# ERFC
# ERFC function
::: warning
🚧 This function is implemented but currently lacks detailed documentation. For guidance, you may refer to the equivalent functionality in [Microsoft Excel documentation](https://support.microsoft.com/en-us/office/excel-functions-by-category-5f91f4e9-7b42-46d2-9bd1-63f26a86c0eb).
:::
**Note:** This draft page is under construction 🚧
:::
## Overview
ERFC (<u>ER</u>ror <u>F</u>unction <u>C</u>omplementary) is a function of the Engineering category that calculates a value for the _complementary error function_, defined by $\text{erfc}(x) = 1 - \text{erf}(x)$. Also known as the _complementary Gauss error function_, the complementary error function represents the probability of a random variable falling outside a certain range, given that it follows a specified normal distribution.
## Usage
### Syntax
**ERFC(<span title="Number" style="color:#1E88E5">X</span>) => <span title="Number" style="color:#1E88E5">erfc</span>**
### Argument descriptions
* *X* ([number](/features/value-types#numbers), required). The lower integration limit to be used to calculate the complementary error function. ERFC integrates over the range [X, $\infty$).
### Additional guidance
None.
### Returned value
ERFC returns a [number](/features/value-types#numbers) that is the complementary error function probability for the specified argument. The returned value lies in range [0, 2].
### Error conditions
* In common with many other IronCalc functions, ERFC propagates errors that are found in its argument.
* If no argument, or more than one argument, is supplied, then ERFC returns the [`#ERROR!`](/features/error-types.md#error) error.
* If the value of any argument is not (or cannot be converted to) a [number](/features/value-types#numbers), then ERFC returns the [`#VALUE!`](/features/error-types.md#value) error.
* For some argument values, ERFC may return the [`#DIV/0!`](/features/error-types.md#div-0) error.
<!--@include: ../markdown-snippets/error-type-details.txt-->
## Details
* The complementary error function arises in many scientific, engineering, and mathematical fields and is commonly defined by the following equation (applicable for any real number $x$):
$$
\text{erfc}(x) = \frac{2}{\sqrt{\pi} }\: \int_{x}^{\infty} e^{-t^2}\:dt
$$
* The figure below illustrates the output of the ERFC function for values of $x$ in the range -3 to +3.
<center><img src="/functions/images/complementary-error-function-curve.png" width="350" alt="Graph showing erfc(x) for x between -3 and +3."></center>
* This figure illustrates some of the key characteristics of the complementary error function:
* $\text{erfc}(0) = 1$
* $\text{erfc}(-x) = 2-\text{erfc}(x)$
* As $x \rightarrow \infty$, $\text{erfc}(x) \rightarrow 0$
* As $x \rightarrow -\infty$, $\text{erfc}(x) \rightarrow 2$
* The complementary error function is a [transcendental](https://en.wikipedia.org/wiki/Transcendental_function), non-algebraic mathematical function. IronCalc implements the ERFC function by numerical approximation using a power series.
## Examples
[See some examples in IronCalc](https://app.ironcalc.com/?example=erfc).
## Links
* See also IronCalc's [ERF](/functions/engineering/erf.md), [ERF.PRECISE](/functions/engineering/erf-precise.md) and [ERFC.PRECISE](/functions/engineering/erfc-precise.md) functions.
* Visit Microsoft Excel's [ERFC function](https://support.microsoft.com/en-gb/office/erfc-function-736e0318-70ba-4e8b-8d08-461fe68b71b3) page.
* Both [Google Sheets](https://support.google.com/docs/answer/3093407) and [LibreOffice Calc](https://wiki.documentfoundation.org/Documentation/Calc_Functions/ERFC) provide versions of the ERFC function.

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB