diff --git a/base/special/ahaversin/README.md b/base/special/ahaversin/README.md index 24ddc1a8e..50edaf76e 100644 --- a/base/special/ahaversin/README.md +++ b/base/special/ahaversin/README.md @@ -105,6 +105,98 @@ for ( i = 0; i < x.length; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/ahaversin.h" +``` + +#### stdlib_base_ahaversin( x ) + +Compute the [inverse half-value versed sine][archaversine] of a double-precision floating-point number (in radians). + +```c +double out = stdlib_base_ahaversin( 0.0 ); +// returns 0.0 +``` + +If `x < 0`, `x > 1`, or `x` is `NaN`, the function returns `NaN`. + +```c +double out = stdlib_base_ahaversin( -3.14 ); +// returns NaN +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_ahaversin( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/ahaversin.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_ahaversin( x[ i ] ); + printf( "ahaversin(%lf) = %lf\n", x[ i ], v ); + } +} +``` + +
+ + + +
+ + +