From 4b6e5847addd45416b087a46a7cccc18528b19b7 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 3 Aug 2024 01:17:22 +0000 Subject: [PATCH] Auto-generated commit --- CHANGELOG.md | 23 ++ base/special/factorialln/README.md | 88 ++++++++ .../factorialln/benchmark/benchmark.native.js | 82 +++++++ .../factorialln/benchmark/c/native/Makefile | 146 +++++++++++++ .../benchmark/c/native/benchmark.c | 133 ++++++++++++ base/special/factorialln/binding.gyp | 170 +++++++++++++++ base/special/factorialln/examples/c/Makefile | 146 +++++++++++++ base/special/factorialln/examples/c/example.c | 31 +++ base/special/factorialln/include.gypi | 53 +++++ .../stdlib/math/base/special/factorialln.h | 38 ++++ base/special/factorialln/lib/native.js | 62 ++++++ base/special/factorialln/manifest.json | 75 +++++++ base/special/factorialln/src/Makefile | 70 ++++++ base/special/factorialln/src/addon.c | 23 ++ base/special/factorialln/src/main.c | 38 ++++ base/special/factorialln/test/test.js | 2 +- base/special/factorialln/test/test.native.js | 202 ++++++++++++++++++ 17 files changed, 1381 insertions(+), 1 deletion(-) create mode 100644 base/special/factorialln/benchmark/benchmark.native.js create mode 100644 base/special/factorialln/benchmark/c/native/Makefile create mode 100644 base/special/factorialln/benchmark/c/native/benchmark.c create mode 100644 base/special/factorialln/binding.gyp create mode 100644 base/special/factorialln/examples/c/Makefile create mode 100644 base/special/factorialln/examples/c/example.c create mode 100644 base/special/factorialln/include.gypi create mode 100644 base/special/factorialln/include/stdlib/math/base/special/factorialln.h create mode 100644 base/special/factorialln/lib/native.js create mode 100644 base/special/factorialln/manifest.json create mode 100644 base/special/factorialln/src/Makefile create mode 100644 base/special/factorialln/src/addon.c create mode 100644 base/special/factorialln/src/main.c create mode 100644 base/special/factorialln/test/test.native.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eaa5d0a7..5f65ca212 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3115,6 +3115,28 @@ This release closes the following issue: +
+ +#### [@stdlib/math/base/special/factorialln](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/factorialln) + +
+ +
+ +##### Features + +- [`1c43f05`](https://github.com/stdlib-js/stdlib/commit/1c43f05a04d6731ea7d1b93f89179da216259005) - add C implementation for `math/base/special/factorialln` [(#2731)](https://github.com/stdlib-js/stdlib/pull/2731 ) + +
+ + + +
+ +
+ + +
#### [@stdlib/math/base/special/fast/abs](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/fast/abs) @@ -5775,6 +5797,7 @@ A total of 30 people contributed to this release. Thank you to the following con
+- [`1c43f05`](https://github.com/stdlib-js/stdlib/commit/1c43f05a04d6731ea7d1b93f89179da216259005) - **feat:** add C implementation for `math/base/special/factorialln` [(#2731)](https://github.com/stdlib-js/stdlib/pull/2731 ) _(by Gunj Joshi)_ - [`b633157`](https://github.com/stdlib-js/stdlib/commit/b6331572f8cc0dcd92ac1dbeb0aeaabc4d858615) - **docs:** remove comments, set `isNegative` to `uint8_t` in `math/base/special/gammaln` [(#2732)](https://github.com/stdlib-js/stdlib/pull/2732) _(by Gunj Joshi)_ - [`759e667`](https://github.com/stdlib-js/stdlib/commit/759e6676d54a121a5458edbe0f6caa541c465001) - **feat:** add C implementation for `math/base/special/sinc` _(by Gunj Joshi)_ - [`06b8011`](https://github.com/stdlib-js/stdlib/commit/06b80119890e1868578ba4904e9efaa071b27b05) - **feat:** add C implementation for `math/base/special/binomcoef` _(by Gunj Joshi)_ diff --git a/base/special/factorialln/README.md b/base/special/factorialln/README.md index 9c6d2ba52..b592aa2e8 100644 --- a/base/special/factorialln/README.md +++ b/base/special/factorialln/README.md @@ -166,6 +166,94 @@ for ( i = 0; i < x.length; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/factorialln.h" +``` + +#### stdlib_base_factorialln( x ) + +Evaluates the natural logarithm of the [factorial function][factorial-function]. For input values other than negative integers, the function returns `ln( x! ) = ln( Γ(x+1) )`, where `Γ` is the [Gamma][gamma-function] function. For negative integers, the function returns `NaN`. + +```c +double out = stdlib_base_factorialln( 3.0 ); +// returns ~1.792 + +out = stdlib_base_factorialln( -1.5 ); +// returns ~1.266 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_factorialln( const double n ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/factorialln.h" +#include + +int main( void ) { + const double x[] = { 2.0, 3.0, 5.0, 8.0 }; + + double y; + int i; + for ( i = 0; i < 4; i++ ) { + y = stdlib_base_factorialln( x[ i ] ); + printf( "factorialln(%lf) = %lf\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +