Average Error: 33.6 → 26.4
Time: 47.7s
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 r2021192 = 2.0;
        double r2021193 = n;
        double r2021194 = r2021192 * r2021193;
        double r2021195 = U;
        double r2021196 = r2021194 * r2021195;
        double r2021197 = t;
        double r2021198 = l;
        double r2021199 = r2021198 * r2021198;
        double r2021200 = Om;
        double r2021201 = r2021199 / r2021200;
        double r2021202 = r2021192 * r2021201;
        double r2021203 = r2021197 - r2021202;
        double r2021204 = r2021198 / r2021200;
        double r2021205 = pow(r2021204, r2021192);
        double r2021206 = r2021193 * r2021205;
        double r2021207 = U_;
        double r2021208 = r2021195 - r2021207;
        double r2021209 = r2021206 * r2021208;
        double r2021210 = r2021203 - r2021209;
        double r2021211 = r2021196 * r2021210;
        double r2021212 = sqrt(r2021211);
        return r2021212;
}

double f(double n, double U, double t, double l, double Om, double U_) {
        double r2021213 = U;
        double r2021214 = 3.311625067513457e-305;
        bool r2021215 = r2021213 <= r2021214;
        double r2021216 = 2.0;
        double r2021217 = r2021216 * r2021213;
        double r2021218 = n;
        double r2021219 = U_;
        double r2021220 = r2021219 - r2021213;
        double r2021221 = Om;
        double r2021222 = l;
        double r2021223 = r2021221 / r2021222;
        double r2021224 = r2021218 / r2021223;
        double r2021225 = r2021224 / r2021223;
        double r2021226 = r2021222 / r2021223;
        double r2021227 = -2.0;
        double r2021228 = t;
        double r2021229 = fma(r2021226, r2021227, r2021228);
        double r2021230 = fma(r2021220, r2021225, r2021229);
        double r2021231 = r2021218 * r2021230;
        double r2021232 = r2021217 * r2021231;
        double r2021233 = sqrt(r2021232);
        double r2021234 = 3.943826962444769e-158;
        bool r2021235 = r2021213 <= r2021234;
        double r2021236 = sqrt(r2021231);
        double r2021237 = sqrt(r2021217);
        double r2021238 = r2021236 * r2021237;
        double r2021239 = 1.6146438901602828e+134;
        bool r2021240 = r2021213 <= r2021239;
        double r2021241 = r2021217 * r2021218;
        double r2021242 = r2021230 * r2021241;
        double r2021243 = sqrt(r2021242);
        double r2021244 = r2021240 ? r2021243 : r2021238;
        double r2021245 = r2021235 ? r2021238 : r2021244;
        double r2021246 = r2021215 ? r2021233 : r2021245;
        return r2021246;
}

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. Using strategy rm
    4. Applied associate-*r*30.7

      \[\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)}}\]
    5. Using strategy rm
    6. Applied associate-*l*29.7

      \[\leadsto \sqrt{\color{blue}{\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 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*))))))