Average Error: 42.6 → 8.9
Time: 25.5s
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.861930782743277 \cdot 10^{+82}:\\ \;\;\;\;\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, \left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}\right), \left(\mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{\frac{2 \cdot t}{x}}{\sqrt{2}}\right)\right)\right)\right)}\\ \mathbf{elif}\;t \le 1.2059628825355719 \cdot 10^{-265}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \left(t \cdot t\right), \left(\mathsf{fma}\left(\left(\frac{t \cdot t}{x}\right), 4, \left(\left(\sqrt{2} \cdot \ell\right) \cdot \frac{\sqrt{2} \cdot \ell}{x}\right)\right)\right)\right)}}\\ \mathbf{elif}\;t \le 1.0535291832943578 \cdot 10^{-158}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}\right), 2, \left(\mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{\frac{2 \cdot t}{x}}{\sqrt{2}}\right)\right) - \frac{2}{\frac{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)}{t}}\right)\right)}\\ \mathbf{elif}\;t \le 2.9199902382812565 \cdot 10^{+64}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \left(t \cdot t\right), \left(\mathsf{fma}\left(\left(\frac{t \cdot t}{x}\right), 4, \left(\left(\sqrt{2} \cdot \ell\right) \cdot \frac{\sqrt{2} \cdot \ell}{x}\right)\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}\right), 2, \left(\mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{\frac{2 \cdot t}{x}}{\sqrt{2}}\right)\right) - \frac{2}{\frac{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)}{t}}\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.861930782743277 \cdot 10^{+82}:\\
\;\;\;\;\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, \left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}\right), \left(\mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{\frac{2 \cdot t}{x}}{\sqrt{2}}\right)\right)\right)\right)}\\

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

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

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

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

\end{array}
double f(double x, double l, double t) {
        double r439983 = 2.0;
        double r439984 = sqrt(r439983);
        double r439985 = t;
        double r439986 = r439984 * r439985;
        double r439987 = x;
        double r439988 = 1.0;
        double r439989 = r439987 + r439988;
        double r439990 = r439987 - r439988;
        double r439991 = r439989 / r439990;
        double r439992 = l;
        double r439993 = r439992 * r439992;
        double r439994 = r439985 * r439985;
        double r439995 = r439983 * r439994;
        double r439996 = r439993 + r439995;
        double r439997 = r439991 * r439996;
        double r439998 = r439997 - r439993;
        double r439999 = sqrt(r439998);
        double r440000 = r439986 / r439999;
        return r440000;
}

double f(double x, double l, double t) {
        double r440001 = t;
        double r440002 = -1.861930782743277e+82;
        bool r440003 = r440001 <= r440002;
        double r440004 = 2.0;
        double r440005 = sqrt(r440004);
        double r440006 = r440005 * r440001;
        double r440007 = x;
        double r440008 = r440007 * r440007;
        double r440009 = r440004 * r440005;
        double r440010 = r440008 * r440009;
        double r440011 = r440010 / r440001;
        double r440012 = r440004 / r440011;
        double r440013 = r440008 * r440005;
        double r440014 = r440001 / r440013;
        double r440015 = r440004 * r440001;
        double r440016 = r440015 / r440007;
        double r440017 = r440016 / r440005;
        double r440018 = fma(r440001, r440005, r440017);
        double r440019 = fma(r440004, r440014, r440018);
        double r440020 = r440012 - r440019;
        double r440021 = r440006 / r440020;
        double r440022 = 1.2059628825355719e-265;
        bool r440023 = r440001 <= r440022;
        double r440024 = r440001 * r440001;
        double r440025 = r440024 / r440007;
        double r440026 = 4.0;
        double r440027 = l;
        double r440028 = r440005 * r440027;
        double r440029 = r440028 / r440007;
        double r440030 = r440028 * r440029;
        double r440031 = fma(r440025, r440026, r440030);
        double r440032 = fma(r440004, r440024, r440031);
        double r440033 = sqrt(r440032);
        double r440034 = r440006 / r440033;
        double r440035 = 1.0535291832943578e-158;
        bool r440036 = r440001 <= r440035;
        double r440037 = r440018 - r440012;
        double r440038 = fma(r440014, r440004, r440037);
        double r440039 = r440006 / r440038;
        double r440040 = 2.9199902382812565e+64;
        bool r440041 = r440001 <= r440040;
        double r440042 = r440041 ? r440034 : r440039;
        double r440043 = r440036 ? r440039 : r440042;
        double r440044 = r440023 ? r440034 : r440043;
        double r440045 = r440003 ? r440021 : r440044;
        return r440045;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -1.861930782743277e+82

    1. Initial program 48.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 3.2

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

      \[\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, \left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}\right), \left(\mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{\frac{2 \cdot t}{x}}{\sqrt{2}}\right)\right)\right)\right)}}\]

    if -1.861930782743277e+82 < t < 1.2059628825355719e-265 or 1.0535291832943578e-158 < t < 2.9199902382812565e+64

    1. Initial program 35.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 15.5

      \[\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. Simplified15.5

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

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

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

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

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

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

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

    if 1.2059628825355719e-265 < t < 1.0535291832943578e-158 or 2.9199902382812565e+64 < t

    1. Initial program 49.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 9.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. Simplified9.8

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.861930782743277 \cdot 10^{+82}:\\ \;\;\;\;\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, \left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}\right), \left(\mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{\frac{2 \cdot t}{x}}{\sqrt{2}}\right)\right)\right)\right)}\\ \mathbf{elif}\;t \le 1.2059628825355719 \cdot 10^{-265}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \left(t \cdot t\right), \left(\mathsf{fma}\left(\left(\frac{t \cdot t}{x}\right), 4, \left(\left(\sqrt{2} \cdot \ell\right) \cdot \frac{\sqrt{2} \cdot \ell}{x}\right)\right)\right)\right)}}\\ \mathbf{elif}\;t \le 1.0535291832943578 \cdot 10^{-158}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}\right), 2, \left(\mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{\frac{2 \cdot t}{x}}{\sqrt{2}}\right)\right) - \frac{2}{\frac{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)}{t}}\right)\right)}\\ \mathbf{elif}\;t \le 2.9199902382812565 \cdot 10^{+64}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \left(t \cdot t\right), \left(\mathsf{fma}\left(\left(\frac{t \cdot t}{x}\right), 4, \left(\left(\sqrt{2} \cdot \ell\right) \cdot \frac{\sqrt{2} \cdot \ell}{x}\right)\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}\right), 2, \left(\mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{\frac{2 \cdot t}{x}}{\sqrt{2}}\right)\right) - \frac{2}{\frac{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)}{t}}\right)\right)}\\ \end{array}\]

Reproduce

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