Skip to content

Latest commit

 

History

History

acotf

Compute the inverse cotangent of a single-precision floating-point number.

Usage

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

acotf( x )

Computes the inverse cotangent of a single-precision floating-point number.

var v = acotf( 2.0 );
// returns ~0.4636

v = acotf( Infinity );
// returns 0.0

Examples

var uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var acotf = require( '@stdlib/math/base/special/acotf' );

var x = uniform( 100, -5.0, 5.0, {
    'dtype': 'float32'
});

logEachMap( 'acotf(%0.4f) = %0.4f', x, acotf );

C APIs

Usage

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

stdlib_base_acotf( x )

Computes the inverse cotangent of a single-precision floating-point number.

float out = stdlib_base_acotf( 2.0f );
// returns ~0.4636f

The function accepts the following arguments:

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

Examples

#include "stdlib/math/base/special/acotf.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_acotf( x[ i ] );
        printf( "acot(%f) = %f\n", x[ i ], v );
    }
}

See Also