@stdlib/math-base-special-kernel-sinf
v0.1.1
Published
Compute the sine of a number on [-π/4, π/4] in single-precision floating-point format.
Readme
kernelSinf
Compute the sine of a number on
[-π/4, π/4]in single-precision floating-point format.
Installation
npm install @stdlib/math-base-special-kernel-sinfUsage
var kernelSinf = require( '@stdlib/math-base-special-kernel-sinf' );kernelSinf( x )
Computes the sine of a number on [-π/4, π/4] in single-precision floating-point format.
var v = kernelSinf( 0.0 );
// returns ~0.0
v = kernelSinf( 3.141592653589793/6.0 );
// returns ~0.5
v = kernelSinf( 0.619 );
// returns ~0.580
v = kernelSinf( NaN );
// returns NaNExamples
var linspace = require( '@stdlib/array-base-linspace' );
var logEachMap = require( '@stdlib/console-log-each-map' );
var PI = require( '@stdlib/constants-float64-pi' );
var kernelSinf = require( '@stdlib/math-base-special-kernel-sinf' );
var x = linspace( -PI/4.0, PI/4.0, 100 );
logEachMap( 'kernelSinf(%0.4f) = %0.4f', x, kernelSinf );C APIs
Usage
#include "stdlib/math/base/special/kernel_sinf.h"stdlib_base_kernel_sinf( x )
Computes the sine of a number on [-π/4, π/4] in single-precision floating-point format.
float v = stdlib_base_kernel_sinf( 0.0 );
// returns ~0.0f
v = stdlib_base_kernel_sinf( 3.141592653589793/6.0 );
// returns ~0.5fThe function accepts the following arguments:
- x:
[in] doubleinput value (in radians, assumed to be bounded by~pi/4in magnitude).
float stdlib_base_kernel_sinf( const double x );Examples
#include "stdlib/math/base/special/kernel_sinf.h"
#include <stdio.h>
int main( void ) {
const double x[] = { -0.7853981633974483, -0.6108652381980153, -0.4363323129985824, -0.26179938779914946, -0.08726646259971649, 0.08726646259971649, 0.26179938779914935, 0.43633231299858233, 0.6108652381980153, 0.7853981633974483 };
float out;
int i;
for ( i = 0; i < 10; i++ ) {
out = stdlib_base_kernel_sinf( x[ i ] );
printf( "kernelSinf(%lf) = %f\n", x[ i ], out );
}
}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
Copyright
Copyright © 2016-2026. The Stdlib Authors.
