Average Error: 43.2 → 9.3
Time: 30.7s
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.940005881918408859869096974602770049363 \cdot 10^{94}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{2 \cdot \left(\frac{t}{\left(2 \cdot \sqrt{2}\right) \cdot \left(x \cdot x\right)} - \frac{t}{\sqrt{2} \cdot x}\right) - \mathsf{fma}\left(\sqrt{2}, t, \frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} \cdot 2\right)}\\ \mathbf{elif}\;t \le 1.839658841198905283015739574372348749582 \cdot 10^{-241}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)\right)}}\\ \mathbf{elif}\;t \le 3.247980644380315344262592988201111260205 \cdot 10^{-157}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, \mathsf{fma}\left(\sqrt{2}, t, \frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} \cdot 2\right)\right) - \frac{t}{\left(2 \cdot \sqrt{2}\right) \cdot \left(x \cdot x\right)} \cdot 2}\\ \mathbf{elif}\;t \le 4.214549585149478093549971775733778272653 \cdot 10^{55}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, \mathsf{fma}\left(\sqrt{2}, t, \frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} \cdot 2\right)\right) - \frac{t}{\left(2 \cdot \sqrt{2}\right) \cdot \left(x \cdot x\right)} \cdot 2}\\ \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.940005881918408859869096974602770049363 \cdot 10^{94}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{2 \cdot \left(\frac{t}{\left(2 \cdot \sqrt{2}\right) \cdot \left(x \cdot x\right)} - \frac{t}{\sqrt{2} \cdot x}\right) - \mathsf{fma}\left(\sqrt{2}, t, \frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} \cdot 2\right)}\\

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

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

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

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

\end{array}
double f(double x, double l, double t) {
        double r1508564 = 2.0;
        double r1508565 = sqrt(r1508564);
        double r1508566 = t;
        double r1508567 = r1508565 * r1508566;
        double r1508568 = x;
        double r1508569 = 1.0;
        double r1508570 = r1508568 + r1508569;
        double r1508571 = r1508568 - r1508569;
        double r1508572 = r1508570 / r1508571;
        double r1508573 = l;
        double r1508574 = r1508573 * r1508573;
        double r1508575 = r1508566 * r1508566;
        double r1508576 = r1508564 * r1508575;
        double r1508577 = r1508574 + r1508576;
        double r1508578 = r1508572 * r1508577;
        double r1508579 = r1508578 - r1508574;
        double r1508580 = sqrt(r1508579);
        double r1508581 = r1508567 / r1508580;
        return r1508581;
}

double f(double x, double l, double t) {
        double r1508582 = t;
        double r1508583 = -1.940005881918409e+94;
        bool r1508584 = r1508582 <= r1508583;
        double r1508585 = 2.0;
        double r1508586 = sqrt(r1508585);
        double r1508587 = r1508586 * r1508582;
        double r1508588 = r1508585 * r1508586;
        double r1508589 = x;
        double r1508590 = r1508589 * r1508589;
        double r1508591 = r1508588 * r1508590;
        double r1508592 = r1508582 / r1508591;
        double r1508593 = r1508586 * r1508589;
        double r1508594 = r1508582 / r1508593;
        double r1508595 = r1508592 - r1508594;
        double r1508596 = r1508585 * r1508595;
        double r1508597 = r1508586 * r1508590;
        double r1508598 = r1508582 / r1508597;
        double r1508599 = r1508598 * r1508585;
        double r1508600 = fma(r1508586, r1508582, r1508599);
        double r1508601 = r1508596 - r1508600;
        double r1508602 = r1508587 / r1508601;
        double r1508603 = 1.8396588411989053e-241;
        bool r1508604 = r1508582 <= r1508603;
        double r1508605 = r1508582 * r1508582;
        double r1508606 = r1508605 / r1508589;
        double r1508607 = 4.0;
        double r1508608 = l;
        double r1508609 = r1508589 / r1508608;
        double r1508610 = r1508608 / r1508609;
        double r1508611 = r1508605 + r1508610;
        double r1508612 = r1508585 * r1508611;
        double r1508613 = fma(r1508606, r1508607, r1508612);
        double r1508614 = sqrt(r1508613);
        double r1508615 = r1508587 / r1508614;
        double r1508616 = 3.2479806443803153e-157;
        bool r1508617 = r1508582 <= r1508616;
        double r1508618 = fma(r1508585, r1508594, r1508600);
        double r1508619 = r1508592 * r1508585;
        double r1508620 = r1508618 - r1508619;
        double r1508621 = r1508587 / r1508620;
        double r1508622 = 4.214549585149478e+55;
        bool r1508623 = r1508582 <= r1508622;
        double r1508624 = r1508623 ? r1508615 : r1508621;
        double r1508625 = r1508617 ? r1508621 : r1508624;
        double r1508626 = r1508604 ? r1508615 : r1508625;
        double r1508627 = r1508584 ? r1508602 : r1508626;
        return r1508627;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -1.940005881918409e+94

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

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

    if -1.940005881918409e+94 < t < 1.8396588411989053e-241 or 3.2479806443803153e-157 < t < 4.214549585149478e+55

    1. Initial program 37.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. Taylor expanded around inf 15.8

      \[\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. Simplified15.8

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \left(t \cdot t + \frac{\ell \cdot \ell}{x}\right)\right)}}}\]
    4. Using strategy rm
    5. Applied associate-/l*12.2

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

    if 1.8396588411989053e-241 < t < 3.2479806443803153e-157 or 4.214549585149478e+55 < t

    1. Initial program 48.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 8.8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.940005881918408859869096974602770049363 \cdot 10^{94}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{2 \cdot \left(\frac{t}{\left(2 \cdot \sqrt{2}\right) \cdot \left(x \cdot x\right)} - \frac{t}{\sqrt{2} \cdot x}\right) - \mathsf{fma}\left(\sqrt{2}, t, \frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} \cdot 2\right)}\\ \mathbf{elif}\;t \le 1.839658841198905283015739574372348749582 \cdot 10^{-241}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)\right)}}\\ \mathbf{elif}\;t \le 3.247980644380315344262592988201111260205 \cdot 10^{-157}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, \mathsf{fma}\left(\sqrt{2}, t, \frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} \cdot 2\right)\right) - \frac{t}{\left(2 \cdot \sqrt{2}\right) \cdot \left(x \cdot x\right)} \cdot 2}\\ \mathbf{elif}\;t \le 4.214549585149478093549971775733778272653 \cdot 10^{55}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x}{\ell}}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, \mathsf{fma}\left(\sqrt{2}, t, \frac{t}{\sqrt{2} \cdot \left(x \cdot x\right)} \cdot 2\right)\right) - \frac{t}{\left(2 \cdot \sqrt{2}\right) \cdot \left(x \cdot x\right)} \cdot 2}\\ \end{array}\]

Reproduce

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