Average Error: 42.8 → 9.3
Time: 27.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 -6.172764092322424109949396121339735582564 \cdot 10^{59}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{2 \cdot \sqrt{2}}, \frac{t}{x \cdot x}, -\mathsf{fma}\left(\frac{2}{\sqrt{2}}, \frac{t}{x}, \mathsf{fma}\left(t, \sqrt{2}, \frac{t}{x \cdot x} \cdot \frac{2}{\sqrt{2}}\right)\right)\right)}\\ \mathbf{elif}\;t \le 1.623710652061729557401163312786003220273 \cdot 10^{60}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, 2 \cdot \left(\sqrt{t \cdot t + \ell \cdot \frac{\ell}{x}} \cdot \sqrt{t \cdot t + \ell \cdot \frac{\ell}{x}}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \sqrt{2} \cdot t + 2 \cdot \left(\frac{\frac{t}{\sqrt{2}}}{x \cdot x} - \frac{t}{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)}\right)\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.172764092322424109949396121339735582564 \cdot 10^{59}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{2 \cdot \sqrt{2}}, \frac{t}{x \cdot x}, -\mathsf{fma}\left(\frac{2}{\sqrt{2}}, \frac{t}{x}, \mathsf{fma}\left(t, \sqrt{2}, \frac{t}{x \cdot x} \cdot \frac{2}{\sqrt{2}}\right)\right)\right)}\\

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

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

\end{array}
double f(double x, double l, double t) {
        double r1210821 = 2.0;
        double r1210822 = sqrt(r1210821);
        double r1210823 = t;
        double r1210824 = r1210822 * r1210823;
        double r1210825 = x;
        double r1210826 = 1.0;
        double r1210827 = r1210825 + r1210826;
        double r1210828 = r1210825 - r1210826;
        double r1210829 = r1210827 / r1210828;
        double r1210830 = l;
        double r1210831 = r1210830 * r1210830;
        double r1210832 = r1210823 * r1210823;
        double r1210833 = r1210821 * r1210832;
        double r1210834 = r1210831 + r1210833;
        double r1210835 = r1210829 * r1210834;
        double r1210836 = r1210835 - r1210831;
        double r1210837 = sqrt(r1210836);
        double r1210838 = r1210824 / r1210837;
        return r1210838;
}

double f(double x, double l, double t) {
        double r1210839 = t;
        double r1210840 = -6.172764092322424e+59;
        bool r1210841 = r1210839 <= r1210840;
        double r1210842 = 2.0;
        double r1210843 = sqrt(r1210842);
        double r1210844 = r1210843 * r1210839;
        double r1210845 = r1210842 * r1210843;
        double r1210846 = r1210842 / r1210845;
        double r1210847 = x;
        double r1210848 = r1210847 * r1210847;
        double r1210849 = r1210839 / r1210848;
        double r1210850 = r1210842 / r1210843;
        double r1210851 = r1210839 / r1210847;
        double r1210852 = r1210849 * r1210850;
        double r1210853 = fma(r1210839, r1210843, r1210852);
        double r1210854 = fma(r1210850, r1210851, r1210853);
        double r1210855 = -r1210854;
        double r1210856 = fma(r1210846, r1210849, r1210855);
        double r1210857 = r1210844 / r1210856;
        double r1210858 = 1.6237106520617296e+60;
        bool r1210859 = r1210839 <= r1210858;
        double r1210860 = 4.0;
        double r1210861 = r1210839 * r1210839;
        double r1210862 = r1210861 / r1210847;
        double r1210863 = l;
        double r1210864 = r1210863 / r1210847;
        double r1210865 = r1210863 * r1210864;
        double r1210866 = r1210861 + r1210865;
        double r1210867 = sqrt(r1210866);
        double r1210868 = r1210867 * r1210867;
        double r1210869 = r1210842 * r1210868;
        double r1210870 = fma(r1210860, r1210862, r1210869);
        double r1210871 = sqrt(r1210870);
        double r1210872 = r1210844 / r1210871;
        double r1210873 = r1210842 / r1210847;
        double r1210874 = r1210839 / r1210843;
        double r1210875 = r1210874 / r1210848;
        double r1210876 = r1210848 * r1210845;
        double r1210877 = r1210839 / r1210876;
        double r1210878 = r1210875 - r1210877;
        double r1210879 = r1210842 * r1210878;
        double r1210880 = r1210844 + r1210879;
        double r1210881 = fma(r1210873, r1210874, r1210880);
        double r1210882 = r1210844 / r1210881;
        double r1210883 = r1210859 ? r1210872 : r1210882;
        double r1210884 = r1210841 ? r1210857 : r1210883;
        return r1210884;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -6.172764092322424e+59

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

      \[\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} + \left(\sqrt{2} \cdot t + 2 \cdot \frac{t}{\sqrt{2} \cdot {x}^{2}}\right)\right)}}\]
    3. Simplified3.6

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

    if -6.172764092322424e+59 < t < 1.6237106520617296e+60

    1. Initial program 40.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 17.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. Simplified17.9

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

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

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

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

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

    if 1.6237106520617296e+60 < t

    1. Initial program 45.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. Taylor expanded around inf 3.8

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

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

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

Reproduce

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