
(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*))))))
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_)))));
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\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)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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*))))))
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_)))));
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\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)}
\end{array}
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(let* ((t_1 (* n (pow (/ l_m Om) 2.0)))
(t_2
(*
(* (* 2.0 n) U)
(+ (- t (* 2.0 (/ (* l_m l_m) Om))) (* t_1 (- U* U))))))
(if (<= t_2 0.0)
(*
(sqrt (fabs (* 2.0 n)))
(sqrt (fabs (* U (- t (* (/ 2.0 Om) (pow l_m 2.0)))))))
(if (<= t_2 4e+302)
(sqrt
(*
(* 2.0 (* n U))
(- t (+ (* t_1 (- U U*)) (* 2.0 (* l_m (/ l_m Om)))))))
(*
(* l_m (sqrt 2.0))
(sqrt (* (* n U) (- (/ (* n U*) (pow Om 2.0)) (/ 2.0 Om)))))))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double t_1 = n * pow((l_m / Om), 2.0);
double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_1 * (U_42_ - U)));
double tmp;
if (t_2 <= 0.0) {
tmp = sqrt(fabs((2.0 * n))) * sqrt(fabs((U * (t - ((2.0 / Om) * pow(l_m, 2.0))))));
} else if (t_2 <= 4e+302) {
tmp = sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l_m * (l_m / Om)))))));
} else {
tmp = (l_m * sqrt(2.0)) * sqrt(((n * U) * (((n * U_42_) / pow(Om, 2.0)) - (2.0 / Om))));
}
return tmp;
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = n * ((l_m / om) ** 2.0d0)
t_2 = ((2.0d0 * n) * u) * ((t - (2.0d0 * ((l_m * l_m) / om))) + (t_1 * (u_42 - u)))
if (t_2 <= 0.0d0) then
tmp = sqrt(abs((2.0d0 * n))) * sqrt(abs((u * (t - ((2.0d0 / om) * (l_m ** 2.0d0))))))
else if (t_2 <= 4d+302) then
tmp = sqrt(((2.0d0 * (n * u)) * (t - ((t_1 * (u - u_42)) + (2.0d0 * (l_m * (l_m / om)))))))
else
tmp = (l_m * sqrt(2.0d0)) * sqrt(((n * u) * (((n * u_42) / (om ** 2.0d0)) - (2.0d0 / om))))
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double t_1 = n * Math.pow((l_m / Om), 2.0);
double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_1 * (U_42_ - U)));
double tmp;
if (t_2 <= 0.0) {
tmp = Math.sqrt(Math.abs((2.0 * n))) * Math.sqrt(Math.abs((U * (t - ((2.0 / Om) * Math.pow(l_m, 2.0))))));
} else if (t_2 <= 4e+302) {
tmp = Math.sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l_m * (l_m / Om)))))));
} else {
tmp = (l_m * Math.sqrt(2.0)) * Math.sqrt(((n * U) * (((n * U_42_) / Math.pow(Om, 2.0)) - (2.0 / Om))));
}
return tmp;
}
l_m = math.fabs(l) def code(n, U, t, l_m, Om, U_42_): t_1 = n * math.pow((l_m / Om), 2.0) t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_1 * (U_42_ - U))) tmp = 0 if t_2 <= 0.0: tmp = math.sqrt(math.fabs((2.0 * n))) * math.sqrt(math.fabs((U * (t - ((2.0 / Om) * math.pow(l_m, 2.0)))))) elif t_2 <= 4e+302: tmp = math.sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l_m * (l_m / Om))))))) else: tmp = (l_m * math.sqrt(2.0)) * math.sqrt(((n * U) * (((n * U_42_) / math.pow(Om, 2.0)) - (2.0 / Om)))) return tmp
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) t_1 = Float64(n * (Float64(l_m / Om) ^ 2.0)) t_2 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) + Float64(t_1 * Float64(U_42_ - U)))) tmp = 0.0 if (t_2 <= 0.0) tmp = Float64(sqrt(abs(Float64(2.0 * n))) * sqrt(abs(Float64(U * Float64(t - Float64(Float64(2.0 / Om) * (l_m ^ 2.0))))))); elseif (t_2 <= 4e+302) tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t - Float64(Float64(t_1 * Float64(U - U_42_)) + Float64(2.0 * Float64(l_m * Float64(l_m / Om))))))); else tmp = Float64(Float64(l_m * sqrt(2.0)) * sqrt(Float64(Float64(n * U) * Float64(Float64(Float64(n * U_42_) / (Om ^ 2.0)) - Float64(2.0 / Om))))); end return tmp end
l_m = abs(l); function tmp_2 = code(n, U, t, l_m, Om, U_42_) t_1 = n * ((l_m / Om) ^ 2.0); t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_1 * (U_42_ - U))); tmp = 0.0; if (t_2 <= 0.0) tmp = sqrt(abs((2.0 * n))) * sqrt(abs((U * (t - ((2.0 / Om) * (l_m ^ 2.0)))))); elseif (t_2 <= 4e+302) tmp = sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l_m * (l_m / Om))))))); else tmp = (l_m * sqrt(2.0)) * sqrt(((n * U) * (((n * U_42_) / (Om ^ 2.0)) - (2.0 / Om)))); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := Block[{t$95$1 = N[(n * N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[(N[Sqrt[N[Abs[N[(2.0 * n), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Abs[N[(U * N[(t - N[(N[(2.0 / Om), $MachinePrecision] * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+302], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t - N[(N[(t$95$1 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(l$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(n * U), $MachinePrecision] * N[(N[(N[(n * U$42$), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision] - N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\\
t_2 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_1 \cdot \left(U* - U\right)\right)\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;\sqrt{\left|2 \cdot n\right|} \cdot \sqrt{\left|U \cdot \left(t - \frac{2}{Om} \cdot {l\_m}^{2}\right)\right|}\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+302}:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \left(t\_1 \cdot \left(U - U*\right) + 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(l\_m \cdot \sqrt{2}\right) \cdot \sqrt{\left(n \cdot U\right) \cdot \left(\frac{n \cdot U*}{{Om}^{2}} - \frac{2}{Om}\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 7.7%
Simplified40.9%
Taylor expanded in Om around inf 37.6%
add-sqr-sqrt37.6%
pow1/237.6%
pow1/237.9%
pow-prod-down20.3%
pow220.3%
associate-*r*11.3%
cancel-sign-sub-inv11.3%
metadata-eval11.3%
Applied egg-rr11.3%
unpow1/211.3%
unpow211.3%
rem-sqrt-square11.3%
metadata-eval11.3%
cancel-sign-sub-inv11.3%
associate-*l*38.3%
associate-*r/38.3%
associate-*l/38.3%
Simplified38.3%
fabs-mul38.3%
sqrt-prod70.5%
Applied egg-rr70.5%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 4.0000000000000003e302Initial program 96.6%
Simplified96.6%
if 4.0000000000000003e302 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 20.2%
Simplified23.6%
Taylor expanded in U around 0 20.5%
associate-*r*18.8%
+-commutative18.8%
mul-1-neg18.8%
unsub-neg18.8%
associate-/l*18.0%
associate-/l*18.8%
Simplified18.8%
Taylor expanded in l around inf 23.7%
*-commutative23.7%
associate-*r*23.7%
*-commutative23.7%
associate-*r/23.7%
metadata-eval23.7%
Simplified23.7%
Final simplification59.4%
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(let* ((t_1 (* U (- t (* (/ 2.0 Om) (pow l_m 2.0)))))
(t_2 (* n (pow (/ l_m Om) 2.0)))
(t_3
(sqrt
(*
(* (* 2.0 n) U)
(+ (- t (* 2.0 (/ (* l_m l_m) Om))) (* t_2 (- U* U)))))))
(if (<= t_3 0.0)
(* (sqrt t_1) (sqrt (* 2.0 n)))
(if (<= t_3 INFINITY)
(sqrt
(*
(* 2.0 (* n U))
(- t (+ (* t_2 (- U U*)) (* 2.0 (* l_m (/ l_m Om)))))))
(sqrt (fabs (* (* 2.0 n) t_1)))))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double t_1 = U * (t - ((2.0 / Om) * pow(l_m, 2.0)));
double t_2 = n * pow((l_m / Om), 2.0);
double t_3 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_2 * (U_42_ - U)))));
double tmp;
if (t_3 <= 0.0) {
tmp = sqrt(t_1) * sqrt((2.0 * n));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt(((2.0 * (n * U)) * (t - ((t_2 * (U - U_42_)) + (2.0 * (l_m * (l_m / Om)))))));
} else {
tmp = sqrt(fabs(((2.0 * n) * t_1)));
}
return tmp;
}
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double t_1 = U * (t - ((2.0 / Om) * Math.pow(l_m, 2.0)));
double t_2 = n * Math.pow((l_m / Om), 2.0);
double t_3 = Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_2 * (U_42_ - U)))));
double tmp;
if (t_3 <= 0.0) {
tmp = Math.sqrt(t_1) * Math.sqrt((2.0 * n));
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt(((2.0 * (n * U)) * (t - ((t_2 * (U - U_42_)) + (2.0 * (l_m * (l_m / Om)))))));
} else {
tmp = Math.sqrt(Math.abs(((2.0 * n) * t_1)));
}
return tmp;
}
l_m = math.fabs(l) def code(n, U, t, l_m, Om, U_42_): t_1 = U * (t - ((2.0 / Om) * math.pow(l_m, 2.0))) t_2 = n * math.pow((l_m / Om), 2.0) t_3 = math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_2 * (U_42_ - U))))) tmp = 0 if t_3 <= 0.0: tmp = math.sqrt(t_1) * math.sqrt((2.0 * n)) elif t_3 <= math.inf: tmp = math.sqrt(((2.0 * (n * U)) * (t - ((t_2 * (U - U_42_)) + (2.0 * (l_m * (l_m / Om))))))) else: tmp = math.sqrt(math.fabs(((2.0 * n) * t_1))) return tmp
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) t_1 = Float64(U * Float64(t - Float64(Float64(2.0 / Om) * (l_m ^ 2.0)))) t_2 = Float64(n * (Float64(l_m / Om) ^ 2.0)) t_3 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) + Float64(t_2 * Float64(U_42_ - U))))) tmp = 0.0 if (t_3 <= 0.0) tmp = Float64(sqrt(t_1) * sqrt(Float64(2.0 * n))); elseif (t_3 <= Inf) tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t - Float64(Float64(t_2 * Float64(U - U_42_)) + Float64(2.0 * Float64(l_m * Float64(l_m / Om))))))); else tmp = sqrt(abs(Float64(Float64(2.0 * n) * t_1))); end return tmp end
l_m = abs(l); function tmp_2 = code(n, U, t, l_m, Om, U_42_) t_1 = U * (t - ((2.0 / Om) * (l_m ^ 2.0))); t_2 = n * ((l_m / Om) ^ 2.0); t_3 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_2 * (U_42_ - U))))); tmp = 0.0; if (t_3 <= 0.0) tmp = sqrt(t_1) * sqrt((2.0 * n)); elseif (t_3 <= Inf) tmp = sqrt(((2.0 * (n * U)) * (t - ((t_2 * (U - U_42_)) + (2.0 * (l_m * (l_m / Om))))))); else tmp = sqrt(abs(((2.0 * n) * t_1))); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := Block[{t$95$1 = N[(U * N[(t - N[(N[(2.0 / Om), $MachinePrecision] * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(n * N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[(N[Sqrt[t$95$1], $MachinePrecision] * N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t - N[(N[(t$95$2 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[Abs[N[(N[(2.0 * n), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := U \cdot \left(t - \frac{2}{Om} \cdot {l\_m}^{2}\right)\\
t_2 := n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\\
t_3 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_2 \cdot \left(U* - U\right)\right)}\\
\mathbf{if}\;t\_3 \leq 0:\\
\;\;\;\;\sqrt{t\_1} \cdot \sqrt{2 \cdot n}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \left(t\_2 \cdot \left(U - U*\right) + 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left|\left(2 \cdot n\right) \cdot t\_1\right|}\\
\end{array}
\end{array}
if (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 0.0Initial program 8.8%
Simplified36.1%
Taylor expanded in Om around inf 39.4%
pow1/239.4%
*-commutative39.4%
unpow-prod-down53.9%
pow1/253.9%
cancel-sign-sub-inv53.9%
metadata-eval53.9%
pow1/253.9%
Applied egg-rr53.9%
metadata-eval53.9%
cancel-sign-sub-inv53.9%
associate-*r/53.9%
associate-*l/53.9%
Simplified53.9%
if 0.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < +inf.0Initial program 68.9%
Simplified71.0%
if +inf.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) Initial program 0.0%
Simplified13.6%
Taylor expanded in Om around inf 8.3%
add-sqr-sqrt8.3%
pow1/28.3%
pow1/239.7%
pow-prod-down37.8%
pow237.8%
associate-*r*32.7%
cancel-sign-sub-inv32.7%
metadata-eval32.7%
Applied egg-rr32.7%
unpow1/232.7%
unpow232.7%
rem-sqrt-square32.7%
metadata-eval32.7%
cancel-sign-sub-inv32.7%
associate-*l*39.8%
associate-*r/39.8%
associate-*l/39.8%
Simplified39.8%
Final simplification63.6%
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(let* ((t_1 (* n (pow (/ l_m Om) 2.0)))
(t_2
(*
(* (* 2.0 n) U)
(+ (- t (* 2.0 (/ (* l_m l_m) Om))) (* t_1 (- U* U))))))
(if (<= t_2 0.0)
(* (sqrt (* U (- t (* (/ 2.0 Om) (pow l_m 2.0))))) (sqrt (* 2.0 n)))
(if (<= t_2 4e+302)
(sqrt
(*
(* 2.0 (* n U))
(- t (+ (* t_1 (- U U*)) (* 2.0 (* l_m (/ l_m Om)))))))
(*
(* l_m (sqrt 2.0))
(sqrt (* (* n U) (- (/ (* n U*) (pow Om 2.0)) (/ 2.0 Om)))))))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double t_1 = n * pow((l_m / Om), 2.0);
double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_1 * (U_42_ - U)));
double tmp;
if (t_2 <= 0.0) {
tmp = sqrt((U * (t - ((2.0 / Om) * pow(l_m, 2.0))))) * sqrt((2.0 * n));
} else if (t_2 <= 4e+302) {
tmp = sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l_m * (l_m / Om)))))));
} else {
tmp = (l_m * sqrt(2.0)) * sqrt(((n * U) * (((n * U_42_) / pow(Om, 2.0)) - (2.0 / Om))));
}
return tmp;
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = n * ((l_m / om) ** 2.0d0)
t_2 = ((2.0d0 * n) * u) * ((t - (2.0d0 * ((l_m * l_m) / om))) + (t_1 * (u_42 - u)))
if (t_2 <= 0.0d0) then
tmp = sqrt((u * (t - ((2.0d0 / om) * (l_m ** 2.0d0))))) * sqrt((2.0d0 * n))
else if (t_2 <= 4d+302) then
tmp = sqrt(((2.0d0 * (n * u)) * (t - ((t_1 * (u - u_42)) + (2.0d0 * (l_m * (l_m / om)))))))
else
tmp = (l_m * sqrt(2.0d0)) * sqrt(((n * u) * (((n * u_42) / (om ** 2.0d0)) - (2.0d0 / om))))
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double t_1 = n * Math.pow((l_m / Om), 2.0);
double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_1 * (U_42_ - U)));
double tmp;
if (t_2 <= 0.0) {
tmp = Math.sqrt((U * (t - ((2.0 / Om) * Math.pow(l_m, 2.0))))) * Math.sqrt((2.0 * n));
} else if (t_2 <= 4e+302) {
tmp = Math.sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l_m * (l_m / Om)))))));
} else {
tmp = (l_m * Math.sqrt(2.0)) * Math.sqrt(((n * U) * (((n * U_42_) / Math.pow(Om, 2.0)) - (2.0 / Om))));
}
return tmp;
}
l_m = math.fabs(l) def code(n, U, t, l_m, Om, U_42_): t_1 = n * math.pow((l_m / Om), 2.0) t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_1 * (U_42_ - U))) tmp = 0 if t_2 <= 0.0: tmp = math.sqrt((U * (t - ((2.0 / Om) * math.pow(l_m, 2.0))))) * math.sqrt((2.0 * n)) elif t_2 <= 4e+302: tmp = math.sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l_m * (l_m / Om))))))) else: tmp = (l_m * math.sqrt(2.0)) * math.sqrt(((n * U) * (((n * U_42_) / math.pow(Om, 2.0)) - (2.0 / Om)))) return tmp
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) t_1 = Float64(n * (Float64(l_m / Om) ^ 2.0)) t_2 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) + Float64(t_1 * Float64(U_42_ - U)))) tmp = 0.0 if (t_2 <= 0.0) tmp = Float64(sqrt(Float64(U * Float64(t - Float64(Float64(2.0 / Om) * (l_m ^ 2.0))))) * sqrt(Float64(2.0 * n))); elseif (t_2 <= 4e+302) tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t - Float64(Float64(t_1 * Float64(U - U_42_)) + Float64(2.0 * Float64(l_m * Float64(l_m / Om))))))); else tmp = Float64(Float64(l_m * sqrt(2.0)) * sqrt(Float64(Float64(n * U) * Float64(Float64(Float64(n * U_42_) / (Om ^ 2.0)) - Float64(2.0 / Om))))); end return tmp end
l_m = abs(l); function tmp_2 = code(n, U, t, l_m, Om, U_42_) t_1 = n * ((l_m / Om) ^ 2.0); t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_1 * (U_42_ - U))); tmp = 0.0; if (t_2 <= 0.0) tmp = sqrt((U * (t - ((2.0 / Om) * (l_m ^ 2.0))))) * sqrt((2.0 * n)); elseif (t_2 <= 4e+302) tmp = sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l_m * (l_m / Om))))))); else tmp = (l_m * sqrt(2.0)) * sqrt(((n * U) * (((n * U_42_) / (Om ^ 2.0)) - (2.0 / Om)))); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := Block[{t$95$1 = N[(n * N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[(N[Sqrt[N[(U * N[(t - N[(N[(2.0 / Om), $MachinePrecision] * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+302], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t - N[(N[(t$95$1 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(l$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(n * U), $MachinePrecision] * N[(N[(N[(n * U$42$), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision] - N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\\
t_2 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_1 \cdot \left(U* - U\right)\right)\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;\sqrt{U \cdot \left(t - \frac{2}{Om} \cdot {l\_m}^{2}\right)} \cdot \sqrt{2 \cdot n}\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+302}:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \left(t\_1 \cdot \left(U - U*\right) + 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(l\_m \cdot \sqrt{2}\right) \cdot \sqrt{\left(n \cdot U\right) \cdot \left(\frac{n \cdot U*}{{Om}^{2}} - \frac{2}{Om}\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 7.7%
Simplified40.9%
Taylor expanded in Om around inf 37.6%
pow1/237.9%
*-commutative37.9%
unpow-prod-down50.4%
pow1/250.3%
cancel-sign-sub-inv50.3%
metadata-eval50.3%
pow1/250.3%
Applied egg-rr50.3%
metadata-eval50.3%
cancel-sign-sub-inv50.3%
associate-*r/50.3%
associate-*l/50.3%
Simplified50.3%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 4.0000000000000003e302Initial program 96.6%
Simplified96.6%
if 4.0000000000000003e302 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 20.2%
Simplified23.6%
Taylor expanded in U around 0 20.5%
associate-*r*18.8%
+-commutative18.8%
mul-1-neg18.8%
unsub-neg18.8%
associate-/l*18.0%
associate-/l*18.8%
Simplified18.8%
Taylor expanded in l around inf 23.7%
*-commutative23.7%
associate-*r*23.7%
*-commutative23.7%
associate-*r/23.7%
metadata-eval23.7%
Simplified23.7%
Final simplification56.9%
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(let* ((t_1 (* 2.0 (* l_m (/ l_m Om))))
(t_2 (* n (pow (/ l_m Om) 2.0)))
(t_3
(*
(* (* 2.0 n) U)
(+ (- t (* 2.0 (/ (* l_m l_m) Om))) (* t_2 (- U* U))))))
(if (<= t_3 0.0)
(sqrt (* (* 2.0 n) (* U (- t t_1))))
(if (<= t_3 INFINITY)
(sqrt (* (* 2.0 (* n U)) (- t (+ (* t_2 (- U U*)) t_1))))
(sqrt (fabs (/ (* -4.0 (* U (* n (pow l_m 2.0)))) Om)))))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double t_1 = 2.0 * (l_m * (l_m / Om));
double t_2 = n * pow((l_m / Om), 2.0);
double t_3 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_2 * (U_42_ - U)));
double tmp;
if (t_3 <= 0.0) {
tmp = sqrt(((2.0 * n) * (U * (t - t_1))));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt(((2.0 * (n * U)) * (t - ((t_2 * (U - U_42_)) + t_1))));
} else {
tmp = sqrt(fabs(((-4.0 * (U * (n * pow(l_m, 2.0)))) / Om)));
}
return tmp;
}
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double t_1 = 2.0 * (l_m * (l_m / Om));
double t_2 = n * Math.pow((l_m / Om), 2.0);
double t_3 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_2 * (U_42_ - U)));
double tmp;
if (t_3 <= 0.0) {
tmp = Math.sqrt(((2.0 * n) * (U * (t - t_1))));
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt(((2.0 * (n * U)) * (t - ((t_2 * (U - U_42_)) + t_1))));
} else {
tmp = Math.sqrt(Math.abs(((-4.0 * (U * (n * Math.pow(l_m, 2.0)))) / Om)));
}
return tmp;
}
l_m = math.fabs(l) def code(n, U, t, l_m, Om, U_42_): t_1 = 2.0 * (l_m * (l_m / Om)) t_2 = n * math.pow((l_m / Om), 2.0) t_3 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_2 * (U_42_ - U))) tmp = 0 if t_3 <= 0.0: tmp = math.sqrt(((2.0 * n) * (U * (t - t_1)))) elif t_3 <= math.inf: tmp = math.sqrt(((2.0 * (n * U)) * (t - ((t_2 * (U - U_42_)) + t_1)))) else: tmp = math.sqrt(math.fabs(((-4.0 * (U * (n * math.pow(l_m, 2.0)))) / Om))) return tmp
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) t_1 = Float64(2.0 * Float64(l_m * Float64(l_m / Om))) t_2 = Float64(n * (Float64(l_m / Om) ^ 2.0)) t_3 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) + Float64(t_2 * Float64(U_42_ - U)))) tmp = 0.0 if (t_3 <= 0.0) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - t_1)))); elseif (t_3 <= Inf) tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t - Float64(Float64(t_2 * Float64(U - U_42_)) + t_1)))); else tmp = sqrt(abs(Float64(Float64(-4.0 * Float64(U * Float64(n * (l_m ^ 2.0)))) / Om))); end return tmp end
l_m = abs(l); function tmp_2 = code(n, U, t, l_m, Om, U_42_) t_1 = 2.0 * (l_m * (l_m / Om)); t_2 = n * ((l_m / Om) ^ 2.0); t_3 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_2 * (U_42_ - U))); tmp = 0.0; if (t_3 <= 0.0) tmp = sqrt(((2.0 * n) * (U * (t - t_1)))); elseif (t_3 <= Inf) tmp = sqrt(((2.0 * (n * U)) * (t - ((t_2 * (U - U_42_)) + t_1)))); else tmp = sqrt(abs(((-4.0 * (U * (n * (l_m ^ 2.0)))) / Om))); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := Block[{t$95$1 = N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(n * N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t - N[(N[(t$95$2 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[Abs[N[(N[(-4.0 * N[(U * N[(n * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\\
t_2 := n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\\
t_3 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_2 \cdot \left(U* - U\right)\right)\\
\mathbf{if}\;t\_3 \leq 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - t\_1\right)\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \left(t\_2 \cdot \left(U - U*\right) + t\_1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left|\frac{-4 \cdot \left(U \cdot \left(n \cdot {l\_m}^{2}\right)\right)}{Om}\right|}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 7.7%
Simplified40.9%
Taylor expanded in Om around inf 37.6%
unpow237.6%
associate-*r/43.6%
*-commutative43.6%
Applied egg-rr43.6%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 68.9%
Simplified71.0%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Simplified7.8%
Taylor expanded in Om around inf 6.7%
add-sqr-sqrt6.7%
pow1/26.7%
pow1/240.9%
pow-prod-down38.6%
pow238.6%
associate-*r*33.0%
cancel-sign-sub-inv33.0%
metadata-eval33.0%
Applied egg-rr33.0%
unpow1/233.0%
unpow233.0%
rem-sqrt-square33.0%
metadata-eval33.0%
cancel-sign-sub-inv33.0%
associate-*l*40.9%
associate-*r/40.9%
associate-*l/40.9%
Simplified40.9%
Taylor expanded in t around 0 41.1%
*-commutative41.1%
associate-/l*41.1%
Simplified41.1%
Final simplification62.7%
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(let* ((t_1 (* 2.0 (* l_m (/ l_m Om))))
(t_2 (* n (pow (/ l_m Om) 2.0)))
(t_3
(*
(* (* 2.0 n) U)
(+ (- t (* 2.0 (/ (* l_m l_m) Om))) (* t_2 (- U* U))))))
(if (<= t_3 0.0)
(sqrt (* (* 2.0 n) (* U (- t t_1))))
(if (<= t_3 INFINITY)
(sqrt (* (* 2.0 (* n U)) (- t (+ (* t_2 (- U U*)) t_1))))
(pow (/ (* -4.0 (* U (* n (pow l_m 2.0)))) Om) 0.5)))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double t_1 = 2.0 * (l_m * (l_m / Om));
double t_2 = n * pow((l_m / Om), 2.0);
double t_3 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_2 * (U_42_ - U)));
double tmp;
if (t_3 <= 0.0) {
tmp = sqrt(((2.0 * n) * (U * (t - t_1))));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt(((2.0 * (n * U)) * (t - ((t_2 * (U - U_42_)) + t_1))));
} else {
tmp = pow(((-4.0 * (U * (n * pow(l_m, 2.0)))) / Om), 0.5);
}
return tmp;
}
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double t_1 = 2.0 * (l_m * (l_m / Om));
double t_2 = n * Math.pow((l_m / Om), 2.0);
double t_3 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_2 * (U_42_ - U)));
double tmp;
if (t_3 <= 0.0) {
tmp = Math.sqrt(((2.0 * n) * (U * (t - t_1))));
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt(((2.0 * (n * U)) * (t - ((t_2 * (U - U_42_)) + t_1))));
} else {
tmp = Math.pow(((-4.0 * (U * (n * Math.pow(l_m, 2.0)))) / Om), 0.5);
}
return tmp;
}
l_m = math.fabs(l) def code(n, U, t, l_m, Om, U_42_): t_1 = 2.0 * (l_m * (l_m / Om)) t_2 = n * math.pow((l_m / Om), 2.0) t_3 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_2 * (U_42_ - U))) tmp = 0 if t_3 <= 0.0: tmp = math.sqrt(((2.0 * n) * (U * (t - t_1)))) elif t_3 <= math.inf: tmp = math.sqrt(((2.0 * (n * U)) * (t - ((t_2 * (U - U_42_)) + t_1)))) else: tmp = math.pow(((-4.0 * (U * (n * math.pow(l_m, 2.0)))) / Om), 0.5) return tmp
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) t_1 = Float64(2.0 * Float64(l_m * Float64(l_m / Om))) t_2 = Float64(n * (Float64(l_m / Om) ^ 2.0)) t_3 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) + Float64(t_2 * Float64(U_42_ - U)))) tmp = 0.0 if (t_3 <= 0.0) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - t_1)))); elseif (t_3 <= Inf) tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t - Float64(Float64(t_2 * Float64(U - U_42_)) + t_1)))); else tmp = Float64(Float64(-4.0 * Float64(U * Float64(n * (l_m ^ 2.0)))) / Om) ^ 0.5; end return tmp end
l_m = abs(l); function tmp_2 = code(n, U, t, l_m, Om, U_42_) t_1 = 2.0 * (l_m * (l_m / Om)); t_2 = n * ((l_m / Om) ^ 2.0); t_3 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_2 * (U_42_ - U))); tmp = 0.0; if (t_3 <= 0.0) tmp = sqrt(((2.0 * n) * (U * (t - t_1)))); elseif (t_3 <= Inf) tmp = sqrt(((2.0 * (n * U)) * (t - ((t_2 * (U - U_42_)) + t_1)))); else tmp = ((-4.0 * (U * (n * (l_m ^ 2.0)))) / Om) ^ 0.5; end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := Block[{t$95$1 = N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(n * N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t - N[(N[(t$95$2 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(N[(-4.0 * N[(U * N[(n * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision], 0.5], $MachinePrecision]]]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\\
t_2 := n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\\
t_3 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_2 \cdot \left(U* - U\right)\right)\\
\mathbf{if}\;t\_3 \leq 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - t\_1\right)\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \left(t\_2 \cdot \left(U - U*\right) + t\_1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{-4 \cdot \left(U \cdot \left(n \cdot {l\_m}^{2}\right)\right)}{Om}\right)}^{0.5}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 7.7%
Simplified40.9%
Taylor expanded in Om around inf 37.6%
unpow237.6%
associate-*r/43.6%
*-commutative43.6%
Applied egg-rr43.6%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 68.9%
Simplified71.0%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Simplified7.8%
Taylor expanded in Om around inf 6.7%
Taylor expanded in t around 0 6.9%
pow1/241.0%
associate-*r/41.0%
*-commutative41.0%
Applied egg-rr41.0%
Final simplification62.7%
l_m = (fabs.f64 l) (FPCore (n U t l_m Om U*) :precision binary64 (if (or (<= n -1.2e-37) (not (<= n 1.1e-81))) (pow (* (* (* 2.0 n) U) (+ t (* -2.0 (/ (pow l_m 2.0) Om)))) 0.5) (sqrt (* (* 2.0 n) (* U (- t (* 2.0 (* l_m (/ l_m Om)))))))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if ((n <= -1.2e-37) || !(n <= 1.1e-81)) {
tmp = pow((((2.0 * n) * U) * (t + (-2.0 * (pow(l_m, 2.0) / Om)))), 0.5);
} else {
tmp = sqrt(((2.0 * n) * (U * (t - (2.0 * (l_m * (l_m / Om)))))));
}
return tmp;
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if ((n <= (-1.2d-37)) .or. (.not. (n <= 1.1d-81))) then
tmp = (((2.0d0 * n) * u) * (t + ((-2.0d0) * ((l_m ** 2.0d0) / om)))) ** 0.5d0
else
tmp = sqrt(((2.0d0 * n) * (u * (t - (2.0d0 * (l_m * (l_m / om)))))))
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if ((n <= -1.2e-37) || !(n <= 1.1e-81)) {
tmp = Math.pow((((2.0 * n) * U) * (t + (-2.0 * (Math.pow(l_m, 2.0) / Om)))), 0.5);
} else {
tmp = Math.sqrt(((2.0 * n) * (U * (t - (2.0 * (l_m * (l_m / Om)))))));
}
return tmp;
}
l_m = math.fabs(l) def code(n, U, t, l_m, Om, U_42_): tmp = 0 if (n <= -1.2e-37) or not (n <= 1.1e-81): tmp = math.pow((((2.0 * n) * U) * (t + (-2.0 * (math.pow(l_m, 2.0) / Om)))), 0.5) else: tmp = math.sqrt(((2.0 * n) * (U * (t - (2.0 * (l_m * (l_m / Om))))))) return tmp
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) tmp = 0.0 if ((n <= -1.2e-37) || !(n <= 1.1e-81)) tmp = Float64(Float64(Float64(2.0 * n) * U) * Float64(t + Float64(-2.0 * Float64((l_m ^ 2.0) / Om)))) ^ 0.5; else tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - Float64(2.0 * Float64(l_m * Float64(l_m / Om))))))); end return tmp end
l_m = abs(l); function tmp_2 = code(n, U, t, l_m, Om, U_42_) tmp = 0.0; if ((n <= -1.2e-37) || ~((n <= 1.1e-81))) tmp = (((2.0 * n) * U) * (t + (-2.0 * ((l_m ^ 2.0) / Om)))) ^ 0.5; else tmp = sqrt(((2.0 * n) * (U * (t - (2.0 * (l_m * (l_m / Om))))))); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[Or[LessEqual[n, -1.2e-37], N[Not[LessEqual[n, 1.1e-81]], $MachinePrecision]], N[Power[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(t + N[(-2.0 * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.2 \cdot 10^{-37} \lor \neg \left(n \leq 1.1 \cdot 10^{-81}\right):\\
\;\;\;\;{\left(\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + -2 \cdot \frac{{l\_m}^{2}}{Om}\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)\right)}\\
\end{array}
\end{array}
if n < -1.19999999999999995e-37 or 1.1e-81 < n Initial program 55.2%
Simplified55.6%
Taylor expanded in Om around inf 40.0%
pow1/251.3%
associate-*r*55.0%
cancel-sign-sub-inv55.0%
metadata-eval55.0%
Applied egg-rr55.0%
if -1.19999999999999995e-37 < n < 1.1e-81Initial program 43.1%
Simplified51.2%
Taylor expanded in Om around inf 47.2%
unpow247.2%
associate-*r/52.5%
*-commutative52.5%
Applied egg-rr52.5%
Final simplification53.9%
l_m = (fabs.f64 l) (FPCore (n U t l_m Om U*) :precision binary64 (if (<= l_m 2.4e+177) (sqrt (* (* 2.0 n) (* U (- t (* 2.0 (* l_m (/ l_m Om))))))) (pow (/ (* -4.0 (* U (* n (pow l_m 2.0)))) Om) 0.5)))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if (l_m <= 2.4e+177) {
tmp = sqrt(((2.0 * n) * (U * (t - (2.0 * (l_m * (l_m / Om)))))));
} else {
tmp = pow(((-4.0 * (U * (n * pow(l_m, 2.0)))) / Om), 0.5);
}
return tmp;
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (l_m <= 2.4d+177) then
tmp = sqrt(((2.0d0 * n) * (u * (t - (2.0d0 * (l_m * (l_m / om)))))))
else
tmp = (((-4.0d0) * (u * (n * (l_m ** 2.0d0)))) / om) ** 0.5d0
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if (l_m <= 2.4e+177) {
tmp = Math.sqrt(((2.0 * n) * (U * (t - (2.0 * (l_m * (l_m / Om)))))));
} else {
tmp = Math.pow(((-4.0 * (U * (n * Math.pow(l_m, 2.0)))) / Om), 0.5);
}
return tmp;
}
l_m = math.fabs(l) def code(n, U, t, l_m, Om, U_42_): tmp = 0 if l_m <= 2.4e+177: tmp = math.sqrt(((2.0 * n) * (U * (t - (2.0 * (l_m * (l_m / Om))))))) else: tmp = math.pow(((-4.0 * (U * (n * math.pow(l_m, 2.0)))) / Om), 0.5) return tmp
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) tmp = 0.0 if (l_m <= 2.4e+177) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - Float64(2.0 * Float64(l_m * Float64(l_m / Om))))))); else tmp = Float64(Float64(-4.0 * Float64(U * Float64(n * (l_m ^ 2.0)))) / Om) ^ 0.5; end return tmp end
l_m = abs(l); function tmp_2 = code(n, U, t, l_m, Om, U_42_) tmp = 0.0; if (l_m <= 2.4e+177) tmp = sqrt(((2.0 * n) * (U * (t - (2.0 * (l_m * (l_m / Om))))))); else tmp = ((-4.0 * (U * (n * (l_m ^ 2.0)))) / Om) ^ 0.5; end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[l$95$m, 2.4e+177], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(N[(-4.0 * N[(U * N[(n * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 2.4 \cdot 10^{+177}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{-4 \cdot \left(U \cdot \left(n \cdot {l\_m}^{2}\right)\right)}{Om}\right)}^{0.5}\\
\end{array}
\end{array}
if l < 2.4e177Initial program 53.8%
Simplified57.0%
Taylor expanded in Om around inf 46.2%
unpow246.2%
associate-*r/49.1%
*-commutative49.1%
Applied egg-rr49.1%
if 2.4e177 < l Initial program 10.8%
Simplified19.7%
Taylor expanded in Om around inf 12.2%
Taylor expanded in t around 0 12.2%
pow1/233.9%
associate-*r/33.9%
*-commutative33.9%
Applied egg-rr33.9%
Final simplification47.7%
l_m = (fabs.f64 l) (FPCore (n U t l_m Om U*) :precision binary64 (sqrt (* (* 2.0 n) (* U (- t (* 2.0 (* l_m (/ l_m Om))))))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
return sqrt(((2.0 * n) * (U * (t - (2.0 * (l_m * (l_m / Om)))))));
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt(((2.0d0 * n) * (u * (t - (2.0d0 * (l_m * (l_m / om)))))))
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
return Math.sqrt(((2.0 * n) * (U * (t - (2.0 * (l_m * (l_m / Om)))))));
}
l_m = math.fabs(l) def code(n, U, t, l_m, Om, U_42_): return math.sqrt(((2.0 * n) * (U * (t - (2.0 * (l_m * (l_m / Om)))))))
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) return sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - Float64(2.0 * Float64(l_m * Float64(l_m / Om))))))) end
l_m = abs(l); function tmp = code(n, U, t, l_m, Om, U_42_) tmp = sqrt(((2.0 * n) * (U * (t - (2.0 * (l_m * (l_m / Om))))))); end
l_m = N[Abs[l], $MachinePrecision] code[n_, U_, t_, l$95$m_, Om_, U$42$_] := N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)\right)}
\end{array}
Initial program 50.0%
Simplified53.6%
Taylor expanded in Om around inf 43.1%
unpow243.1%
associate-*r/46.5%
*-commutative46.5%
Applied egg-rr46.5%
Final simplification46.5%
l_m = (fabs.f64 l) (FPCore (n U t l_m Om U*) :precision binary64 (if (<= Om 5e-235) (pow (* (* n t) (* 2.0 U)) 0.5) (sqrt (* (* 2.0 n) (* U t)))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if (Om <= 5e-235) {
tmp = pow(((n * t) * (2.0 * U)), 0.5);
} else {
tmp = sqrt(((2.0 * n) * (U * t)));
}
return tmp;
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (om <= 5d-235) then
tmp = ((n * t) * (2.0d0 * u)) ** 0.5d0
else
tmp = sqrt(((2.0d0 * n) * (u * t)))
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if (Om <= 5e-235) {
tmp = Math.pow(((n * t) * (2.0 * U)), 0.5);
} else {
tmp = Math.sqrt(((2.0 * n) * (U * t)));
}
return tmp;
}
l_m = math.fabs(l) def code(n, U, t, l_m, Om, U_42_): tmp = 0 if Om <= 5e-235: tmp = math.pow(((n * t) * (2.0 * U)), 0.5) else: tmp = math.sqrt(((2.0 * n) * (U * t))) return tmp
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) tmp = 0.0 if (Om <= 5e-235) tmp = Float64(Float64(n * t) * Float64(2.0 * U)) ^ 0.5; else tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * t))); end return tmp end
l_m = abs(l); function tmp_2 = code(n, U, t, l_m, Om, U_42_) tmp = 0.0; if (Om <= 5e-235) tmp = ((n * t) * (2.0 * U)) ^ 0.5; else tmp = sqrt(((2.0 * n) * (U * t))); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[Om, 5e-235], N[Power[N[(N[(n * t), $MachinePrecision] * N[(2.0 * U), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;Om \leq 5 \cdot 10^{-235}:\\
\;\;\;\;{\left(\left(n \cdot t\right) \cdot \left(2 \cdot U\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\
\end{array}
\end{array}
if Om < 4.9999999999999998e-235Initial program 46.7%
Simplified48.0%
Taylor expanded in t around inf 32.4%
associate-*r*32.4%
associate-*l*30.7%
*-commutative30.7%
*-commutative30.7%
*-commutative30.7%
Simplified30.7%
pow1/231.4%
associate-*r*33.3%
*-commutative33.3%
Applied egg-rr33.3%
if 4.9999999999999998e-235 < Om Initial program 54.1%
Simplified62.8%
Taylor expanded in Om around inf 50.2%
Taylor expanded in t around inf 43.1%
Final simplification37.7%
l_m = (fabs.f64 l) (FPCore (n U t l_m Om U*) :precision binary64 (if (<= Om 1.65e-232) (sqrt (* 2.0 (* U (* n t)))) (sqrt (* (* 2.0 n) (* U t)))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if (Om <= 1.65e-232) {
tmp = sqrt((2.0 * (U * (n * t))));
} else {
tmp = sqrt(((2.0 * n) * (U * t)));
}
return tmp;
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (om <= 1.65d-232) then
tmp = sqrt((2.0d0 * (u * (n * t))))
else
tmp = sqrt(((2.0d0 * n) * (u * t)))
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if (Om <= 1.65e-232) {
tmp = Math.sqrt((2.0 * (U * (n * t))));
} else {
tmp = Math.sqrt(((2.0 * n) * (U * t)));
}
return tmp;
}
l_m = math.fabs(l) def code(n, U, t, l_m, Om, U_42_): tmp = 0 if Om <= 1.65e-232: tmp = math.sqrt((2.0 * (U * (n * t)))) else: tmp = math.sqrt(((2.0 * n) * (U * t))) return tmp
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) tmp = 0.0 if (Om <= 1.65e-232) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t)))); else tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * t))); end return tmp end
l_m = abs(l); function tmp_2 = code(n, U, t, l_m, Om, U_42_) tmp = 0.0; if (Om <= 1.65e-232) tmp = sqrt((2.0 * (U * (n * t)))); else tmp = sqrt(((2.0 * n) * (U * t))); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[Om, 1.65e-232], N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;Om \leq 1.65 \cdot 10^{-232}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\
\end{array}
\end{array}
if Om < 1.64999999999999993e-232Initial program 46.4%
Simplified47.7%
Taylor expanded in t around inf 32.2%
if 1.64999999999999993e-232 < Om Initial program 54.5%
Simplified62.5%
Taylor expanded in Om around inf 49.7%
Taylor expanded in t around inf 43.5%
l_m = (fabs.f64 l) (FPCore (n U t l_m Om U*) :precision binary64 (sqrt (* t (* n (* 2.0 U)))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
return sqrt((t * (n * (2.0 * U))));
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((t * (n * (2.0d0 * u))))
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
return Math.sqrt((t * (n * (2.0 * U))));
}
l_m = math.fabs(l) def code(n, U, t, l_m, Om, U_42_): return math.sqrt((t * (n * (2.0 * U))))
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) return sqrt(Float64(t * Float64(n * Float64(2.0 * U)))) end
l_m = abs(l); function tmp = code(n, U, t, l_m, Om, U_42_) tmp = sqrt((t * (n * (2.0 * U)))); end
l_m = N[Abs[l], $MachinePrecision] code[n_, U_, t_, l$95$m_, Om_, U$42$_] := N[Sqrt[N[(t * N[(n * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\sqrt{t \cdot \left(n \cdot \left(2 \cdot U\right)\right)}
\end{array}
Initial program 50.0%
Simplified52.3%
Taylor expanded in t around inf 33.9%
associate-*r*33.9%
associate-*l*34.8%
*-commutative34.8%
*-commutative34.8%
*-commutative34.8%
Simplified34.8%
Final simplification34.8%
l_m = (fabs.f64 l) (FPCore (n U t l_m Om U*) :precision binary64 (sqrt (* 2.0 (* U (* n t)))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
return sqrt((2.0 * (U * (n * t))));
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((2.0d0 * (u * (n * t))))
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
return Math.sqrt((2.0 * (U * (n * t))));
}
l_m = math.fabs(l) def code(n, U, t, l_m, Om, U_42_): return math.sqrt((2.0 * (U * (n * t))))
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) return sqrt(Float64(2.0 * Float64(U * Float64(n * t)))) end
l_m = abs(l); function tmp = code(n, U, t, l_m, Om, U_42_) tmp = sqrt((2.0 * (U * (n * t)))); end
l_m = N[Abs[l], $MachinePrecision] code[n_, U_, t_, l$95$m_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}
\end{array}
Initial program 50.0%
Simplified52.3%
Taylor expanded in t around inf 33.9%
herbie shell --seed 2024102
(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*))))))