Average Error: 42.3 → 9.2
Time: 1.0m
Precision: 64
Internal Precision: 1344
\[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;t \le -3.117428368383153 \cdot 10^{+112}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{(\left(\frac{t}{x \cdot x}\right) \cdot \left(\frac{1}{\sqrt{2}} - \frac{2}{\sqrt{2}}\right) + \left((\left(\frac{2}{x}\right) \cdot \left(\frac{-t}{\sqrt{2}}\right) + \left(\left(-t\right) \cdot \sqrt{2}\right))_*\right))_*}\\ \mathbf{elif}\;t \le -6.590828423819892 \cdot 10^{-242}:\\ \;\;\;\;\frac{\left(t \cdot \sqrt{\sqrt{2}}\right) \cdot \sqrt{\sqrt{2}}}{\sqrt{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}\\ \mathbf{elif}\;t \le -1.5989301694764613 \cdot 10^{-300}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{(\left(\frac{t}{x \cdot x}\right) \cdot \left(\frac{1}{\sqrt{2}} - \frac{2}{\sqrt{2}}\right) + \left((\left(\frac{2}{x}\right) \cdot \left(\frac{-t}{\sqrt{2}}\right) + \left(\left(-t\right) \cdot \sqrt{2}\right))_*\right))_*}\\ \mathbf{elif}\;t \le 2.7483744020052034 \cdot 10^{-179}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}\\ \mathbf{elif}\;t \le 1.4508073958694626 \cdot 10^{-156} \lor \neg \left(t \le 7.641252240928424 \cdot 10^{+125}\right):\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{(\left(\frac{2}{\sqrt{2}}\right) \cdot \left(\frac{t}{x \cdot x} + \frac{t}{x}\right) + \left((\left(\frac{-1}{\sqrt{2}}\right) \cdot \left(\frac{t}{x \cdot x}\right) + \left(\sqrt{2} \cdot t\right))_*\right))_*}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{\sqrt{2}}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)\right)}{\sqrt{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}\\ \end{array}\]

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 5 regimes
  2. if t < -3.117428368383153e+112 or -6.590828423819892e-242 < t < -1.5989301694764613e-300

    1. Initial program 54.7

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\]
    2. Taylor expanded around -inf 9.1

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{2 \cdot \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}} - \left(2 \cdot \frac{t}{\sqrt{2} \cdot {x}^{2}} + \left(t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right)\right)}}\]
    3. Simplified9.1

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{(\left(\frac{t}{x \cdot x}\right) \cdot \left(\frac{1}{\sqrt{2}} - \frac{2}{\sqrt{2}}\right) + \left((\left(\frac{2}{x}\right) \cdot \left(\frac{-t}{\sqrt{2}}\right) + \left(\sqrt{2} \cdot \left(-t\right)\right))_*\right))_*}}\]

    if -3.117428368383153e+112 < t < -6.590828423819892e-242

    1. Initial program 32.9

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\]
    2. Taylor expanded around -inf 14.6

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot {t}^{2} + \left(2 \cdot \frac{{\ell}^{2}}{x} + 4 \cdot \frac{{t}^{2}}{x}\right)}}}\]
    3. Simplified10.1

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}}\]
    4. Using strategy rm
    5. Applied add-sqr-sqrt10.3

      \[\leadsto \frac{\color{blue}{\left(\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}\right)} \cdot t}{\sqrt{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}\]
    6. Applied associate-*l*10.2

      \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)}}{\sqrt{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}\]

    if -1.5989301694764613e-300 < t < 2.7483744020052034e-179

    1. Initial program 61.5

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\]
    2. Taylor expanded around -inf 30.7

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot {t}^{2} + \left(2 \cdot \frac{{\ell}^{2}}{x} + 4 \cdot \frac{{t}^{2}}{x}\right)}}}\]
    3. Simplified28.9

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}}\]

    if 2.7483744020052034e-179 < t < 1.4508073958694626e-156 or 7.641252240928424e+125 < t

    1. Initial program 55.0

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\]
    2. Taylor expanded around inf 4.7

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{\left(2 \cdot \frac{t}{\sqrt{2} \cdot {x}^{2}} + \left(t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right)\right) - 2 \cdot \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}}}\]
    3. Simplified4.7

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{(\left(\frac{2}{\sqrt{2}}\right) \cdot \left(\frac{t}{x} + \frac{t}{x \cdot x}\right) + \left((\left(\frac{-1}{\sqrt{2}}\right) \cdot \left(\frac{t}{x \cdot x}\right) + \left(\sqrt{2} \cdot t\right))_*\right))_*}}\]

    if 1.4508073958694626e-156 < t < 7.641252240928424e+125

    1. Initial program 23.4

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\]
    2. Taylor expanded around -inf 9.7

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot {t}^{2} + \left(2 \cdot \frac{{\ell}^{2}}{x} + 4 \cdot \frac{{t}^{2}}{x}\right)}}}\]
    3. Simplified4.9

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}}\]
    4. Using strategy rm
    5. Applied add-sqr-sqrt5.0

      \[\leadsto \frac{\color{blue}{\left(\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}\right)} \cdot t}{\sqrt{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}\]
    6. Applied associate-*l*4.9

      \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)}}{\sqrt{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}\]
    7. Using strategy rm
    8. Applied add-sqr-sqrt4.9

      \[\leadsto \frac{\sqrt{\color{blue}{\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)}{\sqrt{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}\]
    9. Applied sqrt-prod4.9

      \[\leadsto \frac{\color{blue}{\left(\sqrt{\sqrt{\sqrt{2}}} \cdot \sqrt{\sqrt{\sqrt{2}}}\right)} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)}{\sqrt{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}\]
    10. Applied associate-*l*4.8

      \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)\right)}}{\sqrt{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}\]
  3. Recombined 5 regimes into one program.
  4. Final simplification9.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -3.117428368383153 \cdot 10^{+112}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{(\left(\frac{t}{x \cdot x}\right) \cdot \left(\frac{1}{\sqrt{2}} - \frac{2}{\sqrt{2}}\right) + \left((\left(\frac{2}{x}\right) \cdot \left(\frac{-t}{\sqrt{2}}\right) + \left(\left(-t\right) \cdot \sqrt{2}\right))_*\right))_*}\\ \mathbf{elif}\;t \le -6.590828423819892 \cdot 10^{-242}:\\ \;\;\;\;\frac{\left(t \cdot \sqrt{\sqrt{2}}\right) \cdot \sqrt{\sqrt{2}}}{\sqrt{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}\\ \mathbf{elif}\;t \le -1.5989301694764613 \cdot 10^{-300}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{(\left(\frac{t}{x \cdot x}\right) \cdot \left(\frac{1}{\sqrt{2}} - \frac{2}{\sqrt{2}}\right) + \left((\left(\frac{2}{x}\right) \cdot \left(\frac{-t}{\sqrt{2}}\right) + \left(\left(-t\right) \cdot \sqrt{2}\right))_*\right))_*}\\ \mathbf{elif}\;t \le 2.7483744020052034 \cdot 10^{-179}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}\\ \mathbf{elif}\;t \le 1.4508073958694626 \cdot 10^{-156} \lor \neg \left(t \le 7.641252240928424 \cdot 10^{+125}\right):\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{(\left(\frac{2}{\sqrt{2}}\right) \cdot \left(\frac{t}{x \cdot x} + \frac{t}{x}\right) + \left((\left(\frac{-1}{\sqrt{2}}\right) \cdot \left(\frac{t}{x \cdot x}\right) + \left(\sqrt{2} \cdot t\right))_*\right))_*}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\sqrt{\sqrt{2}}} \cdot \left(\sqrt{\sqrt{\sqrt{2}}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)\right)}{\sqrt{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}\\ \end{array}\]

Runtime

Time bar (total: 1.0m)Debug logProfile

herbie shell --seed 2018234 +o rules:numerics
(FPCore (x l t)
  :name "Toniolo and Linder, Equation (7)"
  (/ (* (sqrt 2) t) (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l)))))