Average Error: 42.4 → 9.2
Time: 35.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 -1.9501808158464715 \cdot 10^{+103}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}} - \mathsf{fma}\left(\sqrt{2}, t, \frac{\frac{\frac{2 \cdot t}{\sqrt{2}}}{x}}{x}\right)\right) - \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}}\\ \mathbf{elif}\;t \le 3.622605389449186 \cdot 10^{-213}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\frac{\ell}{\frac{x}{\ell}}, 2, \left(2 + \frac{4}{x}\right) \cdot \left(t \cdot t\right)\right)}}\\ \mathbf{elif}\;t \le 5.72877141657189 \cdot 10^{-164}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}, 2, \mathsf{fma}\left(t, \sqrt{2}, \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}\right) - \frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}\right)}\\ \mathbf{elif}\;t \le 3.7543841451851774 \cdot 10^{+122}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\frac{\ell}{\frac{x}{\ell}}, 2, \left(2 + \frac{4}{x}\right) \cdot \left(t \cdot t\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}, 2, \mathsf{fma}\left(t, \sqrt{2}, \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}\right) - \frac{t}{\left(x \cdot x\right) \cdot \sqrt{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 -1.9501808158464715 \cdot 10^{+103}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}} - \mathsf{fma}\left(\sqrt{2}, t, \frac{\frac{\frac{2 \cdot t}{\sqrt{2}}}{x}}{x}\right)\right) - \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}}\\

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

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

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

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

\end{array}
double f(double x, double l, double t) {
        double r973946 = 2.0;
        double r973947 = sqrt(r973946);
        double r973948 = t;
        double r973949 = r973947 * r973948;
        double r973950 = x;
        double r973951 = 1.0;
        double r973952 = r973950 + r973951;
        double r973953 = r973950 - r973951;
        double r973954 = r973952 / r973953;
        double r973955 = l;
        double r973956 = r973955 * r973955;
        double r973957 = r973948 * r973948;
        double r973958 = r973946 * r973957;
        double r973959 = r973956 + r973958;
        double r973960 = r973954 * r973959;
        double r973961 = r973960 - r973956;
        double r973962 = sqrt(r973961);
        double r973963 = r973949 / r973962;
        return r973963;
}

double f(double x, double l, double t) {
        double r973964 = t;
        double r973965 = -1.9501808158464715e+103;
        bool r973966 = r973964 <= r973965;
        double r973967 = 2.0;
        double r973968 = sqrt(r973967);
        double r973969 = r973968 * r973964;
        double r973970 = x;
        double r973971 = r973970 * r973970;
        double r973972 = r973971 * r973968;
        double r973973 = r973964 / r973972;
        double r973974 = r973967 * r973964;
        double r973975 = r973974 / r973968;
        double r973976 = r973975 / r973970;
        double r973977 = r973976 / r973970;
        double r973978 = fma(r973968, r973964, r973977);
        double r973979 = r973973 - r973978;
        double r973980 = r973979 - r973976;
        double r973981 = r973969 / r973980;
        double r973982 = 3.622605389449186e-213;
        bool r973983 = r973964 <= r973982;
        double r973984 = sqrt(r973968);
        double r973985 = r973964 * r973984;
        double r973986 = r973984 * r973985;
        double r973987 = l;
        double r973988 = r973970 / r973987;
        double r973989 = r973987 / r973988;
        double r973990 = 4.0;
        double r973991 = r973990 / r973970;
        double r973992 = r973967 + r973991;
        double r973993 = r973964 * r973964;
        double r973994 = r973992 * r973993;
        double r973995 = fma(r973989, r973967, r973994);
        double r973996 = sqrt(r973995);
        double r973997 = r973986 / r973996;
        double r973998 = 5.72877141657189e-164;
        bool r973999 = r973964 <= r973998;
        double r974000 = fma(r973964, r973968, r973976);
        double r974001 = r974000 - r973973;
        double r974002 = fma(r973973, r973967, r974001);
        double r974003 = r973969 / r974002;
        double r974004 = 3.7543841451851774e+122;
        bool r974005 = r973964 <= r974004;
        double r974006 = r974005 ? r973997 : r974003;
        double r974007 = r973999 ? r974003 : r974006;
        double r974008 = r973983 ? r973997 : r974007;
        double r974009 = r973966 ? r973981 : r974008;
        return r974009;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -1.9501808158464715e+103

    1. Initial program 52.4

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

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

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

    if -1.9501808158464715e+103 < t < 3.622605389449186e-213 or 5.72877141657189e-164 < t < 3.7543841451851774e+122

    1. Initial program 34.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 16.4

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

      \[\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}{\frac{x}{t \cdot t}}\right)}}}\]
    4. Taylor expanded around inf 16.4

      \[\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)}}}\]
    5. Simplified12.0

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

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

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

    if 3.622605389449186e-213 < t < 5.72877141657189e-164 or 3.7543841451851774e+122 < t

    1. Initial program 54.4

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.9501808158464715 \cdot 10^{+103}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}} - \mathsf{fma}\left(\sqrt{2}, t, \frac{\frac{\frac{2 \cdot t}{\sqrt{2}}}{x}}{x}\right)\right) - \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}}\\ \mathbf{elif}\;t \le 3.622605389449186 \cdot 10^{-213}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\frac{\ell}{\frac{x}{\ell}}, 2, \left(2 + \frac{4}{x}\right) \cdot \left(t \cdot t\right)\right)}}\\ \mathbf{elif}\;t \le 5.72877141657189 \cdot 10^{-164}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}, 2, \mathsf{fma}\left(t, \sqrt{2}, \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}\right) - \frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}\right)}\\ \mathbf{elif}\;t \le 3.7543841451851774 \cdot 10^{+122}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(t \cdot \sqrt{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\frac{\ell}{\frac{x}{\ell}}, 2, \left(2 + \frac{4}{x}\right) \cdot \left(t \cdot t\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}, 2, \mathsf{fma}\left(t, \sqrt{2}, \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}\right) - \frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}\right)}\\ \end{array}\]

Reproduce

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