Average Error: 42.6 → 10.0
Time: 31.5s
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 -3.715046482673698729450242436769280905141 \cdot 10^{110}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{2 \cdot \sqrt{2}}, \frac{t}{x \cdot x}, -\mathsf{fma}\left(\frac{2}{\sqrt{2}}, \frac{t}{x}, \mathsf{fma}\left(t, \sqrt{2}, \frac{t}{x \cdot x} \cdot \frac{2}{\sqrt{2}}\right)\right)\right)}\\ \mathbf{elif}\;t \le -1.993349418678108800529215067343269974318 \cdot 10^{-159}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, \left(t \cdot t + \frac{\ell}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\ell}{\sqrt[3]{x}}\right) \cdot 2\right)}}\\ \mathbf{elif}\;t \le -9.405973531316698506909205844553614944599 \cdot 10^{-275}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{2 \cdot \sqrt{2}}, \frac{t}{x \cdot x}, -\mathsf{fma}\left(\frac{2}{\sqrt{2}}, \frac{t}{x}, \mathsf{fma}\left(t, \sqrt{2}, \frac{t}{x \cdot x} \cdot \frac{2}{\sqrt{2}}\right)\right)\right)}\\ \mathbf{elif}\;t \le 8.799119845230040103380880957879300899262 \cdot 10^{-305}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, \left(\frac{\ell \cdot \ell}{x} + t \cdot t\right) \cdot 2\right)}}\\ \mathbf{elif}\;t \le 3.517775087045906516144188620937021386678 \cdot 10^{-239}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, 2 \cdot \left(\frac{\frac{t}{\sqrt{2}}}{x \cdot x} - \frac{t}{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)}\right) + \sqrt{2} \cdot t\right)}\\ \mathbf{elif}\;t \le 4.39891585056256545899226457368516974501 \cdot 10^{111}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, \left(t \cdot t + \frac{\ell}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\ell}{\sqrt[3]{x}}\right) \cdot 2\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, 2 \cdot \left(\frac{\frac{t}{\sqrt{2}}}{x \cdot x} - \frac{t}{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)}\right) + \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 -3.715046482673698729450242436769280905141 \cdot 10^{110}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{2 \cdot \sqrt{2}}, \frac{t}{x \cdot x}, -\mathsf{fma}\left(\frac{2}{\sqrt{2}}, \frac{t}{x}, \mathsf{fma}\left(t, \sqrt{2}, \frac{t}{x \cdot x} \cdot \frac{2}{\sqrt{2}}\right)\right)\right)}\\

\mathbf{elif}\;t \le -1.993349418678108800529215067343269974318 \cdot 10^{-159}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, \left(t \cdot t + \frac{\ell}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\ell}{\sqrt[3]{x}}\right) \cdot 2\right)}}\\

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

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

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

\mathbf{elif}\;t \le 4.39891585056256545899226457368516974501 \cdot 10^{111}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, \left(t \cdot t + \frac{\ell}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\ell}{\sqrt[3]{x}}\right) \cdot 2\right)}}\\

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

\end{array}
double f(double x, double l, double t) {
        double r1253531 = 2.0;
        double r1253532 = sqrt(r1253531);
        double r1253533 = t;
        double r1253534 = r1253532 * r1253533;
        double r1253535 = x;
        double r1253536 = 1.0;
        double r1253537 = r1253535 + r1253536;
        double r1253538 = r1253535 - r1253536;
        double r1253539 = r1253537 / r1253538;
        double r1253540 = l;
        double r1253541 = r1253540 * r1253540;
        double r1253542 = r1253533 * r1253533;
        double r1253543 = r1253531 * r1253542;
        double r1253544 = r1253541 + r1253543;
        double r1253545 = r1253539 * r1253544;
        double r1253546 = r1253545 - r1253541;
        double r1253547 = sqrt(r1253546);
        double r1253548 = r1253534 / r1253547;
        return r1253548;
}

double f(double x, double l, double t) {
        double r1253549 = t;
        double r1253550 = -3.715046482673699e+110;
        bool r1253551 = r1253549 <= r1253550;
        double r1253552 = 2.0;
        double r1253553 = sqrt(r1253552);
        double r1253554 = r1253553 * r1253549;
        double r1253555 = r1253552 * r1253553;
        double r1253556 = r1253552 / r1253555;
        double r1253557 = x;
        double r1253558 = r1253557 * r1253557;
        double r1253559 = r1253549 / r1253558;
        double r1253560 = r1253552 / r1253553;
        double r1253561 = r1253549 / r1253557;
        double r1253562 = r1253559 * r1253560;
        double r1253563 = fma(r1253549, r1253553, r1253562);
        double r1253564 = fma(r1253560, r1253561, r1253563);
        double r1253565 = -r1253564;
        double r1253566 = fma(r1253556, r1253559, r1253565);
        double r1253567 = r1253554 / r1253566;
        double r1253568 = -1.9933494186781088e-159;
        bool r1253569 = r1253549 <= r1253568;
        double r1253570 = 4.0;
        double r1253571 = r1253549 * r1253549;
        double r1253572 = r1253571 / r1253557;
        double r1253573 = l;
        double r1253574 = cbrt(r1253557);
        double r1253575 = r1253574 * r1253574;
        double r1253576 = r1253573 / r1253575;
        double r1253577 = r1253573 / r1253574;
        double r1253578 = r1253576 * r1253577;
        double r1253579 = r1253571 + r1253578;
        double r1253580 = r1253579 * r1253552;
        double r1253581 = fma(r1253570, r1253572, r1253580);
        double r1253582 = sqrt(r1253581);
        double r1253583 = r1253554 / r1253582;
        double r1253584 = -9.405973531316699e-275;
        bool r1253585 = r1253549 <= r1253584;
        double r1253586 = 8.79911984523004e-305;
        bool r1253587 = r1253549 <= r1253586;
        double r1253588 = r1253573 * r1253573;
        double r1253589 = r1253588 / r1253557;
        double r1253590 = r1253589 + r1253571;
        double r1253591 = r1253590 * r1253552;
        double r1253592 = fma(r1253570, r1253572, r1253591);
        double r1253593 = sqrt(r1253592);
        double r1253594 = r1253554 / r1253593;
        double r1253595 = 3.5177750870459065e-239;
        bool r1253596 = r1253549 <= r1253595;
        double r1253597 = r1253552 / r1253557;
        double r1253598 = r1253549 / r1253553;
        double r1253599 = r1253598 / r1253558;
        double r1253600 = r1253558 * r1253555;
        double r1253601 = r1253549 / r1253600;
        double r1253602 = r1253599 - r1253601;
        double r1253603 = r1253552 * r1253602;
        double r1253604 = r1253603 + r1253554;
        double r1253605 = fma(r1253597, r1253598, r1253604);
        double r1253606 = r1253554 / r1253605;
        double r1253607 = 4.3989158505625655e+111;
        bool r1253608 = r1253549 <= r1253607;
        double r1253609 = r1253608 ? r1253583 : r1253606;
        double r1253610 = r1253596 ? r1253606 : r1253609;
        double r1253611 = r1253587 ? r1253594 : r1253610;
        double r1253612 = r1253585 ? r1253567 : r1253611;
        double r1253613 = r1253569 ? r1253583 : r1253612;
        double r1253614 = r1253551 ? r1253567 : r1253613;
        return r1253614;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 4 regimes
  2. if t < -3.715046482673699e+110 or -1.9933494186781088e-159 < t < -9.405973531316699e-275

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

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

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

    if -3.715046482673699e+110 < t < -1.9933494186781088e-159 or 3.5177750870459065e-239 < t < 4.3989158505625655e+111

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, 2 \cdot \left(\frac{\ell \cdot \ell}{x} + t \cdot t\right)\right)}}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt13.0

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

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

    if -9.405973531316699e-275 < t < 8.79911984523004e-305

    1. Initial program 62.1

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

      \[\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. Simplified27.6

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

    if 8.79911984523004e-305 < t < 3.5177750870459065e-239 or 4.3989158505625655e+111 < t

    1. Initial program 54.1

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -3.715046482673698729450242436769280905141 \cdot 10^{110}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{2 \cdot \sqrt{2}}, \frac{t}{x \cdot x}, -\mathsf{fma}\left(\frac{2}{\sqrt{2}}, \frac{t}{x}, \mathsf{fma}\left(t, \sqrt{2}, \frac{t}{x \cdot x} \cdot \frac{2}{\sqrt{2}}\right)\right)\right)}\\ \mathbf{elif}\;t \le -1.993349418678108800529215067343269974318 \cdot 10^{-159}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, \left(t \cdot t + \frac{\ell}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\ell}{\sqrt[3]{x}}\right) \cdot 2\right)}}\\ \mathbf{elif}\;t \le -9.405973531316698506909205844553614944599 \cdot 10^{-275}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{2 \cdot \sqrt{2}}, \frac{t}{x \cdot x}, -\mathsf{fma}\left(\frac{2}{\sqrt{2}}, \frac{t}{x}, \mathsf{fma}\left(t, \sqrt{2}, \frac{t}{x \cdot x} \cdot \frac{2}{\sqrt{2}}\right)\right)\right)}\\ \mathbf{elif}\;t \le 8.799119845230040103380880957879300899262 \cdot 10^{-305}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, \left(\frac{\ell \cdot \ell}{x} + t \cdot t\right) \cdot 2\right)}}\\ \mathbf{elif}\;t \le 3.517775087045906516144188620937021386678 \cdot 10^{-239}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, 2 \cdot \left(\frac{\frac{t}{\sqrt{2}}}{x \cdot x} - \frac{t}{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)}\right) + \sqrt{2} \cdot t\right)}\\ \mathbf{elif}\;t \le 4.39891585056256545899226457368516974501 \cdot 10^{111}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, \left(t \cdot t + \frac{\ell}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\ell}{\sqrt[3]{x}}\right) \cdot 2\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, 2 \cdot \left(\frac{\frac{t}{\sqrt{2}}}{x \cdot x} - \frac{t}{\left(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)}\right) + \sqrt{2} \cdot t\right)}\\ \end{array}\]

Reproduce

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