From 5f96e28819793d763c74be94a3f17b2eca61f9b1 Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Thu, 27 Aug 2026 10:10:41 +0530 Subject: [PATCH] docs: add equations to exponential and logarithmic function READMEs Add defining equations to the intro sections of exp2, exp10, expm1, ln, log, log1p, log1mexp, log1pexp, log1pmx, xlogy, xlog1py and their single-precision variants. Ref: https://github.com/stdlib-js/metr-issue-tracker/issues/1257 --- .../@stdlib/math/base/special/exp10/README.md | 16 ++++++++++++++++ .../@stdlib/math/base/special/exp2/README.md | 16 ++++++++++++++++ .../@stdlib/math/base/special/expm1/README.md | 16 ++++++++++++++++ .../@stdlib/math/base/special/ln/README.md | 16 ++++++++++++++++ .../@stdlib/math/base/special/lnf/README.md | 16 ++++++++++++++++ .../@stdlib/math/base/special/log/README.md | 16 ++++++++++++++++ .../math/base/special/log1mexp/README.md | 16 ++++++++++++++++ .../@stdlib/math/base/special/log1p/README.md | 18 ++++++++++++++++++ .../math/base/special/log1pexp/README.md | 16 ++++++++++++++++ .../@stdlib/math/base/special/log1pf/README.md | 18 ++++++++++++++++++ .../math/base/special/log1pmx/README.md | 16 ++++++++++++++++ .../@stdlib/math/base/special/logf/README.md | 16 ++++++++++++++++ .../math/base/special/xlog1py/README.md | 16 ++++++++++++++++ .../@stdlib/math/base/special/xlogy/README.md | 16 ++++++++++++++++ .../@stdlib/math/base/special/xlogyf/README.md | 16 ++++++++++++++++ 15 files changed, 244 insertions(+) diff --git a/lib/node_modules/@stdlib/math/base/special/exp10/README.md b/lib/node_modules/@stdlib/math/base/special/exp10/README.md index 5a94d93e270d..6ecf9b31bcbd 100644 --- a/lib/node_modules/@stdlib/math/base/special/exp10/README.md +++ b/lib/node_modules/@stdlib/math/base/special/exp10/README.md @@ -22,6 +22,22 @@ limitations under the License. > Base `10` [exponential function][exponential-function]. +
+ +The [base-10 exponential function][exponential-function] is defined as + + + +```math +y = 10^x +``` + + + +
+ + +
## Usage diff --git a/lib/node_modules/@stdlib/math/base/special/exp2/README.md b/lib/node_modules/@stdlib/math/base/special/exp2/README.md index d944a174807e..a489b17fbdfe 100644 --- a/lib/node_modules/@stdlib/math/base/special/exp2/README.md +++ b/lib/node_modules/@stdlib/math/base/special/exp2/README.md @@ -22,6 +22,22 @@ limitations under the License. > Base `2` [exponential function][exponential-function]. +
+ +The [base-2 exponential function][exponential-function] is defined as + + + +```math +y = 2^x +``` + + + +
+ + +
## Usage diff --git a/lib/node_modules/@stdlib/math/base/special/expm1/README.md b/lib/node_modules/@stdlib/math/base/special/expm1/README.md index 8f4232ea6754..edbf6e1cc3da 100644 --- a/lib/node_modules/@stdlib/math/base/special/expm1/README.md +++ b/lib/node_modules/@stdlib/math/base/special/expm1/README.md @@ -22,6 +22,22 @@ limitations under the License. > Compute `exp(x) - 1`. +
+ +The function computes `exp(x) - 1` accurately for small `x` + + + +```math +y = e^x - 1 +``` + + + +
+ + +
## Usage diff --git a/lib/node_modules/@stdlib/math/base/special/ln/README.md b/lib/node_modules/@stdlib/math/base/special/ln/README.md index 0c58bacc84f5..810ee79f4cb2 100644 --- a/lib/node_modules/@stdlib/math/base/special/ln/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ln/README.md @@ -22,6 +22,22 @@ limitations under the License. > Evaluate the [natural logarithm][natural-logarithm] of a double-precision floating-point number. +
+ +The [natural logarithm][natural-logarithm] is defined as + + + +```math +y = \ln(x) = \log_e(x) +``` + + + +
+ + +
## Usage diff --git a/lib/node_modules/@stdlib/math/base/special/lnf/README.md b/lib/node_modules/@stdlib/math/base/special/lnf/README.md index e580f40f2873..74bf17931f26 100644 --- a/lib/node_modules/@stdlib/math/base/special/lnf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/lnf/README.md @@ -22,6 +22,22 @@ limitations under the License. > Evaluate the [natural logarithm][natural-logarithm] of a single-precision floating-point number. +
+ +The [natural logarithm][natural-logarithm] is defined as + + + +```math +y = \ln(x) = \log_e(x) +``` + + + +
+ + +
## Usage diff --git a/lib/node_modules/@stdlib/math/base/special/log/README.md b/lib/node_modules/@stdlib/math/base/special/log/README.md index 2ed02bcaaa66..43214cbc025c 100644 --- a/lib/node_modules/@stdlib/math/base/special/log/README.md +++ b/lib/node_modules/@stdlib/math/base/special/log/README.md @@ -22,6 +22,22 @@ limitations under the License. > Compute the base `b` [logarithm][logarithm] of a double-precision floating-point number. +
+ +The [logarithm][logarithm] with an arbitrary base is defined as + + + +```math +y = \log_b(x) \quad \text{such that} \quad b^y = x +``` + + + +
+ + +
## Usage diff --git a/lib/node_modules/@stdlib/math/base/special/log1mexp/README.md b/lib/node_modules/@stdlib/math/base/special/log1mexp/README.md index a383a59300cb..9a0df1d66467 100644 --- a/lib/node_modules/@stdlib/math/base/special/log1mexp/README.md +++ b/lib/node_modules/@stdlib/math/base/special/log1mexp/README.md @@ -22,6 +22,22 @@ limitations under the License. > Evaluates the [natural logarithm][@stdlib/math/base/special/ln] of `1-exp(-|x|)`. +
+ +The function computes the natural logarithm of `1-exp(-|x|)` accurately + + + +```math +y = \ln(1 - e^{-|x|}) +``` + + + +
+ + +
## Usage diff --git a/lib/node_modules/@stdlib/math/base/special/log1p/README.md b/lib/node_modules/@stdlib/math/base/special/log1p/README.md index 7a2dc1bce3bc..0cef75740f13 100644 --- a/lib/node_modules/@stdlib/math/base/special/log1p/README.md +++ b/lib/node_modules/@stdlib/math/base/special/log1p/README.md @@ -22,6 +22,22 @@ limitations under the License. > Evaluate the [natural logarithm][@stdlib/math/base/special/ln] of `1+x`. +
+ +The function computes the [natural logarithm][natural-logarithm] of `1+x` accurately for small `x` + + + +```math +y = \ln(1 + x) +``` + + + +
+ + +
## Usage @@ -197,6 +213,8 @@ int main( void ) {