Average Error: 43.3 → 10.8
Time: 27.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 -8.435929301784521604503627472201569663835 \cdot 10^{106}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\frac{2}{\frac{\left(2 \cdot \left(x \cdot x\right)\right) \cdot \sqrt{2}}{t}} - \mathsf{fma}\left(t, \sqrt{2}, \frac{2 \cdot \frac{t}{\sqrt{2}}}{x}\right)}\\ \mathbf{elif}\;t \le -8.68838282607017033593451153364695886961 \cdot 10^{-163}:\\ \;\;\;\;\sqrt{\frac{2}{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right), \left(\frac{t}{x} \cdot 4\right) \cdot t\right)}} \cdot t\\ \mathbf{elif}\;t \le -1.619144312720762822244529648017528882505 \cdot 10^{-287}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\frac{2}{\frac{\left(2 \cdot \left(x \cdot x\right)\right) \cdot \sqrt{2}}{t}} - \mathsf{fma}\left(t, \sqrt{2}, \frac{2 \cdot \frac{t}{\sqrt{2}}}{x}\right)}\\ \mathbf{elif}\;t \le 4.008879664456036295439864906185096395333 \cdot 10^{-293} \lor \neg \left(t \le 5.581589580614109566525168164749869984689 \cdot 10^{-155}\right) \land t \le 730958659336468015611904:\\ \;\;\;\;\sqrt{\frac{2}{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right), \left(\frac{t}{x} \cdot 4\right) \cdot t\right)}} \cdot t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(2, \frac{\frac{t}{\sqrt{2}}}{x} - \frac{\frac{t}{x \cdot x}}{2 \cdot \sqrt{2}}, \sqrt{2} \cdot t\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 -8.435929301784521604503627472201569663835 \cdot 10^{106}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\frac{2}{\frac{\left(2 \cdot \left(x \cdot x\right)\right) \cdot \sqrt{2}}{t}} - \mathsf{fma}\left(t, \sqrt{2}, \frac{2 \cdot \frac{t}{\sqrt{2}}}{x}\right)}\\

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

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

\mathbf{elif}\;t \le 4.008879664456036295439864906185096395333 \cdot 10^{-293} \lor \neg \left(t \le 5.581589580614109566525168164749869984689 \cdot 10^{-155}\right) \land t \le 730958659336468015611904:\\
\;\;\;\;\sqrt{\frac{2}{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right), \left(\frac{t}{x} \cdot 4\right) \cdot t\right)}} \cdot t\\

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

\end{array}
double f(double x, double l, double t) {
        double r45494 = 2.0;
        double r45495 = sqrt(r45494);
        double r45496 = t;
        double r45497 = r45495 * r45496;
        double r45498 = x;
        double r45499 = 1.0;
        double r45500 = r45498 + r45499;
        double r45501 = r45498 - r45499;
        double r45502 = r45500 / r45501;
        double r45503 = l;
        double r45504 = r45503 * r45503;
        double r45505 = r45496 * r45496;
        double r45506 = r45494 * r45505;
        double r45507 = r45504 + r45506;
        double r45508 = r45502 * r45507;
        double r45509 = r45508 - r45504;
        double r45510 = sqrt(r45509);
        double r45511 = r45497 / r45510;
        return r45511;
}

double f(double x, double l, double t) {
        double r45512 = t;
        double r45513 = -8.435929301784522e+106;
        bool r45514 = r45512 <= r45513;
        double r45515 = 2.0;
        double r45516 = sqrt(r45515);
        double r45517 = x;
        double r45518 = r45517 * r45517;
        double r45519 = r45515 * r45518;
        double r45520 = r45519 * r45516;
        double r45521 = r45520 / r45512;
        double r45522 = r45515 / r45521;
        double r45523 = r45512 / r45516;
        double r45524 = r45515 * r45523;
        double r45525 = r45524 / r45517;
        double r45526 = fma(r45512, r45516, r45525);
        double r45527 = r45522 - r45526;
        double r45528 = r45516 / r45527;
        double r45529 = r45512 * r45528;
        double r45530 = -8.68838282607017e-163;
        bool r45531 = r45512 <= r45530;
        double r45532 = l;
        double r45533 = r45517 / r45532;
        double r45534 = r45532 / r45533;
        double r45535 = fma(r45512, r45512, r45534);
        double r45536 = r45512 / r45517;
        double r45537 = 4.0;
        double r45538 = r45536 * r45537;
        double r45539 = r45538 * r45512;
        double r45540 = fma(r45515, r45535, r45539);
        double r45541 = r45515 / r45540;
        double r45542 = sqrt(r45541);
        double r45543 = r45542 * r45512;
        double r45544 = -1.6191443127207628e-287;
        bool r45545 = r45512 <= r45544;
        double r45546 = 4.0088796644560363e-293;
        bool r45547 = r45512 <= r45546;
        double r45548 = 5.5815895806141096e-155;
        bool r45549 = r45512 <= r45548;
        double r45550 = !r45549;
        double r45551 = 7.30958659336468e+23;
        bool r45552 = r45512 <= r45551;
        bool r45553 = r45550 && r45552;
        bool r45554 = r45547 || r45553;
        double r45555 = r45523 / r45517;
        double r45556 = r45512 / r45518;
        double r45557 = r45515 * r45516;
        double r45558 = r45556 / r45557;
        double r45559 = r45555 - r45558;
        double r45560 = r45516 * r45512;
        double r45561 = fma(r45515, r45559, r45560);
        double r45562 = r45516 / r45561;
        double r45563 = r45512 * r45562;
        double r45564 = r45554 ? r45543 : r45563;
        double r45565 = r45545 ? r45529 : r45564;
        double r45566 = r45531 ? r45543 : r45565;
        double r45567 = r45514 ? r45529 : r45566;
        return r45567;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -8.435929301784522e+106 or -8.68838282607017e-163 < t < -1.6191443127207628e-287

    1. Initial program 55.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. Simplified55.0

      \[\leadsto \color{blue}{t \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(\ell, \ell, \left(t \cdot t\right) \cdot 2\right) \cdot \frac{1 + x}{x - 1} - \ell \cdot \ell}}}\]
    3. Taylor expanded around inf 46.0

      \[\leadsto t \cdot \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot {t}^{2} + \left(2 \cdot \frac{{\ell}^{2}}{x} + 4 \cdot \frac{{t}^{2}}{x}\right)}}}\]
    4. Simplified46.0

      \[\leadsto t \cdot \frac{\sqrt{2}}{\sqrt{\color{blue}{\mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \mathsf{fma}\left(t, t, \frac{\ell \cdot \ell}{x}\right)\right)}}}\]
    5. Taylor expanded around -inf 13.3

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

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

    if -8.435929301784522e+106 < t < -8.68838282607017e-163 or -1.6191443127207628e-287 < t < 4.0088796644560363e-293 or 5.5815895806141096e-155 < t < 7.30958659336468e+23

    1. Initial program 30.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. Simplified30.9

      \[\leadsto \color{blue}{t \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(\ell, \ell, \left(t \cdot t\right) \cdot 2\right) \cdot \frac{1 + x}{x - 1} - \ell \cdot \ell}}}\]
    3. Taylor expanded around inf 11.6

      \[\leadsto t \cdot \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot {t}^{2} + \left(2 \cdot \frac{{\ell}^{2}}{x} + 4 \cdot \frac{{t}^{2}}{x}\right)}}}\]
    4. Simplified11.6

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

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

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

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

      \[\leadsto t \cdot \frac{\sqrt{2}}{1 \cdot \color{blue}{\sqrt{\mathsf{fma}\left(\frac{t}{\frac{x}{t}}, 4, \mathsf{fma}\left(\frac{\ell}{x}, \ell, t \cdot t\right) \cdot 2\right)}}}\]
    10. Using strategy rm
    11. Applied *-un-lft-identity6.5

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

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

      \[\leadsto 1 \cdot \color{blue}{\left(t \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(\frac{t \cdot 4}{x}, t, 2 \cdot \mathsf{fma}\left(\ell, \frac{\ell}{x}, t \cdot t\right)\right)}}\right)}\]
    14. Using strategy rm
    15. Applied sqrt-undiv6.6

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

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

    if 4.0088796644560363e-293 < t < 5.5815895806141096e-155 or 7.30958659336468e+23 < t

    1. Initial program 47.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. Simplified47.0

      \[\leadsto \color{blue}{t \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(\ell, \ell, \left(t \cdot t\right) \cdot 2\right) \cdot \frac{1 + x}{x - 1} - \ell \cdot \ell}}}\]
    3. Taylor expanded around inf 38.0

      \[\leadsto t \cdot \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot {t}^{2} + \left(2 \cdot \frac{{\ell}^{2}}{x} + 4 \cdot \frac{{t}^{2}}{x}\right)}}}\]
    4. Simplified38.0

      \[\leadsto t \cdot \frac{\sqrt{2}}{\sqrt{\color{blue}{\mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \mathsf{fma}\left(t, t, \frac{\ell \cdot \ell}{x}\right)\right)}}}\]
    5. Taylor expanded around inf 13.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -8.435929301784521604503627472201569663835 \cdot 10^{106}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\frac{2}{\frac{\left(2 \cdot \left(x \cdot x\right)\right) \cdot \sqrt{2}}{t}} - \mathsf{fma}\left(t, \sqrt{2}, \frac{2 \cdot \frac{t}{\sqrt{2}}}{x}\right)}\\ \mathbf{elif}\;t \le -8.68838282607017033593451153364695886961 \cdot 10^{-163}:\\ \;\;\;\;\sqrt{\frac{2}{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right), \left(\frac{t}{x} \cdot 4\right) \cdot t\right)}} \cdot t\\ \mathbf{elif}\;t \le -1.619144312720762822244529648017528882505 \cdot 10^{-287}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\frac{2}{\frac{\left(2 \cdot \left(x \cdot x\right)\right) \cdot \sqrt{2}}{t}} - \mathsf{fma}\left(t, \sqrt{2}, \frac{2 \cdot \frac{t}{\sqrt{2}}}{x}\right)}\\ \mathbf{elif}\;t \le 4.008879664456036295439864906185096395333 \cdot 10^{-293} \lor \neg \left(t \le 5.581589580614109566525168164749869984689 \cdot 10^{-155}\right) \land t \le 730958659336468015611904:\\ \;\;\;\;\sqrt{\frac{2}{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right), \left(\frac{t}{x} \cdot 4\right) \cdot t\right)}} \cdot t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(2, \frac{\frac{t}{\sqrt{2}}}{x} - \frac{\frac{t}{x \cdot x}}{2 \cdot \sqrt{2}}, \sqrt{2} \cdot t\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 2019194 +o rules:numerics
(FPCore (x l t)
  :name "Toniolo and Linder, Equation (7)"
  (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))