Average Error: 41.7 → 9.3
Time: 42.0s
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 -9.865749057695657 \cdot 10^{+66}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{1}{\sqrt{2}} \cdot \frac{t}{x \cdot x} - (t \cdot \left(\sqrt{2}\right) + \left(\frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x} + \frac{t}{x \cdot x}\right)\right))_*}\\ \mathbf{elif}\;t \le -1.1247133289660739 \cdot 10^{-156}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{(\left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) \cdot 2 + \left(\frac{4 \cdot \left(t \cdot t\right)}{x}\right))_*}}\\ \mathbf{elif}\;t \le -1.0005135218675794 \cdot 10^{-221}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{1}{\sqrt{2}} \cdot \frac{t}{x \cdot x} - (t \cdot \left(\sqrt{2}\right) + \left(\frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x} + \frac{t}{x \cdot x}\right)\right))_*}\\ \mathbf{elif}\;t \le 3.0842295975516618 \cdot 10^{+63}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)}{\sqrt{(\left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) \cdot 2 + \left(\frac{4 \cdot \left(t \cdot t\right)}{x}\right))_*}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{(\left(\frac{t}{\sqrt{2} \cdot x}\right) \cdot 2 + \left(\sqrt{2} \cdot t\right))_* + \left(\frac{t}{\sqrt{2}} - \frac{\frac{t}{\sqrt{2}}}{2}\right) \cdot \frac{\frac{2}{x}}{x}}\\ \end{array}\]
double f(double x, double l, double t) {
        double r1550222 = 2.0;
        double r1550223 = sqrt(r1550222);
        double r1550224 = t;
        double r1550225 = r1550223 * r1550224;
        double r1550226 = x;
        double r1550227 = 1.0;
        double r1550228 = r1550226 + r1550227;
        double r1550229 = r1550226 - r1550227;
        double r1550230 = r1550228 / r1550229;
        double r1550231 = l;
        double r1550232 = r1550231 * r1550231;
        double r1550233 = r1550224 * r1550224;
        double r1550234 = r1550222 * r1550233;
        double r1550235 = r1550232 + r1550234;
        double r1550236 = r1550230 * r1550235;
        double r1550237 = r1550236 - r1550232;
        double r1550238 = sqrt(r1550237);
        double r1550239 = r1550225 / r1550238;
        return r1550239;
}

double f(double x, double l, double t) {
        double r1550240 = t;
        double r1550241 = -9.865749057695657e+66;
        bool r1550242 = r1550240 <= r1550241;
        double r1550243 = 2.0;
        double r1550244 = sqrt(r1550243);
        double r1550245 = r1550244 * r1550240;
        double r1550246 = 1.0;
        double r1550247 = r1550246 / r1550244;
        double r1550248 = x;
        double r1550249 = r1550248 * r1550248;
        double r1550250 = r1550240 / r1550249;
        double r1550251 = r1550247 * r1550250;
        double r1550252 = r1550243 / r1550244;
        double r1550253 = r1550240 / r1550248;
        double r1550254 = r1550253 + r1550250;
        double r1550255 = r1550252 * r1550254;
        double r1550256 = fma(r1550240, r1550244, r1550255);
        double r1550257 = r1550251 - r1550256;
        double r1550258 = r1550245 / r1550257;
        double r1550259 = -1.1247133289660739e-156;
        bool r1550260 = r1550240 <= r1550259;
        double r1550261 = l;
        double r1550262 = r1550261 / r1550248;
        double r1550263 = r1550240 * r1550240;
        double r1550264 = fma(r1550262, r1550261, r1550263);
        double r1550265 = 4.0;
        double r1550266 = r1550265 * r1550263;
        double r1550267 = r1550266 / r1550248;
        double r1550268 = fma(r1550264, r1550243, r1550267);
        double r1550269 = sqrt(r1550268);
        double r1550270 = r1550245 / r1550269;
        double r1550271 = -1.0005135218675794e-221;
        bool r1550272 = r1550240 <= r1550271;
        double r1550273 = 3.0842295975516618e+63;
        bool r1550274 = r1550240 <= r1550273;
        double r1550275 = sqrt(r1550244);
        double r1550276 = r1550275 * r1550240;
        double r1550277 = r1550275 * r1550276;
        double r1550278 = r1550277 / r1550269;
        double r1550279 = r1550244 * r1550248;
        double r1550280 = r1550240 / r1550279;
        double r1550281 = fma(r1550280, r1550243, r1550245);
        double r1550282 = r1550240 / r1550244;
        double r1550283 = r1550282 / r1550243;
        double r1550284 = r1550282 - r1550283;
        double r1550285 = r1550243 / r1550248;
        double r1550286 = r1550285 / r1550248;
        double r1550287 = r1550284 * r1550286;
        double r1550288 = r1550281 + r1550287;
        double r1550289 = r1550245 / r1550288;
        double r1550290 = r1550274 ? r1550278 : r1550289;
        double r1550291 = r1550272 ? r1550258 : r1550290;
        double r1550292 = r1550260 ? r1550270 : r1550291;
        double r1550293 = r1550242 ? r1550258 : r1550292;
        return r1550293;
}

\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 -9.865749057695657 \cdot 10^{+66}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{1}{\sqrt{2}} \cdot \frac{t}{x \cdot x} - (t \cdot \left(\sqrt{2}\right) + \left(\frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x} + \frac{t}{x \cdot x}\right)\right))_*}\\

\mathbf{elif}\;t \le -1.1247133289660739 \cdot 10^{-156}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{(\left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) \cdot 2 + \left(\frac{4 \cdot \left(t \cdot t\right)}{x}\right))_*}}\\

\mathbf{elif}\;t \le -1.0005135218675794 \cdot 10^{-221}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{1}{\sqrt{2}} \cdot \frac{t}{x \cdot x} - (t \cdot \left(\sqrt{2}\right) + \left(\frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x} + \frac{t}{x \cdot x}\right)\right))_*}\\

\mathbf{elif}\;t \le 3.0842295975516618 \cdot 10^{+63}:\\
\;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)}{\sqrt{(\left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) \cdot 2 + \left(\frac{4 \cdot \left(t \cdot t\right)}{x}\right))_*}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2} \cdot t}{(\left(\frac{t}{\sqrt{2} \cdot x}\right) \cdot 2 + \left(\sqrt{2} \cdot t\right))_* + \left(\frac{t}{\sqrt{2}} - \frac{\frac{t}{\sqrt{2}}}{2}\right) \cdot \frac{\frac{2}{x}}{x}}\\

\end{array}

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 4 regimes
  2. if t < -9.865749057695657e+66 or -1.1247133289660739e-156 < t < -1.0005135218675794e-221

    1. Initial program 48.0

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

      \[\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. Simplified7.9

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

    if -9.865749057695657e+66 < t < -1.1247133289660739e-156

    1. Initial program 26.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 9.5

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

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

    if -1.0005135218675794e-221 < t < 3.0842295975516618e+63

    1. Initial program 42.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 20.1

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{(\left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) \cdot 2 + \left(\frac{\left(t \cdot t\right) \cdot 4}{x}\right))_*}}}\]
    4. Using strategy rm
    5. Applied add-sqr-sqrt17.0

      \[\leadsto \frac{\color{blue}{\left(\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}\right)} \cdot t}{\sqrt{(\left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) \cdot 2 + \left(\frac{\left(t \cdot t\right) \cdot 4}{x}\right))_*}}\]
    6. Applied associate-*l*17.0

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

    if 3.0842295975516618e+63 < t

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -9.865749057695657 \cdot 10^{+66}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{1}{\sqrt{2}} \cdot \frac{t}{x \cdot x} - (t \cdot \left(\sqrt{2}\right) + \left(\frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x} + \frac{t}{x \cdot x}\right)\right))_*}\\ \mathbf{elif}\;t \le -1.1247133289660739 \cdot 10^{-156}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{(\left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) \cdot 2 + \left(\frac{4 \cdot \left(t \cdot t\right)}{x}\right))_*}}\\ \mathbf{elif}\;t \le -1.0005135218675794 \cdot 10^{-221}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\frac{1}{\sqrt{2}} \cdot \frac{t}{x \cdot x} - (t \cdot \left(\sqrt{2}\right) + \left(\frac{2}{\sqrt{2}} \cdot \left(\frac{t}{x} + \frac{t}{x \cdot x}\right)\right))_*}\\ \mathbf{elif}\;t \le 3.0842295975516618 \cdot 10^{+63}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)}{\sqrt{(\left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) \cdot 2 + \left(\frac{4 \cdot \left(t \cdot t\right)}{x}\right))_*}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{(\left(\frac{t}{\sqrt{2} \cdot x}\right) \cdot 2 + \left(\sqrt{2} \cdot t\right))_* + \left(\frac{t}{\sqrt{2}} - \frac{\frac{t}{\sqrt{2}}}{2}\right) \cdot \frac{\frac{2}{x}}{x}}\\ \end{array}\]

Reproduce

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