Average Error: 42.5 → 9.7
Time: 45.8s
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.4981693604397794 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t \cdot -2}{\sqrt{2} \cdot x} - \sqrt{2} \cdot t}\\ \mathbf{elif}\;t \le 1.0624147501299982 \cdot 10^{-249}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)}}\right) \cdot \left(\sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)}\right), \frac{t \cdot \left(t \cdot 4\right)}{x}\right)}}\\ \mathbf{elif}\;t \le 1.5173692864293495 \cdot 10^{-227}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x \cdot x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(2, \frac{\frac{t}{\sqrt{2}}}{x}, \sqrt{2} \cdot t\right) - \frac{\frac{t}{\sqrt{2}}}{x \cdot x}\right)}\\ \mathbf{elif}\;t \le 4.169836755076731 \cdot 10^{+68}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)}}\right) \cdot \left(\sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)}\right), \frac{t \cdot \left(t \cdot 4\right)}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x \cdot x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(2, \frac{\frac{t}{\sqrt{2}}}{x}, \sqrt{2} \cdot t\right) - \frac{\frac{t}{\sqrt{2}}}{x \cdot x}\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 -4.4981693604397794 \cdot 10^{-29}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t \cdot -2}{\sqrt{2} \cdot x} - \sqrt{2} \cdot t}\\

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

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

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

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

\end{array}
double f(double x, double l, double t) {
        double r1239496 = 2.0;
        double r1239497 = sqrt(r1239496);
        double r1239498 = t;
        double r1239499 = r1239497 * r1239498;
        double r1239500 = x;
        double r1239501 = 1.0;
        double r1239502 = r1239500 + r1239501;
        double r1239503 = r1239500 - r1239501;
        double r1239504 = r1239502 / r1239503;
        double r1239505 = l;
        double r1239506 = r1239505 * r1239505;
        double r1239507 = r1239498 * r1239498;
        double r1239508 = r1239496 * r1239507;
        double r1239509 = r1239506 + r1239508;
        double r1239510 = r1239504 * r1239509;
        double r1239511 = r1239510 - r1239506;
        double r1239512 = sqrt(r1239511);
        double r1239513 = r1239499 / r1239512;
        return r1239513;
}

double f(double x, double l, double t) {
        double r1239514 = t;
        double r1239515 = -4.4981693604397794e-29;
        bool r1239516 = r1239514 <= r1239515;
        double r1239517 = 2.0;
        double r1239518 = sqrt(r1239517);
        double r1239519 = r1239518 * r1239514;
        double r1239520 = -2.0;
        double r1239521 = r1239514 * r1239520;
        double r1239522 = x;
        double r1239523 = r1239518 * r1239522;
        double r1239524 = r1239521 / r1239523;
        double r1239525 = r1239524 - r1239519;
        double r1239526 = r1239519 / r1239525;
        double r1239527 = 1.0624147501299982e-249;
        bool r1239528 = r1239514 <= r1239527;
        double r1239529 = l;
        double r1239530 = r1239522 / r1239529;
        double r1239531 = r1239529 / r1239530;
        double r1239532 = fma(r1239514, r1239514, r1239531);
        double r1239533 = cbrt(r1239532);
        double r1239534 = r1239533 * r1239533;
        double r1239535 = cbrt(r1239534);
        double r1239536 = cbrt(r1239533);
        double r1239537 = r1239535 * r1239536;
        double r1239538 = r1239537 * r1239534;
        double r1239539 = 4.0;
        double r1239540 = r1239514 * r1239539;
        double r1239541 = r1239514 * r1239540;
        double r1239542 = r1239541 / r1239522;
        double r1239543 = fma(r1239517, r1239538, r1239542);
        double r1239544 = sqrt(r1239543);
        double r1239545 = r1239519 / r1239544;
        double r1239546 = 1.5173692864293495e-227;
        bool r1239547 = r1239514 <= r1239546;
        double r1239548 = r1239522 * r1239522;
        double r1239549 = r1239517 / r1239548;
        double r1239550 = r1239514 / r1239518;
        double r1239551 = r1239550 / r1239522;
        double r1239552 = fma(r1239517, r1239551, r1239519);
        double r1239553 = r1239550 / r1239548;
        double r1239554 = r1239552 - r1239553;
        double r1239555 = fma(r1239549, r1239550, r1239554);
        double r1239556 = r1239519 / r1239555;
        double r1239557 = 4.169836755076731e+68;
        bool r1239558 = r1239514 <= r1239557;
        double r1239559 = r1239558 ? r1239545 : r1239556;
        double r1239560 = r1239547 ? r1239556 : r1239559;
        double r1239561 = r1239528 ? r1239545 : r1239560;
        double r1239562 = r1239516 ? r1239526 : r1239561;
        return r1239562;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -4.4981693604397794e-29

    1. Initial program 40.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 36.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. Simplified33.7

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{-\left(t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right)}}\]
    5. Simplified6.4

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{\frac{-2 \cdot t}{x \cdot \sqrt{2}} - \sqrt{2} \cdot t}}\]

    if -4.4981693604397794e-29 < t < 1.0624147501299982e-249 or 1.5173692864293495e-227 < t < 4.169836755076731e+68

    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 17.7

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

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

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

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

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

    if 1.0624147501299982e-249 < t < 1.5173692864293495e-227 or 4.169836755076731e+68 < t

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -4.4981693604397794 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t \cdot -2}{\sqrt{2} \cdot x} - \sqrt{2} \cdot t}\\ \mathbf{elif}\;t \le 1.0624147501299982 \cdot 10^{-249}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)}}\right) \cdot \left(\sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)}\right), \frac{t \cdot \left(t \cdot 4\right)}{x}\right)}}\\ \mathbf{elif}\;t \le 1.5173692864293495 \cdot 10^{-227}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x \cdot x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(2, \frac{\frac{t}{\sqrt{2}}}{x}, \sqrt{2} \cdot t\right) - \frac{\frac{t}{\sqrt{2}}}{x \cdot x}\right)}\\ \mathbf{elif}\;t \le 4.169836755076731 \cdot 10^{+68}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)}}\right) \cdot \left(\sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)}\right), \frac{t \cdot \left(t \cdot 4\right)}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x \cdot x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(2, \frac{\frac{t}{\sqrt{2}}}{x}, \sqrt{2} \cdot t\right) - \frac{\frac{t}{\sqrt{2}}}{x \cdot x}\right)}\\ \end{array}\]

Reproduce

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