Average Error: 42.9 → 8.7
Time: 8.9s
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 -8.703772595808916454667436984685994375446 \cdot 10^{141}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}, -\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)\right)\right)}\\ \mathbf{elif}\;t \le 2.555685633755422263184735039093424552333 \cdot 10^{-264}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{{\ell}^{1}}{\frac{x}{\ell}}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\\ \mathbf{elif}\;t \le 5.748160003020186103470224388296769238726 \cdot 10^{-158}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right) - 2 \cdot \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}\right)}\\ \mathbf{elif}\;t \le 4.837673144276178631404051943017687346215 \cdot 10^{123}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{{\ell}^{1}}{\frac{x}{\ell}}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right) - 2 \cdot \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{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 -8.703772595808916454667436984685994375446 \cdot 10^{141}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}, -\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)\right)\right)}\\

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

\mathbf{elif}\;t \le 5.748160003020186103470224388296769238726 \cdot 10^{-158}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right) - 2 \cdot \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}\right)}\\

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

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

\end{array}
double f(double x, double l, double t) {
        double r37746 = 2.0;
        double r37747 = sqrt(r37746);
        double r37748 = t;
        double r37749 = r37747 * r37748;
        double r37750 = x;
        double r37751 = 1.0;
        double r37752 = r37750 + r37751;
        double r37753 = r37750 - r37751;
        double r37754 = r37752 / r37753;
        double r37755 = l;
        double r37756 = r37755 * r37755;
        double r37757 = r37748 * r37748;
        double r37758 = r37746 * r37757;
        double r37759 = r37756 + r37758;
        double r37760 = r37754 * r37759;
        double r37761 = r37760 - r37756;
        double r37762 = sqrt(r37761);
        double r37763 = r37749 / r37762;
        return r37763;
}

double f(double x, double l, double t) {
        double r37764 = t;
        double r37765 = -8.703772595808916e+141;
        bool r37766 = r37764 <= r37765;
        double r37767 = 2.0;
        double r37768 = sqrt(r37767);
        double r37769 = r37768 * r37764;
        double r37770 = 3.0;
        double r37771 = pow(r37768, r37770);
        double r37772 = x;
        double r37773 = 2.0;
        double r37774 = pow(r37772, r37773);
        double r37775 = r37771 * r37774;
        double r37776 = r37764 / r37775;
        double r37777 = r37768 * r37774;
        double r37778 = r37764 / r37777;
        double r37779 = r37768 * r37772;
        double r37780 = r37764 / r37779;
        double r37781 = r37764 * r37768;
        double r37782 = fma(r37767, r37780, r37781);
        double r37783 = fma(r37767, r37778, r37782);
        double r37784 = -r37783;
        double r37785 = fma(r37767, r37776, r37784);
        double r37786 = r37769 / r37785;
        double r37787 = 2.5556856337554223e-264;
        bool r37788 = r37764 <= r37787;
        double r37789 = pow(r37764, r37773);
        double r37790 = l;
        double r37791 = 1.0;
        double r37792 = pow(r37790, r37791);
        double r37793 = r37772 / r37790;
        double r37794 = r37792 / r37793;
        double r37795 = 4.0;
        double r37796 = r37789 / r37772;
        double r37797 = r37795 * r37796;
        double r37798 = fma(r37767, r37794, r37797);
        double r37799 = fma(r37767, r37789, r37798);
        double r37800 = sqrt(r37799);
        double r37801 = r37781 / r37800;
        double r37802 = 5.748160003020186e-158;
        bool r37803 = r37764 <= r37802;
        double r37804 = r37767 * r37776;
        double r37805 = r37782 - r37804;
        double r37806 = fma(r37767, r37778, r37805);
        double r37807 = r37769 / r37806;
        double r37808 = 4.8376731442761786e+123;
        bool r37809 = r37764 <= r37808;
        double r37810 = r37809 ? r37801 : r37807;
        double r37811 = r37803 ? r37807 : r37810;
        double r37812 = r37788 ? r37801 : r37811;
        double r37813 = r37766 ? r37786 : r37812;
        return r37813;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -8.703772595808916e+141

    1. Initial program 58.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 2.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(2 \cdot \frac{t}{\sqrt{2} \cdot x} + t \cdot \sqrt{2}\right)\right)}}\]
    3. Simplified2.1

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

    if -8.703772595808916e+141 < t < 2.5556856337554223e-264 or 5.748160003020186e-158 < t < 4.8376731442761786e+123

    1. Initial program 32.6

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

      \[\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. Simplified14.2

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{{\ell}^{2}}{x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}}\]
    4. Using strategy rm
    5. Applied sqr-pow14.2

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{\color{blue}{{\ell}^{\left(\frac{2}{2}\right)} \cdot {\ell}^{\left(\frac{2}{2}\right)}}}{x}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\]
    6. Applied associate-/l*9.6

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{{\ell}^{\left(\frac{2}{2}\right)}}{\color{blue}{\frac{x}{\ell}}}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\]
    8. Using strategy rm
    9. Applied *-commutative9.6

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

    if 2.5556856337554223e-264 < t < 5.748160003020186e-158 or 4.8376731442761786e+123 < t

    1. Initial program 57.1

      \[\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 10.8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -8.703772595808916454667436984685994375446 \cdot 10^{141}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}, -\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)\right)\right)}\\ \mathbf{elif}\;t \le 2.555685633755422263184735039093424552333 \cdot 10^{-264}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{{\ell}^{1}}{\frac{x}{\ell}}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\\ \mathbf{elif}\;t \le 5.748160003020186103470224388296769238726 \cdot 10^{-158}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right) - 2 \cdot \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}\right)}\\ \mathbf{elif}\;t \le 4.837673144276178631404051943017687346215 \cdot 10^{123}:\\ \;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{{\ell}^{1}}{\frac{x}{\ell}}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right) - 2 \cdot \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}\right)}\\ \end{array}\]

Reproduce

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