1e1b98d07SMichal Meloun.\" Copyright (c) 2011 Steven G. Kargl. 2e1b98d07SMichal Meloun.\" 3e1b98d07SMichal Meloun.\" Redistribution and use in source and binary forms, with or without 4e1b98d07SMichal Meloun.\" modification, are permitted provided that the following conditions 5e1b98d07SMichal Meloun.\" are met: 6e1b98d07SMichal Meloun.\" 1. Redistributions of source code must retain the above copyright 7e1b98d07SMichal Meloun.\" notice, this list of conditions and the following disclaimer. 8e1b98d07SMichal Meloun.\" 2. Redistributions in binary form must reproduce the above copyright 9e1b98d07SMichal Meloun.\" notice, this list of conditions and the following disclaimer in the 10e1b98d07SMichal Meloun.\" documentation and/or other materials provided with the distribution. 11e1b98d07SMichal Meloun.\" 12e1b98d07SMichal Meloun.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 13e1b98d07SMichal Meloun.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14e1b98d07SMichal Meloun.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 15e1b98d07SMichal Meloun.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 16e1b98d07SMichal Meloun.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 17e1b98d07SMichal Meloun.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 18e1b98d07SMichal Meloun.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 19e1b98d07SMichal Meloun.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 20e1b98d07SMichal Meloun.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 21e1b98d07SMichal Meloun.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 22e1b98d07SMichal Meloun.\" SUCH DAMAGE. 23e1b98d07SMichal Meloun.\" 24e1b98d07SMichal Meloun.Dd March 12, 2011 25e1b98d07SMichal Meloun.Dt SINCOS 3 26e1b98d07SMichal Meloun.Os 27e1b98d07SMichal Meloun.Sh NAME 28e1b98d07SMichal Meloun.Nm sincos , 29e1b98d07SMichal Meloun.Nm sincosf , 30e1b98d07SMichal Meloun.Nm sincosl 31e1b98d07SMichal Meloun.Nd sine and cosine functions 32e1b98d07SMichal Meloun.Sh LIBRARY 33e1b98d07SMichal Meloun.Lb libm 34e1b98d07SMichal Meloun.Sh SYNOPSIS 35e1b98d07SMichal Meloun.In math.h 36e1b98d07SMichal Meloun.Ft void 37e1b98d07SMichal Meloun.Fn sincos "double x" "double *s" "double *c" 38e1b98d07SMichal Meloun.Ft void 39e1b98d07SMichal Meloun.Fn sincosf "float x" "float *s" "float *c" 40e1b98d07SMichal Meloun.Ft void 41e1b98d07SMichal Meloun.Fn sincosl "long double x" "long double *s" "long double *c" 42e1b98d07SMichal Meloun.Sh DESCRIPTION 43e1b98d07SMichal MelounThe 44e1b98d07SMichal Meloun.Fn sincos , 45e1b98d07SMichal Meloun.Fn sincosf , 46e1b98d07SMichal Melounand 47e1b98d07SMichal Meloun.Fn sincosl 48e1b98d07SMichal Melounfunctions compute the sine and cosine of 49e1b98d07SMichal Meloun.Fa x . 50e1b98d07SMichal MelounUsing these functions allows argument reduction to occur only 51e1b98d07SMichal Melounonce instead of twice with individual invocations of 52e1b98d07SMichal Meloun.Fn sin 53e1b98d07SMichal Melounand 54e1b98d07SMichal Meloun.Fn cos . 55e1b98d07SMichal MelounLike 56e1b98d07SMichal Meloun.Fn sin 57e1b98d07SMichal Melounand 58e1b98d07SMichal Meloun.Fn cos , 59e1b98d07SMichal Melouna large magnitude argument may yield a result with little 60e1b98d07SMichal Melounor no significance. 61e1b98d07SMichal Meloun.Sh RETURN VALUES 62e1b98d07SMichal MelounUpon returning from 63e1b98d07SMichal Meloun.Fn sincos , 64e1b98d07SMichal Meloun.Fn sincosf , 65e1b98d07SMichal Melounand 66e1b98d07SMichal Meloun.Fn sincosl , 67e1b98d07SMichal Melounthe memory pointed to by 68c5cbef2fSGordon Bergling.Fa "*s" 69e1b98d07SMichal Melounand 70c5cbef2fSGordon Bergling.Fa "*c" 71e1b98d07SMichal Melounare assigned the values of sine and cosine, respectively. 72e1b98d07SMichal Meloun.Sh SEE ALSO 73e1b98d07SMichal Meloun.Xr cos 3 , 74c5cbef2fSGordon Bergling.Xr sin 3 75e1b98d07SMichal Meloun.Sh HISTORY 76e1b98d07SMichal MelounThese functions were added to 77*2c01176aSBrad Smith.Fx 11.2 78e1b98d07SMichal Melounto aid in writing various complex function contained in 79e1b98d07SMichal Meloun.St -isoC-99 . 80e1b98d07SMichal Meloun 81