Average Error: 43.0 → 9.0
Time: 27.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 -6.758930516841978210246323496861710927032 \cdot 10^{97}:\\ \;\;\;\;\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 4.225315466536892026145009010018028395833 \cdot 10^{92}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, 2 \cdot \left(t \cdot t + \ell \cdot \frac{\ell}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\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(x \cdot x\right) \cdot \left(2 \cdot \sqrt{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 -6.758930516841978210246323496861710927032 \cdot 10^{97}:\\
\;\;\;\;\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 4.225315466536892026145009010018028395833 \cdot 10^{92}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, 2 \cdot \left(t \cdot t + \ell \cdot \frac{\ell}{x}\right)\right)}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\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(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)}\right)\right)}\\

\end{array}
double f(double x, double l, double t) {
        double r1258074 = 2.0;
        double r1258075 = sqrt(r1258074);
        double r1258076 = t;
        double r1258077 = r1258075 * r1258076;
        double r1258078 = x;
        double r1258079 = 1.0;
        double r1258080 = r1258078 + r1258079;
        double r1258081 = r1258078 - r1258079;
        double r1258082 = r1258080 / r1258081;
        double r1258083 = l;
        double r1258084 = r1258083 * r1258083;
        double r1258085 = r1258076 * r1258076;
        double r1258086 = r1258074 * r1258085;
        double r1258087 = r1258084 + r1258086;
        double r1258088 = r1258082 * r1258087;
        double r1258089 = r1258088 - r1258084;
        double r1258090 = sqrt(r1258089);
        double r1258091 = r1258077 / r1258090;
        return r1258091;
}

double f(double x, double l, double t) {
        double r1258092 = t;
        double r1258093 = -6.758930516841978e+97;
        bool r1258094 = r1258092 <= r1258093;
        double r1258095 = 2.0;
        double r1258096 = sqrt(r1258095);
        double r1258097 = r1258096 * r1258092;
        double r1258098 = r1258095 * r1258096;
        double r1258099 = r1258095 / r1258098;
        double r1258100 = x;
        double r1258101 = r1258100 * r1258100;
        double r1258102 = r1258092 / r1258101;
        double r1258103 = r1258095 / r1258096;
        double r1258104 = r1258092 / r1258100;
        double r1258105 = r1258102 * r1258103;
        double r1258106 = fma(r1258092, r1258096, r1258105);
        double r1258107 = fma(r1258103, r1258104, r1258106);
        double r1258108 = -r1258107;
        double r1258109 = fma(r1258099, r1258102, r1258108);
        double r1258110 = r1258097 / r1258109;
        double r1258111 = 4.225315466536892e+92;
        bool r1258112 = r1258092 <= r1258111;
        double r1258113 = 4.0;
        double r1258114 = r1258092 * r1258092;
        double r1258115 = r1258114 / r1258100;
        double r1258116 = l;
        double r1258117 = r1258116 / r1258100;
        double r1258118 = r1258116 * r1258117;
        double r1258119 = r1258114 + r1258118;
        double r1258120 = r1258095 * r1258119;
        double r1258121 = fma(r1258113, r1258115, r1258120);
        double r1258122 = sqrt(r1258121);
        double r1258123 = r1258097 / r1258122;
        double r1258124 = r1258095 / r1258100;
        double r1258125 = r1258092 / r1258096;
        double r1258126 = r1258125 / r1258101;
        double r1258127 = r1258101 * r1258098;
        double r1258128 = r1258092 / r1258127;
        double r1258129 = r1258126 - r1258128;
        double r1258130 = r1258095 * r1258129;
        double r1258131 = r1258097 + r1258130;
        double r1258132 = fma(r1258124, r1258125, r1258131);
        double r1258133 = r1258097 / r1258132;
        double r1258134 = r1258112 ? r1258123 : r1258133;
        double r1258135 = r1258094 ? r1258110 : r1258134;
        return r1258135;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -6.758930516841978e+97

    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 3.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. Simplified3.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 -6.758930516841978e+97 < t < 4.225315466536892e+92

    1. Initial program 38.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 17.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. Simplified17.8

      \[\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 *-un-lft-identity17.8

      \[\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}{1 \cdot x}} + t \cdot t\right)\right)}}\]
    6. Applied times-frac13.2

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

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

    if 4.225315466536892e+92 < t

    1. Initial program 49.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 2.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. Simplified2.8

      \[\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 3 regimes into one program.
  4. Final simplification9.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -6.758930516841978210246323496861710927032 \cdot 10^{97}:\\ \;\;\;\;\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 4.225315466536892026145009010018028395833 \cdot 10^{92}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, 2 \cdot \left(t \cdot t + \ell \cdot \frac{\ell}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\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(x \cdot x\right) \cdot \left(2 \cdot \sqrt{2}\right)}\right)\right)}\\ \end{array}\]

Reproduce

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