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