Average Error: 43.5 → 9.7
Time: 29.6s
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 -5.354437256926885952820305948197945337878 \cdot 10^{88}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(2, \frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x} - \frac{\frac{t}{x}}{\sqrt{2}}, \sqrt{2} \cdot \left(-t\right)\right)}\\ \mathbf{elif}\;t \le 3.424779697706979355832148987272206628453 \cdot 10^{-203} \lor \neg \left(t \le 6.783164823431965385056094361766235146363 \cdot 10^{-165}\right) \land t \le 5.469601309486936787300845358655254676933 \cdot 10^{45}:\\ \;\;\;\;\frac{\sqrt{2}}{\sqrt{\sqrt{\mathsf{fma}\left(\frac{t}{\frac{x}{t}}, 4, 2 \cdot \mathsf{fma}\left(\frac{\ell}{x}, \ell, t \cdot t\right)\right)} \cdot \sqrt{\mathsf{fma}\left(\frac{t}{\frac{x}{t}}, 4, 2 \cdot \mathsf{fma}\left(\frac{\ell}{x}, \ell, t \cdot t\right)\right)}}} \cdot t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(2, \frac{\frac{t}{\sqrt{2}}}{x} - \frac{\frac{t}{x \cdot x}}{2 \cdot \sqrt{2}}, \sqrt{2} \cdot t\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 -5.354437256926885952820305948197945337878 \cdot 10^{88}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(2, \frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x} - \frac{\frac{t}{x}}{\sqrt{2}}, \sqrt{2} \cdot \left(-t\right)\right)}\\

\mathbf{elif}\;t \le 3.424779697706979355832148987272206628453 \cdot 10^{-203} \lor \neg \left(t \le 6.783164823431965385056094361766235146363 \cdot 10^{-165}\right) \land t \le 5.469601309486936787300845358655254676933 \cdot 10^{45}:\\
\;\;\;\;\frac{\sqrt{2}}{\sqrt{\sqrt{\mathsf{fma}\left(\frac{t}{\frac{x}{t}}, 4, 2 \cdot \mathsf{fma}\left(\frac{\ell}{x}, \ell, t \cdot t\right)\right)} \cdot \sqrt{\mathsf{fma}\left(\frac{t}{\frac{x}{t}}, 4, 2 \cdot \mathsf{fma}\left(\frac{\ell}{x}, \ell, t \cdot t\right)\right)}}} \cdot t\\

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

\end{array}
double f(double x, double l, double t) {
        double r44533 = 2.0;
        double r44534 = sqrt(r44533);
        double r44535 = t;
        double r44536 = r44534 * r44535;
        double r44537 = x;
        double r44538 = 1.0;
        double r44539 = r44537 + r44538;
        double r44540 = r44537 - r44538;
        double r44541 = r44539 / r44540;
        double r44542 = l;
        double r44543 = r44542 * r44542;
        double r44544 = r44535 * r44535;
        double r44545 = r44533 * r44544;
        double r44546 = r44543 + r44545;
        double r44547 = r44541 * r44546;
        double r44548 = r44547 - r44543;
        double r44549 = sqrt(r44548);
        double r44550 = r44536 / r44549;
        return r44550;
}

double f(double x, double l, double t) {
        double r44551 = t;
        double r44552 = -5.354437256926886e+88;
        bool r44553 = r44551 <= r44552;
        double r44554 = 2.0;
        double r44555 = sqrt(r44554);
        double r44556 = r44551 / r44555;
        double r44557 = r44556 / r44554;
        double r44558 = x;
        double r44559 = r44558 * r44558;
        double r44560 = r44557 / r44559;
        double r44561 = r44551 / r44558;
        double r44562 = r44561 / r44555;
        double r44563 = r44560 - r44562;
        double r44564 = -r44551;
        double r44565 = r44555 * r44564;
        double r44566 = fma(r44554, r44563, r44565);
        double r44567 = r44555 / r44566;
        double r44568 = r44551 * r44567;
        double r44569 = 3.4247796977069794e-203;
        bool r44570 = r44551 <= r44569;
        double r44571 = 6.783164823431965e-165;
        bool r44572 = r44551 <= r44571;
        double r44573 = !r44572;
        double r44574 = 5.469601309486937e+45;
        bool r44575 = r44551 <= r44574;
        bool r44576 = r44573 && r44575;
        bool r44577 = r44570 || r44576;
        double r44578 = r44558 / r44551;
        double r44579 = r44551 / r44578;
        double r44580 = 4.0;
        double r44581 = l;
        double r44582 = r44581 / r44558;
        double r44583 = r44551 * r44551;
        double r44584 = fma(r44582, r44581, r44583);
        double r44585 = r44554 * r44584;
        double r44586 = fma(r44579, r44580, r44585);
        double r44587 = sqrt(r44586);
        double r44588 = r44587 * r44587;
        double r44589 = sqrt(r44588);
        double r44590 = r44555 / r44589;
        double r44591 = r44590 * r44551;
        double r44592 = r44556 / r44558;
        double r44593 = r44551 / r44559;
        double r44594 = r44554 * r44555;
        double r44595 = r44593 / r44594;
        double r44596 = r44592 - r44595;
        double r44597 = r44555 * r44551;
        double r44598 = fma(r44554, r44596, r44597);
        double r44599 = r44555 / r44598;
        double r44600 = r44551 * r44599;
        double r44601 = r44577 ? r44591 : r44600;
        double r44602 = r44553 ? r44568 : r44601;
        return r44602;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -5.354437256926886e+88

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

      \[\leadsto \color{blue}{t \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(\ell, \ell, \left(t \cdot t\right) \cdot 2\right) \cdot \frac{1 + x}{x - 1} - \ell \cdot \ell}}}\]
    3. Taylor expanded around inf 49.1

      \[\leadsto t \cdot \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot {t}^{2} + \left(2 \cdot \frac{{\ell}^{2}}{x} + 4 \cdot \frac{{t}^{2}}{x}\right)}}}\]
    4. Simplified49.1

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

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

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

      \[\leadsto t \cdot \frac{\sqrt{2}}{\sqrt{\sqrt{\mathsf{fma}\left(\frac{t}{\frac{x}{t}}, 4, \mathsf{fma}\left(\frac{\ell}{x}, \ell, t \cdot t\right) \cdot 2\right)} \cdot \color{blue}{\sqrt{\mathsf{fma}\left(\frac{t}{\frac{x}{t}}, 4, \mathsf{fma}\left(\frac{\ell}{x}, \ell, t \cdot t\right) \cdot 2\right)}}}}\]
    9. Taylor expanded around -inf 3.9

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

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

    if -5.354437256926886e+88 < t < 3.4247796977069794e-203 or 6.783164823431965e-165 < t < 5.469601309486937e+45

    1. Initial program 39.0

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

      \[\leadsto \color{blue}{t \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(\ell, \ell, \left(t \cdot t\right) \cdot 2\right) \cdot \frac{1 + x}{x - 1} - \ell \cdot \ell}}}\]
    3. Taylor expanded around inf 17.3

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

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

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

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

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

    if 3.4247796977069794e-203 < t < 6.783164823431965e-165 or 5.469601309486937e+45 < t

    1. Initial program 47.4

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

      \[\leadsto \color{blue}{t \cdot \frac{\sqrt{2}}{\sqrt{\mathsf{fma}\left(\ell, \ell, \left(t \cdot t\right) \cdot 2\right) \cdot \frac{1 + x}{x - 1} - \ell \cdot \ell}}}\]
    3. Taylor expanded around inf 43.8

      \[\leadsto t \cdot \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot {t}^{2} + \left(2 \cdot \frac{{\ell}^{2}}{x} + 4 \cdot \frac{{t}^{2}}{x}\right)}}}\]
    4. Simplified43.8

      \[\leadsto t \cdot \frac{\sqrt{2}}{\sqrt{\color{blue}{\mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \mathsf{fma}\left(t, t, \frac{\ell \cdot \ell}{x}\right)\right)}}}\]
    5. Taylor expanded around inf 7.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -5.354437256926885952820305948197945337878 \cdot 10^{88}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(2, \frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x} - \frac{\frac{t}{x}}{\sqrt{2}}, \sqrt{2} \cdot \left(-t\right)\right)}\\ \mathbf{elif}\;t \le 3.424779697706979355832148987272206628453 \cdot 10^{-203} \lor \neg \left(t \le 6.783164823431965385056094361766235146363 \cdot 10^{-165}\right) \land t \le 5.469601309486936787300845358655254676933 \cdot 10^{45}:\\ \;\;\;\;\frac{\sqrt{2}}{\sqrt{\sqrt{\mathsf{fma}\left(\frac{t}{\frac{x}{t}}, 4, 2 \cdot \mathsf{fma}\left(\frac{\ell}{x}, \ell, t \cdot t\right)\right)} \cdot \sqrt{\mathsf{fma}\left(\frac{t}{\frac{x}{t}}, 4, 2 \cdot \mathsf{fma}\left(\frac{\ell}{x}, \ell, t \cdot t\right)\right)}}} \cdot t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(2, \frac{\frac{t}{\sqrt{2}}}{x} - \frac{\frac{t}{x \cdot x}}{2 \cdot \sqrt{2}}, \sqrt{2} \cdot t\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 2019179 +o rules:numerics
(FPCore (x l t)
  :name "Toniolo and Linder, Equation (7)"
  (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))