1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
5 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
6 .\" Distributed under GPL
9 .TH SINCOS 3 2017-09-15 "GNU" "Linux Programmer's Manual"
11 sincos, sincosf, sincosl \- calculate sin and cos simultaneously
14 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
17 .BI "void sincos(double " x ", double *" sin ", double *" cos );
18 .BI "void sincosf(float " x ", float *" sin ", float *" cos );
19 .BI "void sincosl(long double " x ", long double *" sin ", long double *" cos );
24 Several applications need sine and cosine of the same angle
26 These functions compute both at the same time, and store the results in
30 Using this function can be more efficient than two separate calls to
45 is positive infinity or negative infinity,
46 a domain error occurs, and
52 These functions return
57 for information on how to determine whether an error has occurred
58 when calling these functions.
60 The following errors can occur:
62 Domain error: \fIx\fP is an infinity
66 An invalid floating-point exception
70 These functions do not set
72 .\" FIXME . Is it intentional that these functions do not set errno?
73 .\" sin() and cos() also don't set errno; bugs have been raised for
75 .\" See https://www.sourceware.org/bugzilla/show_bug.cgi?id=15467
77 These functions first appeared in glibc in version 2.1.
79 For an explanation of the terms used in this section, see
85 Interface Attribute Value
90 T} Thread safety MT-Safe
93 These functions are GNU extensions.
95 To see the performance advantage of
97 it may be necessary to disable
99 built-in optimizations, using flags such as:
103 cc -O \-lm \-fno\-builtin prog.c