asecf

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

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 );
    }
}
Did you find this page helpful?