Average Error: 43.2 → 8.9
Time: 11.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 -7.02224939412324 \cdot 10^{130}:\\ \;\;\;\;\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 3.4154862987809272 \cdot 10^{106}:\\ \;\;\;\;\frac{\sqrt{\sqrt{\sqrt[3]{2} \cdot \sqrt[3]{2}}} \cdot \left(\sqrt{\sqrt{\sqrt[3]{2}}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{\ell}{\frac{x}{\ell}}, 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 -7.02224939412324 \cdot 10^{130}:\\
\;\;\;\;\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 3.4154862987809272 \cdot 10^{106}:\\
\;\;\;\;\frac{\sqrt{\sqrt{\sqrt[3]{2} \cdot \sqrt[3]{2}}} \cdot \left(\sqrt{\sqrt{\sqrt[3]{2}}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{\ell}{\frac{x}{\ell}}, 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 r35657 = 2.0;
        double r35658 = sqrt(r35657);
        double r35659 = t;
        double r35660 = r35658 * r35659;
        double r35661 = x;
        double r35662 = 1.0;
        double r35663 = r35661 + r35662;
        double r35664 = r35661 - r35662;
        double r35665 = r35663 / r35664;
        double r35666 = l;
        double r35667 = r35666 * r35666;
        double r35668 = r35659 * r35659;
        double r35669 = r35657 * r35668;
        double r35670 = r35667 + r35669;
        double r35671 = r35665 * r35670;
        double r35672 = r35671 - r35667;
        double r35673 = sqrt(r35672);
        double r35674 = r35660 / r35673;
        return r35674;
}

double f(double x, double l, double t) {
        double r35675 = t;
        double r35676 = -7.02224939412324e+130;
        bool r35677 = r35675 <= r35676;
        double r35678 = 2.0;
        double r35679 = sqrt(r35678);
        double r35680 = r35679 * r35675;
        double r35681 = 3.0;
        double r35682 = pow(r35679, r35681);
        double r35683 = x;
        double r35684 = 2.0;
        double r35685 = pow(r35683, r35684);
        double r35686 = r35682 * r35685;
        double r35687 = r35675 / r35686;
        double r35688 = r35679 * r35685;
        double r35689 = r35675 / r35688;
        double r35690 = r35679 * r35683;
        double r35691 = r35675 / r35690;
        double r35692 = r35675 * r35679;
        double r35693 = fma(r35678, r35691, r35692);
        double r35694 = fma(r35678, r35689, r35693);
        double r35695 = -r35694;
        double r35696 = fma(r35678, r35687, r35695);
        double r35697 = r35680 / r35696;
        double r35698 = 3.415486298780927e+106;
        bool r35699 = r35675 <= r35698;
        double r35700 = cbrt(r35678);
        double r35701 = r35700 * r35700;
        double r35702 = sqrt(r35701);
        double r35703 = sqrt(r35702);
        double r35704 = sqrt(r35700);
        double r35705 = sqrt(r35704);
        double r35706 = sqrt(r35679);
        double r35707 = r35706 * r35675;
        double r35708 = r35705 * r35707;
        double r35709 = r35703 * r35708;
        double r35710 = pow(r35675, r35684);
        double r35711 = l;
        double r35712 = r35683 / r35711;
        double r35713 = r35711 / r35712;
        double r35714 = 4.0;
        double r35715 = r35710 / r35683;
        double r35716 = r35714 * r35715;
        double r35717 = fma(r35678, r35713, r35716);
        double r35718 = fma(r35678, r35710, r35717);
        double r35719 = sqrt(r35718);
        double r35720 = r35709 / r35719;
        double r35721 = r35678 * r35687;
        double r35722 = r35693 - r35721;
        double r35723 = fma(r35678, r35689, r35722);
        double r35724 = r35680 / r35723;
        double r35725 = r35699 ? r35720 : r35724;
        double r35726 = r35677 ? r35697 : r35725;
        return r35726;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -7.02224939412324e+130

    1. Initial program 55.3

      \[\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.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(2 \cdot \frac{t}{\sqrt{2} \cdot x} + t \cdot \sqrt{2}\right)\right)}}\]
    3. Simplified2.2

      \[\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 -7.02224939412324e+130 < t < 3.415486298780927e+106

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.415486298780927e+106 < t

    1. Initial program 53.1

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -7.02224939412324 \cdot 10^{130}:\\ \;\;\;\;\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 3.4154862987809272 \cdot 10^{106}:\\ \;\;\;\;\frac{\sqrt{\sqrt{\sqrt[3]{2} \cdot \sqrt[3]{2}}} \cdot \left(\sqrt{\sqrt{\sqrt[3]{2}}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)\right)}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{\ell}{\frac{x}{\ell}}, 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 2020035 +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)))))