Average Error: 42.3 → 9.0
Time: 32.7s
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.081620194545127 \cdot 10^{+107}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x}, 2, -\mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \frac{2}{x} \cdot \frac{\frac{t}{\sqrt{2}}}{x}\right)\right)\right)}\\ \mathbf{elif}\;t \le 4.561118037024944 \cdot 10^{+59}:\\ \;\;\;\;\frac{\left(\sqrt[3]{\sqrt{2}} \cdot t\right) \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(2, t \cdot t, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, \frac{\ell}{\frac{x}{\ell}} \cdot 2\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(-2, \frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x}, \mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \frac{2}{x} \cdot \frac{\frac{t}{\sqrt{2}}}{x}\right)\right)\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.081620194545127 \cdot 10^{+107}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x}, 2, -\mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \frac{2}{x} \cdot \frac{\frac{t}{\sqrt{2}}}{x}\right)\right)\right)}\\

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

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

\end{array}
double f(double x, double l, double t) {
        double r981657 = 2.0;
        double r981658 = sqrt(r981657);
        double r981659 = t;
        double r981660 = r981658 * r981659;
        double r981661 = x;
        double r981662 = 1.0;
        double r981663 = r981661 + r981662;
        double r981664 = r981661 - r981662;
        double r981665 = r981663 / r981664;
        double r981666 = l;
        double r981667 = r981666 * r981666;
        double r981668 = r981659 * r981659;
        double r981669 = r981657 * r981668;
        double r981670 = r981667 + r981669;
        double r981671 = r981665 * r981670;
        double r981672 = r981671 - r981667;
        double r981673 = sqrt(r981672);
        double r981674 = r981660 / r981673;
        return r981674;
}

double f(double x, double l, double t) {
        double r981675 = t;
        double r981676 = -6.081620194545127e+107;
        bool r981677 = r981675 <= r981676;
        double r981678 = 2.0;
        double r981679 = sqrt(r981678);
        double r981680 = r981679 * r981675;
        double r981681 = r981675 / r981679;
        double r981682 = r981681 / r981678;
        double r981683 = x;
        double r981684 = r981683 * r981683;
        double r981685 = r981682 / r981684;
        double r981686 = r981678 / r981683;
        double r981687 = r981681 / r981683;
        double r981688 = r981686 * r981687;
        double r981689 = fma(r981675, r981679, r981688);
        double r981690 = fma(r981686, r981681, r981689);
        double r981691 = -r981690;
        double r981692 = fma(r981685, r981678, r981691);
        double r981693 = r981680 / r981692;
        double r981694 = 4.561118037024944e+59;
        bool r981695 = r981675 <= r981694;
        double r981696 = cbrt(r981679);
        double r981697 = r981696 * r981675;
        double r981698 = r981696 * r981696;
        double r981699 = r981697 * r981698;
        double r981700 = r981675 * r981675;
        double r981701 = r981700 / r981683;
        double r981702 = 4.0;
        double r981703 = l;
        double r981704 = r981683 / r981703;
        double r981705 = r981703 / r981704;
        double r981706 = r981705 * r981678;
        double r981707 = fma(r981701, r981702, r981706);
        double r981708 = fma(r981678, r981700, r981707);
        double r981709 = sqrt(r981708);
        double r981710 = r981699 / r981709;
        double r981711 = -2.0;
        double r981712 = fma(r981711, r981685, r981690);
        double r981713 = r981680 / r981712;
        double r981714 = r981695 ? r981710 : r981713;
        double r981715 = r981677 ? r981693 : r981714;
        return r981715;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -6.081620194545127e+107

    1. Initial program 51.2

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

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

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

    if -6.081620194545127e+107 < t < 4.561118037024944e+59

    1. Initial program 37.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.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. Simplified17.4

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\mathsf{fma}\left(2, t \cdot t, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, \frac{\ell \cdot \ell}{x} \cdot 2\right)\right)}}}\]
    4. Using strategy rm
    5. Applied associate-/l*13.6

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

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

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

    if 4.561118037024944e+59 < t

    1. Initial program 45.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 3.5

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

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

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

Reproduce

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