inv_hyper.qbk 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. [/ math.qbk
  2. Copyright 2006 Hubert Holin and John Maddock.
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt).
  6. ]
  7. [def __form1 [^\[0;+'''∞'''\[]]
  8. [def __form2 [^\]-'''∞''';+1\[]]
  9. [def __form3 [^\]-'''∞''';-1\[]]
  10. [def __form4 [^\]+1;+'''∞'''\[]]
  11. [def __form5 [^\[-1;-1+'''ε'''\[]]
  12. [def __form6 '''ε''']
  13. [def __form7 [^\]+1-'''ε''';+1\]]]
  14. [def __effects [*Effects: ]]
  15. [def __formula [*Formula: ]]
  16. [def __exm1 '''<code>e<superscript>x</superscript> - 1</code>''']
  17. [def __ex '''<code>e<superscript>x</superscript></code>''']
  18. [def __te '''2&#x03B5;''']
  19. [section:inv_hyper Inverse Hyperbolic Functions]
  20. [section:inv_hyper_over Inverse Hyperbolic Functions Overview]
  21. The exponential funtion is defined, for all objects for which this makes sense,
  22. as the power series
  23. [equation special_functions_blurb1]
  24. with ['[^n! = 1x2x3x4x5...xn]] (and ['[^0! = 1]] by definition) being the factorial of ['[^n]].
  25. In particular, the exponential function is well defined for real numbers,
  26. complex number, quaternions, octonions, and matrices of complex numbers,
  27. among others.
  28. [: ['[*Graph of exp on R]] ]
  29. [: [$../graphs/exp_on_r.png] ]
  30. [: ['[*Real and Imaginary parts of exp on C]]]
  31. [: [$../graphs/im_exp_on_c.png]]
  32. The hyperbolic functions are defined as power series which
  33. can be computed (for reals, complex, quaternions and octonions) as:
  34. Hyperbolic cosine: [equation special_functions_blurb5]
  35. Hyperbolic sine: [equation special_functions_blurb6]
  36. Hyperbolic tangent: [equation special_functions_blurb7]
  37. [: ['[*Trigonometric functions on R (cos: purple; sin: red; tan: blue)]]]
  38. [: [$../graphs/trigonometric.png]]
  39. [: ['[*Hyperbolic functions on r (cosh: purple; sinh: red; tanh: blue)]]]
  40. [: [$../graphs/hyperbolic.png]]
  41. The hyperbolic sine is one to one on the set of real numbers,
  42. with range the full set of reals, while the hyperbolic tangent is
  43. also one to one on the set of real numbers but with range __form1, and
  44. therefore both have inverses.
  45. The hyperbolic cosine is one to one from __form2 onto __form3 (and from __form4 onto __form3).
  46. The inverse function we use here is defined on __form3 with range __form2.
  47. The inverse of the hyperbolic tangent is called the Argument hyperbolic tangent,
  48. and can be computed as [equation special_functions_blurb15]
  49. The inverse of the hyperbolic sine is called the Argument hyperbolic sine,
  50. and can be computed (for __form5) as [equation special_functions_blurb17]
  51. The inverse of the hyperbolic cosine is called the Argument hyperbolic cosine,
  52. and can be computed as [equation special_functions_blurb18]
  53. [endsect] [/section:inv_hyper_over Inverse Hyperbolic Functions Overview]
  54. [section:acosh acosh]
  55. ``
  56. #include <boost/math/special_functions/acosh.hpp>
  57. ``
  58. template<class T>
  59. ``__sf_result`` acosh(const T x);
  60. template<class T, class ``__Policy``>
  61. ``__sf_result`` acosh(const T x, const ``__Policy``&);
  62. Computes the reciprocal of (the restriction to the range of __form1)
  63. [link math_toolkit.inv_hyper.inv_hyper_over
  64. the hyperbolic cosine function], at x. Values returned are positive.
  65. If x is in the range __form2 then returns the result of __domain_error.
  66. The return type of this function is computed using the __arg_promotion_rules:
  67. the return type is `double` when T is an integer type, and T otherwise.
  68. [optional_policy]
  69. [graph acosh]
  70. [h4 Accuracy]
  71. Generally accuracy is to within 1 or 2 __epsilon across all supported platforms.
  72. [h4 Testing]
  73. This function is tested using a combination of random test values designed to give
  74. full function coverage computed at high precision using the "naive" formula:
  75. [equation acosh1]
  76. along with a selection of sanity check values
  77. computed using functions.wolfram.com to at least 50 decimal digits.
  78. [h4 Implementation]
  79. For sufficiently large x, we can use the
  80. [@http://functions.wolfram.com/ElementaryFunctions/ArcCosh/06/01/06/01/0001/
  81. approximation]:
  82. [equation acosh2]
  83. For x sufficiently close to 1 we can use the
  84. [@http://functions.wolfram.com/ElementaryFunctions/ArcCosh/06/01/04/01/0001/
  85. approximation]:
  86. [equation acosh4]
  87. Otherwise for x close to 1 we can use the following rearrangement of the
  88. primary definition to preserve accuracy:
  89. [equation acosh3]
  90. Otherwise the
  91. [@http://functions.wolfram.com/ElementaryFunctions/ArcCosh/02/
  92. primary definition] is used:
  93. [equation acosh1]
  94. [endsect] [/section:acosh acosh]
  95. [section:asinh asinh]
  96. ``
  97. #include <boost/math/special_functions/asinh.hpp>
  98. ``
  99. template<class T>
  100. ``__sf_result`` asinh(const T x);
  101. template<class T, class ``__Policy``>
  102. ``__sf_result`` asinh(const T x, const ``__Policy``&);
  103. Computes the reciprocal of
  104. [link math_toolkit.inv_hyper.inv_hyper_over
  105. the hyperbolic sine function].
  106. The return type of this function is computed using the __arg_promotion_rules:
  107. the return type is `double` when T is an integer type, and T otherwise.
  108. [graph asinh]
  109. [optional_policy]
  110. [h4 Accuracy]
  111. Generally accuracy is to within 1 or 2 __epsilon across all supported platforms.
  112. [h4 Testing]
  113. This function is tested using a combination of random test values designed to give
  114. full function coverage computed at high precision using the "naive" formula:
  115. [equation asinh1]
  116. along with a selection of sanity check values
  117. computed using functions.wolfram.com to at least 50 decimal digits.
  118. [h4 Implementation]
  119. For sufficiently large x we can use the
  120. [@http://functions.wolfram.com/ElementaryFunctions/ArcSinh/06/01/06/01/0001/
  121. approximation]:
  122. [equation asinh2]
  123. While for very small x we can use the
  124. [@http://functions.wolfram.com/ElementaryFunctions/ArcSinh/06/01/03/01/0001/
  125. approximation]:
  126. [equation asinh3]
  127. For 0.5 > x > [epsilon] the following rearrangement of the primary definition is used:
  128. [equation asinh4]
  129. Otherwise evalution is via the
  130. [@http://functions.wolfram.com/ElementaryFunctions/ArcSinh/02/
  131. primary definition]:
  132. [equation asinh4]
  133. [endsect] [/section:asinh asinh]
  134. [section:atanh atanh]
  135. ``
  136. #include <boost/math/special_functions/atanh.hpp>
  137. ``
  138. template<class T>
  139. ``__sf_result`` atanh(const T x);
  140. template<class T, class ``__Policy``>
  141. ``__sf_result`` atanh(const T x, const ``__Policy``&);
  142. Computes the reciprocal of
  143. [link math_toolkit.inv_hyper.inv_hyper_over
  144. the hyperbolic tangent function], at x.
  145. [optional_policy]
  146. If x is in the range
  147. __form3
  148. or in the range
  149. __form4
  150. then returns the result of __domain_error.
  151. If x is in the range
  152. __form5,
  153. then the result of -__overflow_error is returned, with
  154. __form6
  155. denoting `std::numeric_limits<T>::epsilon()`.
  156. If x is in the range
  157. __form7,
  158. then the result of __overflow_error is returned, with
  159. __form6
  160. denoting
  161. `std::numeric_limits<T>::epsilon()`.
  162. The return type of this function is computed using the __arg_promotion_rules:
  163. the return type is `double` when T is an integer type, and T otherwise.
  164. [graph atanh]
  165. [h4 Accuracy]
  166. Generally accuracy is to within 1 or 2 __epsilon across all supported platforms.
  167. [h4 Testing]
  168. This function is tested using a combination of random test values designed to give
  169. full function coverage computed at high precision using the "naive" formula:
  170. [equation atanh1]
  171. along with a selection of sanity check values
  172. computed using functions.wolfram.com to at least 50 decimal digits.
  173. [h4 Implementation]
  174. For sufficiently small x we can use the
  175. [@http://functions.wolfram.com/ElementaryFunctions/ArcTanh/06/01/03/01/ approximation]:
  176. [equation atanh2]
  177. Otherwise the
  178. [@http://functions.wolfram.com/ElementaryFunctions/ArcTanh/02/ primary definition]:
  179. [equation atanh1]
  180. or its equivalent form:
  181. [equation atanh3]
  182. is used.
  183. [endsect] [/section:atanh atanh]
  184. [endsect] [/section:inv_hyper Inverse Hyperbolic Functions]