xref: /titanic_51/usr/src/boot/include/math.h (revision 4a5d661a82b942b6538acd26209d959ce98b593a)
1*4a5d661aSToomas Soome /*
2*4a5d661aSToomas Soome  * ====================================================
3*4a5d661aSToomas Soome  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
4*4a5d661aSToomas Soome  *
5*4a5d661aSToomas Soome  * Developed at SunPro, a Sun Microsystems, Inc. business.
6*4a5d661aSToomas Soome  * Permission to use, copy, modify, and distribute this
7*4a5d661aSToomas Soome  * software is freely granted, provided that this notice
8*4a5d661aSToomas Soome  * is preserved.
9*4a5d661aSToomas Soome  * ====================================================
10*4a5d661aSToomas Soome  */
11*4a5d661aSToomas Soome 
12*4a5d661aSToomas Soome /*
13*4a5d661aSToomas Soome  * from: @(#)fdlibm.h 5.1 93/09/24
14*4a5d661aSToomas Soome  * $FreeBSD$
15*4a5d661aSToomas Soome  */
16*4a5d661aSToomas Soome 
17*4a5d661aSToomas Soome #ifndef _MATH_H_
18*4a5d661aSToomas Soome #define	_MATH_H_
19*4a5d661aSToomas Soome 
20*4a5d661aSToomas Soome #include <sys/cdefs.h>
21*4a5d661aSToomas Soome #include <sys/_types.h>
22*4a5d661aSToomas Soome #include <machine/_limits.h>
23*4a5d661aSToomas Soome 
24*4a5d661aSToomas Soome /*
25*4a5d661aSToomas Soome  * ANSI/POSIX
26*4a5d661aSToomas Soome  */
27*4a5d661aSToomas Soome extern const union __infinity_un {
28*4a5d661aSToomas Soome 	unsigned char	__uc[8];
29*4a5d661aSToomas Soome 	double		__ud;
30*4a5d661aSToomas Soome } __infinity;
31*4a5d661aSToomas Soome 
32*4a5d661aSToomas Soome extern const union __nan_un {
33*4a5d661aSToomas Soome 	unsigned char	__uc[sizeof(float)];
34*4a5d661aSToomas Soome 	float		__uf;
35*4a5d661aSToomas Soome } __nan;
36*4a5d661aSToomas Soome 
37*4a5d661aSToomas Soome #if __GNUC_PREREQ__(3, 3) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800)
38*4a5d661aSToomas Soome #define	__MATH_BUILTIN_CONSTANTS
39*4a5d661aSToomas Soome #endif
40*4a5d661aSToomas Soome 
41*4a5d661aSToomas Soome #if __GNUC_PREREQ__(3, 0) && !defined(__INTEL_COMPILER)
42*4a5d661aSToomas Soome #define	__MATH_BUILTIN_RELOPS
43*4a5d661aSToomas Soome #endif
44*4a5d661aSToomas Soome 
45*4a5d661aSToomas Soome #ifdef __MATH_BUILTIN_CONSTANTS
46*4a5d661aSToomas Soome #define	HUGE_VAL	__builtin_huge_val()
47*4a5d661aSToomas Soome #else
48*4a5d661aSToomas Soome #define	HUGE_VAL	(__infinity.__ud)
49*4a5d661aSToomas Soome #endif
50*4a5d661aSToomas Soome 
51*4a5d661aSToomas Soome #if __ISO_C_VISIBLE >= 1999
52*4a5d661aSToomas Soome #define	FP_ILOGB0	(-__INT_MAX)
53*4a5d661aSToomas Soome #define	FP_ILOGBNAN	__INT_MAX
54*4a5d661aSToomas Soome 
55*4a5d661aSToomas Soome #ifdef __MATH_BUILTIN_CONSTANTS
56*4a5d661aSToomas Soome #define	HUGE_VALF	__builtin_huge_valf()
57*4a5d661aSToomas Soome #define	HUGE_VALL	__builtin_huge_vall()
58*4a5d661aSToomas Soome #define	INFINITY	__builtin_inff()
59*4a5d661aSToomas Soome #define	NAN		__builtin_nanf("")
60*4a5d661aSToomas Soome #else
61*4a5d661aSToomas Soome #define	HUGE_VALF	(float)HUGE_VAL
62*4a5d661aSToomas Soome #define	HUGE_VALL	(long double)HUGE_VAL
63*4a5d661aSToomas Soome #define	INFINITY	HUGE_VALF
64*4a5d661aSToomas Soome #define	NAN		(__nan.__uf)
65*4a5d661aSToomas Soome #endif /* __MATH_BUILTIN_CONSTANTS */
66*4a5d661aSToomas Soome 
67*4a5d661aSToomas Soome #define	MATH_ERRNO	1
68*4a5d661aSToomas Soome #define	MATH_ERREXCEPT	2
69*4a5d661aSToomas Soome #define	math_errhandling	MATH_ERREXCEPT
70*4a5d661aSToomas Soome 
71*4a5d661aSToomas Soome #define	FP_FAST_FMAF	1
72*4a5d661aSToomas Soome 
73*4a5d661aSToomas Soome /* Symbolic constants to classify floating point numbers. */
74*4a5d661aSToomas Soome #define	FP_INFINITE	0x01
75*4a5d661aSToomas Soome #define	FP_NAN		0x02
76*4a5d661aSToomas Soome #define	FP_NORMAL	0x04
77*4a5d661aSToomas Soome #define	FP_SUBNORMAL	0x08
78*4a5d661aSToomas Soome #define	FP_ZERO		0x10
79*4a5d661aSToomas Soome 
80*4a5d661aSToomas Soome #if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \
81*4a5d661aSToomas Soome     __has_extension(c_generic_selections)
82*4a5d661aSToomas Soome #define	__fp_type_select(x, f, d, ld) _Generic((x),			\
83*4a5d661aSToomas Soome     float: f(x),							\
84*4a5d661aSToomas Soome     double: d(x),							\
85*4a5d661aSToomas Soome     long double: ld(x),							\
86*4a5d661aSToomas Soome     volatile float: f(x),						\
87*4a5d661aSToomas Soome     volatile double: d(x),						\
88*4a5d661aSToomas Soome     volatile long double: ld(x),					\
89*4a5d661aSToomas Soome     volatile const float: f(x),						\
90*4a5d661aSToomas Soome     volatile const double: d(x),					\
91*4a5d661aSToomas Soome     volatile const long double: ld(x),					\
92*4a5d661aSToomas Soome     const float: f(x),							\
93*4a5d661aSToomas Soome     const double: d(x),							\
94*4a5d661aSToomas Soome     const long double: ld(x))
95*4a5d661aSToomas Soome #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus)
96*4a5d661aSToomas Soome #define	__fp_type_select(x, f, d, ld) __builtin_choose_expr(		\
97*4a5d661aSToomas Soome     __builtin_types_compatible_p(__typeof(x), long double), ld(x),	\
98*4a5d661aSToomas Soome     __builtin_choose_expr(						\
99*4a5d661aSToomas Soome     __builtin_types_compatible_p(__typeof(x), double), d(x),		\
100*4a5d661aSToomas Soome     __builtin_choose_expr(						\
101*4a5d661aSToomas Soome     __builtin_types_compatible_p(__typeof(x), float), f(x), (void)0)))
102*4a5d661aSToomas Soome #else
103*4a5d661aSToomas Soome #define	 __fp_type_select(x, f, d, ld)					\
104*4a5d661aSToomas Soome     ((sizeof(x) == sizeof(float)) ? f(x)				\
105*4a5d661aSToomas Soome     : (sizeof(x) == sizeof(double)) ? d(x)				\
106*4a5d661aSToomas Soome     : ld(x))
107*4a5d661aSToomas Soome #endif
108*4a5d661aSToomas Soome 
109*4a5d661aSToomas Soome #define	fpclassify(x) \
110*4a5d661aSToomas Soome 	__fp_type_select(x, __fpclassifyf, __fpclassifyd, __fpclassifyl)
111*4a5d661aSToomas Soome #define	isfinite(x) __fp_type_select(x, __isfinitef, __isfinite, __isfinitel)
112*4a5d661aSToomas Soome #define	isinf(x) __fp_type_select(x, __isinff, __isinf, __isinfl)
113*4a5d661aSToomas Soome #define	isnan(x) \
114*4a5d661aSToomas Soome 	__fp_type_select(x, __inline_isnanf, __inline_isnan, __inline_isnanl)
115*4a5d661aSToomas Soome #define	isnormal(x) __fp_type_select(x, __isnormalf, __isnormal, __isnormall)
116*4a5d661aSToomas Soome 
117*4a5d661aSToomas Soome #ifdef __MATH_BUILTIN_RELOPS
118*4a5d661aSToomas Soome #define	isgreater(x, y)		__builtin_isgreater((x), (y))
119*4a5d661aSToomas Soome #define	isgreaterequal(x, y)	__builtin_isgreaterequal((x), (y))
120*4a5d661aSToomas Soome #define	isless(x, y)		__builtin_isless((x), (y))
121*4a5d661aSToomas Soome #define	islessequal(x, y)	__builtin_islessequal((x), (y))
122*4a5d661aSToomas Soome #define	islessgreater(x, y)	__builtin_islessgreater((x), (y))
123*4a5d661aSToomas Soome #define	isunordered(x, y)	__builtin_isunordered((x), (y))
124*4a5d661aSToomas Soome #else
125*4a5d661aSToomas Soome #define	isgreater(x, y)		(!isunordered((x), (y)) && (x) > (y))
126*4a5d661aSToomas Soome #define	isgreaterequal(x, y)	(!isunordered((x), (y)) && (x) >= (y))
127*4a5d661aSToomas Soome #define	isless(x, y)		(!isunordered((x), (y)) && (x) < (y))
128*4a5d661aSToomas Soome #define	islessequal(x, y)	(!isunordered((x), (y)) && (x) <= (y))
129*4a5d661aSToomas Soome #define	islessgreater(x, y)	(!isunordered((x), (y)) && \
130*4a5d661aSToomas Soome 					((x) > (y) || (y) > (x)))
131*4a5d661aSToomas Soome #define	isunordered(x, y)	(isnan(x) || isnan(y))
132*4a5d661aSToomas Soome #endif /* __MATH_BUILTIN_RELOPS */
133*4a5d661aSToomas Soome 
134*4a5d661aSToomas Soome #define	signbit(x) __fp_type_select(x, __signbitf, __signbit, __signbitl)
135*4a5d661aSToomas Soome 
136*4a5d661aSToomas Soome typedef	__double_t	double_t;
137*4a5d661aSToomas Soome typedef	__float_t	float_t;
138*4a5d661aSToomas Soome #endif /* __ISO_C_VISIBLE >= 1999 */
139*4a5d661aSToomas Soome 
140*4a5d661aSToomas Soome /*
141*4a5d661aSToomas Soome  * XOPEN/SVID
142*4a5d661aSToomas Soome  */
143*4a5d661aSToomas Soome #if __BSD_VISIBLE || __XSI_VISIBLE
144*4a5d661aSToomas Soome #define	M_E		2.7182818284590452354	/* e */
145*4a5d661aSToomas Soome #define	M_LOG2E		1.4426950408889634074	/* log 2e */
146*4a5d661aSToomas Soome #define	M_LOG10E	0.43429448190325182765	/* log 10e */
147*4a5d661aSToomas Soome #define	M_LN2		0.69314718055994530942	/* log e2 */
148*4a5d661aSToomas Soome #define	M_LN10		2.30258509299404568402	/* log e10 */
149*4a5d661aSToomas Soome #define	M_PI		3.14159265358979323846	/* pi */
150*4a5d661aSToomas Soome #define	M_PI_2		1.57079632679489661923	/* pi/2 */
151*4a5d661aSToomas Soome #define	M_PI_4		0.78539816339744830962	/* pi/4 */
152*4a5d661aSToomas Soome #define	M_1_PI		0.31830988618379067154	/* 1/pi */
153*4a5d661aSToomas Soome #define	M_2_PI		0.63661977236758134308	/* 2/pi */
154*4a5d661aSToomas Soome #define	M_2_SQRTPI	1.12837916709551257390	/* 2/sqrt(pi) */
155*4a5d661aSToomas Soome #define	M_SQRT2		1.41421356237309504880	/* sqrt(2) */
156*4a5d661aSToomas Soome #define	M_SQRT1_2	0.70710678118654752440	/* 1/sqrt(2) */
157*4a5d661aSToomas Soome 
158*4a5d661aSToomas Soome #define	MAXFLOAT	((float)3.40282346638528860e+38)
159*4a5d661aSToomas Soome extern int signgam;
160*4a5d661aSToomas Soome #endif /* __BSD_VISIBLE || __XSI_VISIBLE */
161*4a5d661aSToomas Soome 
162*4a5d661aSToomas Soome #if __BSD_VISIBLE
163*4a5d661aSToomas Soome #if 0
164*4a5d661aSToomas Soome /* Old value from 4.4BSD-Lite math.h; this is probably better. */
165*4a5d661aSToomas Soome #define	HUGE		HUGE_VAL
166*4a5d661aSToomas Soome #else
167*4a5d661aSToomas Soome #define	HUGE		MAXFLOAT
168*4a5d661aSToomas Soome #endif
169*4a5d661aSToomas Soome #endif /* __BSD_VISIBLE */
170*4a5d661aSToomas Soome 
171*4a5d661aSToomas Soome /*
172*4a5d661aSToomas Soome  * Most of these functions depend on the rounding mode and have the side
173*4a5d661aSToomas Soome  * effect of raising floating-point exceptions, so they are not declared
174*4a5d661aSToomas Soome  * as __pure2.  In C99, FENV_ACCESS affects the purity of these functions.
175*4a5d661aSToomas Soome  */
176*4a5d661aSToomas Soome __BEGIN_DECLS
177*4a5d661aSToomas Soome /*
178*4a5d661aSToomas Soome  * ANSI/POSIX
179*4a5d661aSToomas Soome  */
180*4a5d661aSToomas Soome int	__fpclassifyd(double) __pure2;
181*4a5d661aSToomas Soome int	__fpclassifyf(float) __pure2;
182*4a5d661aSToomas Soome int	__fpclassifyl(long double) __pure2;
183*4a5d661aSToomas Soome int	__isfinitef(float) __pure2;
184*4a5d661aSToomas Soome int	__isfinite(double) __pure2;
185*4a5d661aSToomas Soome int	__isfinitel(long double) __pure2;
186*4a5d661aSToomas Soome int	__isinff(float) __pure2;
187*4a5d661aSToomas Soome int	__isinf(double) __pure2;
188*4a5d661aSToomas Soome int	__isinfl(long double) __pure2;
189*4a5d661aSToomas Soome int	__isnormalf(float) __pure2;
190*4a5d661aSToomas Soome int	__isnormal(double) __pure2;
191*4a5d661aSToomas Soome int	__isnormall(long double) __pure2;
192*4a5d661aSToomas Soome int	__signbit(double) __pure2;
193*4a5d661aSToomas Soome int	__signbitf(float) __pure2;
194*4a5d661aSToomas Soome int	__signbitl(long double) __pure2;
195*4a5d661aSToomas Soome 
196*4a5d661aSToomas Soome static __inline int
197*4a5d661aSToomas Soome __inline_isnan(__const double __x)
198*4a5d661aSToomas Soome {
199*4a5d661aSToomas Soome 
200*4a5d661aSToomas Soome 	return (__x != __x);
201*4a5d661aSToomas Soome }
202*4a5d661aSToomas Soome 
203*4a5d661aSToomas Soome static __inline int
204*4a5d661aSToomas Soome __inline_isnanf(__const float __x)
205*4a5d661aSToomas Soome {
206*4a5d661aSToomas Soome 
207*4a5d661aSToomas Soome 	return (__x != __x);
208*4a5d661aSToomas Soome }
209*4a5d661aSToomas Soome 
210*4a5d661aSToomas Soome static __inline int
211*4a5d661aSToomas Soome __inline_isnanl(__const long double __x)
212*4a5d661aSToomas Soome {
213*4a5d661aSToomas Soome 
214*4a5d661aSToomas Soome 	return (__x != __x);
215*4a5d661aSToomas Soome }
216*4a5d661aSToomas Soome 
217*4a5d661aSToomas Soome /*
218*4a5d661aSToomas Soome  * Version 2 of the Single UNIX Specification (UNIX98) defined isnan() and
219*4a5d661aSToomas Soome  * isinf() as functions taking double.  C99, and the subsequent POSIX revisions
220*4a5d661aSToomas Soome  * (SUSv3, POSIX.1-2001, define it as a macro that accepts any real floating
221*4a5d661aSToomas Soome  * point type.  If we are targeting SUSv2 and C99 or C11 (or C++11) then we
222*4a5d661aSToomas Soome  * expose the newer definition, assuming that the language spec takes
223*4a5d661aSToomas Soome  * precedence over the operating system interface spec.
224*4a5d661aSToomas Soome  */
225*4a5d661aSToomas Soome #if	__XSI_VISIBLE > 0 && __XSI_VISIBLE < 600 && __ISO_C_VISIBLE < 1999
226*4a5d661aSToomas Soome #undef isinf
227*4a5d661aSToomas Soome #undef isnan
228*4a5d661aSToomas Soome int	isinf(double);
229*4a5d661aSToomas Soome int	isnan(double);
230*4a5d661aSToomas Soome #endif
231*4a5d661aSToomas Soome 
232*4a5d661aSToomas Soome double	acos(double);
233*4a5d661aSToomas Soome double	asin(double);
234*4a5d661aSToomas Soome double	atan(double);
235*4a5d661aSToomas Soome double	atan2(double, double);
236*4a5d661aSToomas Soome double	cos(double);
237*4a5d661aSToomas Soome double	sin(double);
238*4a5d661aSToomas Soome double	tan(double);
239*4a5d661aSToomas Soome 
240*4a5d661aSToomas Soome double	cosh(double);
241*4a5d661aSToomas Soome double	sinh(double);
242*4a5d661aSToomas Soome double	tanh(double);
243*4a5d661aSToomas Soome 
244*4a5d661aSToomas Soome double	exp(double);
245*4a5d661aSToomas Soome double	frexp(double, int *);	/* fundamentally !__pure2 */
246*4a5d661aSToomas Soome double	ldexp(double, int);
247*4a5d661aSToomas Soome double	log(double);
248*4a5d661aSToomas Soome double	log10(double);
249*4a5d661aSToomas Soome double	modf(double, double *);	/* fundamentally !__pure2 */
250*4a5d661aSToomas Soome 
251*4a5d661aSToomas Soome double	pow(double, double);
252*4a5d661aSToomas Soome double	sqrt(double);
253*4a5d661aSToomas Soome 
254*4a5d661aSToomas Soome double	ceil(double);
255*4a5d661aSToomas Soome double	fabs(double) __pure2;
256*4a5d661aSToomas Soome double	floor(double);
257*4a5d661aSToomas Soome double	fmod(double, double);
258*4a5d661aSToomas Soome 
259*4a5d661aSToomas Soome /*
260*4a5d661aSToomas Soome  * These functions are not in C90.
261*4a5d661aSToomas Soome  */
262*4a5d661aSToomas Soome #if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE
263*4a5d661aSToomas Soome double	acosh(double);
264*4a5d661aSToomas Soome double	asinh(double);
265*4a5d661aSToomas Soome double	atanh(double);
266*4a5d661aSToomas Soome double	cbrt(double);
267*4a5d661aSToomas Soome double	erf(double);
268*4a5d661aSToomas Soome double	erfc(double);
269*4a5d661aSToomas Soome double	exp2(double);
270*4a5d661aSToomas Soome double	expm1(double);
271*4a5d661aSToomas Soome double	fma(double, double, double);
272*4a5d661aSToomas Soome double	hypot(double, double);
273*4a5d661aSToomas Soome int	ilogb(double) __pure2;
274*4a5d661aSToomas Soome double	lgamma(double);
275*4a5d661aSToomas Soome long long llrint(double);
276*4a5d661aSToomas Soome long long llround(double);
277*4a5d661aSToomas Soome double	log1p(double);
278*4a5d661aSToomas Soome double	log2(double);
279*4a5d661aSToomas Soome double	logb(double);
280*4a5d661aSToomas Soome long	lrint(double);
281*4a5d661aSToomas Soome long	lround(double);
282*4a5d661aSToomas Soome double	nan(const char *) __pure2;
283*4a5d661aSToomas Soome double	nextafter(double, double);
284*4a5d661aSToomas Soome double	remainder(double, double);
285*4a5d661aSToomas Soome double	remquo(double, double, int *);
286*4a5d661aSToomas Soome double	rint(double);
287*4a5d661aSToomas Soome #endif /* __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE */
288*4a5d661aSToomas Soome 
289*4a5d661aSToomas Soome #if __BSD_VISIBLE || __XSI_VISIBLE
290*4a5d661aSToomas Soome double	j0(double);
291*4a5d661aSToomas Soome double	j1(double);
292*4a5d661aSToomas Soome double	jn(int, double);
293*4a5d661aSToomas Soome double	y0(double);
294*4a5d661aSToomas Soome double	y1(double);
295*4a5d661aSToomas Soome double	yn(int, double);
296*4a5d661aSToomas Soome 
297*4a5d661aSToomas Soome #if __XSI_VISIBLE <= 500 || __BSD_VISIBLE
298*4a5d661aSToomas Soome double	gamma(double);
299*4a5d661aSToomas Soome #endif
300*4a5d661aSToomas Soome 
301*4a5d661aSToomas Soome #if __XSI_VISIBLE <= 600 || __BSD_VISIBLE
302*4a5d661aSToomas Soome double	scalb(double, double);
303*4a5d661aSToomas Soome #endif
304*4a5d661aSToomas Soome #endif /* __BSD_VISIBLE || __XSI_VISIBLE */
305*4a5d661aSToomas Soome 
306*4a5d661aSToomas Soome #if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999
307*4a5d661aSToomas Soome double	copysign(double, double) __pure2;
308*4a5d661aSToomas Soome double	fdim(double, double);
309*4a5d661aSToomas Soome double	fmax(double, double) __pure2;
310*4a5d661aSToomas Soome double	fmin(double, double) __pure2;
311*4a5d661aSToomas Soome double	nearbyint(double);
312*4a5d661aSToomas Soome double	round(double);
313*4a5d661aSToomas Soome double	scalbln(double, long);
314*4a5d661aSToomas Soome double	scalbn(double, int);
315*4a5d661aSToomas Soome double	tgamma(double);
316*4a5d661aSToomas Soome double	trunc(double);
317*4a5d661aSToomas Soome #endif
318*4a5d661aSToomas Soome 
319*4a5d661aSToomas Soome /*
320*4a5d661aSToomas Soome  * BSD math library entry points
321*4a5d661aSToomas Soome  */
322*4a5d661aSToomas Soome #if __BSD_VISIBLE
323*4a5d661aSToomas Soome double	drem(double, double);
324*4a5d661aSToomas Soome int	finite(double) __pure2;
325*4a5d661aSToomas Soome int	isnanf(float) __pure2;
326*4a5d661aSToomas Soome 
327*4a5d661aSToomas Soome /*
328*4a5d661aSToomas Soome  * Reentrant version of gamma & lgamma; passes signgam back by reference
329*4a5d661aSToomas Soome  * as the second argument; user must allocate space for signgam.
330*4a5d661aSToomas Soome  */
331*4a5d661aSToomas Soome double	gamma_r(double, int *);
332*4a5d661aSToomas Soome double	lgamma_r(double, int *);
333*4a5d661aSToomas Soome 
334*4a5d661aSToomas Soome /*
335*4a5d661aSToomas Soome  * IEEE Test Vector
336*4a5d661aSToomas Soome  */
337*4a5d661aSToomas Soome double	significand(double);
338*4a5d661aSToomas Soome #endif /* __BSD_VISIBLE */
339*4a5d661aSToomas Soome 
340*4a5d661aSToomas Soome /* float versions of ANSI/POSIX functions */
341*4a5d661aSToomas Soome #if __ISO_C_VISIBLE >= 1999
342*4a5d661aSToomas Soome float	acosf(float);
343*4a5d661aSToomas Soome float	asinf(float);
344*4a5d661aSToomas Soome float	atanf(float);
345*4a5d661aSToomas Soome float	atan2f(float, float);
346*4a5d661aSToomas Soome float	cosf(float);
347*4a5d661aSToomas Soome float	sinf(float);
348*4a5d661aSToomas Soome float	tanf(float);
349*4a5d661aSToomas Soome 
350*4a5d661aSToomas Soome float	coshf(float);
351*4a5d661aSToomas Soome float	sinhf(float);
352*4a5d661aSToomas Soome float	tanhf(float);
353*4a5d661aSToomas Soome 
354*4a5d661aSToomas Soome float	exp2f(float);
355*4a5d661aSToomas Soome float	expf(float);
356*4a5d661aSToomas Soome float	expm1f(float);
357*4a5d661aSToomas Soome float	frexpf(float, int *);	/* fundamentally !__pure2 */
358*4a5d661aSToomas Soome int	ilogbf(float) __pure2;
359*4a5d661aSToomas Soome float	ldexpf(float, int);
360*4a5d661aSToomas Soome float	log10f(float);
361*4a5d661aSToomas Soome float	log1pf(float);
362*4a5d661aSToomas Soome float	log2f(float);
363*4a5d661aSToomas Soome float	logf(float);
364*4a5d661aSToomas Soome float	modff(float, float *);	/* fundamentally !__pure2 */
365*4a5d661aSToomas Soome 
366*4a5d661aSToomas Soome float	powf(float, float);
367*4a5d661aSToomas Soome float	sqrtf(float);
368*4a5d661aSToomas Soome 
369*4a5d661aSToomas Soome float	ceilf(float);
370*4a5d661aSToomas Soome float	fabsf(float) __pure2;
371*4a5d661aSToomas Soome float	floorf(float);
372*4a5d661aSToomas Soome float	fmodf(float, float);
373*4a5d661aSToomas Soome float	roundf(float);
374*4a5d661aSToomas Soome 
375*4a5d661aSToomas Soome float	erff(float);
376*4a5d661aSToomas Soome float	erfcf(float);
377*4a5d661aSToomas Soome float	hypotf(float, float);
378*4a5d661aSToomas Soome float	lgammaf(float);
379*4a5d661aSToomas Soome float	tgammaf(float);
380*4a5d661aSToomas Soome 
381*4a5d661aSToomas Soome float	acoshf(float);
382*4a5d661aSToomas Soome float	asinhf(float);
383*4a5d661aSToomas Soome float	atanhf(float);
384*4a5d661aSToomas Soome float	cbrtf(float);
385*4a5d661aSToomas Soome float	logbf(float);
386*4a5d661aSToomas Soome float	copysignf(float, float) __pure2;
387*4a5d661aSToomas Soome long long llrintf(float);
388*4a5d661aSToomas Soome long long llroundf(float);
389*4a5d661aSToomas Soome long	lrintf(float);
390*4a5d661aSToomas Soome long	lroundf(float);
391*4a5d661aSToomas Soome float	nanf(const char *) __pure2;
392*4a5d661aSToomas Soome float	nearbyintf(float);
393*4a5d661aSToomas Soome float	nextafterf(float, float);
394*4a5d661aSToomas Soome float	remainderf(float, float);
395*4a5d661aSToomas Soome float	remquof(float, float, int *);
396*4a5d661aSToomas Soome float	rintf(float);
397*4a5d661aSToomas Soome float	scalblnf(float, long);
398*4a5d661aSToomas Soome float	scalbnf(float, int);
399*4a5d661aSToomas Soome float	truncf(float);
400*4a5d661aSToomas Soome 
401*4a5d661aSToomas Soome float	fdimf(float, float);
402*4a5d661aSToomas Soome float	fmaf(float, float, float);
403*4a5d661aSToomas Soome float	fmaxf(float, float) __pure2;
404*4a5d661aSToomas Soome float	fminf(float, float) __pure2;
405*4a5d661aSToomas Soome #endif
406*4a5d661aSToomas Soome 
407*4a5d661aSToomas Soome /*
408*4a5d661aSToomas Soome  * float versions of BSD math library entry points
409*4a5d661aSToomas Soome  */
410*4a5d661aSToomas Soome #if __BSD_VISIBLE
411*4a5d661aSToomas Soome float	dremf(float, float);
412*4a5d661aSToomas Soome int	finitef(float) __pure2;
413*4a5d661aSToomas Soome float	gammaf(float);
414*4a5d661aSToomas Soome float	j0f(float);
415*4a5d661aSToomas Soome float	j1f(float);
416*4a5d661aSToomas Soome float	jnf(int, float);
417*4a5d661aSToomas Soome float	scalbf(float, float);
418*4a5d661aSToomas Soome float	y0f(float);
419*4a5d661aSToomas Soome float	y1f(float);
420*4a5d661aSToomas Soome float	ynf(int, float);
421*4a5d661aSToomas Soome 
422*4a5d661aSToomas Soome /*
423*4a5d661aSToomas Soome  * Float versions of reentrant version of gamma & lgamma; passes
424*4a5d661aSToomas Soome  * signgam back by reference as the second argument; user must
425*4a5d661aSToomas Soome  * allocate space for signgam.
426*4a5d661aSToomas Soome  */
427*4a5d661aSToomas Soome float	gammaf_r(float, int *);
428*4a5d661aSToomas Soome float	lgammaf_r(float, int *);
429*4a5d661aSToomas Soome 
430*4a5d661aSToomas Soome /*
431*4a5d661aSToomas Soome  * float version of IEEE Test Vector
432*4a5d661aSToomas Soome  */
433*4a5d661aSToomas Soome float	significandf(float);
434*4a5d661aSToomas Soome #endif	/* __BSD_VISIBLE */
435*4a5d661aSToomas Soome 
436*4a5d661aSToomas Soome /*
437*4a5d661aSToomas Soome  * long double versions of ISO/POSIX math functions
438*4a5d661aSToomas Soome  */
439*4a5d661aSToomas Soome #if __ISO_C_VISIBLE >= 1999
440*4a5d661aSToomas Soome long double	acoshl(long double);
441*4a5d661aSToomas Soome long double	acosl(long double);
442*4a5d661aSToomas Soome long double	asinhl(long double);
443*4a5d661aSToomas Soome long double	asinl(long double);
444*4a5d661aSToomas Soome long double	atan2l(long double, long double);
445*4a5d661aSToomas Soome long double	atanhl(long double);
446*4a5d661aSToomas Soome long double	atanl(long double);
447*4a5d661aSToomas Soome long double	cbrtl(long double);
448*4a5d661aSToomas Soome long double	ceill(long double);
449*4a5d661aSToomas Soome long double	copysignl(long double, long double) __pure2;
450*4a5d661aSToomas Soome long double	coshl(long double);
451*4a5d661aSToomas Soome long double	cosl(long double);
452*4a5d661aSToomas Soome long double	erfcl(long double);
453*4a5d661aSToomas Soome long double	erfl(long double);
454*4a5d661aSToomas Soome long double	exp2l(long double);
455*4a5d661aSToomas Soome long double	expl(long double);
456*4a5d661aSToomas Soome long double	expm1l(long double);
457*4a5d661aSToomas Soome long double	fabsl(long double) __pure2;
458*4a5d661aSToomas Soome long double	fdiml(long double, long double);
459*4a5d661aSToomas Soome long double	floorl(long double);
460*4a5d661aSToomas Soome long double	fmal(long double, long double, long double);
461*4a5d661aSToomas Soome long double	fmaxl(long double, long double) __pure2;
462*4a5d661aSToomas Soome long double	fminl(long double, long double) __pure2;
463*4a5d661aSToomas Soome long double	fmodl(long double, long double);
464*4a5d661aSToomas Soome long double	frexpl(long double value, int *); /* fundamentally !__pure2 */
465*4a5d661aSToomas Soome long double	hypotl(long double, long double);
466*4a5d661aSToomas Soome int		ilogbl(long double) __pure2;
467*4a5d661aSToomas Soome long double	ldexpl(long double, int);
468*4a5d661aSToomas Soome long double	lgammal(long double);
469*4a5d661aSToomas Soome long long	llrintl(long double);
470*4a5d661aSToomas Soome long long	llroundl(long double);
471*4a5d661aSToomas Soome long double	log10l(long double);
472*4a5d661aSToomas Soome long double	log1pl(long double);
473*4a5d661aSToomas Soome long double	log2l(long double);
474*4a5d661aSToomas Soome long double	logbl(long double);
475*4a5d661aSToomas Soome long double	logl(long double);
476*4a5d661aSToomas Soome long		lrintl(long double);
477*4a5d661aSToomas Soome long		lroundl(long double);
478*4a5d661aSToomas Soome long double	modfl(long double, long double *); /* fundamentally !__pure2 */
479*4a5d661aSToomas Soome long double	nanl(const char *) __pure2;
480*4a5d661aSToomas Soome long double	nearbyintl(long double);
481*4a5d661aSToomas Soome long double	nextafterl(long double, long double);
482*4a5d661aSToomas Soome double		nexttoward(double, long double);
483*4a5d661aSToomas Soome float		nexttowardf(float, long double);
484*4a5d661aSToomas Soome long double	nexttowardl(long double, long double);
485*4a5d661aSToomas Soome long double	powl(long double, long double);
486*4a5d661aSToomas Soome long double	remainderl(long double, long double);
487*4a5d661aSToomas Soome long double	remquol(long double, long double, int *);
488*4a5d661aSToomas Soome long double	rintl(long double);
489*4a5d661aSToomas Soome long double	roundl(long double);
490*4a5d661aSToomas Soome long double	scalblnl(long double, long);
491*4a5d661aSToomas Soome long double	scalbnl(long double, int);
492*4a5d661aSToomas Soome long double	sinhl(long double);
493*4a5d661aSToomas Soome long double	sinl(long double);
494*4a5d661aSToomas Soome long double	sqrtl(long double);
495*4a5d661aSToomas Soome long double	tanhl(long double);
496*4a5d661aSToomas Soome long double	tanl(long double);
497*4a5d661aSToomas Soome long double	tgammal(long double);
498*4a5d661aSToomas Soome long double	truncl(long double);
499*4a5d661aSToomas Soome #endif /* __ISO_C_VISIBLE >= 1999 */
500*4a5d661aSToomas Soome 
501*4a5d661aSToomas Soome #if __BSD_VISIBLE
502*4a5d661aSToomas Soome long double	lgammal_r(long double, int *);
503*4a5d661aSToomas Soome #endif
504*4a5d661aSToomas Soome 
505*4a5d661aSToomas Soome __END_DECLS
506*4a5d661aSToomas Soome 
507*4a5d661aSToomas Soome #endif /* !_MATH_H_ */
508