Average Error: 33.8 → 26.7
Time: 54.5s
Precision: 64
\[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\]
\[\begin{array}{l} \mathbf{if}\;U \le 1.5604221343075467 \cdot 10^{-289}:\\ \;\;\;\;\sqrt{\sqrt{\left(2 \cdot U\right) \cdot \left(n \cdot \mathsf{fma}\left(U* - U, \frac{\frac{n}{\frac{Om}{\ell}}}{\frac{Om}{\ell}}, \mathsf{fma}\left(\frac{\ell}{\frac{Om}{\ell}}, -2, t\right)\right)\right)}} \cdot \sqrt{\sqrt{\left(2 \cdot U\right) \cdot \left(n \cdot \mathsf{fma}\left(U* - U, \frac{\frac{n}{\frac{Om}{\ell}}}{\frac{Om}{\ell}}, \mathsf{fma}\left(\frac{\ell}{\frac{Om}{\ell}}, -2, t\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{n \cdot \mathsf{fma}\left(U* - U, \frac{\frac{n}{\frac{Om}{\ell}}}{\frac{Om}{\ell}}, \mathsf{fma}\left(\frac{\ell}{\frac{Om}{\ell}}, -2, t\right)\right)} \cdot \sqrt{2 \cdot U}\\ \end{array}\]
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}
\begin{array}{l}
\mathbf{if}\;U \le 1.5604221343075467 \cdot 10^{-289}:\\
\;\;\;\;\sqrt{\sqrt{\left(2 \cdot U\right) \cdot \left(n \cdot \mathsf{fma}\left(U* - U, \frac{\frac{n}{\frac{Om}{\ell}}}{\frac{Om}{\ell}}, \mathsf{fma}\left(\frac{\ell}{\frac{Om}{\ell}}, -2, t\right)\right)\right)}} \cdot \sqrt{\sqrt{\left(2 \cdot U\right) \cdot \left(n \cdot \mathsf{fma}\left(U* - U, \frac{\frac{n}{\frac{Om}{\ell}}}{\frac{Om}{\ell}}, \mathsf{fma}\left(\frac{\ell}{\frac{Om}{\ell}}, -2, t\right)\right)\right)}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{n \cdot \mathsf{fma}\left(U* - U, \frac{\frac{n}{\frac{Om}{\ell}}}{\frac{Om}{\ell}}, \mathsf{fma}\left(\frac{\ell}{\frac{Om}{\ell}}, -2, t\right)\right)} \cdot \sqrt{2 \cdot U}\\

\end{array}
double f(double n, double U, double t, double l, double Om, double U_) {
        double r1855315 = 2.0;
        double r1855316 = n;
        double r1855317 = r1855315 * r1855316;
        double r1855318 = U;
        double r1855319 = r1855317 * r1855318;
        double r1855320 = t;
        double r1855321 = l;
        double r1855322 = r1855321 * r1855321;
        double r1855323 = Om;
        double r1855324 = r1855322 / r1855323;
        double r1855325 = r1855315 * r1855324;
        double r1855326 = r1855320 - r1855325;
        double r1855327 = r1855321 / r1855323;
        double r1855328 = pow(r1855327, r1855315);
        double r1855329 = r1855316 * r1855328;
        double r1855330 = U_;
        double r1855331 = r1855318 - r1855330;
        double r1855332 = r1855329 * r1855331;
        double r1855333 = r1855326 - r1855332;
        double r1855334 = r1855319 * r1855333;
        double r1855335 = sqrt(r1855334);
        return r1855335;
}

double f(double n, double U, double t, double l, double Om, double U_) {
        double r1855336 = U;
        double r1855337 = 1.5604221343075467e-289;
        bool r1855338 = r1855336 <= r1855337;
        double r1855339 = 2.0;
        double r1855340 = r1855339 * r1855336;
        double r1855341 = n;
        double r1855342 = U_;
        double r1855343 = r1855342 - r1855336;
        double r1855344 = Om;
        double r1855345 = l;
        double r1855346 = r1855344 / r1855345;
        double r1855347 = r1855341 / r1855346;
        double r1855348 = r1855347 / r1855346;
        double r1855349 = r1855345 / r1855346;
        double r1855350 = -2.0;
        double r1855351 = t;
        double r1855352 = fma(r1855349, r1855350, r1855351);
        double r1855353 = fma(r1855343, r1855348, r1855352);
        double r1855354 = r1855341 * r1855353;
        double r1855355 = r1855340 * r1855354;
        double r1855356 = sqrt(r1855355);
        double r1855357 = sqrt(r1855356);
        double r1855358 = r1855357 * r1855357;
        double r1855359 = sqrt(r1855354);
        double r1855360 = sqrt(r1855340);
        double r1855361 = r1855359 * r1855360;
        double r1855362 = r1855338 ? r1855358 : r1855361;
        return r1855362;
}

Error

Bits error versus n

Bits error versus U

Bits error versus t

Bits error versus l

Bits error versus Om

Bits error versus U*

Derivation

  1. Split input into 2 regimes
  2. if U < 1.5604221343075467e-289

    1. Initial program 34.2

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\]
    2. Simplified30.3

      \[\leadsto \color{blue}{\sqrt{\left(U \cdot 2\right) \cdot \left(n \cdot \mathsf{fma}\left(U* - U, \frac{\frac{n}{\frac{Om}{\ell}}}{\frac{Om}{\ell}}, \mathsf{fma}\left(\frac{\ell}{\frac{Om}{\ell}}, -2, t\right)\right)\right)}}\]
    3. Using strategy rm
    4. Applied add-sqr-sqrt30.5

      \[\leadsto \color{blue}{\sqrt{\sqrt{\left(U \cdot 2\right) \cdot \left(n \cdot \mathsf{fma}\left(U* - U, \frac{\frac{n}{\frac{Om}{\ell}}}{\frac{Om}{\ell}}, \mathsf{fma}\left(\frac{\ell}{\frac{Om}{\ell}}, -2, t\right)\right)\right)}} \cdot \sqrt{\sqrt{\left(U \cdot 2\right) \cdot \left(n \cdot \mathsf{fma}\left(U* - U, \frac{\frac{n}{\frac{Om}{\ell}}}{\frac{Om}{\ell}}, \mathsf{fma}\left(\frac{\ell}{\frac{Om}{\ell}}, -2, t\right)\right)\right)}}}\]

    if 1.5604221343075467e-289 < U

    1. Initial program 33.3

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\]
    2. Simplified29.7

      \[\leadsto \color{blue}{\sqrt{\left(U \cdot 2\right) \cdot \left(n \cdot \mathsf{fma}\left(U* - U, \frac{\frac{n}{\frac{Om}{\ell}}}{\frac{Om}{\ell}}, \mathsf{fma}\left(\frac{\ell}{\frac{Om}{\ell}}, -2, t\right)\right)\right)}}\]
    3. Using strategy rm
    4. Applied sqrt-prod22.5

      \[\leadsto \color{blue}{\sqrt{U \cdot 2} \cdot \sqrt{n \cdot \mathsf{fma}\left(U* - U, \frac{\frac{n}{\frac{Om}{\ell}}}{\frac{Om}{\ell}}, \mathsf{fma}\left(\frac{\ell}{\frac{Om}{\ell}}, -2, t\right)\right)}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification26.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;U \le 1.5604221343075467 \cdot 10^{-289}:\\ \;\;\;\;\sqrt{\sqrt{\left(2 \cdot U\right) \cdot \left(n \cdot \mathsf{fma}\left(U* - U, \frac{\frac{n}{\frac{Om}{\ell}}}{\frac{Om}{\ell}}, \mathsf{fma}\left(\frac{\ell}{\frac{Om}{\ell}}, -2, t\right)\right)\right)}} \cdot \sqrt{\sqrt{\left(2 \cdot U\right) \cdot \left(n \cdot \mathsf{fma}\left(U* - U, \frac{\frac{n}{\frac{Om}{\ell}}}{\frac{Om}{\ell}}, \mathsf{fma}\left(\frac{\ell}{\frac{Om}{\ell}}, -2, t\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{n \cdot \mathsf{fma}\left(U* - U, \frac{\frac{n}{\frac{Om}{\ell}}}{\frac{Om}{\ell}}, \mathsf{fma}\left(\frac{\ell}{\frac{Om}{\ell}}, -2, t\right)\right)} \cdot \sqrt{2 \cdot U}\\ \end{array}\]

Reproduce

herbie shell --seed 2019144 +o rules:numerics
(FPCore (n U t l Om U*)
  :name "Toniolo and Linder, Equation (13)"
  (sqrt (* (* (* 2 n) U) (- (- t (* 2 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2)) (- U U*))))))