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 2021-03-22 "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
67 An invalid floating-point exception
71 These functions first appeared in glibc in version 2.1.
73 For an explanation of the terms used in this section, see
81 Interface Attribute Value
86 T} Thread safety MT-Safe
92 These functions are GNU extensions.
94 To see the performance advantage of
96 it may be necessary to disable
98 built-in optimizations, using flags such as:
102 cc \-O \-lm \-fno\-builtin prog.c
106 Before version 2.22, the glibc implementation did not set
107 .\" https://www.sourceware.org/bugzilla/show_bug.cgi?id=15467
111 when a domain error occurred.