Average Error: 41.9 → 8.9
Time: 25.4s
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.3258761248569655 \cdot 10^{+101}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{-\mathsf{fma}\left(\frac{\frac{t}{\sqrt{2}}}{x}, 2, \sqrt{2} \cdot t\right)}\\ \mathbf{elif}\;t \le 7.466234522592741 \cdot 10^{-275}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right), \frac{4 \cdot \left(t \cdot t\right)}{x}\right)}}\\ \mathbf{elif}\;t \le 3.9773559035809034 \cdot 10^{-165}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x \cdot x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x} \cdot -2\right)\right)\right)}\\ \mathbf{elif}\;t \le 1.190119698582846 \cdot 10^{+73}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \sqrt{\mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)} \cdot \sqrt{\mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)}, \frac{4 \cdot \left(t \cdot t\right)}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x \cdot x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x} \cdot -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 -1.3258761248569655 \cdot 10^{+101}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{-\mathsf{fma}\left(\frac{\frac{t}{\sqrt{2}}}{x}, 2, \sqrt{2} \cdot t\right)}\\

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

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

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

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

\end{array}
double f(double x, double l, double t) {
        double r416857 = 2.0;
        double r416858 = sqrt(r416857);
        double r416859 = t;
        double r416860 = r416858 * r416859;
        double r416861 = x;
        double r416862 = 1.0;
        double r416863 = r416861 + r416862;
        double r416864 = r416861 - r416862;
        double r416865 = r416863 / r416864;
        double r416866 = l;
        double r416867 = r416866 * r416866;
        double r416868 = r416859 * r416859;
        double r416869 = r416857 * r416868;
        double r416870 = r416867 + r416869;
        double r416871 = r416865 * r416870;
        double r416872 = r416871 - r416867;
        double r416873 = sqrt(r416872);
        double r416874 = r416860 / r416873;
        return r416874;
}

double f(double x, double l, double t) {
        double r416875 = t;
        double r416876 = -1.3258761248569655e+101;
        bool r416877 = r416875 <= r416876;
        double r416878 = 2.0;
        double r416879 = sqrt(r416878);
        double r416880 = r416879 * r416875;
        double r416881 = r416875 / r416879;
        double r416882 = x;
        double r416883 = r416881 / r416882;
        double r416884 = fma(r416883, r416878, r416880);
        double r416885 = -r416884;
        double r416886 = r416880 / r416885;
        double r416887 = 7.466234522592741e-275;
        bool r416888 = r416875 <= r416887;
        double r416889 = l;
        double r416890 = r416889 / r416882;
        double r416891 = r416889 * r416890;
        double r416892 = fma(r416875, r416875, r416891);
        double r416893 = 4.0;
        double r416894 = r416875 * r416875;
        double r416895 = r416893 * r416894;
        double r416896 = r416895 / r416882;
        double r416897 = fma(r416878, r416892, r416896);
        double r416898 = sqrt(r416897);
        double r416899 = r416880 / r416898;
        double r416900 = 3.9773559035809034e-165;
        bool r416901 = r416875 <= r416900;
        double r416902 = r416882 * r416882;
        double r416903 = r416878 / r416902;
        double r416904 = r416878 / r416882;
        double r416905 = r416881 / r416878;
        double r416906 = r416905 / r416902;
        double r416907 = -2.0;
        double r416908 = r416906 * r416907;
        double r416909 = fma(r416904, r416881, r416908);
        double r416910 = fma(r416875, r416879, r416909);
        double r416911 = fma(r416903, r416881, r416910);
        double r416912 = r416880 / r416911;
        double r416913 = 1.190119698582846e+73;
        bool r416914 = r416875 <= r416913;
        double r416915 = sqrt(r416892);
        double r416916 = r416915 * r416915;
        double r416917 = fma(r416878, r416916, r416896);
        double r416918 = sqrt(r416917);
        double r416919 = r416880 / r416918;
        double r416920 = r416914 ? r416919 : r416912;
        double r416921 = r416901 ? r416912 : r416920;
        double r416922 = r416888 ? r416899 : r416921;
        double r416923 = r416877 ? r416886 : r416922;
        return r416923;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 4 regimes
  2. if t < -1.3258761248569655e+101

    1. Initial program 50.2

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{-\left(t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right)}}\]
    5. Simplified2.9

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

    if -1.3258761248569655e+101 < t < 7.466234522592741e-275

    1. Initial program 37.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 17.1

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

      \[\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 \left(t \cdot t\right)}{x}\right)}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity17.1

      \[\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 \left(t \cdot t\right)}{x}\right)}}\]
    6. Applied times-frac13.3

      \[\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 \left(t \cdot t\right)}{x}\right)}}\]
    7. Simplified13.3

      \[\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 \left(t \cdot t\right)}{x}\right)}}\]

    if 7.466234522592741e-275 < t < 3.9773559035809034e-165 or 1.190119698582846e+73 < t

    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 10.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. Simplified10.8

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

    if 3.9773559035809034e-165 < t < 1.190119698582846e+73

    1. Initial program 27.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 9.1

      \[\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. Simplified9.1

      \[\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 \left(t \cdot t\right)}{x}\right)}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity9.1

      \[\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 \left(t \cdot t\right)}{x}\right)}}\]
    6. Applied times-frac4.7

      \[\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 \left(t \cdot t\right)}{x}\right)}}\]
    7. Simplified4.7

      \[\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 \left(t \cdot t\right)}{x}\right)}}\]
    8. Using strategy rm
    9. Applied add-sqr-sqrt4.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.3258761248569655 \cdot 10^{+101}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{-\mathsf{fma}\left(\frac{\frac{t}{\sqrt{2}}}{x}, 2, \sqrt{2} \cdot t\right)}\\ \mathbf{elif}\;t \le 7.466234522592741 \cdot 10^{-275}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right), \frac{4 \cdot \left(t \cdot t\right)}{x}\right)}}\\ \mathbf{elif}\;t \le 3.9773559035809034 \cdot 10^{-165}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x \cdot x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x} \cdot -2\right)\right)\right)}\\ \mathbf{elif}\;t \le 1.190119698582846 \cdot 10^{+73}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \sqrt{\mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)} \cdot \sqrt{\mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)}, \frac{4 \cdot \left(t \cdot t\right)}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x \cdot x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x} \cdot -2\right)\right)\right)}\\ \end{array}\]

Reproduce

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