Average Error: 42.3 → 9.2
Time: 28.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 -16678696720617.19:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{-\mathsf{fma}\left(\frac{\frac{t}{\sqrt{2}}}{x}, 2, \sqrt{2} \cdot t\right)}\\ \mathbf{elif}\;t \le 1.7265785379062208 \cdot 10^{+93}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \sqrt{\mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)} \cdot \sqrt{\mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)}, \frac{4 \cdot \left(t \cdot t\right)}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x \cdot x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x} \cdot -2\right)\right)\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 -16678696720617.19:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{-\mathsf{fma}\left(\frac{\frac{t}{\sqrt{2}}}{x}, 2, \sqrt{2} \cdot t\right)}\\

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

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

\end{array}
double f(double x, double l, double t) {
        double r431632 = 2.0;
        double r431633 = sqrt(r431632);
        double r431634 = t;
        double r431635 = r431633 * r431634;
        double r431636 = x;
        double r431637 = 1.0;
        double r431638 = r431636 + r431637;
        double r431639 = r431636 - r431637;
        double r431640 = r431638 / r431639;
        double r431641 = l;
        double r431642 = r431641 * r431641;
        double r431643 = r431634 * r431634;
        double r431644 = r431632 * r431643;
        double r431645 = r431642 + r431644;
        double r431646 = r431640 * r431645;
        double r431647 = r431646 - r431642;
        double r431648 = sqrt(r431647);
        double r431649 = r431635 / r431648;
        return r431649;
}

double f(double x, double l, double t) {
        double r431650 = t;
        double r431651 = -16678696720617.19;
        bool r431652 = r431650 <= r431651;
        double r431653 = 2.0;
        double r431654 = sqrt(r431653);
        double r431655 = r431654 * r431650;
        double r431656 = r431650 / r431654;
        double r431657 = x;
        double r431658 = r431656 / r431657;
        double r431659 = fma(r431658, r431653, r431655);
        double r431660 = -r431659;
        double r431661 = r431655 / r431660;
        double r431662 = 1.7265785379062208e+93;
        bool r431663 = r431650 <= r431662;
        double r431664 = l;
        double r431665 = r431664 / r431657;
        double r431666 = r431664 * r431665;
        double r431667 = fma(r431650, r431650, r431666);
        double r431668 = sqrt(r431667);
        double r431669 = r431668 * r431668;
        double r431670 = 4.0;
        double r431671 = r431650 * r431650;
        double r431672 = r431670 * r431671;
        double r431673 = r431672 / r431657;
        double r431674 = fma(r431653, r431669, r431673);
        double r431675 = sqrt(r431674);
        double r431676 = r431655 / r431675;
        double r431677 = r431657 * r431657;
        double r431678 = r431653 / r431677;
        double r431679 = r431653 / r431657;
        double r431680 = r431656 / r431653;
        double r431681 = r431680 / r431677;
        double r431682 = -2.0;
        double r431683 = r431681 * r431682;
        double r431684 = fma(r431679, r431656, r431683);
        double r431685 = fma(r431650, r431654, r431684);
        double r431686 = fma(r431678, r431656, r431685);
        double r431687 = r431655 / r431686;
        double r431688 = r431663 ? r431676 : r431687;
        double r431689 = r431652 ? r431661 : r431688;
        return r431689;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -16678696720617.19

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

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

      \[\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 \cdot \left(t \cdot t\right)}{x}\right)}}}\]
    4. Taylor expanded around -inf 5.4

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

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

    if -16678696720617.19 < t < 1.7265785379062208e+93

    1. Initial program 39.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. Taylor expanded around inf 18.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. Simplified18.0

      \[\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 \cdot \left(t \cdot t\right)}{x}\right)}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity18.0

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

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

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

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

    if 1.7265785379062208e+93 < t

    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. Taylor expanded around inf 2.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -16678696720617.19:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{-\mathsf{fma}\left(\frac{\frac{t}{\sqrt{2}}}{x}, 2, \sqrt{2} \cdot t\right)}\\ \mathbf{elif}\;t \le 1.7265785379062208 \cdot 10^{+93}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(2, \sqrt{\mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)} \cdot \sqrt{\mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)}, \frac{4 \cdot \left(t \cdot t\right)}{x}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{2}{x \cdot x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x} \cdot -2\right)\right)\right)}\\ \end{array}\]

Reproduce

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