Average Error: 43.2 → 9.1
Time: 42.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 -3.1802682705108005 \cdot 10^{+108}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{1}{\sqrt{2}} \cdot \frac{t}{x \cdot x} - \mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x} + \frac{t}{x \cdot x}\right)\right)\right)}\\ \mathbf{elif}\;t \le 3.397740654645452 \cdot 10^{+84}:\\ \;\;\;\;\frac{t \cdot \left(\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\ell}{x}\right), \ell, \left(t \cdot t\right)\right)\right), 2, \left(\frac{4 \cdot \left(t \cdot t\right)}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{\frac{2}{x}}{x} \cdot \left(\frac{t}{\sqrt{2}} - \frac{\frac{t}{\sqrt{2}}}{2}\right) + \mathsf{fma}\left(\left(\frac{t}{\sqrt{2} \cdot x}\right), 2, \left(\sqrt{2} \cdot t\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 -3.1802682705108005 \cdot 10^{+108}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{1}{\sqrt{2}} \cdot \frac{t}{x \cdot x} - \mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x} + \frac{t}{x \cdot x}\right)\right)\right)}\\

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

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

\end{array}
double f(double x, double l, double t) {
        double r1591237 = 2.0;
        double r1591238 = sqrt(r1591237);
        double r1591239 = t;
        double r1591240 = r1591238 * r1591239;
        double r1591241 = x;
        double r1591242 = 1.0;
        double r1591243 = r1591241 + r1591242;
        double r1591244 = r1591241 - r1591242;
        double r1591245 = r1591243 / r1591244;
        double r1591246 = l;
        double r1591247 = r1591246 * r1591246;
        double r1591248 = r1591239 * r1591239;
        double r1591249 = r1591237 * r1591248;
        double r1591250 = r1591247 + r1591249;
        double r1591251 = r1591245 * r1591250;
        double r1591252 = r1591251 - r1591247;
        double r1591253 = sqrt(r1591252);
        double r1591254 = r1591240 / r1591253;
        return r1591254;
}

double f(double x, double l, double t) {
        double r1591255 = t;
        double r1591256 = -3.1802682705108005e+108;
        bool r1591257 = r1591255 <= r1591256;
        double r1591258 = 2.0;
        double r1591259 = sqrt(r1591258);
        double r1591260 = r1591259 * r1591255;
        double r1591261 = 1.0;
        double r1591262 = r1591261 / r1591259;
        double r1591263 = x;
        double r1591264 = r1591263 * r1591263;
        double r1591265 = r1591255 / r1591264;
        double r1591266 = r1591262 * r1591265;
        double r1591267 = r1591258 / r1591259;
        double r1591268 = r1591255 / r1591263;
        double r1591269 = r1591268 + r1591265;
        double r1591270 = r1591267 * r1591269;
        double r1591271 = fma(r1591255, r1591259, r1591270);
        double r1591272 = r1591266 - r1591271;
        double r1591273 = r1591260 / r1591272;
        double r1591274 = 3.397740654645452e+84;
        bool r1591275 = r1591255 <= r1591274;
        double r1591276 = sqrt(r1591259);
        double r1591277 = r1591276 * r1591276;
        double r1591278 = r1591255 * r1591277;
        double r1591279 = l;
        double r1591280 = r1591279 / r1591263;
        double r1591281 = r1591255 * r1591255;
        double r1591282 = fma(r1591280, r1591279, r1591281);
        double r1591283 = 4.0;
        double r1591284 = r1591283 * r1591281;
        double r1591285 = r1591284 / r1591263;
        double r1591286 = fma(r1591282, r1591258, r1591285);
        double r1591287 = sqrt(r1591286);
        double r1591288 = r1591278 / r1591287;
        double r1591289 = r1591258 / r1591263;
        double r1591290 = r1591289 / r1591263;
        double r1591291 = r1591255 / r1591259;
        double r1591292 = r1591291 / r1591258;
        double r1591293 = r1591291 - r1591292;
        double r1591294 = r1591290 * r1591293;
        double r1591295 = r1591259 * r1591263;
        double r1591296 = r1591255 / r1591295;
        double r1591297 = fma(r1591296, r1591258, r1591260);
        double r1591298 = r1591294 + r1591297;
        double r1591299 = r1591260 / r1591298;
        double r1591300 = r1591275 ? r1591288 : r1591299;
        double r1591301 = r1591257 ? r1591273 : r1591300;
        return r1591301;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -3.1802682705108005e+108

    1. Initial program 52.1

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

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

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

    if -3.1802682705108005e+108 < t < 3.397740654645452e+84

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)}}{\sqrt{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\ell}{x}\right), \ell, \left(t \cdot t\right)\right)\right), 2, \left(\frac{\left(t \cdot t\right) \cdot 4}{x}\right)\right)}}\]
    8. Using strategy rm
    9. Applied associate-*r*13.2

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

    if 3.397740654645452e+84 < t

    1. Initial program 48.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 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}{\frac{\frac{2}{x}}{x} \cdot \left(\frac{t}{\sqrt{2}} - \frac{\frac{t}{\sqrt{2}}}{2}\right) + \mathsf{fma}\left(\left(\frac{t}{\sqrt{2} \cdot x}\right), 2, \left(\sqrt{2} \cdot t\right)\right)}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification9.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -3.1802682705108005 \cdot 10^{+108}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{1}{\sqrt{2}} \cdot \frac{t}{x \cdot x} - \mathsf{fma}\left(t, \left(\sqrt{2}\right), \left(\frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x} + \frac{t}{x \cdot x}\right)\right)\right)}\\ \mathbf{elif}\;t \le 3.397740654645452 \cdot 10^{+84}:\\ \;\;\;\;\frac{t \cdot \left(\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(\left(\mathsf{fma}\left(\left(\frac{\ell}{x}\right), \ell, \left(t \cdot t\right)\right)\right), 2, \left(\frac{4 \cdot \left(t \cdot t\right)}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{\frac{2}{x}}{x} \cdot \left(\frac{t}{\sqrt{2}} - \frac{\frac{t}{\sqrt{2}}}{2}\right) + \mathsf{fma}\left(\left(\frac{t}{\sqrt{2} \cdot x}\right), 2, \left(\sqrt{2} \cdot t\right)\right)}\\ \end{array}\]

Reproduce

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