Average Error: 42.3 → 9.1
Time: 44.3s
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 -1.6626777853889492 \cdot 10^{+102}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{2 \cdot t}{\left(2 \cdot \sqrt{2}\right) \cdot \left(x \cdot x\right)} - \left(\frac{\frac{2 \cdot t}{\sqrt{2}}}{x} + \mathsf{fma}\left(2, \frac{\frac{t}{\sqrt{2}}}{x \cdot x}, \sqrt{2} \cdot t\right)\right)}\\ \mathbf{elif}\;t \le 4.561118037024944 \cdot 10^{+59}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\sqrt{\mathsf{fma}\left(t \cdot t, 2, \mathsf{fma}\left(4, \frac{t \cdot t}{x}, \left(\frac{\ell}{x} \cdot \ell\right) \cdot 2\right)\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(t \cdot t, 2, \mathsf{fma}\left(4, \frac{t \cdot t}{x}, \left(\frac{\ell}{x} \cdot \ell\right) \cdot 2\right)\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{\frac{2 \cdot t}{\sqrt{2}}}{x} + \mathsf{fma}\left(2, \frac{\frac{t}{\sqrt{2}}}{x \cdot x}, \sqrt{2} \cdot t\right)\right) - \frac{2 \cdot t}{\left(2 \cdot \sqrt{2}\right) \cdot \left(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 -1.6626777853889492 \cdot 10^{+102}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{2 \cdot t}{\left(2 \cdot \sqrt{2}\right) \cdot \left(x \cdot x\right)} - \left(\frac{\frac{2 \cdot t}{\sqrt{2}}}{x} + \mathsf{fma}\left(2, \frac{\frac{t}{\sqrt{2}}}{x \cdot x}, \sqrt{2} \cdot t\right)\right)}\\

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

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

\end{array}
double f(double x, double l, double t) {
        double r1264211 = 2.0;
        double r1264212 = sqrt(r1264211);
        double r1264213 = t;
        double r1264214 = r1264212 * r1264213;
        double r1264215 = x;
        double r1264216 = 1.0;
        double r1264217 = r1264215 + r1264216;
        double r1264218 = r1264215 - r1264216;
        double r1264219 = r1264217 / r1264218;
        double r1264220 = l;
        double r1264221 = r1264220 * r1264220;
        double r1264222 = r1264213 * r1264213;
        double r1264223 = r1264211 * r1264222;
        double r1264224 = r1264221 + r1264223;
        double r1264225 = r1264219 * r1264224;
        double r1264226 = r1264225 - r1264221;
        double r1264227 = sqrt(r1264226);
        double r1264228 = r1264214 / r1264227;
        return r1264228;
}

double f(double x, double l, double t) {
        double r1264229 = t;
        double r1264230 = -1.6626777853889492e+102;
        bool r1264231 = r1264229 <= r1264230;
        double r1264232 = 2.0;
        double r1264233 = sqrt(r1264232);
        double r1264234 = r1264233 * r1264229;
        double r1264235 = r1264232 * r1264229;
        double r1264236 = r1264232 * r1264233;
        double r1264237 = x;
        double r1264238 = r1264237 * r1264237;
        double r1264239 = r1264236 * r1264238;
        double r1264240 = r1264235 / r1264239;
        double r1264241 = r1264235 / r1264233;
        double r1264242 = r1264241 / r1264237;
        double r1264243 = r1264229 / r1264233;
        double r1264244 = r1264243 / r1264238;
        double r1264245 = fma(r1264232, r1264244, r1264234);
        double r1264246 = r1264242 + r1264245;
        double r1264247 = r1264240 - r1264246;
        double r1264248 = r1264234 / r1264247;
        double r1264249 = 4.561118037024944e+59;
        bool r1264250 = r1264229 <= r1264249;
        double r1264251 = r1264229 * r1264229;
        double r1264252 = 4.0;
        double r1264253 = r1264251 / r1264237;
        double r1264254 = l;
        double r1264255 = r1264254 / r1264237;
        double r1264256 = r1264255 * r1264254;
        double r1264257 = r1264256 * r1264232;
        double r1264258 = fma(r1264252, r1264253, r1264257);
        double r1264259 = fma(r1264251, r1264232, r1264258);
        double r1264260 = sqrt(r1264259);
        double r1264261 = sqrt(r1264260);
        double r1264262 = r1264261 * r1264261;
        double r1264263 = r1264234 / r1264262;
        double r1264264 = r1264246 - r1264240;
        double r1264265 = r1264234 / r1264264;
        double r1264266 = r1264250 ? r1264263 : r1264265;
        double r1264267 = r1264231 ? r1264248 : r1264266;
        return r1264267;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -1.6626777853889492e+102

    1. Initial program 49.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 2.3

      \[\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}{\frac{2 \cdot t}{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)} - \left(\mathsf{fma}\left(2, \frac{\frac{t}{\sqrt{2}}}{x \cdot x}, t \cdot \sqrt{2}\right) + \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}\right)}}\]

    if -1.6626777853889492e+102 < t < 4.561118037024944e+59

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.6626777853889492 \cdot 10^{+102}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{2 \cdot t}{\left(2 \cdot \sqrt{2}\right) \cdot \left(x \cdot x\right)} - \left(\frac{\frac{2 \cdot t}{\sqrt{2}}}{x} + \mathsf{fma}\left(2, \frac{\frac{t}{\sqrt{2}}}{x \cdot x}, \sqrt{2} \cdot t\right)\right)}\\ \mathbf{elif}\;t \le 4.561118037024944 \cdot 10^{+59}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\sqrt{\mathsf{fma}\left(t \cdot t, 2, \mathsf{fma}\left(4, \frac{t \cdot t}{x}, \left(\frac{\ell}{x} \cdot \ell\right) \cdot 2\right)\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(t \cdot t, 2, \mathsf{fma}\left(4, \frac{t \cdot t}{x}, \left(\frac{\ell}{x} \cdot \ell\right) \cdot 2\right)\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{\frac{2 \cdot t}{\sqrt{2}}}{x} + \mathsf{fma}\left(2, \frac{\frac{t}{\sqrt{2}}}{x \cdot x}, \sqrt{2} \cdot t\right)\right) - \frac{2 \cdot t}{\left(2 \cdot \sqrt{2}\right) \cdot \left(x \cdot x\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)))))