From 1ab652368f1fc17c584c3c81486cfc5837070562 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 1 Mar 2024 15:48:25 +0000 Subject: [PATCH] Auto-generated commit --- base/special/ahavercos/README.md | 94 +++++++++- .../ahavercos/benchmark/benchmark.native.js | 60 +++++++ .../ahavercos/benchmark/c/native/Makefile | 146 +++++++++++++++ .../ahavercos/benchmark/c/native/benchmark.c | 136 ++++++++++++++ base/special/ahavercos/binding.gyp | 170 ++++++++++++++++++ base/special/ahavercos/examples/c/Makefile | 146 +++++++++++++++ base/special/ahavercos/examples/c/example.c | 31 ++++ base/special/ahavercos/include.gypi | 53 ++++++ .../stdlib/math/base/special/ahavercos.h | 38 ++++ base/special/ahavercos/lib/native.js | 63 +++++++ base/special/ahavercos/manifest.json | 75 ++++++++ base/special/ahavercos/src/Makefile | 70 ++++++++ base/special/ahavercos/src/addon.c | 23 +++ base/special/ahavercos/src/main.c | 35 ++++ base/special/ahavercos/test/test.native.js | 126 +++++++++++++ 15 files changed, 1265 insertions(+), 1 deletion(-) create mode 100644 base/special/ahavercos/benchmark/benchmark.native.js create mode 100644 base/special/ahavercos/benchmark/c/native/Makefile create mode 100644 base/special/ahavercos/benchmark/c/native/benchmark.c create mode 100644 base/special/ahavercos/binding.gyp create mode 100644 base/special/ahavercos/examples/c/Makefile create mode 100644 base/special/ahavercos/examples/c/example.c create mode 100644 base/special/ahavercos/include.gypi create mode 100644 base/special/ahavercos/include/stdlib/math/base/special/ahavercos.h create mode 100644 base/special/ahavercos/lib/native.js create mode 100644 base/special/ahavercos/manifest.json create mode 100644 base/special/ahavercos/src/Makefile create mode 100644 base/special/ahavercos/src/addon.c create mode 100644 base/special/ahavercos/src/main.c create mode 100644 base/special/ahavercos/test/test.native.js diff --git a/base/special/ahavercos/README.md b/base/special/ahavercos/README.md index dad4402e3..e1b2c233b 100644 --- a/base/special/ahavercos/README.md +++ b/base/special/ahavercos/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2018 The Stdlib Authors. +Copyright (c) 2024 The Stdlib Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -105,6 +105,98 @@ for ( i = 0; i < x.length; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/ahavercos.h" +``` + +#### stdlib_base_ahavercos( x ) + +Compute the [inverse half-value versed cosine][archavercosine] of a double-precision floating-point number (in radians). + +```c +double out = stdlib_base_ahavercos( 0.0 ); +// returns ~3.1416 +``` + +If `x < 0`, `x > 1`, or `x` is `NaN`, the function returns `NaN`. + +```c +double out = stdlib_base_ahavercos( -3.14 ); +// returns NaN +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_ahavercos( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/ahavercos.h" +#include + +int main( void ) { + const double x[] = { -2.0, -1.6, -1.2, -0.8, -0.4, 0.4, 0.8, 1.2, 1.6, 2.0 }; + + double v; + int i; + for ( i = 0; i < 10; i++ ) { + v = stdlib_base_ahavercos( x[ i ] ); + printf( "ahavercos(%lf) = %lf\n", x[ i ], v ); + } +} +``` + +
+ + + +
+ + +