Average Error: 42.7 → 9.3
Time: 37.1s
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.2951730784916024 \cdot 10^{+124}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}} - \mathsf{fma}\left(\sqrt{2}, t, \frac{\frac{\frac{2 \cdot t}{\sqrt{2}}}{x}}{x}\right)\right) - \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}}\\ \mathbf{elif}\;t \le -1.5159399738466835 \cdot 10^{-163}:\\ \;\;\;\;\left(\sqrt{2} \cdot t\right) \cdot {\left(\mathsf{fma}\left(\frac{\ell}{\frac{x}{\ell}}, 2, \left(t \cdot t\right) \cdot \left(2 + \frac{4}{x}\right)\right)\right)}^{\frac{-1}{2}}\\ \mathbf{elif}\;t \le -4.983948587970619 \cdot 10^{-272}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}} - \mathsf{fma}\left(\sqrt{2}, t, \frac{\frac{\frac{2 \cdot t}{\sqrt{2}}}{x}}{x}\right)\right) - \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}}\\ \mathbf{elif}\;t \le 2.330241086706517 \cdot 10^{-194}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)}{\sqrt{\mathsf{fma}\left(\frac{\ell}{\frac{x}{\ell}}, 2, \left(t \cdot t\right) \cdot \left(2 + \frac{4}{x}\right)\right)}}\\ \mathbf{elif}\;t \le 4.752330698039452 \cdot 10^{-164}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}, 2, \mathsf{fma}\left(t, \sqrt{2}, \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}\right) - \frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}\right)}\\ \mathbf{elif}\;t \le 3.228763357777958 \cdot 10^{+132}:\\ \;\;\;\;\left(\sqrt{2} \cdot t\right) \cdot {\left(\mathsf{fma}\left(\frac{\ell}{\frac{x}{\ell}}, 2, \left(t \cdot t\right) \cdot \left(2 + \frac{4}{x}\right)\right)\right)}^{\frac{-1}{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}, 2, \mathsf{fma}\left(t, \sqrt{2}, \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}\right) - \frac{t}{\left(x \cdot x\right) \cdot \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.2951730784916024 \cdot 10^{+124}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}} - \mathsf{fma}\left(\sqrt{2}, t, \frac{\frac{\frac{2 \cdot t}{\sqrt{2}}}{x}}{x}\right)\right) - \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}}\\

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

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

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

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

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

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

\end{array}
double f(double x, double l, double t) {
        double r1108554 = 2.0;
        double r1108555 = sqrt(r1108554);
        double r1108556 = t;
        double r1108557 = r1108555 * r1108556;
        double r1108558 = x;
        double r1108559 = 1.0;
        double r1108560 = r1108558 + r1108559;
        double r1108561 = r1108558 - r1108559;
        double r1108562 = r1108560 / r1108561;
        double r1108563 = l;
        double r1108564 = r1108563 * r1108563;
        double r1108565 = r1108556 * r1108556;
        double r1108566 = r1108554 * r1108565;
        double r1108567 = r1108564 + r1108566;
        double r1108568 = r1108562 * r1108567;
        double r1108569 = r1108568 - r1108564;
        double r1108570 = sqrt(r1108569);
        double r1108571 = r1108557 / r1108570;
        return r1108571;
}

double f(double x, double l, double t) {
        double r1108572 = t;
        double r1108573 = -2.2951730784916024e+124;
        bool r1108574 = r1108572 <= r1108573;
        double r1108575 = 2.0;
        double r1108576 = sqrt(r1108575);
        double r1108577 = r1108576 * r1108572;
        double r1108578 = x;
        double r1108579 = r1108578 * r1108578;
        double r1108580 = r1108579 * r1108576;
        double r1108581 = r1108572 / r1108580;
        double r1108582 = r1108575 * r1108572;
        double r1108583 = r1108582 / r1108576;
        double r1108584 = r1108583 / r1108578;
        double r1108585 = r1108584 / r1108578;
        double r1108586 = fma(r1108576, r1108572, r1108585);
        double r1108587 = r1108581 - r1108586;
        double r1108588 = r1108587 - r1108584;
        double r1108589 = r1108577 / r1108588;
        double r1108590 = -1.5159399738466835e-163;
        bool r1108591 = r1108572 <= r1108590;
        double r1108592 = l;
        double r1108593 = r1108578 / r1108592;
        double r1108594 = r1108592 / r1108593;
        double r1108595 = r1108572 * r1108572;
        double r1108596 = 4.0;
        double r1108597 = r1108596 / r1108578;
        double r1108598 = r1108575 + r1108597;
        double r1108599 = r1108595 * r1108598;
        double r1108600 = fma(r1108594, r1108575, r1108599);
        double r1108601 = -0.5;
        double r1108602 = pow(r1108600, r1108601);
        double r1108603 = r1108577 * r1108602;
        double r1108604 = -4.983948587970619e-272;
        bool r1108605 = r1108572 <= r1108604;
        double r1108606 = 2.330241086706517e-194;
        bool r1108607 = r1108572 <= r1108606;
        double r1108608 = sqrt(r1108576);
        double r1108609 = r1108608 * r1108572;
        double r1108610 = r1108608 * r1108609;
        double r1108611 = sqrt(r1108600);
        double r1108612 = r1108610 / r1108611;
        double r1108613 = 4.752330698039452e-164;
        bool r1108614 = r1108572 <= r1108613;
        double r1108615 = fma(r1108572, r1108576, r1108584);
        double r1108616 = r1108615 - r1108581;
        double r1108617 = fma(r1108581, r1108575, r1108616);
        double r1108618 = r1108577 / r1108617;
        double r1108619 = 3.228763357777958e+132;
        bool r1108620 = r1108572 <= r1108619;
        double r1108621 = r1108620 ? r1108603 : r1108618;
        double r1108622 = r1108614 ? r1108618 : r1108621;
        double r1108623 = r1108607 ? r1108612 : r1108622;
        double r1108624 = r1108605 ? r1108589 : r1108623;
        double r1108625 = r1108591 ? r1108603 : r1108624;
        double r1108626 = r1108574 ? r1108589 : r1108625;
        return r1108626;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 4 regimes
  2. if t < -2.2951730784916024e+124 or -1.5159399738466835e-163 < t < -4.983948587970619e-272

    1. Initial program 56.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 11.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(t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right)\right)}}\]
    3. Simplified11.9

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

    if -2.2951730784916024e+124 < t < -1.5159399738466835e-163 or 4.752330698039452e-164 < t < 3.228763357777958e+132

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

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

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\mathsf{fma}\left(\frac{\ell}{\frac{x}{\ell}}, 2, \left(t \cdot t\right) \cdot \left(2 + \frac{4}{x}\right)\right)}}}\]
    6. Using strategy rm
    7. Applied div-inv5.5

      \[\leadsto \color{blue}{\left(\sqrt{2} \cdot t\right) \cdot \frac{1}{\sqrt{\mathsf{fma}\left(\frac{\ell}{\frac{x}{\ell}}, 2, \left(t \cdot t\right) \cdot \left(2 + \frac{4}{x}\right)\right)}}}\]
    8. Using strategy rm
    9. Applied pow1/25.5

      \[\leadsto \left(\sqrt{2} \cdot t\right) \cdot \frac{1}{\color{blue}{{\left(\mathsf{fma}\left(\frac{\ell}{\frac{x}{\ell}}, 2, \left(t \cdot t\right) \cdot \left(2 + \frac{4}{x}\right)\right)\right)}^{\frac{1}{2}}}}\]
    10. Applied pow-flip5.4

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

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

    if -4.983948587970619e-272 < t < 2.330241086706517e-194

    1. Initial program 61.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 31.4

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

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

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

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

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

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

    if 2.330241086706517e-194 < t < 4.752330698039452e-164 or 3.228763357777958e+132 < t

    1. Initial program 56.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 5.2

      \[\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. Simplified5.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -2.2951730784916024 \cdot 10^{+124}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}} - \mathsf{fma}\left(\sqrt{2}, t, \frac{\frac{\frac{2 \cdot t}{\sqrt{2}}}{x}}{x}\right)\right) - \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}}\\ \mathbf{elif}\;t \le -1.5159399738466835 \cdot 10^{-163}:\\ \;\;\;\;\left(\sqrt{2} \cdot t\right) \cdot {\left(\mathsf{fma}\left(\frac{\ell}{\frac{x}{\ell}}, 2, \left(t \cdot t\right) \cdot \left(2 + \frac{4}{x}\right)\right)\right)}^{\frac{-1}{2}}\\ \mathbf{elif}\;t \le -4.983948587970619 \cdot 10^{-272}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}} - \mathsf{fma}\left(\sqrt{2}, t, \frac{\frac{\frac{2 \cdot t}{\sqrt{2}}}{x}}{x}\right)\right) - \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}}\\ \mathbf{elif}\;t \le 2.330241086706517 \cdot 10^{-194}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)}{\sqrt{\mathsf{fma}\left(\frac{\ell}{\frac{x}{\ell}}, 2, \left(t \cdot t\right) \cdot \left(2 + \frac{4}{x}\right)\right)}}\\ \mathbf{elif}\;t \le 4.752330698039452 \cdot 10^{-164}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}, 2, \mathsf{fma}\left(t, \sqrt{2}, \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}\right) - \frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}\right)}\\ \mathbf{elif}\;t \le 3.228763357777958 \cdot 10^{+132}:\\ \;\;\;\;\left(\sqrt{2} \cdot t\right) \cdot {\left(\mathsf{fma}\left(\frac{\ell}{\frac{x}{\ell}}, 2, \left(t \cdot t\right) \cdot \left(2 + \frac{4}{x}\right)\right)\right)}^{\frac{-1}{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}, 2, \mathsf{fma}\left(t, \sqrt{2}, \frac{\frac{2 \cdot t}{\sqrt{2}}}{x}\right) - \frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}}\right)}\\ \end{array}\]

Reproduce

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