diff --git a/books/bookvol10.pamphlet b/books/bookvol10.pamphlet index 02f5902..14e5bd0 100644 --- a/books/bookvol10.pamphlet +++ b/books/bookvol10.pamphlet @@ -241,7 +241,222 @@ November 10, 2003 ((iHy)) \pagenumbering{arabic} \setcounter{chapter}{0} % Chapter 1 \chapter{Implementation} + +\section{Elementary Functions\cite{4}} +\subsection{Rationale for Branch Cuts and Identities} + +Perhaps one of the most vexing problems to be addressed when +attempting to determine a set of mathematical function definitions is +the choice of the principal branches of the inverses of the +exponential, trigonometric and hyperbolic functions, and, further, the +mathematical form that these functions take on their domains (the +complex plane slit by the corresponding branch cuts). The fundamental +issue facing the mathematical library developer is the plethora of +possibilities, and while some choices are demonstrably inferior, there +is rarely a choice which is clearly best. + +Following Kahan [1], we will refer to the mathematical formula we use +to define the principal branch of each such function as its principal +expression. For the inverse trigonometric and inverse hyperbolic +functions, this principal expression is given in terms of the +functions $\ln{}z$ and $\sqrt{z}$. + +The choices set out in this Standard are derived from the following +principles: +\begin{enumerate} +\item Branch cuts must lie completely within either the real or imaginary axis. +\item The principal expression must not have any singularities at finite +points which the original function does not share. +\item Branch cuts end at branch points. +\item Where not otherwise determined, the value of a function on its branch +cut or cuts is obtained by taking a limit along a path which approaches the +branch cut in a counterclockwise manner around one of the branch points +which terminate the cut (“counterclockwise continuity”, or CCC for short). +\item Each inverse trigonometric or hyperbolic function must be real-valued +on the range of the corresponding trigonometric or hyperbolic function when +restricted to the real axis. +\end{enumerate} + +Further explanation of these principles can be found in [1]. + +While standard identities such as $\ln \frac{1}{x} = -\ln x$ hold for +$x > 0$, they generally fail to hold for complex +arguments of principal branches, even complex arguments which do not +lie on a branch cut. Consequently, a definition of, say, +\[\arctan z =\frac{i}{2}(\ln(1-iz)-\ln(1+iz))\] +is not the same as the apparently equivalent +\[i\ln\left(\sqrt\frac{1-iz}{1+iz}\right)\]. +It can be challenging to decide if two candidate expressions for +representing an inverse trigonometric or hyperbolic function which agree +in the mathematical domain are the same in the restricted computational realm +of principal expressions. + +If the underlying computational mathematical system supports a signed +zero, as prescribed by the IEEE/754 Standard [2], then a larger set of +identities will hold. For example, +\[\ln \frac{1}{z} = -\ln z\] +holds for all complex $z$ in such a system, as do +conjugate symmetry relations for functions such as +$\arcsin z$. However, identities such as $\ln zw = \ln z + \ln w$ +still fail to hold for some complex $z$ and $w$. + +A useful function for representing identities involving complex +functions which are related to the logarithm function is the complex +signum function, defined as: +\[ +{\rm csgn}(z) = +\left\{ +\begin{array}{cc} +1, & \mbox{if }\Re z > 0 \mbox{ or }\Re z = 0\mbox{ and }\Im z > 0 \\ +-1, & \mbox{if }\Re z < 0 \mbox{ or }\Re z = 0\mbox{ and }\Im z < 0 \\ +\end{array} +\right. +\] + +The value of ${\rm csgn}(0)$ is unspecified. Note, for example, that +$\sqrt{z^2} = z {\rm csgn}(z)$. + +Using the principal expressions for each of the 12 inverse +trigonometric and hyperbolic functions as given in this Standard, we +have the following relations and identities: + +\subsection{Inverse trigonometric functions} +\begin{tabular}{|c|l|} +\hline +$\arcsin(z)$ & +$\begin{array}{l} +\\ += -\arcsin(-z) \\ += \displaystyle\frac{\pi}{2} - \arccos(z) \\ += -i {\rm arcsinh}(iz) \\ +\\ +\end{array}$ \\ +\hline +$\arccos(z)$ & +$\begin{array}{l} +\\ += \pi - \arccos(-z) \\ += \displaystyle\frac{\pi}{2} - \arcsin(z) \\ += i {\rm csgn}(i(z-1)) {\rm arccosh}(z) \\ +\\ +\end{array}$\\ +\hline +$\arctan(z)$ & +$\begin{array}{l} +\\ += -\arctan(-z) \\ += \displaystyle\frac{\pi}{2} - {\rm arccot}(z) \\ += -i {\rm arctanh}(iz) \\ += -i \displaystyle\ln\left(\frac{1+iz}{\sqrt{z^2+1}}\right) \\ +\\ +\end{array}$ \\ +\hline +${\rm arccot}(z)$ & +$\begin{array}{l} +\\ += \pi - {\rm arccot}(-z) \\ += \displaystyle\frac{\pi}{2} - \arctan(z) \\ += i {\rm arccoth}(iz)+\displaystyle\frac{\pi}{2}(1-{\rm csgn}(z+i)) \\ += -i \displaystyle\ln\left(\frac{z+i}{\sqrt{z^2+1}}\right) \\ +\\ +\end{array}$\\ +\hline +${\rm arccsc}(z)$ & +$\begin{array}{l} +\\ += - {\rm arccsc}(-z) \\ += \displaystyle\arcsin(\frac{1}{z}) \\ += \displaystyle\frac{\pi}{2} - {\rm arcsec}(z) \\ += i\ {\rm arccsch}(iz) \\ +\\ +\end{array}$ \\ +\hline +${\rm arcsec}(z)$ & +$\begin{array}{l} +\\ += \pi - {\rm arcsec}(-z) \\ += \arccos(\displaystyle\frac{1}{z}) \\ += \displaystyle\frac{\pi}{2} - {\rm arccsc}(z) \\ += i \displaystyle{\rm csgn}(i(\frac{1}{z}-1)) {\rm arcsech}(z) \\ +\\ +\end{array}$\\ +\hline +\end{tabular} + +\subsection{Inverse hyperbolic functions} + +\begin{tabular}{|c|l|} +\hline +${\rm arcsin}h(z)$ & +$\begin{array}{l} +\\ += -{\rm arcsinh}(-z) \\ += \displaystyle\frac{\pi}{2}i - {\rm csgn}(i-z){\rm arccosh}(-iz) \\ += -i {\rm arcsin}(iz) \\ +\\ +\end{array}$ \\ +\hline +${\rm arccosh}(z)$ & +$\begin{array}{l} +\\ += i {\rm csgn}(i(1-z)){\rm arccos}(z) \\ += \displaystyle{\rm csgn}(i(1-z))(\frac{\pi}{2}i - {\rm arcsinh}(iz)) \\ +\\ +\end{array}$ \\ +\hline +${\rm arctanh}(z)$ & +$\begin{array}{l} +\\ += -{\rm arctanh}(-z) \\ += \displaystyle{\rm arccoth}(z) -\frac{\pi}{2}i {\rm csgn}(i(z-1)) \\ += -i {\rm arctan}(iz) \\ += -\displaystyle\ln\left(\frac{1-z}{\sqrt{1-z^2}}\right) \\ +\\ +\end{array}$\\ +\hline +${\rm arccoth}(z)$ & +$\begin{array}{l} +\\ += \displaystyle{\rm arctanh}(z)+\frac{\pi}{2}i {\rm csgn}(i(z-1)) \\ += i \displaystyle{\rm arccot}(iz)+\frac{\pi}{2}i ({\rm csgn}(i(z-1))-1) \\ += i \displaystyle{\rm arctan}(-iz)+\frac{\pi}{2}i {\rm csgn}(i(z-1)) \\ +\\ +\end{array}$ \\ +\hline +${\rm arccsch}(z) $ & +$\begin{array}{l} +\\ += -{\rm arccscn}(-z) \\ += \displaystyle{\rm arcsinn}(\frac{1}{z}) \\ += \displaystyle{\rm csgn}(i+\frac{1}{z}){\rm arcsech}(-iz)-\frac{\pi}{2}i \\ += i {\rm arccsc}(iz) \\ +\\ +\end{array}$ \\ +\hline +${\rm arcsech}(z)$ & +$\begin{array}{l} +\\ += \displaystyle{\rm arccosh}(\frac{1}{z}) \\ += i \displaystyle{\rm csgn}(i(1-\frac{1}{z})) {\rm arcsec}(z) \\ += \displaystyle{\rm csgn}(i(1-\frac{1}{z}))(\frac{\pi}{2}i+{\rm arccsch}(iz) \\ +\\ +\end{array}$ \\ +\hline +\end{tabular} + +\eject \begin{thebibliography}{99} +\bibitem{1} Kahan, W., “Branch cuts for complex elementary functions, or, +Much ado about nothing's sign bit”, Proceedings of the joint IMA/SIAM +conference on The State of the Art in Numerical Analysis, University of +Birmingham, A. Iserles and M.J.D. Powell, eds, Clarendon Press, +Oxford,1987, 165-210. +\bibitem{2} IEEE standard 754-1985 for binary floating-point arithmetic, +reprinted in ACM SIGPLAN Notices 22 \#2 (1987), 9-25. +\bibitem{3} IEEE standard 754-2008 +\bibitem{4} Numerical Mathematics Consortium +Technical Specification 1.0 (Draft) +\verb|http://www.nmconstorium.org| \end{thebibliography} \printindex \end{document} diff --git a/changelog b/changelog index cc1ce70..14860f1 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,5 @@ +20100316 tpd src/axiom-website/patches.html 2010316.01.tpd.patch +20100316 tpd books/bookvol10 add Elementary Functions branch cuts 20100311 tpd src/axiom-website/patches.html 2010311.02.tpd.patch 20100311 tpd src/input/unittest2.input add Nate Daly to credits 20100311 tpd readme add Nate Daly to credits diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index e59b4d0..e9afd56 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -2574,5 +2574,7 @@ src/input/unittest2.input fix broken tests
src/axiom-website/style.css rewrite per Nate Daly
20100311.02.tpd.patch books/bookvol5.pamphlet add Nate Daly to credits
+20100316.01.tpd.patch +books/bookvol10 add Elementary Functions branch cuts