home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 188_01 / trns1.doc < prev   
Text File  |  1987-09-30  |  4KB  |  69 lines

  1.              Transcendenta∞ Function≤ Versioε 1.1
  2.  
  3.      Thσá codσ originall∙ issueΣ iε ├ Usersº Grou≡ Volumσá 18╕ ì
  4. ha≤á beeε adapteΣ t∩ ruε oε Ecosof⌠ ├ a≤ wel∞ a≤ MI╪á C«á  Thσ ì
  5. MI╪á ├ versioε wil∞ ruε oε Azteπ ├ iµ thσ frexp(⌐ anΣá ldexp(⌐ ì
  6. function≤ supplieΣ iε Azteπ m.liΓ arσ used¼ bu⌠ Azteπ arithmeì
  7. tiπ i≤ no⌠ accuratσ enougΦ t∩ justif∙ thσ numbe≥ oµ term≤ useΣ ì
  8. iε thσ polynomials.
  9.  
  10.      ┴á tan(⌐á functioεá ha≤ beeε addeΣ whicΦá use≤á ßá singlσ ì
  11. rationa∞ polynomia∞ approximatioε t∩ cove≥ thσ wholσ rangσá oµ ì
  12. +- PI/2¼á witΦá minima°á relativσ error«á  Thi≤ ha≤ proveεá a≤ ì
  13. accuratσá anΣá nearl∙ a≤ fas⌠ a≤ an∙ oµ thσá morσá complicateΣ ì
  14. method≤ whicΦ thσ autho≥ ha≤ seen.
  15.  
  16.      Coefficient≤á oµ polynomial≤ havσ beeε recalculateΣ usinτ ì
  17. Chebyshe÷á fit≤á t∩ function≤ sucΦá a≤á sin(x)/x¼á whicΦá givσ ì
  18. bette≥á averagσá relativσ erro≥ thaε ß minimuφ relativσá erro≥ ì
  19. fit«á  Thσ approximatioε fo≥ log2(⌐ ha≤ les≤ erro≥á everywherσ ì
  20. thaε thσ bes⌠ relativσ erro≥ fits«á  Chebyshe÷ polynomial≤ arσ ì
  21. morσá economica∞á anΣ reproduciblσ t∩ calculatσá thaεá minimuφ ì
  22. relativσ erro≥ polynomials¼ bu⌠ arσ no⌠ applicablσ t∩ rationa∞ ì
  23. approximations.
  24.  
  25.      EcoSof⌠á ├ doe≤ no⌠ providσ ßá floor(⌐á function«á  Sincσ ì
  26. thi≤á presumabl∙ mean≤ tha⌠ thσ developer≤ founΣ thei≥á dint(⌐ ì
  27. functioε t∩ bσ morσ efficient¼ thσ conditiona∞ compilatioε fo≥ ì
  28. EcoSof⌠ versioε set≤ u≡ thi≤ substitution¼ a≤ wel∞ a≤ carryinτ ì
  29. ou⌠á EcoSoft'≤ suggestioε tha⌠ commoε constant≤ bσ referreΣ t∩ ì
  30. b∙á thσ librar∙ name≤ t∩ savσ thσ ╕ byte≤ whicΦ woulΣ bσá useΣ ì
  31. iε eacΦ functioε whicΦ carrie≤ it≤ owε copy¼ anΣ usσ value≤ t∩ ì
  32. ful∞ machinσ accuracy.
  33.  
  34.      Neithe≥á EcoSof⌠ no≥ MI╪ wil∞ compilσ negativσ doublσá o≥ ì
  35. floa⌠á constants╗á howeve≥á MI╪ simpl∙ compile≤á thσá absolutσ ì
  36. valuσá anΣ s∩ accept≤ standarΣ codσ withou⌠ warninτá oµá erroì
  37. neou≤ results«á  BotΦ compiler≤ carr∙ 5╢ bit≤ precisioε arithì
  38. metic¼á althougΦá thσ MI╪ compile≥ doe≤ no⌠ appea≥ t∩ reaΣ thσ ì
  39. equivalen⌠á 1╖ o≥ morσ digit≤ oµ constants«á  Sincσ thσá sin(⌐ ì
  40. functioε oµ thσ MI╪ versioε i≤ accuratσ onl∙ t∩ 1╢ digits¼ thσ ì
  41. EcoSof⌠ versioε extend≤ precisioε t∩ 1╣ digits.
  42.  
  43.      Thσ followinτ tablσ show≤ thσ numbe≥ oµ term≤ requireΣ t∩ ì
  44. achievσá specifieΣ accurac∙ usinτ thesσ approximation≤ t∩á thσ ì
  45. standarΣá transcendenta∞á functions«á  Thosσ wh∩ arσá familia≥ ì
  46. witΦá somσá oµ thσ commercia∞ librarie≤ ma∙ notσ morσá thaεá ß ì
  47. coincidenta∞á attractioε t∩ approximation≤ whicΦ arσá accuratσ ì
  48. t∩ 6¼á 10¼á o≥ 1│ digits¼á wherσ benchmarδ competition≤ ma∙ bσ ì
  49. woε b∙ fallinτ shor⌠ oµ ful∞ machinσ accuracy«  Approximation≤ ì
  50. t∩á 1╕á o≥á 21.╡á digit≤ sharσ thσá samσá propert∙á oµá havinτ ì
  51. efficien⌠á approximation≤ availablσ fo≥ mos⌠ oµ thσá importan⌠ ì
  52. functions.
  53. .paè       Terms Required for Transcendental Approximations
  54. .------!---!---!---!---!---!---!---!---!---!---!---!---!---!-R
  55. _____________________________________________________________
  56. log()    3   4   5    6    7   8   9  10   11  12   13   14
  57.  
  58. exp()  3       4       5       6      7
  59.  
  60. sinh 3    4    5     6     7     8     9     10     11
  61.  
  62. sin()  4   5    6    7     8    9    10   11    12    13
  63.  
  64. tan() 5   6    7    8    9    10
  65.  
  66. atan() 3  4   5   6  7   8   9 10  11 12  13  14 15  16 17
  67. ____________________________________________________________
  68. Digits 6   8  10  12  14  16  18  20  22  24  26  28  30  32
  69.