SINCOS 3CW "12 December 2007" "mathcw-1.00"

Table of contents


NAME

sincosf, sincos, sincosl, sincosw, sincosq, sincosll, sincosdf, sincosd, sincosdl, sincosdll - sine and cosine functions

SYNOPSIS

cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ]

#include <mathcw.h>

extern void sincosf (float x, float *s, float *c);

extern void sincos (double x, double *s, double *c);

extern void sincosl (long double x, long double *s, long double *c);

extern void sincosw (__float80 x, __float80 *s, __float80 *c);

extern void sincosq (__float128 x, __float128 *s, __float128 *c);

extern void sincosll (long_long_double x, long_long_double *s, long_long_double *c);

extern void sincosdf (decimal_float x, decimal_float *s, decimal_float *c);

extern void sincosd (decimal_double x, decimal_double *s, decimal_double *c);

extern void sincosdl (decimal_long_double x, decimal_long_double *s, decimal_long_double *c);

extern void sincosdll (decimal_long_long_double x, decimal_long_long_double *s,
                                                   decimal_long_long_double *c);

NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.


DESCRIPTION

Compute the sine and cosine of x, where the argument is measured in radians.

RETURN VALUES

If the argument is finite, its sine and cosine are returned via the final two pointer arguments, as long as they are non-NULL. Otherwise, NaNs are returned via those arguments.

Caution: Since the sine and cosine are periodic functions on [0,2pi], arguments outside that range must be reduced to that range by subtracting a suitable multiple of 2pi. For large arguments, significance loss from that subtraction can reduce the accuracy of the reduced argument, possibly to the point where there are no significant digits left. Accuracy is therefore unavoidably reduced for arguments of large magnitude. However, argument reduction in this implementation is exact, so accuracy is maintained over the entire floating-point range.


ERRORS

If the argument is a NaN, errno is set to EDOM, and the argument is returned. If the argument is +Infinity or -Infinity, errno is set to EDOM, and a quiet NaN is returned.

SEE ALSO

acos(3CW), acosp(3CW), acospi(3CW), asin(3CW), asinp(3CW), asinpi(3CW), atan(3CW), atan2(3CW), atan2p(3CW), atan2pi(3CW), atanp(3CW), atanpi(3CW), cos(3CW), cosp(3CW), cospi(3CW), cotan(3CW), cotanp(3CW), cotanpi(3CW), sin(3CW), sincosp(3CW), sincospi(3CW), sinp(3CW), sinpi(3CW), tan(3CW), tanp(3CW), tanpi(3CW).