Average Error: 43.0 → 9.7
Time: 29.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 -8543336356588510030856192:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\ \mathbf{elif}\;t \le -8.549619549454067904050788555376770008695 \cdot 10^{-265}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}}}\\ \mathbf{elif}\;t \le -1.402005127257352814267210643002199774407 \cdot 10^{-302}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\ \mathbf{elif}\;t \le 6.335165898555757118212433419014376963533 \cdot 10^{148}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right) - \frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{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 -8543336356588510030856192:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\

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

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

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

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

\end{array}
double f(double x, double l, double t) {
        double r48657 = 2.0;
        double r48658 = sqrt(r48657);
        double r48659 = t;
        double r48660 = r48658 * r48659;
        double r48661 = x;
        double r48662 = 1.0;
        double r48663 = r48661 + r48662;
        double r48664 = r48661 - r48662;
        double r48665 = r48663 / r48664;
        double r48666 = l;
        double r48667 = r48666 * r48666;
        double r48668 = r48659 * r48659;
        double r48669 = r48657 * r48668;
        double r48670 = r48667 + r48669;
        double r48671 = r48665 * r48670;
        double r48672 = r48671 - r48667;
        double r48673 = sqrt(r48672);
        double r48674 = r48660 / r48673;
        return r48674;
}

double f(double x, double l, double t) {
        double r48675 = t;
        double r48676 = -8.54333635658851e+24;
        bool r48677 = r48675 <= r48676;
        double r48678 = 2.0;
        double r48679 = sqrt(r48678);
        double r48680 = r48679 * r48675;
        double r48681 = x;
        double r48682 = 2.0;
        double r48683 = pow(r48681, r48682);
        double r48684 = r48675 / r48683;
        double r48685 = r48678 * r48679;
        double r48686 = r48678 / r48685;
        double r48687 = r48678 / r48679;
        double r48688 = r48686 - r48687;
        double r48689 = r48684 * r48688;
        double r48690 = r48679 * r48681;
        double r48691 = r48675 / r48690;
        double r48692 = r48675 * r48679;
        double r48693 = fma(r48678, r48691, r48692);
        double r48694 = r48689 - r48693;
        double r48695 = r48680 / r48694;
        double r48696 = -8.549619549454068e-265;
        bool r48697 = r48675 <= r48696;
        double r48698 = l;
        double r48699 = r48698 / r48681;
        double r48700 = r48698 * r48699;
        double r48701 = fma(r48675, r48675, r48700);
        double r48702 = 4.0;
        double r48703 = pow(r48675, r48682);
        double r48704 = r48703 / r48681;
        double r48705 = r48702 * r48704;
        double r48706 = fma(r48678, r48701, r48705);
        double r48707 = sqrt(r48706);
        double r48708 = sqrt(r48707);
        double r48709 = r48708 * r48708;
        double r48710 = r48680 / r48709;
        double r48711 = -1.4020051272573528e-302;
        bool r48712 = r48675 <= r48711;
        double r48713 = 6.335165898555757e+148;
        bool r48714 = r48675 <= r48713;
        double r48715 = r48693 - r48689;
        double r48716 = r48680 / r48715;
        double r48717 = r48714 ? r48710 : r48716;
        double r48718 = r48712 ? r48695 : r48717;
        double r48719 = r48697 ? r48710 : r48718;
        double r48720 = r48677 ? r48695 : r48719;
        return r48720;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -8.54333635658851e+24 or -8.549619549454068e-265 < t < -1.4020051272573528e-302

    1. Initial program 44.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 7.6

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

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

    if -8.54333635658851e+24 < t < -8.549619549454068e-265 or -1.4020051272573528e-302 < t < 6.335165898555757e+148

    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.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. Simplified17.1

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

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

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

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

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

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

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

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

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

    if 6.335165898555757e+148 < t

    1. Initial program 60.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 1.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -8543336356588510030856192:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\ \mathbf{elif}\;t \le -8.549619549454067904050788555376770008695 \cdot 10^{-265}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}}}\\ \mathbf{elif}\;t \le -1.402005127257352814267210643002199774407 \cdot 10^{-302}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\ \mathbf{elif}\;t \le 6.335165898555757118212433419014376963533 \cdot 10^{148}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right) - \frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right)}\\ \end{array}\]

Reproduce

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