Average Error: 41.9 → 9.1
Time: 40.3s
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 -3.8166792423498327 \cdot 10^{+149}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{\frac{t}{\sqrt{2}}}{2} - \frac{t}{\sqrt{2}}\right) \cdot \frac{2}{x \cdot x} - \mathsf{fma}\left(t, \sqrt{2}, \frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right)}\\ \mathbf{elif}\;t \le 2.2206986511032415 \cdot 10^{+64}:\\ \;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(\frac{\ell}{x}, \ell \cdot 2, \left(t \cdot t\right) \cdot \left(2 + \frac{4}{x}\right)\right)}} \cdot \left(\sqrt{2} \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(t, \sqrt{2}, \frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right) - \left(\frac{\frac{t}{\sqrt{2}}}{2} - \frac{t}{\sqrt{2}}\right) \cdot \frac{2}{x \cdot x}}\\ \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 -3.8166792423498327 \cdot 10^{+149}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{\frac{t}{\sqrt{2}}}{2} - \frac{t}{\sqrt{2}}\right) \cdot \frac{2}{x \cdot x} - \mathsf{fma}\left(t, \sqrt{2}, \frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right)}\\

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

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

\end{array}
double f(double x, double l, double t) {
        double r1130696 = 2.0;
        double r1130697 = sqrt(r1130696);
        double r1130698 = t;
        double r1130699 = r1130697 * r1130698;
        double r1130700 = x;
        double r1130701 = 1.0;
        double r1130702 = r1130700 + r1130701;
        double r1130703 = r1130700 - r1130701;
        double r1130704 = r1130702 / r1130703;
        double r1130705 = l;
        double r1130706 = r1130705 * r1130705;
        double r1130707 = r1130698 * r1130698;
        double r1130708 = r1130696 * r1130707;
        double r1130709 = r1130706 + r1130708;
        double r1130710 = r1130704 * r1130709;
        double r1130711 = r1130710 - r1130706;
        double r1130712 = sqrt(r1130711);
        double r1130713 = r1130699 / r1130712;
        return r1130713;
}

double f(double x, double l, double t) {
        double r1130714 = t;
        double r1130715 = -3.8166792423498327e+149;
        bool r1130716 = r1130714 <= r1130715;
        double r1130717 = 2.0;
        double r1130718 = sqrt(r1130717);
        double r1130719 = r1130718 * r1130714;
        double r1130720 = r1130714 / r1130718;
        double r1130721 = r1130720 / r1130717;
        double r1130722 = r1130721 - r1130720;
        double r1130723 = x;
        double r1130724 = r1130723 * r1130723;
        double r1130725 = r1130717 / r1130724;
        double r1130726 = r1130722 * r1130725;
        double r1130727 = r1130717 / r1130723;
        double r1130728 = r1130720 * r1130727;
        double r1130729 = fma(r1130714, r1130718, r1130728);
        double r1130730 = r1130726 - r1130729;
        double r1130731 = r1130719 / r1130730;
        double r1130732 = 2.2206986511032415e+64;
        bool r1130733 = r1130714 <= r1130732;
        double r1130734 = 1.0;
        double r1130735 = l;
        double r1130736 = r1130735 / r1130723;
        double r1130737 = r1130735 * r1130717;
        double r1130738 = r1130714 * r1130714;
        double r1130739 = 4.0;
        double r1130740 = r1130739 / r1130723;
        double r1130741 = r1130717 + r1130740;
        double r1130742 = r1130738 * r1130741;
        double r1130743 = fma(r1130736, r1130737, r1130742);
        double r1130744 = sqrt(r1130743);
        double r1130745 = r1130734 / r1130744;
        double r1130746 = r1130745 * r1130719;
        double r1130747 = r1130729 - r1130726;
        double r1130748 = r1130719 / r1130747;
        double r1130749 = r1130733 ? r1130746 : r1130748;
        double r1130750 = r1130716 ? r1130731 : r1130749;
        return r1130750;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -3.8166792423498327e+149

    1. Initial program 61.3

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

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

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

    if -3.8166792423498327e+149 < t < 2.2206986511032415e+64

    1. Initial program 35.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 16.9

      \[\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. Simplified16.9

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{\ell \cdot \ell}{x}\right), \frac{4 \cdot t}{\frac{x}{t}}\right)}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity16.9

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

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

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\mathsf{fma}\left(\frac{\ell}{x}, 2 \cdot \ell, \left(t \cdot t\right) \cdot \left(2 + \frac{4}{x}\right)\right)}}}\]
    10. Using strategy rm
    11. Applied div-inv12.9

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

    if 2.2206986511032415e+64 < t

    1. Initial program 45.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 3.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. Simplified3.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -3.8166792423498327 \cdot 10^{+149}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{\frac{t}{\sqrt{2}}}{2} - \frac{t}{\sqrt{2}}\right) \cdot \frac{2}{x \cdot x} - \mathsf{fma}\left(t, \sqrt{2}, \frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right)}\\ \mathbf{elif}\;t \le 2.2206986511032415 \cdot 10^{+64}:\\ \;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(\frac{\ell}{x}, \ell \cdot 2, \left(t \cdot t\right) \cdot \left(2 + \frac{4}{x}\right)\right)}} \cdot \left(\sqrt{2} \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(t, \sqrt{2}, \frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right) - \left(\frac{\frac{t}{\sqrt{2}}}{2} - \frac{t}{\sqrt{2}}\right) \cdot \frac{2}{x \cdot x}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019143 +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)))))