Average Error: 42.5 → 9.2
Time: 29.2s
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.046010354271018 \cdot 10^{+94}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{2}{\frac{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)}{t}} - \mathsf{fma}\left(2, \frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \frac{\frac{2 \cdot t}{x}}{\sqrt{2}}\right)\right)}\\ \mathbf{elif}\;t \le 1.4541398591892197 \cdot 10^{+121}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, t \cdot t, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, \frac{\ell \cdot \sqrt{2}}{x} \cdot \left(\ell \cdot \sqrt{2}\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{\sqrt{2}}, \frac{t}{x}, \sqrt{2} \cdot t - \frac{\frac{t}{x}}{x} \cdot \frac{1}{\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.046010354271018 \cdot 10^{+94}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{2}{\frac{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)}{t}} - \mathsf{fma}\left(2, \frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \frac{\frac{2 \cdot t}{x}}{\sqrt{2}}\right)\right)}\\

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

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

\end{array}
double f(double x, double l, double t) {
        double r722800 = 2.0;
        double r722801 = sqrt(r722800);
        double r722802 = t;
        double r722803 = r722801 * r722802;
        double r722804 = x;
        double r722805 = 1.0;
        double r722806 = r722804 + r722805;
        double r722807 = r722804 - r722805;
        double r722808 = r722806 / r722807;
        double r722809 = l;
        double r722810 = r722809 * r722809;
        double r722811 = r722802 * r722802;
        double r722812 = r722800 * r722811;
        double r722813 = r722810 + r722812;
        double r722814 = r722808 * r722813;
        double r722815 = r722814 - r722810;
        double r722816 = sqrt(r722815);
        double r722817 = r722803 / r722816;
        return r722817;
}

double f(double x, double l, double t) {
        double r722818 = t;
        double r722819 = -1.046010354271018e+94;
        bool r722820 = r722818 <= r722819;
        double r722821 = 2.0;
        double r722822 = sqrt(r722821);
        double r722823 = r722822 * r722818;
        double r722824 = x;
        double r722825 = r722824 * r722824;
        double r722826 = r722821 * r722822;
        double r722827 = r722825 * r722826;
        double r722828 = r722827 / r722818;
        double r722829 = r722821 / r722828;
        double r722830 = r722825 * r722822;
        double r722831 = r722818 / r722830;
        double r722832 = r722821 * r722818;
        double r722833 = r722832 / r722824;
        double r722834 = r722833 / r722822;
        double r722835 = fma(r722818, r722822, r722834);
        double r722836 = fma(r722821, r722831, r722835);
        double r722837 = r722829 - r722836;
        double r722838 = r722823 / r722837;
        double r722839 = 1.4541398591892197e+121;
        bool r722840 = r722818 <= r722839;
        double r722841 = r722818 * r722818;
        double r722842 = r722841 / r722824;
        double r722843 = 4.0;
        double r722844 = l;
        double r722845 = r722844 * r722822;
        double r722846 = r722845 / r722824;
        double r722847 = r722846 * r722845;
        double r722848 = fma(r722842, r722843, r722847);
        double r722849 = fma(r722821, r722841, r722848);
        double r722850 = sqrt(r722849);
        double r722851 = r722823 / r722850;
        double r722852 = r722821 / r722822;
        double r722853 = r722818 / r722824;
        double r722854 = r722853 / r722824;
        double r722855 = 1.0;
        double r722856 = r722855 / r722822;
        double r722857 = r722854 * r722856;
        double r722858 = r722823 - r722857;
        double r722859 = fma(r722852, r722853, r722858);
        double r722860 = r722823 / r722859;
        double r722861 = r722840 ? r722851 : r722860;
        double r722862 = r722820 ? r722838 : r722861;
        return r722862;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -1.046010354271018e+94

    1. Initial program 49.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 3.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(t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right)\right)}}\]
    3. Simplified3.1

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

    if -1.046010354271018e+94 < t < 1.4541398591892197e+121

    1. Initial program 36.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 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, t \cdot t, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, \frac{\ell \cdot \ell}{\frac{x}{2}}\right)\right)}}}\]
    4. Using strategy rm
    5. Applied add-sqr-sqrt16.9

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

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

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

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

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

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

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

    if 1.4541398591892197e+121 < t

    1. Initial program 53.7

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

      \[\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. Simplified53.6

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, t \cdot t, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, \frac{\ell \cdot \ell}{\frac{x}{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}}\right)\right)}}\]
    6. Applied *-un-lft-identity53.6

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

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

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

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

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

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

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

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

Reproduce

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