Average Error: 42.9 → 12.2
Time: 10.1s
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 -6.9713348016436594 \cdot 10^{-265}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}, -\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)\right)\right)}\\ \mathbf{elif}\;t \le 1.7717133594264462 \cdot 10^{69}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \left(\frac{{\left(\sqrt[3]{\ell}\right)}^{4}}{\sqrt[3]{x}} \cdot \frac{\left|\sqrt[3]{\ell}\right|}{\sqrt[3]{x}}\right) \cdot \frac{\sqrt{{\left(\sqrt[3]{\ell}\right)}^{2}}}{\sqrt[3]{x}}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right) - 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 -6.9713348016436594 \cdot 10^{-265}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}, -\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)\right)\right)}\\

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

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

\end{array}
double f(double x, double l, double t) {
        double r41611 = 2.0;
        double r41612 = sqrt(r41611);
        double r41613 = t;
        double r41614 = r41612 * r41613;
        double r41615 = x;
        double r41616 = 1.0;
        double r41617 = r41615 + r41616;
        double r41618 = r41615 - r41616;
        double r41619 = r41617 / r41618;
        double r41620 = l;
        double r41621 = r41620 * r41620;
        double r41622 = r41613 * r41613;
        double r41623 = r41611 * r41622;
        double r41624 = r41621 + r41623;
        double r41625 = r41619 * r41624;
        double r41626 = r41625 - r41621;
        double r41627 = sqrt(r41626);
        double r41628 = r41614 / r41627;
        return r41628;
}

double f(double x, double l, double t) {
        double r41629 = t;
        double r41630 = -6.971334801643659e-265;
        bool r41631 = r41629 <= r41630;
        double r41632 = 2.0;
        double r41633 = sqrt(r41632);
        double r41634 = r41633 * r41629;
        double r41635 = 3.0;
        double r41636 = pow(r41633, r41635);
        double r41637 = x;
        double r41638 = 2.0;
        double r41639 = pow(r41637, r41638);
        double r41640 = r41636 * r41639;
        double r41641 = r41629 / r41640;
        double r41642 = r41633 * r41639;
        double r41643 = r41629 / r41642;
        double r41644 = r41633 * r41637;
        double r41645 = r41629 / r41644;
        double r41646 = r41629 * r41633;
        double r41647 = fma(r41632, r41645, r41646);
        double r41648 = fma(r41632, r41643, r41647);
        double r41649 = -r41648;
        double r41650 = fma(r41632, r41641, r41649);
        double r41651 = r41634 / r41650;
        double r41652 = 1.771713359426446e+69;
        bool r41653 = r41629 <= r41652;
        double r41654 = pow(r41629, r41638);
        double r41655 = l;
        double r41656 = cbrt(r41655);
        double r41657 = 4.0;
        double r41658 = pow(r41656, r41657);
        double r41659 = cbrt(r41637);
        double r41660 = r41658 / r41659;
        double r41661 = fabs(r41656);
        double r41662 = r41661 / r41659;
        double r41663 = r41660 * r41662;
        double r41664 = pow(r41656, r41638);
        double r41665 = sqrt(r41664);
        double r41666 = r41665 / r41659;
        double r41667 = r41663 * r41666;
        double r41668 = 4.0;
        double r41669 = r41654 / r41637;
        double r41670 = r41668 * r41669;
        double r41671 = fma(r41632, r41667, r41670);
        double r41672 = fma(r41632, r41654, r41671);
        double r41673 = sqrt(r41672);
        double r41674 = r41634 / r41673;
        double r41675 = r41632 * r41641;
        double r41676 = r41647 - r41675;
        double r41677 = fma(r41632, r41643, r41676);
        double r41678 = r41634 / r41677;
        double r41679 = r41653 ? r41674 : r41678;
        double r41680 = r41631 ? r41651 : r41679;
        return r41680;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -6.971334801643659e-265

    1. Initial program 41.5

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

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

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

    if -6.971334801643659e-265 < t < 1.771713359426446e+69

    1. Initial program 41.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 18.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. Simplified18.6

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, {\left(\sqrt[3]{\ell}\right)}^{4} \cdot \frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\]
    12. Applied add-sqr-sqrt16.1

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, {\left(\sqrt[3]{\ell}\right)}^{4} \cdot \color{blue}{\left(\frac{\sqrt{{\left(\sqrt[3]{\ell}\right)}^{2}}}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\sqrt{{\left(\sqrt[3]{\ell}\right)}^{2}}}{\sqrt[3]{x}}\right)}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\]
    14. Applied associate-*r*16.1

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

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

    if 1.771713359426446e+69 < t

    1. Initial program 47.5

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -6.9713348016436594 \cdot 10^{-265}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}, -\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)\right)\right)}\\ \mathbf{elif}\;t \le 1.7717133594264462 \cdot 10^{69}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \left(\frac{{\left(\sqrt[3]{\ell}\right)}^{4}}{\sqrt[3]{x}} \cdot \frac{\left|\sqrt[3]{\ell}\right|}{\sqrt[3]{x}}\right) \cdot \frac{\sqrt{{\left(\sqrt[3]{\ell}\right)}^{2}}}{\sqrt[3]{x}}, 4 \cdot \frac{{t}^{2}}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot {x}^{2}}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right) - 2 \cdot \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}\right)}\\ \end{array}\]

Reproduce

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