Back to index

glibc  2.9
MathLib.h
Go to the documentation of this file.
00001 /*
00002  * IBM Accurate Mathematical Library
00003  * Written by International Business Machines Corp.
00004  * Copyright (C) 2001 Free Software Foundation, Inc.
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU Lesser General Public License as published by
00008  * the Free Software Foundation; either version 2.1 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00019  */
00020 
00021 /********************************************************************/
00022 /* Ultimate math functions. Each function computes the exact        */
00023 /* theoretical value of its argument rounded to nearest or even.    */
00024 /*                                                                  */
00025 /* Assumption: Machine arithmetic operations are performed in       */
00026 /* round nearest mode of IEEE 754 standard.                         */
00027 /********************************************************************/
00028 
00029 #ifndef UMATH_LIB
00030 #define UMATH_LIB
00031 /********************************************************************/
00032 /* Function changes the precision mode to IEEE 754 double precision */
00033 /* and the rounding mode to nearest or even.                        */
00034 /* It returns the original status of these modes.                   */
00035 /* See further explanations of usage in DPChange.h                  */
00036 /********************************************************************/
00037 unsigned short Init_Lib(void);
00038 
00039 /********************************************************************/
00040 /* Function that changes the precision and rounding modes to the    */
00041 /* specified by the argument received. See further explanations in  */
00042 /* DPChange.h                                                       */
00043 /********************************************************************/
00044 void Exit_Lib(unsigned short);
00045 
00046 
00047 /* The  asin() function calculates the arc sine of its argument.    */
00048 /* The  function returns the arc sine in radians                    */
00049 /* (between -PI/2 and PI/2).                                        */
00050 /* If the argument is greater than 1 or less than -1 it returns     */
00051 /* a NaN.                                                           */
00052 double uasin(double );
00053 
00054 
00055 /* The  acos() function calculates the arc cosine of its argument.  */
00056 /* The  function returns the arc cosine in radians                  */
00057 /* (between -PI/2 and PI/2).                                        */
00058 /* If the argument is greater than 1 or less than -1 it returns     */
00059 /* a NaN.                                                           */
00060 double uacos(double );
00061 
00062 /* The  atan() function calculates the arctanget of its argument.   */
00063 /* The  function returns the arc tangent in radians                 */
00064 /* (between -PI/2 and PI/2).                                        */
00065 double uatan(double );
00066 
00067 
00068 /* The uatan2() function calculates the arc tangent of the two arguments x   */
00069 /* and y (x is the right argument and y is the left one).The signs of both   */
00070 /* arguments are used to determine the quadrant of the result.               */
00071 /* The function returns the result in radians, which is between -PI and PI   */
00072 double uatan2(double ,double );
00073 
00074 /* Compute log(x). The base of log is e (natural logarithm)         */
00075 double ulog(double );
00076 
00077 /* Compute e raised to the power of argument x.                     */
00078 double uexp(double );
00079 
00080 /* Compute sin(x). The argument x is assumed to be given in radians.*/
00081 double usin(double );
00082 
00083 /* Compute cos(x). The argument x is assumed to be given in radians.*/
00084 double ucos(double );
00085 
00086 /* Compute tan(x). The argument x is assumed to be given in radians.*/
00087 double utan(double );
00088 
00089 /* Compute the square root of non-negative argument x.              */
00090 /* If x is negative the returned value is NaN.                      */
00091 double usqrt(double );
00092 
00093 /* Compute x raised to the power of y, where x is the left argument */
00094 /* and y is the right argument. The function returns a NaN if x<0.  */
00095 /* If x equals zero it returns -inf                                 */
00096 double upow(double , double );
00097 
00098 /* Computing x mod y, where x is the left argument and y is the     */
00099 /* right one.                                                       */
00100 double uremainder(double , double );
00101 
00102 
00103 #endif