home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / c / cephes.arc / CEPHES.DOC < prev    next >
Encoding:
Text File  |  1987-06-20  |  9.4 KB  |  226 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.               CEPHES MATHEMATICAL FUNCTION LIBRARY
  7.  
  8.  
  9.      This computer software library is a collection of fast and
  10. highly accurate double precision mathematical routines for
  11. scientific and engineering applications.  All are written
  12. entirely in C language.
  13.  
  14.      The library contains more than 100 tested functions.  In
  15. addition to the elementary transcendental functions, it includes
  16. a substantial collection of probability integrals, Bessel
  17. functions, and higher transcendental functions.
  18.  
  19.      There are complex variable routines covering complex
  20. arithmetic, complex logarithm and exponential, and complex
  21. trigonometric functions.
  22.  
  23.      Each subroutine has been tested by comparing at a large
  24. number of points against high precision check routines.  The test
  25. programs use floating point arithmetic having 144 bit (43
  26. decimal) precision.  Test results are given with the desription
  27. of each routine.
  28.  
  29.      The routines have been characterized and tested in IEEE Std
  30. 754 double precision arithmetic, used on IBM PC and a growing
  31. number of other computers, and also in the popular DEC/IBM double
  32. precision format.
  33.  
  34.      For DEC and IEEE arithmetic, numerical constants and
  35. approximation coefficients are supplied as integer arrays in
  36. order to eliminate conversion errors that might be introduced by
  37. the language compiler.  All coefficients are also supplied in the
  38. normal decimal scientific notation so that the routines can be
  39. compiled and used on other machines that do not support either of
  40. the above numeric formats.
  41.  
  42.      A single, common error handling routine is supplied.  Error
  43. conditions produce a display of the function name and error type.
  44. The user may easily insert modifications to implement any desired
  45. action on specified types of error.
  46.  
  47.      The following table summarizes the current contents of the
  48. library.  Note that since the quoted accuracies are
  49. experimentally measured, they are not guaranteed maximum errors.
  50. Nevertheless the same tests applied to several published math
  51. routine libraries have revealed significant differences, in favor
  52. of the Cephes routines.
  53.  
  54.      Following the summary table are Unix-style manual pages that
  55. describe the functions and their invocation.
  56.  
  57.                                                            PAGE 2
  58.  
  59.  
  60.  
  61. Function                        Name      Accuracy
  62. --------                        ----    DEC     IEEE
  63.                                         ----    ----
  64.                 Algebraic
  65. Square root                     sqrt    2e-17   2e-16
  66. Long integer square root        lsqrt   1       1
  67. Cube root                       cbrt    2e-17   2e-16
  68. Evaluate polynomial             polevl
  69. Evaluate Chebyshev series       chbevl
  70. Round to nearest integer value  round
  71. Truncate upward to integer      ceil
  72. Truncate downward to integer    floor
  73. Extract exponent                frexp
  74. Add integer to exponent         ldexp
  75. Absolute value                  fabs
  76. Roots of a polynomial           polrt
  77.  
  78.                 Exponential and Trigonometric
  79. Arc cosine                      acos    3e-17   2e-16
  80. Arc hyperbolic cosine           acosh   4e-17   4e-16
  81. Arc hyperbolic sine             asinh   5e-17   4e-16
  82. Arc hyperbolic tangent          atanh   3e-17   2e-16
  83. Arcsine                         asin    6e-17   5e-16
  84. Arctangent                      atan    3e-17   3e-16
  85. Quadrant correct arctangent     atan2   3e-17   3e-16
  86. Cosine                          cos     3e-17   2e-16
  87. Cosine of arg in degrees        cosdg   4e-17   2e-16
  88. Exponential, base e             exp     3e-17   2e-16
  89. Exponential, base 2             exp2    2e-17   2e-16
  90. Exponential, base 10            exp10   3e-17   3e-16
  91. Hyperbolic cosine               cosh    3e-17   2e-16
  92. Hyperbolic sine                 sinh    4e-17   3e-16
  93. Hyperbolic tangent              tanh    3e-17   2e-16
  94. Logarithm, base e               log     2e-17   2e-16
  95. Logarithm, base 10              log10   3e-17   2e-16
  96. Power                           pow     1e-15   1e-14
  97. Sine                            sin     3e-17   2e-16
  98. Sine of arg in degrees          sindg   4e-17   2e-16
  99. Tangent                         tan     4e-17   3e-16
  100. Tangent of arg in degrees       tandg   3e-17   2e-16
  101.  
  102.                 Exponential integral
  103. Exponential integral            expn    2e-16   1e-15
  104. Hyperbolic cosine integral      shichi  9e-17   7e-16
  105. Hyperbolic sine integral        shichi  9e-17   6e-16
  106. Cosine integral                 sici    8e-17A  6e-16
  107. Sine integral                   sici    4e-17A  5e-16
  108.  
  109.                 Gamma
  110. Beta                            beta    8e-15   2e-14
  111. Factorial                       fac     2e-17   1e-15
  112. Gamma                           gamma   1e-16   1e-15
  113. Logarithm of gamma function     lgam    5e-17   5e-16
  114.  
  115.                                                            PAGE 3
  116.  
  117.  
  118.  
  119. Incomplete beta integral        incbet  4e-14   4e-13
  120. Inverse beta integral           incbi   3e-13   2e-12
  121. Incomplete gamma integral       igam    5e-15   3e-14
  122. Complemented gamma integral     igamc   3e-15   2e-14
  123. Inverse gamma integral          igami   9e-16   6e-15
  124. Psi (digamma) function          psi     2e-16   4e-15
  125. Reciprocal Gamma                rgamma  1e-16   1e-15
  126.  
  127.                 Error function
  128. Error function                  erf     5e-17   3e-16
  129. Complemented error function     erfc    5e-16   6e-14
  130. Dawson's integral               dawsn   2e-16   1e-15
  131. Fresnel integral (C, S)         fresnl  2e-16   2e-15
  132.  
  133.                 Bessel
  134. Airy (Ai, Ai', Bi, Bi')         airy    8e-13A  2e-9A
  135. Bessel, order 0                 j0      4e-17A  4e-16A
  136. Bessel, order 1                 j1      3e-17A  2e-16A
  137. Bessel, order n                 jn      7e-17A  5e-16A
  138. Bessel, noninteger order        jv      1e-13A  9e-13A
  139. Bessel, second kind, order 0    y0      8e-17A  1e-15A
  140. Bessel, second kind, order 1    y1      9e-17A  7e-16A
  141. Bessel, second kind, order n    yn      3e-16A  2e-15A
  142. Modified Bessel, order 0        i0      8e-17   8e-16
  143. Exponentially scaled i0         i0e     8e-17   8e-16
  144. Modified Bessel, order 1        i1      1e-16   2e-15
  145. Exponentially scaled i1         i1e     1e-16   2e-15
  146. Modified Bessel, nonint. order  iv      3e-15   2e-15
  147. Mod. Bessel, 3rd kind, order 0  k0      1e-16   1e-15
  148. Exponentially scaled k0         k0e     1e-16   1e-15
  149. Mod. Bessel, 3rd kind, order 1  k1      9e-17   8e-16
  150. Exponentially scaled k1         k1e     9e-17   8e-16
  151. Mod. Bessel, 3rd kind, order n  kn      1e-9    7e-9
  152.  
  153.                 Hypergeometric
  154. Confluent hypergeometric        hyperg  1e-15   1e-14
  155. Gauss hypergeometric function   hyp2f1  4e-11   3e-9
  156.  
  157.                 Elliptic
  158. Complete elliptic integral (E)   ellpe  3e-17   2e-16
  159. Incomplete elliptic integral (E) ellie  2e-16   2e-15
  160. Complete elliptic integral (K)   ellpk  4e-17   3e-16
  161. Incomplete elliptic integral (K) ellik  9e-17   5e-16
  162. Jacobian elliptic functions      ellpj  5e-16A  9e-13
  163.  
  164.                 Probability
  165. Binomial distribution           bdtr    4e-14   4e-13
  166. Complemented binomial           bdtrc   4e-14   4e-13
  167. Inverse binomial                bdtri   3e-13   2e-12
  168. Chi square distribution         chdtr   5e-15   3e-14
  169. Complemented Chi square         chdtrc  3E-15   2E-14
  170. Inverse Chi square              chdtri  9e-16   6e-15
  171. F distribution                  fdtr    4e-14   4e-13
  172.  
  173.                                                            PAGE 4
  174.  
  175.  
  176.  
  177. Complemented F                  fdtrc   4e-14   4e-13
  178. Inverse F distribution          fdtri   3e-13   2e-12
  179. Gamma distribution              gdtr    5e-15   3e-14
  180. Complemented gamma              gdtrc   3e-15   2e-14
  181. Negative binomial distribution  nbdtr   4e-14   4e-13
  182. Complemented negative binomial  nbdtrc  4e-14   4e-13
  183. Normal distribution             ndtr    2e-15   3e-14
  184. Inverse normal distribution     ndtri   8e-17   7e-16
  185. Poisson distribution            pdtr    3e-15   2e-14
  186. Complemented Poisson            pdtrc   5e-15   3e-14
  187. Inverse Poisson distribution    pdtri   3e-15   5e-14
  188. Student's t distribution        stdtr   2e-15   1e-14
  189.  
  190.                 Miscellaneous
  191. Dilogarithm                     spence  2e-16   1e-15
  192. Riemann Zeta function           zetac   1e-16
  193. Two argument zeta function      zeta
  194.  
  195.                 Matrix
  196. Fast Fourier transform          fftr
  197. Simultaneous linear equations   simq
  198.  
  199.                 Complex Arithmetic
  200. Complex addition                cadd    1e-17   1e-16
  201. Subtraction                     csub    1e-17   1e-16
  202. Multiplication                  cmul    2e-17   2e-16
  203. Division                        cdiv    5e-17   4e-16
  204. Absolute value                  cabs    3e-17   2e-16
  205. Square root                     sqrt    3e-17   2e-16
  206.  
  207.         Complex Exponential and Trigonometric
  208. Exponential                     cexp    4e-17   3e-16
  209. Logarithm                       clog    9e-17   7e-16
  210. Cosine                          ccos    5e-17   4e-16
  211. Arc cosine                      cacos   2e-15   1e-14
  212. Sine                            csin    5e-17   4e-16
  213. Arc sine                        casin   2e-15   2e-14
  214. Tangent                         ctan    7e-17   6e-16
  215. Arc tangent                     catan   1e-16   4e-16
  216. Cotangent                       ccot    7e-17   5e-16
  217.  
  218. A: absolute error; others are relative error (i.e., % of reading)
  219.  
  220. Copyright 1987 by Stephen L. Moshier
  221.  
  222. Release 1.0: July, 1984
  223. Release 1.1: March, 1985
  224. Release 1.2: May, 1986
  225. Release 2.0: April, 1987
  226.