Average Error: 42.1 → 9.3
Time: 31.3s
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 -7.13289705956808 \cdot 10^{+147}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{\frac{2 \cdot t}{x \cdot x}}{2 \cdot \sqrt{2}} - \mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right)\right)\right) - \frac{2 \cdot \frac{t}{\sqrt{2}}}{x \cdot x}}\\ \mathbf{elif}\;t \le 7.246088747560428 \cdot 10^{-307}:\\ \;\;\;\;\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{\frac{2}{\frac{x}{\ell}}}{\frac{1}{\ell}}\right)\right)\right)\right)}}\\ \mathbf{elif}\;t \le 9.57501207531824 \cdot 10^{-225}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\left(\frac{2}{x}\right), \left(\frac{t}{\sqrt{2}}\right), \left(\mathsf{fma}\left(\left(\sqrt{2}\right), t, \left(\frac{-2 \cdot \frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x}\right)\right)\right)\right)}\\ \mathbf{elif}\;t \le 45772087522.28849:\\ \;\;\;\;\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{2}{\frac{\frac{x}{\ell}}{\ell}}\right)\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\left(\frac{2}{x}\right), \left(\frac{t}{\sqrt{2}}\right), \left(\mathsf{fma}\left(\left(\sqrt{2}\right), t, \left(\frac{-2 \cdot \frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x}\right)\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 -7.13289705956808 \cdot 10^{+147}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{\frac{2 \cdot t}{x \cdot x}}{2 \cdot \sqrt{2}} - \mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right)\right)\right) - \frac{2 \cdot \frac{t}{\sqrt{2}}}{x \cdot x}}\\

\mathbf{elif}\;t \le 7.246088747560428 \cdot 10^{-307}:\\
\;\;\;\;\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{\frac{2}{\frac{x}{\ell}}}{\frac{1}{\ell}}\right)\right)\right)\right)}}\\

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

\mathbf{elif}\;t \le 45772087522.28849:\\
\;\;\;\;\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{2}{\frac{\frac{x}{\ell}}{\ell}}\right)\right)\right)\right)}}\\

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

\end{array}
double f(double x, double l, double t) {
        double r697244 = 2.0;
        double r697245 = sqrt(r697244);
        double r697246 = t;
        double r697247 = r697245 * r697246;
        double r697248 = x;
        double r697249 = 1.0;
        double r697250 = r697248 + r697249;
        double r697251 = r697248 - r697249;
        double r697252 = r697250 / r697251;
        double r697253 = l;
        double r697254 = r697253 * r697253;
        double r697255 = r697246 * r697246;
        double r697256 = r697244 * r697255;
        double r697257 = r697254 + r697256;
        double r697258 = r697252 * r697257;
        double r697259 = r697258 - r697254;
        double r697260 = sqrt(r697259);
        double r697261 = r697247 / r697260;
        return r697261;
}

double f(double x, double l, double t) {
        double r697262 = t;
        double r697263 = -7.13289705956808e+147;
        bool r697264 = r697262 <= r697263;
        double r697265 = 2.0;
        double r697266 = sqrt(r697265);
        double r697267 = r697266 * r697262;
        double r697268 = r697265 * r697262;
        double r697269 = x;
        double r697270 = r697269 * r697269;
        double r697271 = r697268 / r697270;
        double r697272 = r697265 * r697266;
        double r697273 = r697271 / r697272;
        double r697274 = r697262 / r697266;
        double r697275 = r697265 / r697269;
        double r697276 = r697274 * r697275;
        double r697277 = fma(r697262, r697266, r697276);
        double r697278 = r697273 - r697277;
        double r697279 = r697265 * r697274;
        double r697280 = r697279 / r697270;
        double r697281 = r697278 - r697280;
        double r697282 = r697267 / r697281;
        double r697283 = 7.246088747560428e-307;
        bool r697284 = r697262 <= r697283;
        double r697285 = r697262 * r697262;
        double r697286 = r697285 / r697269;
        double r697287 = 4.0;
        double r697288 = l;
        double r697289 = r697269 / r697288;
        double r697290 = r697265 / r697289;
        double r697291 = 1.0;
        double r697292 = r697291 / r697288;
        double r697293 = r697290 / r697292;
        double r697294 = fma(r697286, r697287, r697293);
        double r697295 = fma(r697265, r697285, r697294);
        double r697296 = sqrt(r697295);
        double r697297 = r697267 / r697296;
        double r697298 = 9.57501207531824e-225;
        bool r697299 = r697262 <= r697298;
        double r697300 = -2.0;
        double r697301 = r697274 / r697265;
        double r697302 = r697300 * r697301;
        double r697303 = r697302 / r697270;
        double r697304 = fma(r697266, r697262, r697303);
        double r697305 = fma(r697275, r697274, r697304);
        double r697306 = r697267 / r697305;
        double r697307 = 45772087522.28849;
        bool r697308 = r697262 <= r697307;
        double r697309 = r697289 / r697288;
        double r697310 = r697265 / r697309;
        double r697311 = fma(r697286, r697287, r697310);
        double r697312 = fma(r697265, r697285, r697311);
        double r697313 = sqrt(r697312);
        double r697314 = r697267 / r697313;
        double r697315 = r697308 ? r697314 : r697306;
        double r697316 = r697299 ? r697306 : r697315;
        double r697317 = r697284 ? r697297 : r697316;
        double r697318 = r697264 ? r697282 : r697317;
        return r697318;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 4 regimes
  2. if t < -7.13289705956808e+147

    1. Initial program 60.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 2.4

      \[\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. Simplified2.4

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

    if -7.13289705956808e+147 < t < 7.246088747560428e-307

    1. Initial program 33.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.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. Simplified15.2

      \[\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{2}{\frac{x}{\ell \cdot \ell}}\right)\right)\right)\right)}}}\]
    4. Using strategy rm
    5. Applied associate-/r*11.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(\frac{2}{\color{blue}{\frac{\frac{x}{\ell}}{\ell}}}\right)\right)\right)\right)}}\]
    6. Using strategy rm
    7. Applied div-inv11.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(\frac{2}{\color{blue}{\frac{x}{\ell} \cdot \frac{1}{\ell}}}\right)\right)\right)\right)}}\]
    8. Applied associate-/r*10.8

      \[\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{\frac{2}{\frac{x}{\ell}}}{\frac{1}{\ell}}\right)}\right)\right)\right)}}\]

    if 7.246088747560428e-307 < t < 9.57501207531824e-225 or 45772087522.28849 < t

    1. Initial program 44.4

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

      \[\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{2}{\frac{x}{\ell \cdot \ell}}\right)\right)\right)\right)}}}\]
    4. Taylor expanded around inf 10.2

      \[\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}}}}\]
    5. Simplified10.2

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

    if 9.57501207531824e-225 < t < 45772087522.28849

    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 16.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. Simplified16.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{2}{\frac{x}{\ell \cdot \ell}}\right)\right)\right)\right)}}}\]
    4. Using strategy rm
    5. Applied associate-/r*11.2

      \[\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{2}{\color{blue}{\frac{\frac{x}{\ell}}{\ell}}}\right)\right)\right)\right)}}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification9.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -7.13289705956808 \cdot 10^{+147}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{\frac{2 \cdot t}{x \cdot x}}{2 \cdot \sqrt{2}} - \mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{t}{\sqrt{2}} \cdot \frac{2}{x}\right)\right)\right) - \frac{2 \cdot \frac{t}{\sqrt{2}}}{x \cdot x}}\\ \mathbf{elif}\;t \le 7.246088747560428 \cdot 10^{-307}:\\ \;\;\;\;\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{\frac{2}{\frac{x}{\ell}}}{\frac{1}{\ell}}\right)\right)\right)\right)}}\\ \mathbf{elif}\;t \le 9.57501207531824 \cdot 10^{-225}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\left(\frac{2}{x}\right), \left(\frac{t}{\sqrt{2}}\right), \left(\mathsf{fma}\left(\left(\sqrt{2}\right), t, \left(\frac{-2 \cdot \frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x}\right)\right)\right)\right)}\\ \mathbf{elif}\;t \le 45772087522.28849:\\ \;\;\;\;\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{2}{\frac{\frac{x}{\ell}}{\ell}}\right)\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\left(\frac{2}{x}\right), \left(\frac{t}{\sqrt{2}}\right), \left(\mathsf{fma}\left(\left(\sqrt{2}\right), t, \left(\frac{-2 \cdot \frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x}\right)\right)\right)\right)}\\ \end{array}\]

Reproduce

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