]>
Commit | Line | Data |
---|---|---|
e4d82761 UD |
1 | /* |
2 | * IBM Accurate Mathematical Library | |
c6c6dd48 | 3 | * Written by International Business Machines Corp. |
bfff8b1b | 4 | * Copyright (C) 2001-2017 Free Software Foundation, Inc. |
e4d82761 UD |
5 | * |
6 | * This program is free software; you can redistribute it and/or modify | |
c6c6dd48 | 7 | * it under the terms of the GNU Lesser General Public License as published by |
cc7375ce | 8 | * the Free Software Foundation; either version 2.1 of the License, or |
e4d82761 | 9 | * (at your option) any later version. |
445028e3 | 10 | * |
e4d82761 UD |
11 | * This program is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
c6c6dd48 | 14 | * GNU Lesser General Public License for more details. |
e4d82761 | 15 | * |
c6c6dd48 | 16 | * You should have received a copy of the GNU Lesser General Public License |
59ba27a6 | 17 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
e4d82761 | 18 | */ |
c6c6dd48 | 19 | |
e4d82761 UD |
20 | /********************************************************************/ |
21 | /* Ultimate math functions. Each function computes the exact */ | |
22 | /* theoretical value of its argument rounded to nearest or even. */ | |
23 | /* */ | |
24 | /* Assumption: Machine arithmetic operations are performed in */ | |
25 | /* round nearest mode of IEEE 754 standard. */ | |
26 | /********************************************************************/ | |
27 | ||
28 | #ifndef UMATH_LIB | |
29 | #define UMATH_LIB | |
30 | /********************************************************************/ | |
31 | /* Function changes the precision mode to IEEE 754 double precision */ | |
32 | /* and the rounding mode to nearest or even. */ | |
33 | /* It returns the original status of these modes. */ | |
34 | /* See further explanations of usage in DPChange.h */ | |
35 | /********************************************************************/ | |
c5d5d574 | 36 | unsigned short Init_Lib (void); |
e4d82761 UD |
37 | |
38 | /********************************************************************/ | |
39 | /* Function that changes the precision and rounding modes to the */ | |
40 | /* specified by the argument received. See further explanations in */ | |
41 | /* DPChange.h */ | |
42 | /********************************************************************/ | |
c5d5d574 | 43 | void Exit_Lib (unsigned short); |
e4d82761 UD |
44 | |
45 | ||
46 | /* The asin() function calculates the arc sine of its argument. */ | |
47 | /* The function returns the arc sine in radians */ | |
48 | /* (between -PI/2 and PI/2). */ | |
49 | /* If the argument is greater than 1 or less than -1 it returns */ | |
50 | /* a NaN. */ | |
c5d5d574 | 51 | double uasin (double); |
e4d82761 UD |
52 | |
53 | ||
54 | /* The acos() function calculates the arc cosine of its argument. */ | |
55 | /* The function returns the arc cosine in radians */ | |
56 | /* (between -PI/2 and PI/2). */ | |
57 | /* If the argument is greater than 1 or less than -1 it returns */ | |
58 | /* a NaN. */ | |
c5d5d574 | 59 | double uacos (double); |
e4d82761 UD |
60 | |
61 | /* The atan() function calculates the arctanget of its argument. */ | |
62 | /* The function returns the arc tangent in radians */ | |
63 | /* (between -PI/2 and PI/2). */ | |
c5d5d574 | 64 | double uatan (double); |
e4d82761 UD |
65 | |
66 | ||
67 | /* The uatan2() function calculates the arc tangent of the two arguments x */ | |
68 | /* and y (x is the right argument and y is the left one).The signs of both */ | |
69 | /* arguments are used to determine the quadrant of the result. */ | |
70 | /* The function returns the result in radians, which is between -PI and PI */ | |
c5d5d574 | 71 | double uatan2 (double, double); |
e4d82761 UD |
72 | |
73 | /* Compute log(x). The base of log is e (natural logarithm) */ | |
c5d5d574 | 74 | double ulog (double); |
e4d82761 UD |
75 | |
76 | /* Compute e raised to the power of argument x. */ | |
c5d5d574 | 77 | double uexp (double); |
e4d82761 UD |
78 | |
79 | /* Compute sin(x). The argument x is assumed to be given in radians.*/ | |
c5d5d574 | 80 | double usin (double); |
e4d82761 UD |
81 | |
82 | /* Compute cos(x). The argument x is assumed to be given in radians.*/ | |
c5d5d574 | 83 | double ucos (double); |
e4d82761 UD |
84 | |
85 | /* Compute tan(x). The argument x is assumed to be given in radians.*/ | |
c5d5d574 | 86 | double utan (double); |
e4d82761 UD |
87 | |
88 | /* Compute the square root of non-negative argument x. */ | |
89 | /* If x is negative the returned value is NaN. */ | |
c5d5d574 | 90 | double usqrt (double); |
e4d82761 UD |
91 | |
92 | /* Compute x raised to the power of y, where x is the left argument */ | |
93 | /* and y is the right argument. The function returns a NaN if x<0. */ | |
94 | /* If x equals zero it returns -inf */ | |
c5d5d574 | 95 | double upow (double, double); |
e4d82761 UD |
96 | |
97 | /* Computing x mod y, where x is the left argument and y is the */ | |
98 | /* right one. */ | |
c5d5d574 | 99 | double uremainder (double, double); |
e4d82761 | 100 | #endif |