Average Error: 43.4 → 10.1
Time: 26.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.922123040950101526776925110190092589123 \cdot 10^{-18}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{2 \cdot \left(\frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}} - \frac{t}{\sqrt{2} \cdot {x}^{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\ \mathbf{elif}\;t \le 4568115772869941922171560669274498400256:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{{t}^{2}}{x}, 2 \cdot \left(\sqrt{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)} \cdot \sqrt{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}} + \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2} - 2 \cdot \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{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.922123040950101526776925110190092589123 \cdot 10^{-18}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{2 \cdot \left(\frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}} - \frac{t}{\sqrt{2} \cdot {x}^{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\

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

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

\end{array}
double f(double x, double l, double t) {
        double r44068 = 2.0;
        double r44069 = sqrt(r44068);
        double r44070 = t;
        double r44071 = r44069 * r44070;
        double r44072 = x;
        double r44073 = 1.0;
        double r44074 = r44072 + r44073;
        double r44075 = r44072 - r44073;
        double r44076 = r44074 / r44075;
        double r44077 = l;
        double r44078 = r44077 * r44077;
        double r44079 = r44070 * r44070;
        double r44080 = r44068 * r44079;
        double r44081 = r44078 + r44080;
        double r44082 = r44076 * r44081;
        double r44083 = r44082 - r44078;
        double r44084 = sqrt(r44083);
        double r44085 = r44071 / r44084;
        return r44085;
}

double f(double x, double l, double t) {
        double r44086 = t;
        double r44087 = -1.9221230409501015e-18;
        bool r44088 = r44086 <= r44087;
        double r44089 = 2.0;
        double r44090 = sqrt(r44089);
        double r44091 = r44090 * r44086;
        double r44092 = 3.0;
        double r44093 = pow(r44090, r44092);
        double r44094 = x;
        double r44095 = 2.0;
        double r44096 = pow(r44094, r44095);
        double r44097 = r44093 * r44096;
        double r44098 = r44086 / r44097;
        double r44099 = r44090 * r44096;
        double r44100 = r44086 / r44099;
        double r44101 = r44098 - r44100;
        double r44102 = r44089 * r44101;
        double r44103 = r44090 * r44094;
        double r44104 = r44086 / r44103;
        double r44105 = r44086 * r44090;
        double r44106 = fma(r44089, r44104, r44105);
        double r44107 = r44102 - r44106;
        double r44108 = r44091 / r44107;
        double r44109 = 4.568115772869942e+39;
        bool r44110 = r44086 <= r44109;
        double r44111 = 4.0;
        double r44112 = pow(r44086, r44095);
        double r44113 = r44112 / r44094;
        double r44114 = l;
        double r44115 = r44094 / r44114;
        double r44116 = r44114 / r44115;
        double r44117 = fma(r44086, r44086, r44116);
        double r44118 = sqrt(r44117);
        double r44119 = r44118 * r44118;
        double r44120 = r44089 * r44119;
        double r44121 = fma(r44111, r44113, r44120);
        double r44122 = sqrt(r44121);
        double r44123 = r44091 / r44122;
        double r44124 = r44100 + r44104;
        double r44125 = r44089 * r44098;
        double r44126 = r44105 - r44125;
        double r44127 = fma(r44089, r44124, r44126);
        double r44128 = r44091 / r44127;
        double r44129 = r44110 ? r44123 : r44128;
        double r44130 = r44088 ? r44108 : r44129;
        return r44130;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -1.9221230409501015e-18

    1. Initial program 40.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 5.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}^{2}} + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + t \cdot \sqrt{2}\right)\right)}}\]
    3. Simplified5.3

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

    if -1.9221230409501015e-18 < t < 4.568115772869942e+39

    1. Initial program 44.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 20.0

      \[\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. Simplified20.0

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

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

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

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

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

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

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

    if 4.568115772869942e+39 < t

    1. Initial program 43.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 4.7

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

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

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

Reproduce

herbie shell --seed 2019235 +o rules:numerics
(FPCore (x l t)
  :name "Toniolo and Linder, Equation (7)"
  :precision binary64
  (/ (* (sqrt 2) t) (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l)))))