diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a6bce0e1..ae7d6d46b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3800,6 +3800,28 @@ This release closes the following issue: +
+ +#### [@stdlib/math/base/special/gamma1pm1](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/gamma1pm1) + +
+ +
+ +##### Features + +- [`458697c`](https://github.com/stdlib-js/stdlib/commit/458697cf4aae5b6bcd2e0d9e19181d2ac3b70fe1) - add C implementation for `math/base/special/gamma1pm1` + +
+ + + +
+ +
+ + +
#### [@stdlib/math/base/special/gammaln](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/gammaln) @@ -5819,6 +5841,7 @@ A total of 30 people contributed to this release. Thank you to the following con
+- [`458697c`](https://github.com/stdlib-js/stdlib/commit/458697cf4aae5b6bcd2e0d9e19181d2ac3b70fe1) - **feat:** add C implementation for `math/base/special/gamma1pm1` _(by Gunj Joshi)_ - [`7502603`](https://github.com/stdlib-js/stdlib/commit/75026039180c76cf376d7550d7470c57a11780cd) - **feat:** add C implementation for `math/base/special/betaln` _(by Gunj Joshi, Philipp Burckhardt)_ - [`5cd396f`](https://github.com/stdlib-js/stdlib/commit/5cd396ff2752de587151f2f8b50d36348db3321e) - **refactor:** use bitwise operation and make casting behavior explicit [(#2733)](https://github.com/stdlib-js/stdlib/pull/2733) _(by Gunj Joshi)_ - [`8a97c7d`](https://github.com/stdlib-js/stdlib/commit/8a97c7dbcb07a873fe7395156cfa1fa40beb1dad) - **chore:** update package meta data [(#2738)](https://github.com/stdlib-js/stdlib/pull/2738) _(by stdlib-bot, Philipp Burckhardt)_ diff --git a/base/special/gamma1pm1/README.md b/base/special/gamma1pm1/README.md index d70a105d6..cdb46bef0 100644 --- a/base/special/gamma1pm1/README.md +++ b/base/special/gamma1pm1/README.md @@ -75,6 +75,91 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/gamma1pm1.h" +``` + +#### stdlib_base_gamma1pm1( x ) + +Computes `gamma(x+1) - 1` without cancellation errors for small `x` and where `gamma(x)` is the [gamma function][@stdlib/math/base/special/gamma]. + +```c +double out = stdlib_base_gamma1pm1( 0.2 ); +// returns ~-0.082 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_gamma1pm1( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/gamma1pm1.h" +#include + +int main( void ) { + const double x[] = { 4.0, -1.5, -0.5, 0.5 }; + + double y; + int i; + for ( i = 0; i < 4; i++ ) { + y = stdlib_base_gamma1pm1( x[ i ] ); + printf( "gamma1pm1(%lf) = %lf\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +