Average Error: 43.1 → 10.0
Time: 31.9s
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.303460822673397315215412157251637183073 \cdot 10^{149}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\ \mathbf{elif}\;t \le -1.230065150000774851732639496826971723637 \cdot 10^{-149}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}}\\ \mathbf{elif}\;t \le -4.303938162079978611630039682650481103959 \cdot 10^{-243}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\ \mathbf{elif}\;t \le 3.190616919639676067581902350380230729983 \cdot 10^{-45}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right) - \frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\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.303460822673397315215412157251637183073 \cdot 10^{149}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\

\mathbf{elif}\;t \le -1.230065150000774851732639496826971723637 \cdot 10^{-149}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}}\\

\mathbf{elif}\;t \le -4.303938162079978611630039682650481103959 \cdot 10^{-243}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\

\mathbf{elif}\;t \le 3.190616919639676067581902350380230729983 \cdot 10^{-45}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}}\\

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

\end{array}
double f(double x, double l, double t) {
        double r44371 = 2.0;
        double r44372 = sqrt(r44371);
        double r44373 = t;
        double r44374 = r44372 * r44373;
        double r44375 = x;
        double r44376 = 1.0;
        double r44377 = r44375 + r44376;
        double r44378 = r44375 - r44376;
        double r44379 = r44377 / r44378;
        double r44380 = l;
        double r44381 = r44380 * r44380;
        double r44382 = r44373 * r44373;
        double r44383 = r44371 * r44382;
        double r44384 = r44381 + r44383;
        double r44385 = r44379 * r44384;
        double r44386 = r44385 - r44381;
        double r44387 = sqrt(r44386);
        double r44388 = r44374 / r44387;
        return r44388;
}

double f(double x, double l, double t) {
        double r44389 = t;
        double r44390 = -2.3034608226733973e+149;
        bool r44391 = r44389 <= r44390;
        double r44392 = 2.0;
        double r44393 = sqrt(r44392);
        double r44394 = r44393 * r44389;
        double r44395 = x;
        double r44396 = 2.0;
        double r44397 = pow(r44395, r44396);
        double r44398 = r44389 / r44397;
        double r44399 = r44392 * r44393;
        double r44400 = r44392 / r44399;
        double r44401 = r44392 / r44393;
        double r44402 = r44400 - r44401;
        double r44403 = r44398 * r44402;
        double r44404 = r44393 * r44395;
        double r44405 = r44389 / r44404;
        double r44406 = r44389 * r44393;
        double r44407 = fma(r44392, r44405, r44406);
        double r44408 = r44403 - r44407;
        double r44409 = r44394 / r44408;
        double r44410 = -1.2300651500007749e-149;
        bool r44411 = r44389 <= r44410;
        double r44412 = l;
        double r44413 = fabs(r44412);
        double r44414 = r44413 / r44395;
        double r44415 = r44413 * r44414;
        double r44416 = fma(r44389, r44389, r44415);
        double r44417 = 4.0;
        double r44418 = pow(r44389, r44396);
        double r44419 = r44418 / r44395;
        double r44420 = r44417 * r44419;
        double r44421 = fma(r44392, r44416, r44420);
        double r44422 = sqrt(r44421);
        double r44423 = r44394 / r44422;
        double r44424 = -4.3039381620799786e-243;
        bool r44425 = r44389 <= r44424;
        double r44426 = 3.190616919639676e-45;
        bool r44427 = r44389 <= r44426;
        double r44428 = r44407 - r44403;
        double r44429 = r44394 / r44428;
        double r44430 = r44427 ? r44423 : r44429;
        double r44431 = r44425 ? r44409 : r44430;
        double r44432 = r44411 ? r44423 : r44431;
        double r44433 = r44391 ? r44409 : r44432;
        return r44433;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -2.3034608226733973e+149 or -1.2300651500007749e-149 < t < -4.3039381620799786e-243

    1. Initial program 60.6

      \[\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 10.9

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

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

    if -2.3034608226733973e+149 < t < -1.2300651500007749e-149 or -4.3039381620799786e-243 < t < 3.190616919639676e-45

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

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{{\ell}^{2}}{\color{blue}{1 \cdot x}}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}}\]
    6. Applied add-sqr-sqrt17.3

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

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

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

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

    if 3.190616919639676e-45 < t

    1. Initial program 39.5

      \[\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 5.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -2.303460822673397315215412157251637183073 \cdot 10^{149}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\ \mathbf{elif}\;t \le -1.230065150000774851732639496826971723637 \cdot 10^{-149}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}}\\ \mathbf{elif}\;t \le -4.303938162079978611630039682650481103959 \cdot 10^{-243}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right) - \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right)}\\ \mathbf{elif}\;t \le 3.190616919639676067581902350380230729983 \cdot 10^{-45}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \left|\ell\right| \cdot \frac{\left|\ell\right|}{x}\right), 4 \cdot \frac{{t}^{2}}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, t \cdot \sqrt{2}\right) - \frac{t}{{x}^{2}} \cdot \left(\frac{2}{2 \cdot \sqrt{2}} - \frac{2}{\sqrt{2}}\right)}\\ \end{array}\]

Reproduce

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