/* Copyright 1996 Acorn Computers Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma force_top_level #pragma include_only_once /* math.h: ISO 'C' (9899:1999) library header, section 7.12 */ /* Copyright (C) Codemist Ltd. */ /* Copyright (C) Acorn Computers Ltd. 1991 */ /* version 0.07 */ #ifndef __math_h #define __math_h typedef float float_t; typedef double double_t; /* most efficient types at least as wide as float and double */ #ifndef HUGE_VAL # define HUGE_VAL __huge_val #ifdef __cplusplus # define HUGE __huge_val extern "C" const double HUGE_VAL; #else extern const double HUGE_VAL; #endif #endif /* HUGE_VAL equals DBL_MAX, and this is the return value for overflow */ /* range errors in the C90 functions. Also, domain errors return */ /* -HUGE_VAL = -DBL_MAX. */ /* However, new C99 functions are in a state of flux. They may either */ /* return DBL_MAX or INFINITY for range errors and either a NaN */ /* or -DBL_MAX for domain errors, depending on how new the shared C */ /* library is. Newer versions of the C library will use infinities and */ /* NaNs for all the C99 functions, and will also have a parallel set of */ /* C99 versions of the original C90 functions, so behaviour will */ /* eventually be consistent within each mode, with HUGE_VAL set to */ /* DBL_MAX for C90 mode and INFINITY for C99 mode. */ /* See also math_errhandling below. */ #ifndef HUGE_VALL #define HUGE_VALL ((long double) HUGE_VAL) #endif /* long double is equivalent to double in Norcroft C, so all */ /* long double functions just call their double counterpart. */ #ifndef __cplusplus #ifndef HUGE_VALF # define HUGE_VALF INFINITY #endif #define INFINITY 0f_7F800000 /* a constant expression of type float representing positive infinity */ #define NAN 0f_7FC00001 /* a constant expression of type float representing a quiet NaN */ #define FP_ZERO 0 #define FP_SUBNORMAL 1 #define FP_NORMAL 2 #define FP_INFINITE 3 #define FP_NAN 4 /* the mutually exclusive kinds of floating-point values for fpclassify */ #endif #ifdef __FP_FAST_FMA #define FP_FAST_FMA 1 #endif #ifdef __FP_FAST_FMAF #define FP_FAST_FMAF 1 #endif #ifdef __FP_FAST_FMAL #define FP_FAST_FMAL 1 #endif /* indicates that the fmaf/fmaf/fmal functions generally execute about */ /* as fast, or faster than, a multiply and an add of the operands. */ #define FP_ILOGB0 (-0x7FFFFFFF) /* -INT_MAX */ #define FP_ILOGBNAN (~0x7FFFFFFF) /* INT_MIN */ /* integer constant expressions whose values are returned by ilogb(x) */ /* if x is zero or NaN, respectively. */ #define MATH_ERRNO 1 #define MATH_ERREXCEPT 2 #undef math_errhandling /* math_errhandling is not currently provided, as an indication that */ /* this is in flux. At present, "invalid", "divide-by-zero" and */ /* "overflow" traps are enabled by default, so to raise these would */ /* cause SIGFPE. C90 does not allow functions to do this, so */ /* the functions present in C90 do not raise these exceptions. */ /* They instead set errno to EDOM or ERANGE, as required by C90. */ /* The new C99 functions do raise exceptions, and don't set errno. But */ /* because this will (by default) lead to SIGFPE being raised, the */ /* behaviour does not currently conform to the C99 standard. To avoid */ /* the traps you can use feholdexcept(). A future C99 version of the */ /* library will have all traps disabled by default, making these */ /* functions conforming, and will have new versions of the C90 */ /* functions which do raise exceptions. Note that some C99 functions */ /* may still be using errno and DBL_MAX, but this will be changed (even */ /* for existing clients) by newer Shared C libraries. The original C90 */ /* functions will not change, to preserve compatibility for older */ /* clients. See also HUGE_VAL above. */ /* #pragma STDC FP_CONTRACT ON|OFF|DEFAULT */ /* The FP_CONTRACT pragma can be used to allow (if the state is "on") */ /* or disallow (if the state is "off") the implementation to contract */ /* expressions (refer to section 6.5 of the ISO standard). Each pragma */ /* can occur either outside external declarations or preceding all */ /* explicit declarations and statements inside a compound statement. */ /* When outside external declarations, the pragma takes effect from its */ /* occurrence until another FP_CONTRACT pragma is encountered, or until */ /* the end of the translation unit. When inside a compound statement, */ /* the pragma takes effect from its occurrence until another */ /* FP_CONTRACT pragma is encountered (including within a nested */ /* compound statement), or until the end of the compound statement; at */ /* the end of a compound statement the state for the pragma is restored */ /* to its condition just before the compound statement. If this pragma */ /* is used in any other context, the behaviour is undefined. The */ /* default state for this pragma is implementation-defined ("off" in */ /* Norcroft C.). */ #ifdef __cplusplus extern "C" { #endif #ifndef __cplusplus /* None of this actually works, as the C++ system won't obey the force_fpargs_in_regs pragma */ #pragma no_side_effects #pragma force_fpargs_in_regs __caller_narrow int __fpclassifyf(float); int __fpclassifyd(double); __caller_narrow int __signbitf(float); int __signbitd(double); __caller_narrow float __copysignf(float,float); double __copysignd(double,double); #pragma no_force_fpargs_in_regs #pragma side_effects #ifdef __cplusplus #define __classmacro(fn,r) (sizeof(r) == 4 ? __##fn##f((float)(r)) : \ __##fn##d((double)(r))) #else #define __assertfp(r) ___assert(___typeof(r) == 0x002 ||\ ___typeof(r) == 0x202 ||\ ___typeof(r) == 0x402, \ "Illegal type used with classification macro") #define __classmacro(fn,r) (__assertfp(r),\ ___typeof(r) == 0x402 ? __##fn##f((float)(r)) : \ __##fn##d((double)(r))) #endif #define fpclassify(r) __classmacro(fpclassify,(r)) /* Returns: the value of the appropriate number classification macro */ #define isfinite(r) (fpclassify(r) <= FP_NORMAL) /* Returns: a nonzero value if and only if its argument is finite */ #define isinf(r) (fpclassify(r) == FP_INFINITE) /* Returns: a nonzero value if and only if its argument is infinite */ #define isnan(r) (fpclassify(r) == FP_NAN) /* Returns: a nonzero value if and only if its argument is a NaN */ #define isnormal(r) (fpclassify(r) == FP_NORMAL) /* Returns: a nonzero value if and only if its argument is normal */ #define signbit(r) __classmacro(signbit,(r)) /* Returns: a nonzero value if and only if its argument is negative */ #endif double acos(double /*x*/); float acosf(float /*x*/); long double acosl(long double /*x*/); /* computes the principal value of the arc cosine of x */ /* a domain error occurs for arguments not in the range -1 to 1 */ /* Returns: the arc cosine in the range 0 to Pi. */ double asin(double /*x*/); float asinf(float /*x*/); long double asinl(long double /*x*/); /* computes the principal value of the arc sine of x */ /* a domain error occurs for arguments not in the range -1 to 1 */ /* Returns: the arc sine in the range -Pi/2 to Pi/2. */ double atan(double /*x*/); float atanf(float /*x*/); long double atanl(long double /*x*/); /* computes the principal value of the arc tangent of x */ /* Returns: the arc tangent in the range -Pi/2 to Pi/2. */ double atan2(double /*y*/, double /*x*/); float atan2f(float /*y*/, float /*x*/); long double atan2l(long double /*y*/, long double /*x*/); /* computes the principal value of the arc tangent of y/x, using the */ /* signs of both arguments to determine the quadrant of the return */ /* value */ /* Returns: the arc tangent of y/x, in the range -Pi to Pi. */ double cos(double /*x*/); float cosf(float /*x*/); long double cosl(long double /*x*/); /* computes the cosine of x (measured in radians). A large magnitude */ /* argument may yield a result with little or no significance */ /* Returns: the cosine value. */ double sin(double /*x*/); float sinf(float /*x*/); long double sinl(long double /*x*/); /* computes the sine of x (measured in radians). A large magnitude */ /* argument may yield a result with little or no significance */ /* Returns: the sine value. */ double tan(double /*x*/); float tanf(float /*x*/); long double tanl(long double /*x*/); /* computes the tangent of x (measured in radians). A large magnitude */ /* argument may yield a result with little or no significance */ /* Returns: the tangent value. */ double acosh(double /*x*/); float acoshf(float /*x*/); long double acoshl(long double /*x*/); /* computes the (non-negative) arc hyperbolic cosine of x. */ /* A domain error occurs for arguments less than 1. */ /* Returns: arcosh x in the interval [0,+inf] */ double asinh(double /*x*/); float asinhf(float /*x*/); long double asinhl(long double /*x*/); /* computes the arc hyperbolic sine of x. */ /* Returns: arsinh x */ double atanh(double /*x*/); float atanhf(float /*x*/); long double atanhl(long double /*x*/); /* computes the arc hyperbolic tangent of x. A domain error occurs */ /* for arguments not in the interval [-1,+1]. A range error occurs */ /* if the argument equals -1 or +1. */ /* Returns: artanh x */ double cosh(double /*x*/); float coshf(float /*x*/); long double coshl(long double /*x*/); /* computes the hyperbolic cosine of x. A range error occurs if the */ /* magnitude of x is too large. */ /* Returns: the hyperbolic cosine value. */ double sinh(double /*x*/); float sinhf(float /*x*/); long double sinhl(long double /*x*/); /* computes the hyperbolic sine of x. A range error occurs if the */ /* magnitude of x is too large. */ /* Returns: the hyperbolic sine value. */ double tanh(double /*x*/); float tanhf(float /*x*/); long double tanhl(long double /*x*/); /* computes the hyperbolic tangent of x. */ /* Returns: the hyperbolic tangent value. */ double exp(double /*x*/); float expf(float /*x*/); long double expl(long double /*x*/); /* computes the base-e exponential of x. A range error occurs if the */ /* magnitude of x is too large. */ /* Returns: e^x */ double exp2(double /*x*/); float exp2f(float /*x*/); long double exp2l(long double /*x*/); /* computes the base-2 exponential of x. A range error occurs if the */ /* magnitude of x is too large. */ /* Returns: 2^x */ double expm1(double /*x*/); float expm1f(float /*x*/); long double expm1l(long double /*x*/); /* computes the base-e exponential of x, minus 1. A range error occurs if */ /* the magnitude of x is too large. */ /* Returns: e^x - 1 */ double frexp(double /*value*/, int * /*exp*/); float frexpf(float /*value*/, int * /*exp*/); long double frexpl(long double /*value*/, int * /*exp*/); /* breaks a floating-point number into a normalised fraction and an */ /* integral power of 2. It stores the integer in the int object pointed */ /* to by exp. */ /* Returns: the value x, such that x is a double with magnitude in the */ /* interval [0.5,1.0) or zero, and value equals x times 2 raised to the */ /* power *exp. If value is zero, both parts of the result are zero. */ int ilogb(double /*x*/); int ilogbf(float /*x*/); int ilogbl(long double /*x*/); /* extracts the exponent of x as a signed int value. If x is zero it */ /* computes the value FP_ILOGB0; if x is infinite it computes the value */ /* INT_MAX; if x is a NaN it computes the value FP_ILOGBNAN; otherwise */ /* it is equivalent to calling the corresponding logb function and */ /* casting the returned value to type int. */ /* Returns: the exponent of x as a signed int value. */ double ldexp(double /*x*/, int /*exp*/); float ldexpf(float /*x*/, int /*exp*/); long double ldexpl(long double /*x*/, int /*exp*/); /* multiplies a floating-point number by an integral power of 2. */ /* A range error may occur. */ /* Returns: the value of x times 2 raised to the power of exp. */ double log(double /*x*/); float logf(float /*x*/); long double logl(long double /*x*/); /* computes the base-e (natural) logarithm of x. A domain error occurs */ /* if the argument is negative. A range error occurs if the argument is */ /* zero. */ /* Returns: the natural logarithm. */ double log10(double /*x*/); float log10f(float /*x*/); long double log10l(long double /*x*/); /* computes the base-ten (common) logarithm of x. A domain error occurs */ /* if the argument is negative. A range error occurs if the argument is */ /* zero. */ /* Returns: the base-ten logarithm. */ double log1p(double /*x*/); float log1pf(float /*x*/); long double log1pl(long double /*x*/); /* computes the base-e (natural) logarithm of 1 plus the argument. A */ /* domain error occurs if the argument is less than -1. A range error */ /* occurs if the argument equals -1. */ /* Returns: the natural logarithm of (1+x). */ double log2(double /*x*/); float log2f(float /*x*/); long double log2l(long double /*x*/); /* computes the base-two logarithm of x. A domain error occurs if the */ /* argument is negative. A range error occurs if the argument is zero. */ /* Returns: the base-two logarithm. */ double logb(double /*x*/); float logbf(float /*x*/); long double logbl(long double /*x*/); /* extracts the exponent of x, as a signed integer value in floating- */ /* point format. If x is subnormal it is treated as though it were */ /* normalised; thus, for positive finite x, */ /* 1 <= x * FLT_RADIX ^ -logb(x) < FLT_RADIX */ /* A range error occurs if the argument is zero. */ /* Returns: the signed exponent of x */ double modf(double /*value*/, double * /*iptr*/); float modff(float /*value*/, float * /*iptr*/); long double modfl(long double /*value*/, long double * /*iptr*/); /* breaks the argument value into integral and fraction parts, each of */ /* which has the same sign as the argument. It stores the integral part */ /* as a double in the object pointed to by iptr. */ /* Returns: the signed fractional part of value. */ double scalbn(double /*x*/, int /*n*/); float scalbnf(float /*x*/, int /*n*/); long double scalbnl(long double /*x*/, int /*n*/); double scalbln(double /*x*/, long int /*n*/); float scalblnf(float /*x*/, long int /*n*/); long double scalblnl(long double /*x*/, long int /*n*/); /* computes x * FLT_RADIX^n efficiently. A range error may occur. */ /* Returns: x * FLT_RADIX^n */ double cbrt(double /*x*/); float cbrtf(float /*x*/); long double cbrtl(long double /*x*/); /* computes the real cube root of x. */ /* Returns: x^(1/3) */ #pragma no_side_effects double fabs(double /*x*/); float fabsf(float /*x*/); long double fabsl(long double /*x*/); /* computes the absolute value of the floating-point number x. */ /* Returns: the absolute value of x. */ #pragma side_effects double hypot(double /*x*/, double /*y*/); float hypotf(float /*x*/, float /*y*/); long double hypotl(long double /*x*/, long double /*y*/); /* computes the square root of the sum of the squares of x and y, */ /* without undue overflow or underflow. A range error may occur. */ /* Returns: sqrt(x^2 + y^2) */ double pow(double /*x*/, double /*y*/); float powf(float /*x*/, float /*y*/); long double powl(long double /*x*/, long double /*y*/); /* computes x raised to the power of y. A domain error occurs if x is */ /* zero and y is less than or equal to zero, or if x is negative and y */ /* is not an integer. A range error may occur. */ /* Returns: the value of x raised to the power of y. */ double sqrt(double /*x*/); float sqrtf(float /*x*/); long double sqrtl(long double /*x*/); /* computes the non-negative square root of x. A domain error occurs */ /* if the argument is less than zero. */ /* Returns: the value of the square root. */ double erf(double /*x*/); float erff(float /*x*/); long double erfl(long double /*x*/); /* computes the error function of x. */ /* Returns: erf x = 2/sqrt(pi) * integral[0,x] (e^(-t^2)) dt */ double erfc(double /*x*/); float erfcf(float /*x*/); long double erfcl(long double /*x*/); /* computes the complementary error function of x. A range error occurs */ /* if x is too large. */ /* Returns: erfc x = 1 - erf x */ /* = 2/sqrt(pi) * integral[x,inf] (e^(-t^2)) dt */ double lgamma(double /*x*/); float lgammaf(float /*x*/); long double lgammal(long double /*x*/); /* computes the natural logarithm of the absolute value of gamma of x. */ /* A range error occurs if x is too large. A range error occurs if x is */ /* a negative integer or zero. */ /* Returns: log |Gamma(x)| */ double tgamma(double /*x*/); float tgammaf(float /*x*/); long double tgammal(long double /*x*/); /* computes the gamma function of x. A domain error occurs if x is a */ /* negative integer or if the result cannot be represented when x is */ /* zero. A range error may occur if the magnitude of x is too large or */ /* too small. */ /* Returns: Gamma(x) */ double ceil(double /*x*/); float ceilf(float /*x*/); long double ceill(long double /*x*/); /* computes the smallest integer not less than x. */ /* Returns: the smallest integer not less than x, expressed as a */ /* floating-point number. */ double floor(double /*x*/); float floorf(float /*x*/); long double floorl(long double /*x*/); /* computes the largest integer not greater than x. */ /* Returns: the largest integer not greater than x, expressed as a */ /* floating-point number. */ #pragma no_side_effects double nearbyint(double /*x*/); float nearbyintf(float /*x*/); long double nearbyintl(long double /*x*/); /* rounds its argument to an integer value, using the current rounding */ /* direction. Does not raise the inexact exception. */ /* Returns: the rounded integer value. */ #pragma side_effects double rint(double /*x*/); float rintf(float /*x*/); long double rintl(long double /*x*/); /* rounds its argument to an integer value, using the current rounding */ /* direction. Raises "inexact" if the result differs from the argument. */ /* Returns: the rounded integer value. */ long int lrint(double /*x*/); long int lrintf(float /*x*/); long int lrintl(long double /*x*/); #ifdef __STDC_VERSION__ #if __STDC_VERSION__ >= 199901 long long int llrint(double /*x*/); long long int llrintf(float /*x*/); long long int llrintl(long double /*x*/); #endif #endif /* rounds its argument to an integer value, using the current rounding */ /* direction. Raises "inexact" if the result differs from the argument. */ /* Returns: the rounded integer value. */ #pragma no_side_effects double round(double /*x*/); float roundf(float /*x*/); long double roundl(long double /*x*/); /* rounds its argument to the nearest integer value, rounding halfway */ /* cases away from zero. */ /* Returns: the rounded integer value. */ #pragma side_effects long int lround(double /*x*/); long int lroundf(float /*x*/); long int lroundl(long double /*x*/); #ifdef __STDC_VERSION__ #if __STDC_VERSION__ >= 199901 long long int llround(double /*x*/); long long int llroundf(float /*x*/); long long int llroundl(long double /*x*/); #endif #endif /* rounds its argument to the nearest integer value, rounding halfway */ /* cases away from zero. */ /* Returns: the rounded integer value. */ double trunc(double /*x*/); float truncf(float /*x*/); long double truncl(long double /*x*/); /* rounds its argument to the integer value, nearest to but no larger */ /* in magnitude than the argument. */ /* Returns: the truncated integer value. */ double fmod(double /*x*/, double /*y*/); float fmodf(float /*x*/, float /*y*/); long double fmodl(long double /*x*/, long double /*y*/); /* computes the floating-point remainder of x/y. */ /* Returns: the value x - n * y, for some integer n such that, if y is */ /* nonzero, the result has the same sign as x and magnitude */ /* less than the magnitude of y. If y is zero, a domain error */ /* occurs. */ double remainder(double /*x*/, double /*y*/); float remainderf(float /*x*/, float /*y*/); long double remainderl(long double /*x*/, long double /*y*/); /* computes the remainder x REM y required by IEEE 754 */ /* Returns: x REM y */ double remquo(double /*x*/, double /*y*/, int * /*quo*/); float remquof(float /*x*/, float /*y*/, int * /*quo*/); long double remquol(long double /*x*/, long double /*y*/, int * /*quo*/); /* compute the same remainder as the remainder functions. In the object */ /* pointed to by quo they store a value whose sign is the sign of x/y */ /* and whose magnitude is congruent modulo 2^n to the magnitude of the */ /* integral quotient of x/y, where n is an implementation-defined */ /* integer greater than or equal to 3 (n=31 under RISC OS) */ /* Returns: x REM y */ #pragma no_side_effects double copysign(double /*x*/, double /*y*/); float copysignf(float /*x*/, float /*y*/); long double copysignl(long double /*x*/, long double /*y*/); /* produce a value with the magnitude of x and the sign of y. They */ /* produce a NaN (with the sign of y) if x is a NaN. */ /* Returns: a value with the magnitude of x and the sign of y. */ double nan(const char * /*tagp*/); float nanf(const char * /*tagp*/); long double nanl(const char * /*tagp*/); /* Returns: a quiet NaN, with content indicated through tagp. */ #pragma side_effects double nextafter(double /*x*/, double /*y*/); float nextafterf(float /*x*/, float /*y*/); long double nextafterl(long double /*x*/, long double /*y*/); /* Returns: the next representable value in the specified format after */ /* x in the direction of y */ double nexttoward(double /*x*/, long double /*y*/); float nexttowardf(float /*x*/, long double /*y*/); long double nexttowardl(long double /*x*/, long double /*y*/); /* equivalent to the nextafter functions except that the second */ /* parameter has type long double. */ double fdim(double /*x*/, double /*y*/); float fdimf(float /*x*/, float /*y*/); long double fdiml(long double /*x*/, long double /*y*/); /* determine the positive difference between their arguments: */ /* { x-y if x > y */ /* { +0 if x <= y */ /* A range error may occur. */ /* Returns: the positive difference value. */ #pragma no_side_effects double fmax(double /*x*/, double /*y*/); float fmaxf(float /*x*/, float /*y*/); long double fmaxl(long double /*x*/, long double /*y*/); /* Returns: the maximum numeric value of their arguments. */ double fmin(double /*x*/, double /*y*/); float fminf(float /*x*/, float /*y*/); long double fminl(long double /*x*/, long double /*y*/); /* Returns: the minimum numeric value of their arguments. */ #pragma side_effects double fma(double /*x*/, double /*y*/, double /*z*/); float fmaf(float /*x*/, float /*y*/, float /*z*/); long double fmal(long double /*x*/, long double /*y*/, long double /*z*/); /* computes (x*y)+z, rounded as one ternary operation: it computes */ /* the value (as if) to infinite precision and rounds once to the */ /* result format, according to the rounding mode characterised by the */ /* value of FLT_ROUNDS. */ /* Returns: (x*y)+z, rounded as one ternary operation. */ #ifndef __cplusplus #define isgreater(x,y) ((x) __greater (y)) #define isgreaterequal(x,y) ((x) __greaterequal (y)) #define isless(x,y) ((x) __less (y)) #define islessequal(x,y) ((x) __lessequal (y)) #define islessgreater(x,y) ((x) __lessgreater (y)) #define isunordered(x,y) ((x) __unordered (y)) /* quiet (non floating-point exception raising) versions of the */ /* relational operators, and other comparison macros that facilitate */ /* writing efficient code that accounts for NaNs without suffering the */ /* "invalid" floating-point exception. */ #endif /* Some functions can be safely inlined - appropriate macros defined here. */ /* float ones can't be inlined in C++ because of the odd calling */ /* convention. Some can't be inlined because they won't set errno - in */ /* future they will be inlined in C99 mode, once the real functions are */ /* consistent. Define __MATH_FORCE_INLINING if you don't care about errno */ /* vs exceptions. */ double __d_acos(double); double __d_asin(double); double __d_atan(double); double __d_cos(double); double __d_sin(double); double __d_tan(double); double __d_log(double); double __d_lg10(double); double __d_exp(double); double __d_abs(double); double __d_sqrt(double); double __d_floor(double); double __d_ceil(double); double __d_trunc(double); double __d_rint(double); long int __d_lrint(double); double __d_rem(double,double); double __d_fma(double,double,double); #ifdef __MATH_FORCE_INLINING # if __STDC_VERSION__ >= 199901 #define acos(x) __d_acos(x) #define asin(x) __d_asin(x) #define cos(x) __d_cos(x) #define sin(x) __d_sin(x) #define tan(x) __d_tan(x) #define sqrt(x) __d_sqrt(x) #define log(x) __d_log(x) #define log10(x) __d_lg10(x) #define exp(x) __d_exp(x) # endif #endif #define atan(x) __d_atan(x) #ifdef __cplusplus # define fabs(x) __d_abs(x) #else # define fabs(x) ((void) sizeof (fabs)(x), __abs (double) (x)) #endif #define floor(x) __d_floor(x) #define ceil(x) __d_ceil(x) #define trunc(x) __d_trunc(x) #define rint(x) __d_rint(x) #define lrint(x) __d_lrint(x) #define remainder(x,y) __d_rem(x,y) #define fma(x,y,z) __d_fma(x,y,z) #ifndef __cplusplus __caller_narrow float __r_acos(float); __caller_narrow float __r_asin(float); __caller_narrow float __r_atan(float); __caller_narrow float __r_sin(float); __caller_narrow float __r_cos(float); __caller_narrow float __r_tan(float); __caller_narrow float __r_log(float); __caller_narrow float __r_lg10(float); __caller_narrow float __r_exp(float); __caller_narrow float __r_abs(float); __caller_narrow float __r_sqrt(float); __caller_narrow float __r_floor(float); __caller_narrow float __r_ceil(float); __caller_narrow float __r_trunc(float); __caller_narrow float __r_rint(float); __caller_narrow long int __r_lrint(float); __caller_narrow float __r_rem(float,float); __caller_narrow float __r_fma(float,float,float); #define copysign(x,y) __copysignd(x,y) #define copysignf(x,y) __copysignf(x,y) #define acosf(x) __r_acos(x) #define asinf(x) __r_asin(x) #define atanf(x) __r_atan(x) #define sinf(x) __r_sin(x) #define cosf(x) __r_cos(x) #define tanf(x) __r_tan(x) #define sqrtf(x) __r_sqrt(x) #define logf(x) __r_log(x) #define log10f(x) __r_lg10(x) #define expf(x) __r_exp(x) #define fabsf(x) ((void) sizeof (fabsf)(x), __abs (float) (x)) #define floorf(x) __r_floor(x) #define ceilf(x) __r_ceil(x) #define truncf(x) __r_trunc(x) #define rintf(x) __r_rint(x) #define lrintf(x) __r_lrint(x) #define remainderf(x,y) __r_rem(x,y) #define fmaf(x,y,z) __r_fma(x,y,z) #endif #ifdef __cplusplus } #endif #endif /* end of math.h */