Average Error: 43.2 → 9.3
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 -1.940005881918408859869096974602770049363 \cdot 10^{94}:\\ \;\;\;\;\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.839658841198905283015739574372348749582 \cdot 10^{-241}:\\ \;\;\;\;\frac{\left(\sqrt[3]{\sqrt{2}} \cdot t\right) \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\frac{t}{\frac{x}{t}}, 4, 2 \cdot \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)\right)}}\\ \mathbf{elif}\;t \le 3.247980644380315344262592988201111260205 \cdot 10^{-157}:\\ \;\;\;\;\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}}\\ \mathbf{elif}\;t \le 4.214549585149478093549971775733778272653 \cdot 10^{55}:\\ \;\;\;\;\frac{\left(\sqrt[3]{\sqrt{2}} \cdot t\right) \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\frac{t}{\frac{x}{t}}, 4, 2 \cdot \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\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 -1.940005881918408859869096974602770049363 \cdot 10^{94}:\\
\;\;\;\;\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.839658841198905283015739574372348749582 \cdot 10^{-241}:\\
\;\;\;\;\frac{\left(\sqrt[3]{\sqrt{2}} \cdot t\right) \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\frac{t}{\frac{x}{t}}, 4, 2 \cdot \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)\right)}}\\

\mathbf{elif}\;t \le 3.247980644380315344262592988201111260205 \cdot 10^{-157}:\\
\;\;\;\;\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}}\\

\mathbf{elif}\;t \le 4.214549585149478093549971775733778272653 \cdot 10^{55}:\\
\;\;\;\;\frac{\left(\sqrt[3]{\sqrt{2}} \cdot t\right) \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\frac{t}{\frac{x}{t}}, 4, 2 \cdot \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\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 r1040870 = 2.0;
        double r1040871 = sqrt(r1040870);
        double r1040872 = t;
        double r1040873 = r1040871 * r1040872;
        double r1040874 = x;
        double r1040875 = 1.0;
        double r1040876 = r1040874 + r1040875;
        double r1040877 = r1040874 - r1040875;
        double r1040878 = r1040876 / r1040877;
        double r1040879 = l;
        double r1040880 = r1040879 * r1040879;
        double r1040881 = r1040872 * r1040872;
        double r1040882 = r1040870 * r1040881;
        double r1040883 = r1040880 + r1040882;
        double r1040884 = r1040878 * r1040883;
        double r1040885 = r1040884 - r1040880;
        double r1040886 = sqrt(r1040885);
        double r1040887 = r1040873 / r1040886;
        return r1040887;
}

double f(double x, double l, double t) {
        double r1040888 = t;
        double r1040889 = -1.940005881918409e+94;
        bool r1040890 = r1040888 <= r1040889;
        double r1040891 = 2.0;
        double r1040892 = sqrt(r1040891);
        double r1040893 = r1040892 * r1040888;
        double r1040894 = x;
        double r1040895 = r1040894 * r1040894;
        double r1040896 = r1040891 / r1040895;
        double r1040897 = r1040891 * r1040892;
        double r1040898 = r1040888 / r1040897;
        double r1040899 = r1040888 / r1040892;
        double r1040900 = r1040899 / r1040894;
        double r1040901 = fma(r1040900, r1040891, r1040893);
        double r1040902 = fma(r1040896, r1040899, r1040901);
        double r1040903 = -r1040902;
        double r1040904 = fma(r1040896, r1040898, r1040903);
        double r1040905 = r1040893 / r1040904;
        double r1040906 = 1.8396588411989053e-241;
        bool r1040907 = r1040888 <= r1040906;
        double r1040908 = cbrt(r1040892);
        double r1040909 = r1040908 * r1040888;
        double r1040910 = r1040908 * r1040908;
        double r1040911 = r1040909 * r1040910;
        double r1040912 = r1040894 / r1040888;
        double r1040913 = r1040888 / r1040912;
        double r1040914 = 4.0;
        double r1040915 = l;
        double r1040916 = r1040894 / r1040915;
        double r1040917 = r1040915 / r1040916;
        double r1040918 = fma(r1040888, r1040888, r1040917);
        double r1040919 = r1040891 * r1040918;
        double r1040920 = fma(r1040913, r1040914, r1040919);
        double r1040921 = sqrt(r1040920);
        double r1040922 = r1040911 / r1040921;
        double r1040923 = 3.2479806443803153e-157;
        bool r1040924 = r1040888 <= r1040923;
        double r1040925 = r1040891 * r1040888;
        double r1040926 = r1040925 / r1040897;
        double r1040927 = r1040926 / r1040895;
        double r1040928 = r1040902 - r1040927;
        double r1040929 = r1040893 / r1040928;
        double r1040930 = 4.214549585149478e+55;
        bool r1040931 = r1040888 <= r1040930;
        double r1040932 = r1040931 ? r1040922 : r1040929;
        double r1040933 = r1040924 ? r1040929 : r1040932;
        double r1040934 = r1040907 ? r1040922 : r1040933;
        double r1040935 = r1040890 ? r1040905 : r1040934;
        return r1040935;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -1.940005881918409e+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.3

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

      \[\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 -1.940005881918409e+94 < t < 1.8396588411989053e-241 or 3.2479806443803153e-157 < t < 4.214549585149478e+55

    1. Initial program 37.0

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

      \[\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. Simplified12.2

      \[\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-cube-cbrt12.2

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

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

    if 1.8396588411989053e-241 < t < 3.2479806443803153e-157 or 4.214549585149478e+55 < t

    1. Initial program 48.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 8.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. Simplified8.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.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.940005881918408859869096974602770049363 \cdot 10^{94}:\\ \;\;\;\;\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.839658841198905283015739574372348749582 \cdot 10^{-241}:\\ \;\;\;\;\frac{\left(\sqrt[3]{\sqrt{2}} \cdot t\right) \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\frac{t}{\frac{x}{t}}, 4, 2 \cdot \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)\right)}}\\ \mathbf{elif}\;t \le 3.247980644380315344262592988201111260205 \cdot 10^{-157}:\\ \;\;\;\;\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}}\\ \mathbf{elif}\;t \le 4.214549585149478093549971775733778272653 \cdot 10^{55}:\\ \;\;\;\;\frac{\left(\sqrt[3]{\sqrt{2}} \cdot t\right) \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\frac{t}{\frac{x}{t}}, 4, 2 \cdot \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\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 2019174 +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)))))