Average Error: 43.3 → 9.7
Time: 35.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 -5.8966186448062604 \cdot 10^{70}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{2 \cdot \left(\frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}} - \frac{t}{\sqrt{2} \cdot {x}^{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\ \mathbf{elif}\;t \le 1.54970592101093 \cdot 10^{104}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{{t}^{2}}{x}, \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right) \cdot 2\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}} + \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2} - 2 \cdot \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{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 -5.8966186448062604 \cdot 10^{70}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{2 \cdot \left(\frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}} - \frac{t}{\sqrt{2} \cdot {x}^{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\

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

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

\end{array}
double f(double x, double l, double t) {
        double r43619 = 2.0;
        double r43620 = sqrt(r43619);
        double r43621 = t;
        double r43622 = r43620 * r43621;
        double r43623 = x;
        double r43624 = 1.0;
        double r43625 = r43623 + r43624;
        double r43626 = r43623 - r43624;
        double r43627 = r43625 / r43626;
        double r43628 = l;
        double r43629 = r43628 * r43628;
        double r43630 = r43621 * r43621;
        double r43631 = r43619 * r43630;
        double r43632 = r43629 + r43631;
        double r43633 = r43627 * r43632;
        double r43634 = r43633 - r43629;
        double r43635 = sqrt(r43634);
        double r43636 = r43622 / r43635;
        return r43636;
}

double f(double x, double l, double t) {
        double r43637 = t;
        double r43638 = -5.89661864480626e+70;
        bool r43639 = r43637 <= r43638;
        double r43640 = 2.0;
        double r43641 = sqrt(r43640);
        double r43642 = r43641 * r43637;
        double r43643 = 3.0;
        double r43644 = pow(r43641, r43643);
        double r43645 = x;
        double r43646 = 2.0;
        double r43647 = pow(r43645, r43646);
        double r43648 = r43644 * r43647;
        double r43649 = r43637 / r43648;
        double r43650 = r43641 * r43647;
        double r43651 = r43637 / r43650;
        double r43652 = r43649 - r43651;
        double r43653 = r43640 * r43652;
        double r43654 = r43641 * r43645;
        double r43655 = r43637 / r43654;
        double r43656 = r43637 * r43641;
        double r43657 = fma(r43640, r43655, r43656);
        double r43658 = r43653 - r43657;
        double r43659 = r43642 / r43658;
        double r43660 = 1.5497059210109297e+104;
        bool r43661 = r43637 <= r43660;
        double r43662 = 4.0;
        double r43663 = pow(r43637, r43646);
        double r43664 = r43663 / r43645;
        double r43665 = l;
        double r43666 = r43645 / r43665;
        double r43667 = r43665 / r43666;
        double r43668 = fma(r43637, r43637, r43667);
        double r43669 = r43668 * r43640;
        double r43670 = fma(r43662, r43664, r43669);
        double r43671 = sqrt(r43670);
        double r43672 = r43642 / r43671;
        double r43673 = r43651 + r43655;
        double r43674 = r43640 * r43649;
        double r43675 = r43656 - r43674;
        double r43676 = fma(r43640, r43673, r43675);
        double r43677 = r43642 / r43676;
        double r43678 = r43661 ? r43672 : r43677;
        double r43679 = r43639 ? r43659 : r43678;
        return r43679;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -5.89661864480626e+70

    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 3.7

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

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

    if -5.89661864480626e+70 < t < 1.5497059210109297e+104

    1. Initial program 38.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 18.8

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

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

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

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

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

    if 1.5497059210109297e+104 < t

    1. Initial program 51.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 2.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -5.8966186448062604 \cdot 10^{70}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{2 \cdot \left(\frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}} - \frac{t}{\sqrt{2} \cdot {x}^{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\ \mathbf{elif}\;t \le 1.54970592101093 \cdot 10^{104}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{{t}^{2}}{x}, \mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right) \cdot 2\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}} + \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2} - 2 \cdot \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}\right)}\\ \end{array}\]

Reproduce

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