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

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

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

\end{array}
double f(double x, double l, double t) {
        double r1085963 = 2.0;
        double r1085964 = sqrt(r1085963);
        double r1085965 = t;
        double r1085966 = r1085964 * r1085965;
        double r1085967 = x;
        double r1085968 = 1.0;
        double r1085969 = r1085967 + r1085968;
        double r1085970 = r1085967 - r1085968;
        double r1085971 = r1085969 / r1085970;
        double r1085972 = l;
        double r1085973 = r1085972 * r1085972;
        double r1085974 = r1085965 * r1085965;
        double r1085975 = r1085963 * r1085974;
        double r1085976 = r1085973 + r1085975;
        double r1085977 = r1085971 * r1085976;
        double r1085978 = r1085977 - r1085973;
        double r1085979 = sqrt(r1085978);
        double r1085980 = r1085966 / r1085979;
        return r1085980;
}

double f(double x, double l, double t) {
        double r1085981 = t;
        double r1085982 = -6.172764092322424e+59;
        bool r1085983 = r1085981 <= r1085982;
        double r1085984 = 2.0;
        double r1085985 = sqrt(r1085984);
        double r1085986 = r1085985 * r1085981;
        double r1085987 = x;
        double r1085988 = r1085987 * r1085987;
        double r1085989 = r1085984 / r1085988;
        double r1085990 = r1085984 * r1085985;
        double r1085991 = r1085981 / r1085990;
        double r1085992 = r1085981 / r1085985;
        double r1085993 = r1085992 / r1085987;
        double r1085994 = fma(r1085993, r1085984, r1085986);
        double r1085995 = fma(r1085989, r1085992, r1085994);
        double r1085996 = -r1085995;
        double r1085997 = fma(r1085989, r1085991, r1085996);
        double r1085998 = r1085986 / r1085997;
        double r1085999 = 1.6237106520617296e+60;
        bool r1086000 = r1085981 <= r1085999;
        double r1086001 = r1085987 / r1085981;
        double r1086002 = r1085981 / r1086001;
        double r1086003 = 4.0;
        double r1086004 = l;
        double r1086005 = r1085987 / r1086004;
        double r1086006 = r1086004 / r1086005;
        double r1086007 = fma(r1085981, r1085981, r1086006);
        double r1086008 = sqrt(r1086007);
        double r1086009 = r1086008 * r1086008;
        double r1086010 = r1085984 * r1086009;
        double r1086011 = fma(r1086002, r1086003, r1086010);
        double r1086012 = sqrt(r1086011);
        double r1086013 = r1085986 / r1086012;
        double r1086014 = r1085984 * r1085981;
        double r1086015 = r1086014 / r1085990;
        double r1086016 = r1086015 / r1085988;
        double r1086017 = r1085995 - r1086016;
        double r1086018 = r1085986 / r1086017;
        double r1086019 = r1086000 ? r1086013 : r1086018;
        double r1086020 = r1085983 ? r1085998 : r1086019;
        return r1086020;
}

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.5

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{\mathsf{fma}\left(\frac{2}{x \cdot x}, \frac{t}{\sqrt{2} \cdot 2}, -\mathsf{fma}\left(\frac{2}{x \cdot x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(\frac{\frac{t}{\sqrt{2}}}{x}, 2, t \cdot \sqrt{2}\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. Simplified14.5

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{t}{\frac{x}{t}}, 4, 2 \cdot \color{blue}{\left(\sqrt{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)} \cdot \sqrt{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)}\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 \cdot x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(\frac{\frac{t}{\sqrt{2}}}{x}, 2, t \cdot \sqrt{2}\right)\right) - \frac{\frac{2 \cdot t}{\sqrt{2} \cdot 2}}{x \cdot x}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification9.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -6.172764092322424109949396121339735582564 \cdot 10^{59}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x \cdot x}, \frac{t}{2 \cdot \sqrt{2}}, -\mathsf{fma}\left(\frac{2}{x \cdot x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(\frac{\frac{t}{\sqrt{2}}}{x}, 2, \sqrt{2} \cdot t\right)\right)\right)}\\ \mathbf{elif}\;t \le 1.623710652061729557401163312786003220273 \cdot 10^{60}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{t}{\frac{x}{t}}, 4, 2 \cdot \left(\sqrt{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)} \cdot \sqrt{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x \cdot x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(\frac{\frac{t}{\sqrt{2}}}{x}, 2, \sqrt{2} \cdot t\right)\right) - \frac{\frac{2 \cdot t}{2 \cdot \sqrt{2}}}{x \cdot x}}\\ \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)))))