Average Error: 41.9 → 9.1
Time: 40.6s
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 -8.954275544416124 \cdot 10^{+61}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{\frac{t}{\sqrt{2}}}{x \cdot x} - \mathsf{fma}\left(t, \sqrt{2}, \mathsf{fma}\left(\frac{\frac{t}{\sqrt{2}}}{x}, 2, \frac{2}{x} \cdot \frac{\frac{t}{\sqrt{2}}}{x}\right)\right)}\\ \mathbf{elif}\;t \le 4.8064993713964147 \cdot 10^{+83}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \sqrt{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)} \cdot \left(\sqrt{\sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)}} \cdot \sqrt{\sqrt[3]{\mathsf{fma}\left(t, t, \frac{\ell}{\frac{x}{\ell}}\right)}}\right), \frac{t \cdot \left(4 \cdot t\right)}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x \cdot x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(2, \frac{\frac{t}{\sqrt{2}}}{x}, \sqrt{2} \cdot t\right) - \frac{\frac{t}{\sqrt{2}}}{x \cdot x}\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 -8.954275544416124 \cdot 10^{+61}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{\frac{t}{\sqrt{2}}}{x \cdot x} - \mathsf{fma}\left(t, \sqrt{2}, \mathsf{fma}\left(\frac{\frac{t}{\sqrt{2}}}{x}, 2, \frac{2}{x} \cdot \frac{\frac{t}{\sqrt{2}}}{x}\right)\right)}\\

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

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

\end{array}
double f(double x, double l, double t) {
        double r965636 = 2.0;
        double r965637 = sqrt(r965636);
        double r965638 = t;
        double r965639 = r965637 * r965638;
        double r965640 = x;
        double r965641 = 1.0;
        double r965642 = r965640 + r965641;
        double r965643 = r965640 - r965641;
        double r965644 = r965642 / r965643;
        double r965645 = l;
        double r965646 = r965645 * r965645;
        double r965647 = r965638 * r965638;
        double r965648 = r965636 * r965647;
        double r965649 = r965646 + r965648;
        double r965650 = r965644 * r965649;
        double r965651 = r965650 - r965646;
        double r965652 = sqrt(r965651);
        double r965653 = r965639 / r965652;
        return r965653;
}

double f(double x, double l, double t) {
        double r965654 = t;
        double r965655 = -8.954275544416124e+61;
        bool r965656 = r965654 <= r965655;
        double r965657 = 2.0;
        double r965658 = sqrt(r965657);
        double r965659 = r965658 * r965654;
        double r965660 = r965654 / r965658;
        double r965661 = x;
        double r965662 = r965661 * r965661;
        double r965663 = r965660 / r965662;
        double r965664 = r965660 / r965661;
        double r965665 = r965657 / r965661;
        double r965666 = r965665 * r965664;
        double r965667 = fma(r965664, r965657, r965666);
        double r965668 = fma(r965654, r965658, r965667);
        double r965669 = r965663 - r965668;
        double r965670 = r965659 / r965669;
        double r965671 = 4.8064993713964147e+83;
        bool r965672 = r965654 <= r965671;
        double r965673 = l;
        double r965674 = r965661 / r965673;
        double r965675 = r965673 / r965674;
        double r965676 = fma(r965654, r965654, r965675);
        double r965677 = sqrt(r965676);
        double r965678 = cbrt(r965676);
        double r965679 = r965678 * r965678;
        double r965680 = sqrt(r965679);
        double r965681 = sqrt(r965678);
        double r965682 = r965680 * r965681;
        double r965683 = r965677 * r965682;
        double r965684 = 4.0;
        double r965685 = r965684 * r965654;
        double r965686 = r965654 * r965685;
        double r965687 = r965686 / r965661;
        double r965688 = fma(r965657, r965683, r965687);
        double r965689 = sqrt(r965688);
        double r965690 = r965659 / r965689;
        double r965691 = r965657 / r965662;
        double r965692 = fma(r965657, r965664, r965659);
        double r965693 = r965692 - r965663;
        double r965694 = fma(r965691, r965660, r965693);
        double r965695 = r965659 / r965694;
        double r965696 = r965672 ? r965690 : r965695;
        double r965697 = r965656 ? r965670 : r965696;
        return r965697;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -8.954275544416124e+61

    1. Initial program 45.8

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

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

    if -8.954275544416124e+61 < t < 4.8064993713964147e+83

    1. Initial program 37.8

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

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

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

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

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

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

    if 4.8064993713964147e+83 < t

    1. Initial program 47.8

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{\left(2 \cdot \frac{t}{\sqrt{2} \cdot {x}^{2}} + \left(t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right)\right) - 2 \cdot \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}}}\]
    3. Simplified3.6

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

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

Reproduce

herbie shell --seed 2019149 +o rules:numerics
(FPCore (x l t)
  :name "Toniolo and Linder, Equation (7)"
  (/ (* (sqrt 2) t) (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l)))))