osx man page for __cospif

Query: __cospif

OS: osx

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

__COSPI(3)						   BSD Library Functions Manual 						__COSPI(3)

NAME
__cospi -- cosine-pi function
SYNOPSIS
#include <math.h> float __cospif(float x); double __cospi(double x);
DESCRIPTION
The __cospi() function returns the cosine of pi times x (measured in radians). This can be computed more accurately than cos(M_PI * x), because it can implicitly use as many bits of pi as are necessary to deliver a well-rounded result, instead of the 53-bits to which M_PI is limited. For large x it may also be more efficient, as the argument reduction involved is significantly simpler. This function may be especially useful for working with degrees; whereas cos(M_PI * x / 180.0) cannot produce exact results for angles that naively "should" be exact, like 90 degrees, __cospi(x / 180.0) can be computed exactly.
SPECIAL VALUES
__cospi(-x) is the same as __cospi(x) for any finite x. __cospi(n) returns +1 for any even integer n. __cospi(n) returns -1 for any odd integer n. __cospi(n + 0.5) returns +0 for any integer n. __cospi(+-infinity) raises the invalid floating-point exception and returns NaN.
VECTOR OPERATIONS
If you need to apply the __cospi() function to SIMD vectors or arrays, using the following functions provided by the Accelerate.framework may be useful: #include <Accelerate/Accelerate.h> vFloat vcospif(vFloat x); void vvcospif(float *y, float *x, const int n); void vvcospi(double *y, double *x, const int n);
SEE ALSO
__sinpi(3), __tanpi(3), __sincospi(3), math(3)
BSD
December 15, 2012 BSD
Related Man Pages
__cospif(3) - mojave
__tanpi(3) - mojave
__cospi(3) - osx
__tanpi(3) - osx
__tanpif(3) - osx
Similar Topics in the Unix Linux Community
Mac OS X: Based on UNIX - Solid As a Rock
When is a _function_ not a _function_?
Hearing Aid for OSX 10.12.x and greater.
To print diamond asterisk pattern based on inputs
My first PERL incarnation... Audio Oscillograph