Average Error: 43.0 → 9.6
Time: 31.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 -8543336356588510030856192:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\ \mathbf{elif}\;t \le -8.549619549454067904050788555376770008695 \cdot 10^{-265}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}}\\ \mathbf{elif}\;t \le -1.402005127257352814267210643002199774407 \cdot 10^{-302}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\ \mathbf{elif}\;t \le 6.335165898555757118212433419014376963533 \cdot 10^{148}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right) - \frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{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 -8543336356588510030856192:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\

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

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

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

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

\end{array}
double f(double x, double l, double t) {
        double r46431 = 2.0;
        double r46432 = sqrt(r46431);
        double r46433 = t;
        double r46434 = r46432 * r46433;
        double r46435 = x;
        double r46436 = 1.0;
        double r46437 = r46435 + r46436;
        double r46438 = r46435 - r46436;
        double r46439 = r46437 / r46438;
        double r46440 = l;
        double r46441 = r46440 * r46440;
        double r46442 = r46433 * r46433;
        double r46443 = r46431 * r46442;
        double r46444 = r46441 + r46443;
        double r46445 = r46439 * r46444;
        double r46446 = r46445 - r46441;
        double r46447 = sqrt(r46446);
        double r46448 = r46434 / r46447;
        return r46448;
}

double f(double x, double l, double t) {
        double r46449 = t;
        double r46450 = -8.54333635658851e+24;
        bool r46451 = r46449 <= r46450;
        double r46452 = 2.0;
        double r46453 = sqrt(r46452);
        double r46454 = r46453 * r46449;
        double r46455 = x;
        double r46456 = 2.0;
        double r46457 = pow(r46455, r46456);
        double r46458 = r46449 / r46457;
        double r46459 = r46452 * r46453;
        double r46460 = r46452 / r46459;
        double r46461 = r46452 / r46453;
        double r46462 = r46460 - r46461;
        double r46463 = r46458 * r46462;
        double r46464 = r46453 * r46455;
        double r46465 = r46449 / r46464;
        double r46466 = r46449 * r46453;
        double r46467 = fma(r46452, r46465, r46466);
        double r46468 = r46463 - r46467;
        double r46469 = r46454 / r46468;
        double r46470 = -8.549619549454068e-265;
        bool r46471 = r46449 <= r46470;
        double r46472 = l;
        double r46473 = fabs(r46472);
        double r46474 = r46473 / r46455;
        double r46475 = r46473 * r46474;
        double r46476 = fma(r46449, r46449, r46475);
        double r46477 = 4.0;
        double r46478 = pow(r46449, r46456);
        double r46479 = r46478 / r46455;
        double r46480 = r46477 * r46479;
        double r46481 = fma(r46452, r46476, r46480);
        double r46482 = sqrt(r46481);
        double r46483 = r46454 / r46482;
        double r46484 = -1.4020051272573528e-302;
        bool r46485 = r46449 <= r46484;
        double r46486 = 6.335165898555757e+148;
        bool r46487 = r46449 <= r46486;
        double r46488 = r46467 - r46463;
        double r46489 = r46454 / r46488;
        double r46490 = r46487 ? r46483 : r46489;
        double r46491 = r46485 ? r46469 : r46490;
        double r46492 = r46471 ? r46483 : r46491;
        double r46493 = r46451 ? r46469 : r46492;
        return r46493;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -8.54333635658851e+24 or -8.549619549454068e-265 < t < -1.4020051272573528e-302

    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 7.6

      \[\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. Simplified7.6

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

    if -8.54333635658851e+24 < t < -8.549619549454068e-265 or -1.4020051272573528e-302 < t < 6.335165898555757e+148

    1. Initial program 36.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 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}^{2}}{x}\right), 4 \cdot \frac{{t}^{2}}{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}^{2}}{\color{blue}{1 \cdot x}}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}}\]
    6. Applied add-sqr-sqrt17.1

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

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

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

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

    if 6.335165898555757e+148 < t

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

      \[\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. Simplified1.6

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -8543336356588510030856192:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\ \mathbf{elif}\;t \le -8.549619549454067904050788555376770008695 \cdot 10^{-265}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}}\\ \mathbf{elif}\;t \le -1.402005127257352814267210643002199774407 \cdot 10^{-302}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\ \mathbf{elif}\;t \le 6.335165898555757118212433419014376963533 \cdot 10^{148}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right) - \frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right)}\\ \end{array}\]

Reproduce

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