From 76e76d82def92e5d13a45c11bc5f270fe671adf6 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Tue, 12 Mar 2024 13:33:34 +0000 Subject: [PATCH] Auto-generated commit --- base/special/xlogy/README.md | 90 +++++++++ .../xlogy/benchmark/benchmark.native.js | 62 ++++++ .../special/xlogy/benchmark/c/native/Makefile | 146 ++++++++++++++ .../xlogy/benchmark/c/native/benchmark.c | 138 +++++++++++++ base/special/xlogy/binding.gyp | 170 ++++++++++++++++ base/special/xlogy/examples/c/Makefile | 146 ++++++++++++++ base/special/xlogy/examples/c/example.c | 35 ++++ base/special/xlogy/include.gypi | 53 +++++ .../include/stdlib/math/base/special/xlogy.h | 38 ++++ base/special/xlogy/lib/native.js | 52 +++++ base/special/xlogy/manifest.json | 75 +++++++ base/special/xlogy/src/Makefile | 70 +++++++ base/special/xlogy/src/addon.c | 23 +++ base/special/xlogy/src/main.c | 42 ++++ base/special/xlogy/test/test.native.js | 187 ++++++++++++++++++ 15 files changed, 1327 insertions(+) create mode 100644 base/special/xlogy/benchmark/benchmark.native.js create mode 100644 base/special/xlogy/benchmark/c/native/Makefile create mode 100644 base/special/xlogy/benchmark/c/native/benchmark.c create mode 100644 base/special/xlogy/binding.gyp create mode 100644 base/special/xlogy/examples/c/Makefile create mode 100644 base/special/xlogy/examples/c/example.c create mode 100644 base/special/xlogy/include.gypi create mode 100644 base/special/xlogy/include/stdlib/math/base/special/xlogy.h create mode 100644 base/special/xlogy/lib/native.js create mode 100644 base/special/xlogy/manifest.json create mode 100644 base/special/xlogy/src/Makefile create mode 100644 base/special/xlogy/src/addon.c create mode 100644 base/special/xlogy/src/main.c create mode 100644 base/special/xlogy/test/test.native.js diff --git a/base/special/xlogy/README.md b/base/special/xlogy/README.md index d3bea1f59..84b7f0c75 100644 --- a/base/special/xlogy/README.md +++ b/base/special/xlogy/README.md @@ -89,6 +89,96 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/xlogy.h" +``` + +#### stdlib_base_xlogy( x, y ) + +Computes `x * ln(y)` so that the result is `0` if `x = 0`. + +```c +double v = stdlib_base_xlogy( 3.0, 2.0 ); +// returns ~2.079 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **y**: `[in] double` input value. + +```c +double stdlib_base_xlogy( const double x, const double y ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/xlogy.h" +#include +#include + +int main( void ) { + double out; + double x; + double y; + int i; + + for ( i = 0; i < 100; i++ ) { + x = ( (double)rand() / (double)RAND_MAX ) * 100.0; + y = ( (double)rand() / (double)RAND_MAX ) * 5.0; + out = stdlib_base_xlogy( x, y ); + printf( "xlogy(%lf, %lf) = %lf\n", x, y, out ); + } +} +``` + +
+ + + +
+ + +