Average Error: 33.6 → 26.4
Time: 48.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 3.311625067513457 \cdot 10^{-305}:\\ \;\;\;\;\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{elif}\;U \le 3.943826962444769 \cdot 10^{-158}:\\ \;\;\;\;\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}\\ \mathbf{elif}\;U \le 1.6146438901602828 \cdot 10^{+134}:\\ \;\;\;\;\sqrt{\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 \left(\left(2 \cdot U\right) \cdot n\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 3.311625067513457 \cdot 10^{-305}:\\
\;\;\;\;\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{elif}\;U \le 3.943826962444769 \cdot 10^{-158}:\\
\;\;\;\;\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}\\

\mathbf{elif}\;U \le 1.6146438901602828 \cdot 10^{+134}:\\
\;\;\;\;\sqrt{\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 \left(\left(2 \cdot U\right) \cdot n\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 r1463440 = 2.0;
        double r1463441 = n;
        double r1463442 = r1463440 * r1463441;
        double r1463443 = U;
        double r1463444 = r1463442 * r1463443;
        double r1463445 = t;
        double r1463446 = l;
        double r1463447 = r1463446 * r1463446;
        double r1463448 = Om;
        double r1463449 = r1463447 / r1463448;
        double r1463450 = r1463440 * r1463449;
        double r1463451 = r1463445 - r1463450;
        double r1463452 = r1463446 / r1463448;
        double r1463453 = pow(r1463452, r1463440);
        double r1463454 = r1463441 * r1463453;
        double r1463455 = U_;
        double r1463456 = r1463443 - r1463455;
        double r1463457 = r1463454 * r1463456;
        double r1463458 = r1463451 - r1463457;
        double r1463459 = r1463444 * r1463458;
        double r1463460 = sqrt(r1463459);
        return r1463460;
}

double f(double n, double U, double t, double l, double Om, double U_) {
        double r1463461 = U;
        double r1463462 = 3.311625067513457e-305;
        bool r1463463 = r1463461 <= r1463462;
        double r1463464 = 2.0;
        double r1463465 = r1463464 * r1463461;
        double r1463466 = n;
        double r1463467 = U_;
        double r1463468 = r1463467 - r1463461;
        double r1463469 = Om;
        double r1463470 = l;
        double r1463471 = r1463469 / r1463470;
        double r1463472 = r1463466 / r1463471;
        double r1463473 = r1463472 / r1463471;
        double r1463474 = r1463470 / r1463471;
        double r1463475 = -2.0;
        double r1463476 = t;
        double r1463477 = fma(r1463474, r1463475, r1463476);
        double r1463478 = fma(r1463468, r1463473, r1463477);
        double r1463479 = r1463466 * r1463478;
        double r1463480 = r1463465 * r1463479;
        double r1463481 = sqrt(r1463480);
        double r1463482 = 3.943826962444769e-158;
        bool r1463483 = r1463461 <= r1463482;
        double r1463484 = sqrt(r1463479);
        double r1463485 = sqrt(r1463465);
        double r1463486 = r1463484 * r1463485;
        double r1463487 = 1.6146438901602828e+134;
        bool r1463488 = r1463461 <= r1463487;
        double r1463489 = r1463465 * r1463466;
        double r1463490 = r1463478 * r1463489;
        double r1463491 = sqrt(r1463490);
        double r1463492 = r1463488 ? r1463491 : r1463486;
        double r1463493 = r1463483 ? r1463486 : r1463492;
        double r1463494 = r1463463 ? r1463481 : r1463493;
        return r1463494;
}

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 3 regimes
  2. if U < 3.311625067513457e-305

    1. Initial program 34.5

      \[\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. Taylor expanded around 0 30.2

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

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

    if 3.311625067513457e-305 < U < 3.943826962444769e-158 or 1.6146438901602828e+134 < U

    1. Initial program 36.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. Simplified32.0

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

      \[\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)}}\]

    if 3.943826962444769e-158 < U < 1.6146438901602828e+134

    1. Initial program 29.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. Simplified24.8

      \[\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 associate-*r*24.9

      \[\leadsto \sqrt{\color{blue}{\left(\left(U \cdot 2\right) \cdot n\right) \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 3 regimes into one program.
  4. Final simplification26.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;U \le 3.311625067513457 \cdot 10^{-305}:\\ \;\;\;\;\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{elif}\;U \le 3.943826962444769 \cdot 10^{-158}:\\ \;\;\;\;\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}\\ \mathbf{elif}\;U \le 1.6146438901602828 \cdot 10^{+134}:\\ \;\;\;\;\sqrt{\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 \left(\left(2 \cdot U\right) \cdot n\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 2019143 +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*))))))