Average Error: 33.8 → 26.7
Time: 54.0s
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 r3559162 = 2.0;
        double r3559163 = n;
        double r3559164 = r3559162 * r3559163;
        double r3559165 = U;
        double r3559166 = r3559164 * r3559165;
        double r3559167 = t;
        double r3559168 = l;
        double r3559169 = r3559168 * r3559168;
        double r3559170 = Om;
        double r3559171 = r3559169 / r3559170;
        double r3559172 = r3559162 * r3559171;
        double r3559173 = r3559167 - r3559172;
        double r3559174 = r3559168 / r3559170;
        double r3559175 = pow(r3559174, r3559162);
        double r3559176 = r3559163 * r3559175;
        double r3559177 = U_;
        double r3559178 = r3559165 - r3559177;
        double r3559179 = r3559176 * r3559178;
        double r3559180 = r3559173 - r3559179;
        double r3559181 = r3559166 * r3559180;
        double r3559182 = sqrt(r3559181);
        return r3559182;
}

double f(double n, double U, double t, double l, double Om, double U_) {
        double r3559183 = U;
        double r3559184 = 1.5604221343075467e-289;
        bool r3559185 = r3559183 <= r3559184;
        double r3559186 = 2.0;
        double r3559187 = r3559186 * r3559183;
        double r3559188 = n;
        double r3559189 = U_;
        double r3559190 = r3559189 - r3559183;
        double r3559191 = Om;
        double r3559192 = l;
        double r3559193 = r3559191 / r3559192;
        double r3559194 = r3559188 / r3559193;
        double r3559195 = r3559194 / r3559193;
        double r3559196 = r3559192 / r3559193;
        double r3559197 = -2.0;
        double r3559198 = t;
        double r3559199 = fma(r3559196, r3559197, r3559198);
        double r3559200 = fma(r3559190, r3559195, r3559199);
        double r3559201 = r3559188 * r3559200;
        double r3559202 = r3559187 * r3559201;
        double r3559203 = sqrt(r3559202);
        double r3559204 = sqrt(r3559203);
        double r3559205 = r3559204 * r3559204;
        double r3559206 = sqrt(r3559201);
        double r3559207 = sqrt(r3559187);
        double r3559208 = r3559206 * r3559207;
        double r3559209 = r3559185 ? r3559205 : r3559208;
        return r3559209;
}

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*))))))