Log-Arcsine Algorithm
|
11-05-2022, 01:27 AM
Post: #5
|
|||
|
|||
RE: Log-Arcsine Algorithm
With a minor change we can also calculate the inverse hyperbolic sine function.
We just have to start with: \( x \sqrt{1 + x^2} \) and \( x \) Example 2 SQRT 1 XEQ 00 0.88137358702 To find the recurrence relation we can define the following functions with somewhat suggestive names: \( \begin{align} s(z) &= \frac{z - \frac{1}{z}}{2} \\ \\ c(z) &= \frac{z + \frac{1}{z}}{2} \\ \end{align} \) It's easy to show (see below) that: \( \begin{align} 2 s(z) c(z) &= s(z^2) \\ \\ 2 c(z)^2 &= 1 + c(z^2) \\ \end{align} \) From the latter we conclude: \( \begin{align} c(z) = \sqrt{\frac{1 + c(z^2)}{2}} \end{align} \) Using the substitution \(z \to z^{\tfrac{1}{2}}\) we get: \( \begin{align} c(z^{\frac{1}{2}}) &= \sqrt{\frac{1 + c(z)}{2}} \\ \\ s(z) &= 2 \, s(z^{\frac{1}{2}}) \, c(z^{\frac{1}{2}}) \\ \\ &= 2 \, s(z^{\frac{1}{2}}) \, \sqrt{\frac{1 + c(z)}{2}} \\ \\ &= 2 \, s(z^{\frac{1}{2}}) \, \sqrt{\frac{s(z) + s(z)c(z)}{2s(z)}} \\ \\ &= 2 \, s(z^{\frac{1}{2}}) \, \sqrt{\frac{s(z) + \frac{1}{2}s(z^2)}{2s(z)}} \\ \end{align} \) Or then after rearranging it: \( \begin{align} 2 \, s(z^{\frac{1}{2}}) = s(z) \, \sqrt{\frac{2s(z)}{s(z) + \frac{1}{2}s(z^2)}} \end{align} \) With: \( \begin{align} \ell(h) = \frac{1}{2h}(x^h - x^{-h}) = \frac{s(x^h)}{h} \end{align} \) Or then with \(z = x^h = x^{2^{-n}}\) we have: \( \begin{align} \ell_n = \ell(2^{-n}) = 2^n s(x^{2^{-n}}) = 2^n s(z) = s_n \end{align} \) This leads to the recurrence relation: \( \begin{align} s_{n+1} &= \ell(2^{-n-1}) \\ &= 2^{n+1} s(x^{2^{-n-1}}) \\ &= 2^n \cdot 2 s(z^{\tfrac{1}{2}}) \\ \\ &= 2^n s(z) \sqrt{\frac{2s(z)}{s(z) + \tfrac{1}{2}s(z^2)}} \\ \\ &= 2^n s(z) \sqrt{\frac{2 \cdot 2^n s(z)}{2^n s(z) + \tfrac{1}{2} \cdot 2^n s(z^2)}} \\ \\ &= s_n \sqrt{\frac{2 s_n}{s_n + 2^{n-1} s(z^2)}} \\ \\ &= s_n \sqrt{\frac{2 s_n}{s_n + s_{n-1}}} \\ \end{align} \) We can plug in \(z = e^x\) or \(z = e^{ix}\) to get related formulas for \(\sinh(x)\) and \(\sin(x)\): \( \begin{align} 2 \sinh(\frac{1}{2} z) &= \sinh(z) \sqrt{\frac{2\sinh(z)}{\sinh(z) + \frac{1}{2}\sinh(2z)}} \\ \\ 2 \sin(\frac{1}{2} z) &= \sin(z) \sqrt{\frac{2\sin(z)}{\sin(z) + \frac{1}{2}\sin(2z)}} \\ \end{align} \) That's due to the fact that: \( \begin{align} s(e^x) = \frac{e^x - e^{-x}}{2} = \sinh(x) \\ \\ s(e^{ix}) = \frac{e^{ix} - e^{-ix}}{2} = \sin(x) \\ \end{align} \) \( \begin{align} 2 s(z) c(z) &= 2 \frac{z - \frac{1}{z}}{2} \frac{z + \frac{1}{z}}{2} \\ &= \frac{\left(z - \frac{1}{z} \right) \left(z + \frac{1}{z} \right)}{2} \\ &= \frac{z^2 - \frac{1}{z^2}}{2} \\ &= s(z^2) \\ \\ 2 c(z)^2 &= 2 \left( \frac{z + \frac{1}{z}}{2} \right)^2 \\ &= \frac{\left(z + \frac{1}{z} \right)^2}{2} \\ &= \frac{z^2 + 2 + \frac{1}{z^2}}{2} \\ &= 1 + \frac{z^2 + \frac{1}{z^2}}{2} \\ &= 1 + c(z^2) \\ \end{align} \) |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Log-Arcsine Algorithm - Thomas Klemm - 11-02-2022, 10:22 PM
RE: Log-Arcsine Algorithm - Nihotte(lma) - 11-03-2022, 06:32 PM
RE: Log-Arcsine Algorithm - Albert Chan - 11-04-2022, 03:29 PM
RE: Log-Arcsine Algorithm - Albert Chan - 11-04-2022, 04:58 PM
RE: Log-Arcsine Algorithm - Albert Chan - 11-05-2022, 10:47 AM
RE: Log-Arcsine Algorithm - Thomas Klemm - 11-05-2022 01:27 AM
RE: Log-Arcsine Algorithm - Albert Chan - 11-06-2022, 12:09 PM
RE: Log-Arcsine Algorithm - Thomas Klemm - 11-05-2022, 11:18 PM
RE: Log-Arcsine Algorithm - Thomas Klemm - 11-06-2022, 02:43 PM
|
User(s) browsing this thread: 1 Guest(s)