Average Error: 42.6 → 9.7
Time: 1.3m
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 -4.9427862702567594 \cdot 10^{+101}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\left(\frac{\frac{2}{x}}{x}\right), \left(\frac{t}{2 \cdot \sqrt{2}}\right), \left(-\mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{t}{\sqrt{2}} \cdot \left(\frac{2}{x} + \frac{\frac{2}{x}}{x}\right)\right)\right)\right)\right)}\\ \mathbf{elif}\;t \le -2.5942426972954006 \cdot 10^{-168}:\\ \;\;\;\;\frac{\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \left(t \cdot \sqrt[3]{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\ell}{x}\right), \ell, \left(t \cdot t\right)\right)\right), 2, \left(\frac{4 \cdot \left(t \cdot t\right)}{x}\right)\right)}}\\ \mathbf{elif}\;t \le -3.816898726684052 \cdot 10^{-294}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\left(\frac{\frac{2}{x}}{x}\right), \left(\frac{t}{2 \cdot \sqrt{2}}\right), \left(-\mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{t}{\sqrt{2}} \cdot \left(\frac{2}{x} + \frac{\frac{2}{x}}{x}\right)\right)\right)\right)\right)}\\ \mathbf{elif}\;t \le 1.562851894102399 \cdot 10^{-208}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt[3]{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\ell}{x}\right), \ell, \left(t \cdot t\right)\right)\right), 2, \left(\frac{t \cdot t}{\frac{x}{4}}\right)\right) \cdot \sqrt{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\ell}{x}\right), \ell, \left(t \cdot t\right)\right)\right), 2, \left(\frac{t \cdot t}{\frac{x}{4}}\right)\right)}}}\\ \mathbf{elif}\;t \le 1.5761969664625226 \cdot 10^{-161}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\left(\sqrt{2}\right), t, \left(\frac{t}{\sqrt{2}} \cdot \left(\frac{2}{x} + \frac{\frac{2}{x}}{x}\right)\right)\right) - \frac{\frac{t}{\sqrt{2}}}{x \cdot x}}\\ \mathbf{elif}\;t \le 2.496995094803613 \cdot 10^{+98}:\\ \;\;\;\;\frac{\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \left(t \cdot \sqrt[3]{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\ell}{x}\right), \ell, \left(t \cdot t\right)\right)\right), 2, \left(\frac{4 \cdot \left(t \cdot t\right)}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\left(\sqrt{2}\right), t, \left(\frac{t}{\sqrt{2}} \cdot \left(\frac{2}{x} + \frac{\frac{2}{x}}{x}\right)\right)\right) - \frac{\frac{t}{\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 -4.9427862702567594 \cdot 10^{+101}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\left(\frac{\frac{2}{x}}{x}\right), \left(\frac{t}{2 \cdot \sqrt{2}}\right), \left(-\mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{t}{\sqrt{2}} \cdot \left(\frac{2}{x} + \frac{\frac{2}{x}}{x}\right)\right)\right)\right)\right)}\\

\mathbf{elif}\;t \le -2.5942426972954006 \cdot 10^{-168}:\\
\;\;\;\;\frac{\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \left(t \cdot \sqrt[3]{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\ell}{x}\right), \ell, \left(t \cdot t\right)\right)\right), 2, \left(\frac{4 \cdot \left(t \cdot t\right)}{x}\right)\right)}}\\

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

\mathbf{elif}\;t \le 1.562851894102399 \cdot 10^{-208}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt[3]{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\ell}{x}\right), \ell, \left(t \cdot t\right)\right)\right), 2, \left(\frac{t \cdot t}{\frac{x}{4}}\right)\right) \cdot \sqrt{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\ell}{x}\right), \ell, \left(t \cdot t\right)\right)\right), 2, \left(\frac{t \cdot t}{\frac{x}{4}}\right)\right)}}}\\

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

\mathbf{elif}\;t \le 2.496995094803613 \cdot 10^{+98}:\\
\;\;\;\;\frac{\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \left(t \cdot \sqrt[3]{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\ell}{x}\right), \ell, \left(t \cdot t\right)\right)\right), 2, \left(\frac{4 \cdot \left(t \cdot t\right)}{x}\right)\right)}}\\

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

\end{array}
double f(double x, double l, double t) {
        double r4258371 = 2.0;
        double r4258372 = sqrt(r4258371);
        double r4258373 = t;
        double r4258374 = r4258372 * r4258373;
        double r4258375 = x;
        double r4258376 = 1.0;
        double r4258377 = r4258375 + r4258376;
        double r4258378 = r4258375 - r4258376;
        double r4258379 = r4258377 / r4258378;
        double r4258380 = l;
        double r4258381 = r4258380 * r4258380;
        double r4258382 = r4258373 * r4258373;
        double r4258383 = r4258371 * r4258382;
        double r4258384 = r4258381 + r4258383;
        double r4258385 = r4258379 * r4258384;
        double r4258386 = r4258385 - r4258381;
        double r4258387 = sqrt(r4258386);
        double r4258388 = r4258374 / r4258387;
        return r4258388;
}

double f(double x, double l, double t) {
        double r4258389 = t;
        double r4258390 = -4.9427862702567594e+101;
        bool r4258391 = r4258389 <= r4258390;
        double r4258392 = 2.0;
        double r4258393 = sqrt(r4258392);
        double r4258394 = r4258393 * r4258389;
        double r4258395 = x;
        double r4258396 = r4258392 / r4258395;
        double r4258397 = r4258396 / r4258395;
        double r4258398 = r4258392 * r4258393;
        double r4258399 = r4258389 / r4258398;
        double r4258400 = r4258389 / r4258393;
        double r4258401 = r4258396 + r4258397;
        double r4258402 = r4258400 * r4258401;
        double r4258403 = fma(r4258389, r4258393, r4258402);
        double r4258404 = -r4258403;
        double r4258405 = fma(r4258397, r4258399, r4258404);
        double r4258406 = r4258394 / r4258405;
        double r4258407 = -2.5942426972954006e-168;
        bool r4258408 = r4258389 <= r4258407;
        double r4258409 = cbrt(r4258393);
        double r4258410 = r4258409 * r4258409;
        double r4258411 = r4258389 * r4258409;
        double r4258412 = r4258410 * r4258411;
        double r4258413 = l;
        double r4258414 = r4258413 / r4258395;
        double r4258415 = r4258389 * r4258389;
        double r4258416 = fma(r4258414, r4258413, r4258415);
        double r4258417 = 4.0;
        double r4258418 = r4258417 * r4258415;
        double r4258419 = r4258418 / r4258395;
        double r4258420 = fma(r4258416, r4258392, r4258419);
        double r4258421 = sqrt(r4258420);
        double r4258422 = r4258412 / r4258421;
        double r4258423 = -3.816898726684052e-294;
        bool r4258424 = r4258389 <= r4258423;
        double r4258425 = 1.562851894102399e-208;
        bool r4258426 = r4258389 <= r4258425;
        double r4258427 = r4258395 / r4258417;
        double r4258428 = r4258415 / r4258427;
        double r4258429 = fma(r4258416, r4258392, r4258428);
        double r4258430 = sqrt(r4258429);
        double r4258431 = r4258429 * r4258430;
        double r4258432 = cbrt(r4258431);
        double r4258433 = r4258394 / r4258432;
        double r4258434 = 1.5761969664625226e-161;
        bool r4258435 = r4258389 <= r4258434;
        double r4258436 = fma(r4258393, r4258389, r4258402);
        double r4258437 = r4258395 * r4258395;
        double r4258438 = r4258400 / r4258437;
        double r4258439 = r4258436 - r4258438;
        double r4258440 = r4258394 / r4258439;
        double r4258441 = 2.496995094803613e+98;
        bool r4258442 = r4258389 <= r4258441;
        double r4258443 = r4258442 ? r4258422 : r4258440;
        double r4258444 = r4258435 ? r4258440 : r4258443;
        double r4258445 = r4258426 ? r4258433 : r4258444;
        double r4258446 = r4258424 ? r4258406 : r4258445;
        double r4258447 = r4258408 ? r4258422 : r4258446;
        double r4258448 = r4258391 ? r4258406 : r4258447;
        return r4258448;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 4 regimes
  2. if t < -4.9427862702567594e+101 or -2.5942426972954006e-168 < t < -3.816898726684052e-294

    1. Initial program 54.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 13.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. Simplified13.2

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

    if -4.9427862702567594e+101 < t < -2.5942426972954006e-168 or 1.5761969664625226e-161 < t < 2.496995094803613e+98

    1. Initial program 26.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 10.6

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

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

      \[\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(\left(\mathsf{fma}\left(\left(\frac{\ell}{x}\right), \ell, \left(t \cdot t\right)\right)\right), 2, \left(\frac{\left(t \cdot t\right) \cdot 4}{x}\right)\right)}}\]
    6. Applied associate-*l*5.4

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

    if -3.816898726684052e-294 < t < 1.562851894102399e-208

    1. Initial program 61.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 29.9

      \[\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. Simplified28.8

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

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

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

    if 1.562851894102399e-208 < t < 1.5761969664625226e-161 or 2.496995094803613e+98 < t

    1. Initial program 51.2

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -4.9427862702567594 \cdot 10^{+101}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\left(\frac{\frac{2}{x}}{x}\right), \left(\frac{t}{2 \cdot \sqrt{2}}\right), \left(-\mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{t}{\sqrt{2}} \cdot \left(\frac{2}{x} + \frac{\frac{2}{x}}{x}\right)\right)\right)\right)\right)}\\ \mathbf{elif}\;t \le -2.5942426972954006 \cdot 10^{-168}:\\ \;\;\;\;\frac{\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \left(t \cdot \sqrt[3]{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\ell}{x}\right), \ell, \left(t \cdot t\right)\right)\right), 2, \left(\frac{4 \cdot \left(t \cdot t\right)}{x}\right)\right)}}\\ \mathbf{elif}\;t \le -3.816898726684052 \cdot 10^{-294}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\left(\frac{\frac{2}{x}}{x}\right), \left(\frac{t}{2 \cdot \sqrt{2}}\right), \left(-\mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{t}{\sqrt{2}} \cdot \left(\frac{2}{x} + \frac{\frac{2}{x}}{x}\right)\right)\right)\right)\right)}\\ \mathbf{elif}\;t \le 1.562851894102399 \cdot 10^{-208}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt[3]{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\ell}{x}\right), \ell, \left(t \cdot t\right)\right)\right), 2, \left(\frac{t \cdot t}{\frac{x}{4}}\right)\right) \cdot \sqrt{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\ell}{x}\right), \ell, \left(t \cdot t\right)\right)\right), 2, \left(\frac{t \cdot t}{\frac{x}{4}}\right)\right)}}}\\ \mathbf{elif}\;t \le 1.5761969664625226 \cdot 10^{-161}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\left(\sqrt{2}\right), t, \left(\frac{t}{\sqrt{2}} \cdot \left(\frac{2}{x} + \frac{\frac{2}{x}}{x}\right)\right)\right) - \frac{\frac{t}{\sqrt{2}}}{x \cdot x}}\\ \mathbf{elif}\;t \le 2.496995094803613 \cdot 10^{+98}:\\ \;\;\;\;\frac{\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \left(t \cdot \sqrt[3]{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\ell}{x}\right), \ell, \left(t \cdot t\right)\right)\right), 2, \left(\frac{4 \cdot \left(t \cdot t\right)}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\left(\sqrt{2}\right), t, \left(\frac{t}{\sqrt{2}} \cdot \left(\frac{2}{x} + \frac{\frac{2}{x}}{x}\right)\right)\right) - \frac{\frac{t}{\sqrt{2}}}{x \cdot x}}\\ \end{array}\]

Reproduce

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