Average Error: 42.8 → 9.3
Time: 52.5s
Precision: 64
\[\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 -6.009472995498685461722593118137696682668 \cdot 10^{123}:\\ \;\;\;\;\frac{\sqrt{2}}{-\mathsf{fma}\left(\frac{2}{\sqrt{2}}, \frac{t}{x}, \sqrt{2} \cdot t\right)} \cdot t\\ \mathbf{elif}\;t \le 1.970000535892972371169366993383041147751 \cdot 10^{94}:\\ \;\;\;\;\frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right), \frac{4}{x} \cdot \left(t \cdot t\right)\right)}} \cdot t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(t, \sqrt{2}, \frac{2 \cdot t}{x \cdot \sqrt{2}}\right)}\\ \end{array}\]
\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 -6.009472995498685461722593118137696682668 \cdot 10^{123}:\\
\;\;\;\;\frac{\sqrt{2}}{-\mathsf{fma}\left(\frac{2}{\sqrt{2}}, \frac{t}{x}, \sqrt{2} \cdot t\right)} \cdot t\\

\mathbf{elif}\;t \le 1.970000535892972371169366993383041147751 \cdot 10^{94}:\\
\;\;\;\;\frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right), \frac{4}{x} \cdot \left(t \cdot t\right)\right)}} \cdot t\\

\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(t, \sqrt{2}, \frac{2 \cdot t}{x \cdot \sqrt{2}}\right)}\\

\end{array}
double f(double x, double l, double t) {
        double r1537770 = 2.0;
        double r1537771 = sqrt(r1537770);
        double r1537772 = t;
        double r1537773 = r1537771 * r1537772;
        double r1537774 = x;
        double r1537775 = 1.0;
        double r1537776 = r1537774 + r1537775;
        double r1537777 = r1537774 - r1537775;
        double r1537778 = r1537776 / r1537777;
        double r1537779 = l;
        double r1537780 = r1537779 * r1537779;
        double r1537781 = r1537772 * r1537772;
        double r1537782 = r1537770 * r1537781;
        double r1537783 = r1537780 + r1537782;
        double r1537784 = r1537778 * r1537783;
        double r1537785 = r1537784 - r1537780;
        double r1537786 = sqrt(r1537785);
        double r1537787 = r1537773 / r1537786;
        return r1537787;
}

double f(double x, double l, double t) {
        double r1537788 = t;
        double r1537789 = -6.009472995498685e+123;
        bool r1537790 = r1537788 <= r1537789;
        double r1537791 = 2.0;
        double r1537792 = sqrt(r1537791);
        double r1537793 = r1537791 / r1537792;
        double r1537794 = x;
        double r1537795 = r1537788 / r1537794;
        double r1537796 = r1537792 * r1537788;
        double r1537797 = fma(r1537793, r1537795, r1537796);
        double r1537798 = -r1537797;
        double r1537799 = r1537792 / r1537798;
        double r1537800 = r1537799 * r1537788;
        double r1537801 = 1.9700005358929724e+94;
        bool r1537802 = r1537788 <= r1537801;
        double r1537803 = l;
        double r1537804 = r1537794 / r1537803;
        double r1537805 = r1537803 / r1537804;
        double r1537806 = fma(r1537788, r1537788, r1537805);
        double r1537807 = 4.0;
        double r1537808 = r1537807 / r1537794;
        double r1537809 = r1537788 * r1537788;
        double r1537810 = r1537808 * r1537809;
        double r1537811 = fma(r1537791, r1537806, r1537810);
        double r1537812 = sqrt(r1537811);
        double r1537813 = r1537792 / r1537812;
        double r1537814 = r1537813 * r1537788;
        double r1537815 = r1537791 * r1537788;
        double r1537816 = r1537794 * r1537792;
        double r1537817 = r1537815 / r1537816;
        double r1537818 = fma(r1537788, r1537792, r1537817);
        double r1537819 = r1537792 / r1537818;
        double r1537820 = r1537788 * r1537819;
        double r1537821 = r1537802 ? r1537814 : r1537820;
        double r1537822 = r1537790 ? r1537800 : r1537821;
        return r1537822;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -6.009472995498685e+123

    1. Initial program 54.8

      \[\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. Simplified54.7

      \[\leadsto \color{blue}{t \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(t \cdot t, 2, \ell \cdot \ell\right) \cdot \frac{1 + x}{x - 1} - \ell \cdot \ell}}}\]
    3. Taylor expanded around -inf 3.2

      \[\leadsto t \cdot \frac{\sqrt{2}}{\color{blue}{-\left(t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right)}}\]
    4. Simplified3.2

      \[\leadsto t \cdot \frac{\sqrt{2}}{\color{blue}{-\mathsf{fma}\left(\frac{2}{\sqrt{2}}, \frac{t}{x}, t \cdot \sqrt{2}\right)}}\]

    if -6.009472995498685e+123 < t < 1.9700005358929724e+94

    1. Initial program 37.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. Simplified37.3

      \[\leadsto \color{blue}{t \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(t \cdot t, 2, \ell \cdot \ell\right) \cdot \frac{1 + x}{x - 1} - \ell \cdot \ell}}}\]
    3. Taylor expanded around inf 17.3

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

      \[\leadsto t \cdot \frac{\sqrt{2}}{\sqrt{\color{blue}{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right), \frac{4}{x} \cdot \left(t \cdot t\right)\right)}}}\]

    if 1.9700005358929724e+94 < t

    1. Initial program 48.8

      \[\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. Simplified48.8

      \[\leadsto \color{blue}{t \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(t \cdot t, 2, \ell \cdot \ell\right) \cdot \frac{1 + x}{x - 1} - \ell \cdot \ell}}}\]
    3. Taylor expanded around inf 48.3

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

      \[\leadsto t \cdot \frac{\sqrt{2}}{\sqrt{\color{blue}{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right), \frac{4}{x} \cdot \left(t \cdot t\right)\right)}}}\]
    5. Taylor expanded around inf 3.5

      \[\leadsto t \cdot \frac{\sqrt{2}}{\color{blue}{t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}}}\]
    6. Simplified3.5

      \[\leadsto t \cdot \frac{\sqrt{2}}{\color{blue}{\mathsf{fma}\left(t, \sqrt{2}, \frac{t \cdot 2}{\sqrt{2} \cdot x}\right)}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification9.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -6.009472995498685461722593118137696682668 \cdot 10^{123}:\\ \;\;\;\;\frac{\sqrt{2}}{-\mathsf{fma}\left(\frac{2}{\sqrt{2}}, \frac{t}{x}, \sqrt{2} \cdot t\right)} \cdot t\\ \mathbf{elif}\;t \le 1.970000535892972371169366993383041147751 \cdot 10^{94}:\\ \;\;\;\;\frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right), \frac{4}{x} \cdot \left(t \cdot t\right)\right)}} \cdot t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(t, \sqrt{2}, \frac{2 \cdot t}{x \cdot \sqrt{2}}\right)}\\ \end{array}\]

Reproduce

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