Average Error: 42.9 → 8.7
Time: 9.0s
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{\sqrt{1} \cdot \left(\sqrt{2} \cdot t\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{\ell}{\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{\sqrt{1} \cdot \left(\sqrt{2} \cdot t\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{\ell}{\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{\sqrt{1} \cdot \left(\sqrt{2} \cdot t\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{\ell}{\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{\sqrt{1} \cdot \left(\sqrt{2} \cdot t\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{\ell}{\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 r37703 = 2.0;
        double r37704 = sqrt(r37703);
        double r37705 = t;
        double r37706 = r37704 * r37705;
        double r37707 = x;
        double r37708 = 1.0;
        double r37709 = r37707 + r37708;
        double r37710 = r37707 - r37708;
        double r37711 = r37709 / r37710;
        double r37712 = l;
        double r37713 = r37712 * r37712;
        double r37714 = r37705 * r37705;
        double r37715 = r37703 * r37714;
        double r37716 = r37713 + r37715;
        double r37717 = r37711 * r37716;
        double r37718 = r37717 - r37713;
        double r37719 = sqrt(r37718);
        double r37720 = r37706 / r37719;
        return r37720;
}

double f(double x, double l, double t) {
        double r37721 = t;
        double r37722 = -8.703772595808916e+141;
        bool r37723 = r37721 <= r37722;
        double r37724 = 2.0;
        double r37725 = sqrt(r37724);
        double r37726 = r37725 * r37721;
        double r37727 = 3.0;
        double r37728 = pow(r37725, r37727);
        double r37729 = x;
        double r37730 = 2.0;
        double r37731 = pow(r37729, r37730);
        double r37732 = r37728 * r37731;
        double r37733 = r37721 / r37732;
        double r37734 = r37725 * r37731;
        double r37735 = r37721 / r37734;
        double r37736 = r37725 * r37729;
        double r37737 = r37721 / r37736;
        double r37738 = r37721 * r37725;
        double r37739 = fma(r37724, r37737, r37738);
        double r37740 = fma(r37724, r37735, r37739);
        double r37741 = -r37740;
        double r37742 = fma(r37724, r37733, r37741);
        double r37743 = r37726 / r37742;
        double r37744 = 2.5556856337554223e-264;
        bool r37745 = r37721 <= r37744;
        double r37746 = 1.0;
        double r37747 = sqrt(r37746);
        double r37748 = r37747 * r37726;
        double r37749 = pow(r37721, r37730);
        double r37750 = l;
        double r37751 = r37729 / r37750;
        double r37752 = r37750 / r37751;
        double r37753 = 4.0;
        double r37754 = r37749 / r37729;
        double r37755 = r37753 * r37754;
        double r37756 = fma(r37724, r37752, r37755);
        double r37757 = fma(r37724, r37749, r37756);
        double r37758 = sqrt(r37757);
        double r37759 = r37748 / r37758;
        double r37760 = 5.748160003020186e-158;
        bool r37761 = r37721 <= r37760;
        double r37762 = r37724 * r37733;
        double r37763 = r37739 - r37762;
        double r37764 = fma(r37724, r37735, r37763);
        double r37765 = r37726 / r37764;
        double r37766 = 4.8376731442761786e+123;
        bool r37767 = r37721 <= r37766;
        double r37768 = r37767 ? r37759 : r37765;
        double r37769 = r37761 ? r37765 : r37768;
        double r37770 = r37745 ? r37759 : r37769;
        double r37771 = r37723 ? r37743 : r37770;
        return r37771;
}

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 unpow214.2

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{\color{blue}{\ell \cdot \ell}}{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}{\frac{x}{\ell}}}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\]
    7. Using strategy rm
    8. Applied *-un-lft-identity9.6

      \[\leadsto \frac{\sqrt{\color{blue}{1 \cdot 2}} \cdot t}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{\ell}{\frac{x}{\ell}}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\]
    9. Applied sqrt-prod9.6

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

      \[\leadsto \frac{\color{blue}{\sqrt{1} \cdot \left(\sqrt{2} \cdot t\right)}}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{\ell}{\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{\sqrt{1} \cdot \left(\sqrt{2} \cdot t\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{\ell}{\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{\sqrt{1} \cdot \left(\sqrt{2} \cdot t\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{\ell}{\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)))))