Average Error: 33.2 → 26.3
Time: 50.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.1668341231116616 \cdot 10^{-307}:\\ \;\;\;\;\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.1668341231116616 \cdot 10^{-307}:\\
\;\;\;\;\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 r2203371 = 2.0;
        double r2203372 = n;
        double r2203373 = r2203371 * r2203372;
        double r2203374 = U;
        double r2203375 = r2203373 * r2203374;
        double r2203376 = t;
        double r2203377 = l;
        double r2203378 = r2203377 * r2203377;
        double r2203379 = Om;
        double r2203380 = r2203378 / r2203379;
        double r2203381 = r2203371 * r2203380;
        double r2203382 = r2203376 - r2203381;
        double r2203383 = r2203377 / r2203379;
        double r2203384 = pow(r2203383, r2203371);
        double r2203385 = r2203372 * r2203384;
        double r2203386 = U_;
        double r2203387 = r2203374 - r2203386;
        double r2203388 = r2203385 * r2203387;
        double r2203389 = r2203382 - r2203388;
        double r2203390 = r2203375 * r2203389;
        double r2203391 = sqrt(r2203390);
        return r2203391;
}

double f(double n, double U, double t, double l, double Om, double U_) {
        double r2203392 = U;
        double r2203393 = -1.1668341231116616e-307;
        bool r2203394 = r2203392 <= r2203393;
        double r2203395 = 2.0;
        double r2203396 = r2203395 * r2203392;
        double r2203397 = n;
        double r2203398 = U_;
        double r2203399 = r2203398 - r2203392;
        double r2203400 = Om;
        double r2203401 = l;
        double r2203402 = r2203400 / r2203401;
        double r2203403 = r2203397 / r2203402;
        double r2203404 = r2203403 / r2203402;
        double r2203405 = r2203401 / r2203402;
        double r2203406 = -2.0;
        double r2203407 = t;
        double r2203408 = fma(r2203405, r2203406, r2203407);
        double r2203409 = fma(r2203399, r2203404, r2203408);
        double r2203410 = r2203397 * r2203409;
        double r2203411 = r2203396 * r2203410;
        double r2203412 = sqrt(r2203411);
        double r2203413 = sqrt(r2203412);
        double r2203414 = r2203413 * r2203413;
        double r2203415 = sqrt(r2203410);
        double r2203416 = sqrt(r2203396);
        double r2203417 = r2203415 * r2203416;
        double r2203418 = r2203394 ? r2203414 : r2203417;
        return r2203418;
}

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.1668341231116616e-307

    1. Initial program 33.4

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

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

      \[\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.1668341231116616e-307 < U

    1. Initial program 33.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;U \le -1.1668341231116616 \cdot 10^{-307}:\\ \;\;\;\;\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 2019142 +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*))))))