Average Error: 42.9 → 10.0
Time: 29.8s
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.91060683778735 \cdot 10^{+99}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x}, 2, -\mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \frac{2}{x} \cdot \frac{\frac{t}{\sqrt{2}}}{x}\right)\right)\right)}\\ \mathbf{elif}\;t \le -9.825191585136072 \cdot 10^{-221}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\sqrt{\mathsf{fma}\left(2, t \cdot t, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \frac{\ell}{\frac{x}{\ell}}\right)\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(2, t \cdot t, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \frac{\ell}{\frac{x}{\ell}}\right)\right)}}}\\ \mathbf{elif}\;t \le -7.929477479606887 \cdot 10^{-243}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x}, 2, -\mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \frac{2}{x} \cdot \frac{\frac{t}{\sqrt{2}}}{x}\right)\right)\right)}\\ \mathbf{elif}\;t \le 1.989394621889763 \cdot 10^{-296}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\sqrt{\mathsf{fma}\left(2, t \cdot t, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \frac{\ell}{\frac{x}{\ell}}\right)\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(2, t \cdot t, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \frac{\ell}{\frac{x}{\ell}}\right)\right)}}}\\ \mathbf{elif}\;t \le 5.519300554524216 \cdot 10^{-179}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(-2, \frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x}, \mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \frac{2}{x} \cdot \frac{\frac{t}{\sqrt{2}}}{x}\right)\right)\right)}\\ \mathbf{elif}\;t \le 8.400049024243972 \cdot 10^{+60}:\\ \;\;\;\;\frac{\left(t \cdot \sqrt{\sqrt{2}}\right) \cdot \sqrt{\sqrt{2}}}{\sqrt{\mathsf{fma}\left(2, t \cdot t, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \frac{\ell}{\frac{x}{\ell}}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(-2, \frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x}, \mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \frac{2}{x} \cdot \frac{\frac{t}{\sqrt{2}}}{x}\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 -1.91060683778735 \cdot 10^{+99}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x}, 2, -\mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \frac{2}{x} \cdot \frac{\frac{t}{\sqrt{2}}}{x}\right)\right)\right)}\\

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

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

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

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

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

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

\end{array}
double f(double x, double l, double t) {
        double r1041632 = 2.0;
        double r1041633 = sqrt(r1041632);
        double r1041634 = t;
        double r1041635 = r1041633 * r1041634;
        double r1041636 = x;
        double r1041637 = 1.0;
        double r1041638 = r1041636 + r1041637;
        double r1041639 = r1041636 - r1041637;
        double r1041640 = r1041638 / r1041639;
        double r1041641 = l;
        double r1041642 = r1041641 * r1041641;
        double r1041643 = r1041634 * r1041634;
        double r1041644 = r1041632 * r1041643;
        double r1041645 = r1041642 + r1041644;
        double r1041646 = r1041640 * r1041645;
        double r1041647 = r1041646 - r1041642;
        double r1041648 = sqrt(r1041647);
        double r1041649 = r1041635 / r1041648;
        return r1041649;
}

double f(double x, double l, double t) {
        double r1041650 = t;
        double r1041651 = -1.91060683778735e+99;
        bool r1041652 = r1041650 <= r1041651;
        double r1041653 = 2.0;
        double r1041654 = sqrt(r1041653);
        double r1041655 = r1041654 * r1041650;
        double r1041656 = r1041650 / r1041654;
        double r1041657 = r1041656 / r1041653;
        double r1041658 = x;
        double r1041659 = r1041658 * r1041658;
        double r1041660 = r1041657 / r1041659;
        double r1041661 = r1041653 / r1041658;
        double r1041662 = r1041656 / r1041658;
        double r1041663 = r1041661 * r1041662;
        double r1041664 = fma(r1041650, r1041654, r1041663);
        double r1041665 = fma(r1041661, r1041656, r1041664);
        double r1041666 = -r1041665;
        double r1041667 = fma(r1041660, r1041653, r1041666);
        double r1041668 = r1041655 / r1041667;
        double r1041669 = -9.825191585136072e-221;
        bool r1041670 = r1041650 <= r1041669;
        double r1041671 = r1041650 * r1041650;
        double r1041672 = r1041671 / r1041658;
        double r1041673 = 4.0;
        double r1041674 = l;
        double r1041675 = r1041658 / r1041674;
        double r1041676 = r1041674 / r1041675;
        double r1041677 = r1041653 * r1041676;
        double r1041678 = fma(r1041672, r1041673, r1041677);
        double r1041679 = fma(r1041653, r1041671, r1041678);
        double r1041680 = sqrt(r1041679);
        double r1041681 = sqrt(r1041680);
        double r1041682 = r1041681 * r1041681;
        double r1041683 = r1041655 / r1041682;
        double r1041684 = -7.929477479606887e-243;
        bool r1041685 = r1041650 <= r1041684;
        double r1041686 = 1.989394621889763e-296;
        bool r1041687 = r1041650 <= r1041686;
        double r1041688 = 5.519300554524216e-179;
        bool r1041689 = r1041650 <= r1041688;
        double r1041690 = -2.0;
        double r1041691 = fma(r1041690, r1041660, r1041665);
        double r1041692 = r1041655 / r1041691;
        double r1041693 = 8.400049024243972e+60;
        bool r1041694 = r1041650 <= r1041693;
        double r1041695 = sqrt(r1041654);
        double r1041696 = r1041650 * r1041695;
        double r1041697 = r1041696 * r1041695;
        double r1041698 = r1041697 / r1041680;
        double r1041699 = r1041694 ? r1041698 : r1041692;
        double r1041700 = r1041689 ? r1041692 : r1041699;
        double r1041701 = r1041687 ? r1041683 : r1041700;
        double r1041702 = r1041685 ? r1041668 : r1041701;
        double r1041703 = r1041670 ? r1041683 : r1041702;
        double r1041704 = r1041652 ? r1041668 : r1041703;
        return r1041704;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 4 regimes
  2. if t < -1.91060683778735e+99 or -9.825191585136072e-221 < t < -7.929477479606887e-243

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

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

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

    if -1.91060683778735e+99 < t < -9.825191585136072e-221 or -7.929477479606887e-243 < t < 1.989394621889763e-296

    1. Initial program 37.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 16.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. Simplified16.6

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

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

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

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

    if 1.989394621889763e-296 < t < 5.519300554524216e-179 or 8.400049024243972e+60 < t

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

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

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

    if 5.519300554524216e-179 < t < 8.400049024243972e+60

    1. Initial program 31.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 13.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. Simplified13.8

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.91060683778735 \cdot 10^{+99}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x}, 2, -\mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \frac{2}{x} \cdot \frac{\frac{t}{\sqrt{2}}}{x}\right)\right)\right)}\\ \mathbf{elif}\;t \le -9.825191585136072 \cdot 10^{-221}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\sqrt{\mathsf{fma}\left(2, t \cdot t, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \frac{\ell}{\frac{x}{\ell}}\right)\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(2, t \cdot t, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \frac{\ell}{\frac{x}{\ell}}\right)\right)}}}\\ \mathbf{elif}\;t \le -7.929477479606887 \cdot 10^{-243}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x}, 2, -\mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \frac{2}{x} \cdot \frac{\frac{t}{\sqrt{2}}}{x}\right)\right)\right)}\\ \mathbf{elif}\;t \le 1.989394621889763 \cdot 10^{-296}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\sqrt{\mathsf{fma}\left(2, t \cdot t, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \frac{\ell}{\frac{x}{\ell}}\right)\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(2, t \cdot t, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \frac{\ell}{\frac{x}{\ell}}\right)\right)}}}\\ \mathbf{elif}\;t \le 5.519300554524216 \cdot 10^{-179}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(-2, \frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x}, \mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \frac{2}{x} \cdot \frac{\frac{t}{\sqrt{2}}}{x}\right)\right)\right)}\\ \mathbf{elif}\;t \le 8.400049024243972 \cdot 10^{+60}:\\ \;\;\;\;\frac{\left(t \cdot \sqrt{\sqrt{2}}\right) \cdot \sqrt{\sqrt{2}}}{\sqrt{\mathsf{fma}\left(2, t \cdot t, \mathsf{fma}\left(\frac{t \cdot t}{x}, 4, 2 \cdot \frac{\ell}{\frac{x}{\ell}}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(-2, \frac{\frac{\frac{t}{\sqrt{2}}}{2}}{x \cdot x}, \mathsf{fma}\left(\frac{2}{x}, \frac{t}{\sqrt{2}}, \mathsf{fma}\left(t, \sqrt{2}, \frac{2}{x} \cdot \frac{\frac{t}{\sqrt{2}}}{x}\right)\right)\right)}\\ \end{array}\]

Reproduce

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