Average Error: 42.5 → 9.1
Time: 42.5s
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 -2.661507795721962 \cdot 10^{+93}:\\ \;\;\;\;\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.088323180304518 \cdot 10^{+139}:\\ \;\;\;\;\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, \mathsf{fma}\left(\ell, \frac{\ell}{x}, t \cdot t\right), \left(4 \cdot t\right) \cdot \frac{t}{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 -2.661507795721962 \cdot 10^{+93}:\\
\;\;\;\;\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.088323180304518 \cdot 10^{+139}:\\
\;\;\;\;\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, \mathsf{fma}\left(\ell, \frac{\ell}{x}, t \cdot t\right), \left(4 \cdot t\right) \cdot \frac{t}{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 r1022057 = 2.0;
        double r1022058 = sqrt(r1022057);
        double r1022059 = t;
        double r1022060 = r1022058 * r1022059;
        double r1022061 = x;
        double r1022062 = 1.0;
        double r1022063 = r1022061 + r1022062;
        double r1022064 = r1022061 - r1022062;
        double r1022065 = r1022063 / r1022064;
        double r1022066 = l;
        double r1022067 = r1022066 * r1022066;
        double r1022068 = r1022059 * r1022059;
        double r1022069 = r1022057 * r1022068;
        double r1022070 = r1022067 + r1022069;
        double r1022071 = r1022065 * r1022070;
        double r1022072 = r1022071 - r1022067;
        double r1022073 = sqrt(r1022072);
        double r1022074 = r1022060 / r1022073;
        return r1022074;
}

double f(double x, double l, double t) {
        double r1022075 = t;
        double r1022076 = -2.661507795721962e+93;
        bool r1022077 = r1022075 <= r1022076;
        double r1022078 = 2.0;
        double r1022079 = sqrt(r1022078);
        double r1022080 = r1022079 * r1022075;
        double r1022081 = r1022075 / r1022079;
        double r1022082 = x;
        double r1022083 = r1022082 * r1022082;
        double r1022084 = r1022081 / r1022083;
        double r1022085 = r1022081 / r1022082;
        double r1022086 = r1022078 / r1022082;
        double r1022087 = r1022086 * r1022085;
        double r1022088 = fma(r1022085, r1022078, r1022087);
        double r1022089 = fma(r1022075, r1022079, r1022088);
        double r1022090 = r1022084 - r1022089;
        double r1022091 = r1022080 / r1022090;
        double r1022092 = 4.088323180304518e+139;
        bool r1022093 = r1022075 <= r1022092;
        double r1022094 = cbrt(r1022079);
        double r1022095 = r1022094 * r1022075;
        double r1022096 = r1022094 * r1022094;
        double r1022097 = r1022095 * r1022096;
        double r1022098 = l;
        double r1022099 = r1022098 / r1022082;
        double r1022100 = r1022075 * r1022075;
        double r1022101 = fma(r1022098, r1022099, r1022100);
        double r1022102 = 4.0;
        double r1022103 = r1022102 * r1022075;
        double r1022104 = r1022075 / r1022082;
        double r1022105 = r1022103 * r1022104;
        double r1022106 = fma(r1022078, r1022101, r1022105);
        double r1022107 = sqrt(r1022106);
        double r1022108 = r1022097 / r1022107;
        double r1022109 = r1022078 / r1022083;
        double r1022110 = fma(r1022078, r1022085, r1022080);
        double r1022111 = r1022110 - r1022084;
        double r1022112 = fma(r1022109, r1022081, r1022111);
        double r1022113 = r1022080 / r1022112;
        double r1022114 = r1022093 ? r1022108 : r1022113;
        double r1022115 = r1022077 ? r1022091 : r1022114;
        return r1022115;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -2.661507795721962e+93

    1. Initial program 50.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 3.1

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

      \[\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 -2.661507795721962e+93 < t < 4.088323180304518e+139

    1. Initial program 35.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.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. Simplified12.9

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

      \[\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 *-un-lft-identity12.9

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{1 \cdot \mathsf{fma}\left(2, \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)}}}\]
    8. Applied sqrt-prod12.9

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{\sqrt{1} \cdot \sqrt{\mathsf{fma}\left(2, \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)}}}\]
    9. Simplified12.9

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{1} \cdot \sqrt{\mathsf{fma}\left(2, \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)}}\]
    10. Simplified12.9

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

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

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

    if 4.088323180304518e+139 < t

    1. Initial program 57.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 2.1

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

      \[\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 -2.661507795721962 \cdot 10^{+93}:\\ \;\;\;\;\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.088323180304518 \cdot 10^{+139}:\\ \;\;\;\;\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, \mathsf{fma}\left(\ell, \frac{\ell}{x}, t \cdot t\right), \left(4 \cdot t\right) \cdot \frac{t}{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 2019151 +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)))))