Average Error: 35.0 → 26.7
Time: 5.4min
Precision: binary64
Cost: 36033
\[\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}\;\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) \leq 0:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \sqrt[3]{U* - U} \cdot \left(\left(n \cdot \frac{\ell}{Om}\right) \cdot \left(\sqrt[3]{U* - U} \cdot \sqrt[3]{U* - U}\right)\right)\right)\right)\right)}\\ \mathbf{elif}\;\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) \leq \infty:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + U* \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(\ell \cdot \sqrt{n \cdot \left(U \cdot \left(\frac{n \cdot U*}{Om \cdot Om} - \left(\frac{n \cdot U}{Om \cdot Om} + \frac{2}{Om}\right)\right)\right)}\right)\\ \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}\;\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) \leq 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \sqrt[3]{U* - U} \cdot \left(\left(n \cdot \frac{\ell}{Om}\right) \cdot \left(\sqrt[3]{U* - U} \cdot \sqrt[3]{U* - U}\right)\right)\right)\right)\right)}\\

\mathbf{elif}\;\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) \leq \infty:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + U* \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)}\\

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

\end{array}
(FPCore (n U t l Om U*)
 :precision binary64
 (sqrt
  (*
   (* (* 2.0 n) U)
   (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<=
      (*
       (* (* 2.0 n) U)
       (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))
      0.0)
   (sqrt
    (*
     (* 2.0 n)
     (*
      U
      (+
       t
       (*
        (/ l Om)
        (+
         (* l -2.0)
         (*
          (cbrt (- U* U))
          (* (* n (/ l Om)) (* (cbrt (- U* U)) (cbrt (- U* U)))))))))))
   (if (<=
        (*
         (* (* 2.0 n) U)
         (-
          (- t (* 2.0 (/ (* l l) Om)))
          (* (* n (pow (/ l Om) 2.0)) (- U U*))))
        INFINITY)
     (sqrt
      (*
       (* (* 2.0 n) U)
       (+ t (* (/ l Om) (+ (* l -2.0) (* U* (* n (/ l Om))))))))
     (*
      (sqrt 2.0)
      (*
       l
       (sqrt
        (*
         n
         (*
          U
          (-
           (/ (* n U*) (* Om Om))
           (+ (/ (* n U) (* Om Om)) (/ 2.0 Om)))))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt(((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_))));
}
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if ((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))) <= 0.0) {
		tmp = sqrt((2.0 * n) * (U * (t + ((l / Om) * ((l * -2.0) + (cbrt(U_42_ - U) * ((n * (l / Om)) * (cbrt(U_42_ - U) * cbrt(U_42_ - U)))))))));
	} else if ((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))) <= ((double) INFINITY)) {
		tmp = sqrt(((2.0 * n) * U) * (t + ((l / Om) * ((l * -2.0) + (U_42_ * (n * (l / Om)))))));
	} else {
		tmp = sqrt(2.0) * (l * sqrt(n * (U * (((n * U_42_) / (Om * Om)) - (((n * U) / (Om * Om)) + (2.0 / Om))))));
	}
	return tmp;
}

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*

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error26.7
Cost31170
\[\begin{array}{l} \mathbf{if}\;\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) \leq 0:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + U* \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\ \mathbf{elif}\;\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) \leq \infty:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + U* \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(\ell \cdot \sqrt{n \cdot \left(U \cdot \left(\frac{n \cdot U*}{Om \cdot Om} - \left(\frac{n \cdot U}{Om \cdot Om} + \frac{2}{Om}\right)\right)\right)}\right)\\ \end{array}\]
Alternative 2
Error26.7
Cost30914
\[\begin{array}{l} \mathbf{if}\;\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) \leq 0:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + U* \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\ \mathbf{elif}\;\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) \leq \infty:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + U* \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(n \cdot U\right) \cdot \frac{\frac{n \cdot U*}{Om} - \left(2 + \frac{n \cdot U}{Om}\right)}{Om}} \cdot \left(\ell \cdot \sqrt{2}\right)\\ \end{array}\]
Alternative 3
Error29.7
Cost13825
\[\begin{array}{l} \mathbf{if}\;\ell \leq 9.375455422571545 \cdot 10^{+196}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + U* \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(\ell \cdot \sqrt{-2 \cdot \frac{n \cdot U}{Om}}\right)\\ \end{array}\]
Alternative 4
Error31.1
Cost8963
\[\begin{array}{l} \mathbf{if}\;U* \leq -2.288091003434274 \cdot 10^{+174}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + U* \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\ \mathbf{elif}\;U* \leq -7.37744113393698 \cdot 10^{+27}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + U* \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)}\\ \mathbf{elif}\;U* \leq 1.0265641528632078 \cdot 10^{-157}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + U* \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \left(U* - U\right) \cdot \frac{n \cdot \ell}{Om}\right)\right)}\\ \end{array}\]
Alternative 5
Error30.9
Cost8332
\[\begin{array}{l} \mathbf{if}\;U* \leq -4.2577670731976007 \cdot 10^{+173} \lor \neg \left(U* \leq -3.801842269998187 \cdot 10^{+27}\right) \land U* \leq 1.1066923262746806 \cdot 10^{-158}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + U* \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + U* \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)}\\ \end{array}\]
Alternative 6
Error30.7
Cost8200
\[\begin{array}{l} \mathbf{if}\;U \leq -8.939592240728657 \cdot 10^{-307} \lor \neg \left(U \leq 9.254280005184624 \cdot 10^{-198}\right):\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + U* \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}\\ \end{array}\]
Alternative 7
Error35.2
Cost8332
\[\begin{array}{l} \mathbf{if}\;U* \leq -8.006058640161498 \cdot 10^{+174} \lor \neg \left(U* \leq -3.198428286253744 \cdot 10^{+31}\right) \land U* \leq 4.897470277910266 \cdot 10^{-158}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell \cdot \left(\ell \cdot -2 + \frac{\ell}{Om} \cdot \left(n \cdot U*\right)\right)}{Om}\right)}\\ \end{array}\]
Alternative 8
Error35.4
Cost9028
\[\begin{array}{l} \mathbf{if}\;U* \leq -6.389588186975487 \cdot 10^{+213}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}\\ \mathbf{elif}\;U* \leq -7.7637127646784 \cdot 10^{+34}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot \left(n \cdot \left(U* - U\right)\right)\right)\right)}\\ \mathbf{elif}\;U* \leq 2.2782929962950365 \cdot 10^{-176}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}\\ \mathbf{elif}\;U* \leq 2.3947496780133307 \cdot 10^{+104}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot \left(n \cdot \left(U* - U\right)\right)\right)\right)}\\ \end{array}\]
Alternative 9
Error32.5
Cost7688
\[\begin{array}{l} \mathbf{if}\;U \leq -1.436021515694449 \cdot 10^{+29} \lor \neg \left(U \leq 5.523615901209126 \cdot 10^{-50}\right):\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}\\ \end{array}\]
Alternative 10
Error34.7
Cost7681
\[\begin{array}{l} \mathbf{if}\;U \leq 4.512649071113925 \cdot 10^{+172}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\ \end{array}\]
Alternative 11
Error41.2
Cost8453
\[\begin{array}{l} \mathbf{if}\;t \leq -1.3874823129819738 \cdot 10^{-103}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\ \mathbf{elif}\;t \leq -1.8628278213737705 \cdot 10^{-156}:\\ \;\;\;\;\sqrt{\frac{n \cdot \left(U \cdot \left(\ell \cdot \ell\right)\right)}{Om} \cdot -4}\\ \mathbf{elif}\;t \leq -7.593430322271435 \cdot 10^{-253}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\ \mathbf{elif}\;t \leq 3.13126537796642 \cdot 10^{-141}:\\ \;\;\;\;\sqrt{\frac{n \cdot \left(U \cdot \left(\ell \cdot \ell\right)\right)}{Om} \cdot -4}\\ \mathbf{elif}\;t \leq 1.2202590128081094 \cdot 10^{+201}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\ \end{array}\]
Alternative 12
Error40.2
Cost7169
\[\begin{array}{l} \mathbf{if}\;n \leq 1.8625196802125445 \cdot 10^{-172}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\ \end{array}\]
Alternative 13
Error39.6
Cost7176
\[\begin{array}{l} \mathbf{if}\;n \leq -2.0030237459866915 \cdot 10^{-25} \lor \neg \left(n \leq -7.128042310595049 \cdot 10^{-300}\right):\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\ \end{array}\]
Alternative 14
Error40.2
Cost6848
\[\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\]
Alternative 15
Error60.1
Cost64
\[1\]
Alternative 16
Error61.4
Cost64
\[0\]

Error

Derivation

  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < 0.0

    1. Initial program 57.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. Simplified52.7

      \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \frac{\ell}{Om} \cdot \left(n \cdot \left(U* - U\right)\right)\right)\right)}}\]
    3. Using strategy rm
    4. Applied associate-*r*_binary64_35951.0

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \color{blue}{\left(\frac{\ell}{Om} \cdot n\right) \cdot \left(U* - U\right)}\right)\right)}\]
    5. Simplified51.0

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \color{blue}{\left(n \cdot \frac{\ell}{Om}\right)} \cdot \left(U* - U\right)\right)\right)}\]
    6. Using strategy rm
    7. Applied associate-*l*_binary64_36036.0

      \[\leadsto \sqrt{\color{blue}{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \left(n \cdot \frac{\ell}{Om}\right) \cdot \left(U* - U\right)\right)\right)\right)}}\]
    8. Using strategy rm
    9. Applied add-cube-cbrt_binary64_45436.0

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \left(n \cdot \frac{\ell}{Om}\right) \cdot \color{blue}{\left(\left(\sqrt[3]{U* - U} \cdot \sqrt[3]{U* - U}\right) \cdot \sqrt[3]{U* - U}\right)}\right)\right)\right)}\]
    10. Applied associate-*r*_binary64_35936.0

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \color{blue}{\left(\left(n \cdot \frac{\ell}{Om}\right) \cdot \left(\sqrt[3]{U* - U} \cdot \sqrt[3]{U* - U}\right)\right) \cdot \sqrt[3]{U* - U}}\right)\right)\right)}\]
    11. Simplified36.0

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

    if 0.0 < (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < +inf.0

    1. Initial program 24.7

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

      \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \frac{\ell}{Om} \cdot \left(n \cdot \left(U* - U\right)\right)\right)\right)}}\]
    3. Using strategy rm
    4. Applied associate-*r*_binary64_35920.4

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \color{blue}{\left(\frac{\ell}{Om} \cdot n\right) \cdot \left(U* - U\right)}\right)\right)}\]
    5. Simplified20.4

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \color{blue}{\left(n \cdot \frac{\ell}{Om}\right)} \cdot \left(U* - U\right)\right)\right)}\]
    6. Taylor expanded around inf 23.7

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \color{blue}{\frac{n \cdot \left(U* \cdot \ell\right)}{Om}}\right)\right)}\]
    7. Simplified20.6

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \color{blue}{\left(n \cdot \frac{\ell}{Om}\right) \cdot U*}\right)\right)}\]
    8. Simplified20.6

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

    if +inf.0 < (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))

    1. Initial program 64.0

      \[\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. Simplified63.6

      \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \frac{\ell}{Om} \cdot \left(n \cdot \left(U* - U\right)\right)\right)\right)}}\]
    3. Taylor expanded around 0 64.0

      \[\leadsto \color{blue}{\sqrt{\left(\frac{n \cdot \left(U* \cdot {\ell}^{2}\right)}{{Om}^{2}} - \left(\frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{{Om}^{2}} + 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right) \cdot \left(U \cdot n\right)} \cdot \sqrt{2}}\]
    4. Simplified64.0

      \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{\left(\frac{\left(\ell \cdot \ell\right) \cdot \left(n \cdot \left(U* - U\right)\right)}{Om \cdot Om} + \frac{\ell}{Om} \cdot \left(\ell \cdot -2\right)\right) \cdot \left(n \cdot U\right)}}\]
    5. Taylor expanded around 0 49.4

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\sqrt{n \cdot \left(U \cdot \left(\frac{n \cdot U*}{{Om}^{2}} - \left(\frac{U \cdot n}{{Om}^{2}} + 2 \cdot \frac{1}{Om}\right)\right)\right)} \cdot \ell\right)}\]
    6. Simplified49.4

      \[\leadsto \sqrt{2} \cdot \color{blue}{\left(\ell \cdot \sqrt{n \cdot \left(U \cdot \left(\frac{n \cdot U*}{Om \cdot Om} - \left(\frac{n \cdot U}{Om \cdot Om} + \frac{2}{Om}\right)\right)\right)}\right)}\]
    7. Simplified49.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq 0:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \sqrt[3]{U* - U} \cdot \left(\left(n \cdot \frac{\ell}{Om}\right) \cdot \left(\sqrt[3]{U* - U} \cdot \sqrt[3]{U* - U}\right)\right)\right)\right)\right)}\\ \mathbf{elif}\;\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) \leq \infty:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + U* \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(\ell \cdot \sqrt{n \cdot \left(U \cdot \left(\frac{n \cdot U*}{Om \cdot Om} - \left(\frac{n \cdot U}{Om \cdot Om} + \frac{2}{Om}\right)\right)\right)}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2021014 
(FPCore (n U t l Om U*)
  :name "Toniolo and Linder, Equation (13)"
  :precision binary64
  (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))