0.1.0 • Published 30 days ago

@stdlib/math-base-special-asecf v0.1.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
30 days ago

asecf

NPM version Build Status Coverage Status

Compute the inverse (arc) secant of a single-precision floating-point number.

Installation

npm install @stdlib/math-base-special-asecf

Usage

var asecf = require( '@stdlib/math-base-special-asecf' );

asecf( x )

Computes the inverse (arc) secant of a single-precision floating-point number.

var v = asecf( 1.0 );
// returns 0.0

v = asecf( 2.0 );
// returns ~1.0472

v = asecf( NaN );
// returns NaN

The domain of x is restricted to the intervals [-inf, -1] and [1, inf]. For x outside of these intervals, the function returns NaN.

var v = asecf( -0.5 );
// returns NaN

v = asecf( 0.5 );
// returns NaN

Examples

var linspace = require( '@stdlib/array-base-linspace' );
var asecf = require( '@stdlib/math-base-special-asecf' );

var x = linspace( 1.0, 10.0, 100 );

var i;
for ( i = 0; i < x.length; i++ ) {
    console.log( asecf( x[ i ] ) );
}

C APIs

Usage

#include "stdlib/math/base/special/asecf.h"

stdlib_base_asecf( x )

Computes the inverse (arc) secant of a single-precision floating-point number.

float out = stdlib_base_asecf( 2.0f );
// returns ~1.0472f

The function accepts the following arguments:

  • x: [in] float input value.
float stdlib_base_asecf( const float x );

Examples

#include "stdlib/math/base/special/asecf.h"
#include <stdio.h>

int main( void ) {
    const float x[] = { -5.0f, -3.89f, -2.78f, -1.67f, -0.56f, 0.56f, 1.67f, 2.78f, 3.89f, 5.0f };
    
    float v;
    int i;
    for ( i = 0; i < 10; i++ ) {
        v = stdlib_base_asecf( x[ i ] );
        printf( "asec(%f) = %f\n", x[ i ], v );
    }
}

Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2024. The Stdlib Authors.