]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man3/sincos.3
dlopen.3: tfix
[thirdparty/man-pages.git] / man3 / sincos.3
index fb0b295bf76b632133f27886dfcb3d621ad8f161..74fb4603fac5357f177c0d4f9dc48748929c547a 100644 (file)
@@ -6,7 +6,7 @@
 .\" Distributed under GPL
 .\" %%%LICENSE_END
 .\"
-.TH SINCOS 3  2015-03-02 "GNU" "Linux Programmer's Manual"
+.TH SINCOS 3  2017-09-15 "GNU" "Linux Programmer's Manual"
 .SH NAME
 sincos, sincosf, sincosl \- calculate sin and cos simultaneously
 .SH SYNOPSIS
@@ -15,9 +15,7 @@ sincos, sincosf, sincosl \- calculate sin and cos simultaneously
 .B #include <math.h>
 .PP
 .BI "void sincos(double " x ", double *" sin ", double *" cos );
-.br
 .BI "void sincosf(float " x ", float *" sin ", float *" cos );
-.br
 .BI "void sincosl(long double " x ", long double *" sin ", long double *" cos );
 .fi
 .PP
@@ -29,6 +27,10 @@ These functions compute both at the same time, and store the results in
 .I *sin
 and
 .IR *cos .
+Using this function can be more efficient than two separate calls to
+.BR sin (3)
+and
+.BR cos (3).
 .PP
 If
 .I x
@@ -58,19 +60,13 @@ when calling these functions.
 The following errors can occur:
 .TP
 Domain error: \fIx\fP is an infinity
-.\" .I errno
-.\" is set to
-.\" .BR EDOM .
+.I errno
+is set to
+.BR EDOM
+(but see BUGS).
 An invalid floating-point exception
 .RB ( FE_INVALID )
 is raised.
-.PP
-These functions do not set
-.IR errno .
-.\" FIXME . Is it intentional that these functions do not set errno?
-.\" sin() and cos() also don't set errno; bugs have been raised for
-.\" those functions.
-.\" See https://www.sourceware.org/bugzilla/show_bug.cgi?id=15467
 .SH VERSIONS
 These functions first appeared in glibc in version 2.1.
 .SH ATTRIBUTES
@@ -89,6 +85,25 @@ T}   Thread safety   MT-Safe
 .TE
 .SH CONFORMING TO
 These functions are GNU extensions.
+.SH NOTES
+To see the performance advantage of
+.BR sincos (),
+it may be necessary to disable
+.BR gcc (1)
+built-in optimizations, using flags such as:
+.PP
+.in +4n
+.EX
+cc -O \-lm \-fno\-builtin prog.c
+.EE
+.in
+.SH BUGS
+Before version 2.22, the glibc implementation did not set
+.\" https://www.sourceware.org/bugzilla/show_bug.cgi?id=15467
+.I errno
+to
+.B EDOM
+when a domain error occurred.
 .SH SEE ALSO
 .BR cos (3),
 .BR sin (3),