Average Error: 43.0 → 9.0
Time: 45.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.629018353342801758747202682647704661678 \cdot 10^{99}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{\frac{t}{\sqrt{2}} \cdot \frac{2}{2}}{x \cdot x} - \left(\frac{\frac{t}{\sqrt{2}}}{x} + \frac{\frac{t}{\sqrt{2}}}{x \cdot x}\right) \cdot 2\right) - \sqrt{2} \cdot t}\\ \mathbf{elif}\;t \le 1.423524572675994608344388557654474711065 \cdot 10^{99}:\\ \;\;\;\;\frac{\left(t \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right)}{\sqrt{\mathsf{fma}\left(2, t \cdot t, \mathsf{fma}\left(2, \frac{\ell}{\frac{x}{\ell}}, \frac{\left(t \cdot t\right) \cdot 4}{x}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\frac{\frac{t}{\sqrt{2}}}{x}, 2, \mathsf{fma}\left(\sqrt{2}, t, \frac{2}{x \cdot x} \cdot \frac{t}{\sqrt{2}}\right) - \frac{\frac{t}{\sqrt{2}} \cdot \frac{2}{2}}{x \cdot x}\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.629018353342801758747202682647704661678 \cdot 10^{99}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{\frac{t}{\sqrt{2}} \cdot \frac{2}{2}}{x \cdot x} - \left(\frac{\frac{t}{\sqrt{2}}}{x} + \frac{\frac{t}{\sqrt{2}}}{x \cdot x}\right) \cdot 2\right) - \sqrt{2} \cdot t}\\

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

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

\end{array}
double f(double x, double l, double t) {
        double r1105203 = 2.0;
        double r1105204 = sqrt(r1105203);
        double r1105205 = t;
        double r1105206 = r1105204 * r1105205;
        double r1105207 = x;
        double r1105208 = 1.0;
        double r1105209 = r1105207 + r1105208;
        double r1105210 = r1105207 - r1105208;
        double r1105211 = r1105209 / r1105210;
        double r1105212 = l;
        double r1105213 = r1105212 * r1105212;
        double r1105214 = r1105205 * r1105205;
        double r1105215 = r1105203 * r1105214;
        double r1105216 = r1105213 + r1105215;
        double r1105217 = r1105211 * r1105216;
        double r1105218 = r1105217 - r1105213;
        double r1105219 = sqrt(r1105218);
        double r1105220 = r1105206 / r1105219;
        return r1105220;
}

double f(double x, double l, double t) {
        double r1105221 = t;
        double r1105222 = -6.629018353342802e+99;
        bool r1105223 = r1105221 <= r1105222;
        double r1105224 = 2.0;
        double r1105225 = sqrt(r1105224);
        double r1105226 = r1105225 * r1105221;
        double r1105227 = r1105221 / r1105225;
        double r1105228 = r1105224 / r1105224;
        double r1105229 = r1105227 * r1105228;
        double r1105230 = x;
        double r1105231 = r1105230 * r1105230;
        double r1105232 = r1105229 / r1105231;
        double r1105233 = r1105227 / r1105230;
        double r1105234 = r1105227 / r1105231;
        double r1105235 = r1105233 + r1105234;
        double r1105236 = r1105235 * r1105224;
        double r1105237 = r1105232 - r1105236;
        double r1105238 = r1105237 - r1105226;
        double r1105239 = r1105226 / r1105238;
        double r1105240 = 1.4235245726759946e+99;
        bool r1105241 = r1105221 <= r1105240;
        double r1105242 = cbrt(r1105225);
        double r1105243 = r1105221 * r1105242;
        double r1105244 = r1105242 * r1105242;
        double r1105245 = r1105243 * r1105244;
        double r1105246 = r1105221 * r1105221;
        double r1105247 = l;
        double r1105248 = r1105230 / r1105247;
        double r1105249 = r1105247 / r1105248;
        double r1105250 = 4.0;
        double r1105251 = r1105246 * r1105250;
        double r1105252 = r1105251 / r1105230;
        double r1105253 = fma(r1105224, r1105249, r1105252);
        double r1105254 = fma(r1105224, r1105246, r1105253);
        double r1105255 = sqrt(r1105254);
        double r1105256 = r1105245 / r1105255;
        double r1105257 = r1105224 / r1105231;
        double r1105258 = r1105257 * r1105227;
        double r1105259 = fma(r1105225, r1105221, r1105258);
        double r1105260 = r1105259 - r1105232;
        double r1105261 = fma(r1105233, r1105224, r1105260);
        double r1105262 = r1105226 / r1105261;
        double r1105263 = r1105241 ? r1105256 : r1105262;
        double r1105264 = r1105223 ? r1105239 : r1105263;
        return r1105264;
}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -6.629018353342802e+99

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

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

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

    if -6.629018353342802e+99 < t < 1.4235245726759946e+99

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

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

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

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

    if 1.4235245726759946e+99 < 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 3.3

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

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

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

Reproduce

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