diff --git a/docs/src/functions/engineering.md b/docs/src/functions/engineering.md index 3e08e59..c441897 100644 --- a/docs/src/functions/engineering.md +++ b/docs/src/functions/engineering.md @@ -28,9 +28,9 @@ All Engineering functions are already supported in IronCalc. | DEC2HEX | | – | | DEC2OCT | | – | | ERF | | [ERF](engineering/erf) | -| ERF.PRECISE | | – | -| ERFC | | – | -| ERFC.PRECISE | | – | +| ERF.PRECISE | | [ERF.PRECISE](engineering/erf-precise) | +| ERFC | | [ERFC](engineering/erfc) | +| ERFC.PRECISE | | [ERFC.PRECISE](engineering/erfc-precise) | | GESTEP | | – | | HEX2BIN | | – | | HEX2DEC | | – | diff --git a/docs/src/functions/engineering/erf-precise.md b/docs/src/functions/engineering/erf-precise.md index 7683c07..c227e5c 100644 --- a/docs/src/functions/engineering/erf-precise.md +++ b/docs/src/functions/engineering/erf-precise.md @@ -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). -::: \ No newline at end of file +**Note:** This draft page is under construction 🚧 +::: +## Overview +ERF.PRECISE (ERror Function) 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(X) => erf.precise** +### 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. + + +## 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. +
Graph showing erf(x) for x between -3 and +3.
+ +* 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. \ No newline at end of file diff --git a/docs/src/functions/engineering/erfc-precise.md b/docs/src/functions/engineering/erfc-precise.md index 6abc919..c7bb4a5 100644 --- a/docs/src/functions/engineering/erfc-precise.md +++ b/docs/src/functions/engineering/erfc-precise.md @@ -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). -::: \ No newline at end of file +**Note:** This draft page is under construction 🚧 +::: +## Overview +ERFC.PRECISE (ERror Function Complementary) 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(X) => erfc.precise** +### 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. + + +## 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. +
Graph showing erfc(x) for x between -3 and +3.
+ +* 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. \ No newline at end of file diff --git a/docs/src/functions/engineering/erfc.md b/docs/src/functions/engineering/erfc.md index 709cf90..8141bd3 100644 --- a/docs/src/functions/engineering/erfc.md +++ b/docs/src/functions/engineering/erfc.md @@ -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). -::: \ No newline at end of file +**Note:** This draft page is under construction 🚧 +::: +## Overview +ERFC (ERror Function Complementary) 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(X) => erfc** +### 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. + + +## 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. +
Graph showing erfc(x) for x between -3 and +3.
+ +* 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. \ No newline at end of file diff --git a/docs/src/functions/images/complementary-error-function-curve.png b/docs/src/functions/images/complementary-error-function-curve.png new file mode 100644 index 0000000..5533e85 Binary files /dev/null and b/docs/src/functions/images/complementary-error-function-curve.png differ diff --git a/xlsx/tests/docs/ERF-PRECISE.xlsx b/xlsx/tests/docs/ERF-PRECISE.xlsx new file mode 100644 index 0000000..cb4aaea Binary files /dev/null and b/xlsx/tests/docs/ERF-PRECISE.xlsx differ diff --git a/xlsx/tests/docs/ERFC-PRECISE.xlsx b/xlsx/tests/docs/ERFC-PRECISE.xlsx new file mode 100644 index 0000000..5ec1b98 Binary files /dev/null and b/xlsx/tests/docs/ERFC-PRECISE.xlsx differ diff --git a/xlsx/tests/docs/ERFC.xlsx b/xlsx/tests/docs/ERFC.xlsx new file mode 100644 index 0000000..64e861b Binary files /dev/null and b/xlsx/tests/docs/ERFC.xlsx differ