Average Error: 42.9 → 10.0
Time: 10.2s
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 -1.76577991310669669 \cdot 10^{-26}:\\ \;\;\;\;\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 -2.9584637926800251 \cdot 10^{-203}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{\ell}{\frac{x}{\ell}}, 4 \cdot \left({\left(\sqrt[3]{t}\right)}^{4} \cdot \frac{{\left(\sqrt[3]{t}\right)}^{2}}{x}\right)\right)\right)}}\\ \mathbf{elif}\;t \le -1.4640217334256062 \cdot 10^{-238}:\\ \;\;\;\;\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.2953282500941115 \cdot 10^{113}:\\ \;\;\;\;\frac{\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)}}\\ \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 -1.76577991310669669 \cdot 10^{-26}:\\
\;\;\;\;\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 -2.9584637926800251 \cdot 10^{-203}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{\ell}{\frac{x}{\ell}}, 4 \cdot \left({\left(\sqrt[3]{t}\right)}^{4} \cdot \frac{{\left(\sqrt[3]{t}\right)}^{2}}{x}\right)\right)\right)}}\\

\mathbf{elif}\;t \le -1.4640217334256062 \cdot 10^{-238}:\\
\;\;\;\;\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.2953282500941115 \cdot 10^{113}:\\
\;\;\;\;\frac{\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)}}\\

\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 r41635 = 2.0;
        double r41636 = sqrt(r41635);
        double r41637 = t;
        double r41638 = r41636 * r41637;
        double r41639 = x;
        double r41640 = 1.0;
        double r41641 = r41639 + r41640;
        double r41642 = r41639 - r41640;
        double r41643 = r41641 / r41642;
        double r41644 = l;
        double r41645 = r41644 * r41644;
        double r41646 = r41637 * r41637;
        double r41647 = r41635 * r41646;
        double r41648 = r41645 + r41647;
        double r41649 = r41643 * r41648;
        double r41650 = r41649 - r41645;
        double r41651 = sqrt(r41650);
        double r41652 = r41638 / r41651;
        return r41652;
}

double f(double x, double l, double t) {
        double r41653 = t;
        double r41654 = -1.7657799131066967e-26;
        bool r41655 = r41653 <= r41654;
        double r41656 = 2.0;
        double r41657 = sqrt(r41656);
        double r41658 = r41657 * r41653;
        double r41659 = 3.0;
        double r41660 = pow(r41657, r41659);
        double r41661 = x;
        double r41662 = 2.0;
        double r41663 = pow(r41661, r41662);
        double r41664 = r41660 * r41663;
        double r41665 = r41653 / r41664;
        double r41666 = r41657 * r41663;
        double r41667 = r41653 / r41666;
        double r41668 = r41657 * r41661;
        double r41669 = r41653 / r41668;
        double r41670 = r41653 * r41657;
        double r41671 = fma(r41656, r41669, r41670);
        double r41672 = fma(r41656, r41667, r41671);
        double r41673 = -r41672;
        double r41674 = fma(r41656, r41665, r41673);
        double r41675 = r41658 / r41674;
        double r41676 = -2.958463792680025e-203;
        bool r41677 = r41653 <= r41676;
        double r41678 = pow(r41653, r41662);
        double r41679 = l;
        double r41680 = r41661 / r41679;
        double r41681 = r41679 / r41680;
        double r41682 = 4.0;
        double r41683 = cbrt(r41653);
        double r41684 = 4.0;
        double r41685 = pow(r41683, r41684);
        double r41686 = pow(r41683, r41662);
        double r41687 = r41686 / r41661;
        double r41688 = r41685 * r41687;
        double r41689 = r41682 * r41688;
        double r41690 = fma(r41656, r41681, r41689);
        double r41691 = fma(r41656, r41678, r41690);
        double r41692 = sqrt(r41691);
        double r41693 = r41658 / r41692;
        double r41694 = -1.4640217334256062e-238;
        bool r41695 = r41653 <= r41694;
        double r41696 = 1.2953282500941115e+113;
        bool r41697 = r41653 <= r41696;
        double r41698 = sqrt(r41657);
        double r41699 = r41698 * r41653;
        double r41700 = r41698 * r41699;
        double r41701 = r41678 / r41661;
        double r41702 = r41682 * r41701;
        double r41703 = fma(r41656, r41681, r41702);
        double r41704 = fma(r41656, r41678, r41703);
        double r41705 = sqrt(r41704);
        double r41706 = r41700 / r41705;
        double r41707 = r41656 * r41665;
        double r41708 = r41671 - r41707;
        double r41709 = fma(r41656, r41667, r41708);
        double r41710 = r41658 / r41709;
        double r41711 = r41697 ? r41706 : r41710;
        double r41712 = r41695 ? r41675 : r41711;
        double r41713 = r41677 ? r41693 : r41712;
        double r41714 = r41655 ? r41675 : r41713;
        return r41714;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 4 regimes
  2. if t < -1.7657799131066967e-26 or -2.958463792680025e-203 < t < -1.4640217334256062e-238

    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 8.5

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

      \[\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 -1.7657799131066967e-26 < t < -2.958463792680025e-203

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

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

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

      \[\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*11.4

      \[\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 *-un-lft-identity11.4

      \[\leadsto \frac{\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}}{\color{blue}{1 \cdot x}}\right)\right)}}\]
    9. Applied add-cube-cbrt11.4

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

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

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

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

    if -1.4640217334256062e-238 < t < 1.2953282500941115e+113

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

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

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

      \[\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*14.6

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

      \[\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-prod14.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*14.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)}}\]

    if 1.2953282500941115e+113 < t

    1. Initial program 52.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 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}}, \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 4 regimes into one program.
  4. Final simplification10.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.76577991310669669 \cdot 10^{-26}:\\ \;\;\;\;\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 -2.9584637926800251 \cdot 10^{-203}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, {t}^{2}, \mathsf{fma}\left(2, \frac{\ell}{\frac{x}{\ell}}, 4 \cdot \left({\left(\sqrt[3]{t}\right)}^{4} \cdot \frac{{\left(\sqrt[3]{t}\right)}^{2}}{x}\right)\right)\right)}}\\ \mathbf{elif}\;t \le -1.4640217334256062 \cdot 10^{-238}:\\ \;\;\;\;\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.2953282500941115 \cdot 10^{113}:\\ \;\;\;\;\frac{\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)}}\\ \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 2020059 +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)))))