xref: /freebsd/lib/msun/man/cospi.3 (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1.\" Copyright (c) 2017 Steven G. Kargl <kargl@FreeBSD.org>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.Dd April 1, 2017
26.Dt COSPI 3
27.Os
28.Sh NAME
29.Nm cospi ,
30.Nm cospif ,
31.Nm cospil
32.Nd half\(encycle cosine functions
33.Sh LIBRARY
34.Lb libm
35.Sh SYNOPSIS
36.In math.h
37.Ft double
38.Fn cospi "double x"
39.Ft float
40.Fn cospif "float x"
41.Ft long double
42.Fn cospil "long double x"
43.Sh DESCRIPTION
44The
45.Fn cospi ,
46.Fn cospif ,
47and
48.Fn cospil
49functions compute the cosine of
50.Fa "\(*p \(mu x" .
51and measure angles in half-cycles.
52.Sh RETURN VALUES
53The
54.Fn cospi ,
55.Fn cospif ,
56and
57.Fn cospil
58functions returns
59.Fn cos "\(*p \(mu x" .
60If \*(Bax\*(Ba \*(Ge 2^(p - 1)
61where p is the floating\(enpoint precision of
62.Ar x ,
63then the returned value is 1 and it has no significance.
64.Sh SPECIAL VALUES
65.Bl -tag -width "cospi(+n/2)"
66.It Fn cospi \*(Pm0
67returns 1.
68.It Fn cospi \*(Pmn/2
69returns 0 for positive integers
70.Ar n .
71.It Fn cospi n
72returns 1 for even integers
73.Ar n .
74.It Fn cospi n
75returns \-1 for odd integers
76.Ar n .
77.It Fn cospi \*(Pm\(if
78return an \*(Na and raises an FE_INVALID exception.
79.It Fn cospi \*(Na
80return an \*(Na and raises an FE_INVALID exception.
81.El
82.Sh SEE ALSO
83.Xr cos 3 ,
84.Xr fenv 3 ,
85.Xr math 3 ,
86.Xr sin 3 ,
87.Xr sinpi 3 ,
88.Xr tan 3 ,
89.Xr tanpi 3
90.Sh AUTHORS
91The half\(encycle trignometric functions were written by
92.An Steven G. Kargl Aq Mt kargl@FreeBSD.org .
93.Sh STANDARDS
94These functions conform to
95IEEE Std 754\(tm\(en2008 ,
96\(dqIEEE Standard for Floating-Point Arithmetic\(dq
97and to
98ISO/IEC TS 18661-4 ,
99\(dqInformation technology \(em Programming languages, their environments,
100and system software interfaces \(em Floating\(enpoint extensions for
101C\(dq \(em Part 4: Supplementary functions.
102
103
104