
(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 14 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}
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* U (* n (- (* (/ n (pow Om 2.0)) (- U* U)) (/ 2.0 Om)))))
(t_2 (pow (/ l Om) 2.0))
(t_3 (* (* n t_2) (- U* U)))
(t_4 (* (* 2.0 n) U))
(t_5 (sqrt (* t_4 (+ (- t (* 2.0 (/ (* l l) Om))) t_3)))))
(if (<= t_5 0.0)
(*
(sqrt (* 2.0 n))
(sqrt (* U (- t (fma 2.0 (/ (pow l 2.0) Om) (* n (* t_2 (- U U*))))))))
(if (<= t_5 INFINITY)
(sqrt (* t_4 (+ (- t (* 2.0 (* l (/ l Om)))) t_3)))
(* (* (cbrt t_1) (cbrt (sqrt t_1))) (* l (sqrt 2.0)))))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = U * (n * (((n / pow(Om, 2.0)) * (U_42_ - U)) - (2.0 / Om)));
double t_2 = pow((l / Om), 2.0);
double t_3 = (n * t_2) * (U_42_ - U);
double t_4 = (2.0 * n) * U;
double t_5 = sqrt((t_4 * ((t - (2.0 * ((l * l) / Om))) + t_3)));
double tmp;
if (t_5 <= 0.0) {
tmp = sqrt((2.0 * n)) * sqrt((U * (t - fma(2.0, (pow(l, 2.0) / Om), (n * (t_2 * (U - U_42_)))))));
} else if (t_5 <= ((double) INFINITY)) {
tmp = sqrt((t_4 * ((t - (2.0 * (l * (l / Om)))) + t_3)));
} else {
tmp = (cbrt(t_1) * cbrt(sqrt(t_1))) * (l * sqrt(2.0));
}
return tmp;
}
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(U * Float64(n * Float64(Float64(Float64(n / (Om ^ 2.0)) * Float64(U_42_ - U)) - Float64(2.0 / Om)))) t_2 = Float64(l / Om) ^ 2.0 t_3 = Float64(Float64(n * t_2) * Float64(U_42_ - U)) t_4 = Float64(Float64(2.0 * n) * U) t_5 = sqrt(Float64(t_4 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_3))) tmp = 0.0 if (t_5 <= 0.0) tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * Float64(t - fma(2.0, Float64((l ^ 2.0) / Om), Float64(n * Float64(t_2 * Float64(U - U_42_)))))))); elseif (t_5 <= Inf) tmp = sqrt(Float64(t_4 * Float64(Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))) + t_3))); else tmp = Float64(Float64(cbrt(t_1) * cbrt(sqrt(t_1))) * Float64(l * sqrt(2.0))); end return tmp end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(U * N[(n * N[(N[(N[(n / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] - N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(n * t$95$2), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(t$95$4 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$5, 0.0], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(t - N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] + N[(n * N[(t$95$2 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[Sqrt[N[(t$95$4 * N[(N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[Power[t$95$1, 1/3], $MachinePrecision] * N[Power[N[Sqrt[t$95$1], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] * N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := U \cdot \left(n \cdot \left(\frac{n}{{Om}^{2}} \cdot \left(U* - U\right) - \frac{2}{Om}\right)\right)\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(n \cdot t_2\right) \cdot \left(U* - U\right)\\
t_4 := \left(2 \cdot n\right) \cdot U\\
t_5 := \sqrt{t_4 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_3\right)}\\
\mathbf{if}\;t_5 \leq 0:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(2, \frac{{\ell}^{2}}{Om}, n \cdot \left(t_2 \cdot \left(U - U*\right)\right)\right)\right)}\\
\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;\sqrt{t_4 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_3\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{t_1} \cdot \sqrt[3]{\sqrt{t_1}}\right) \cdot \left(\ell \cdot \sqrt{2}\right)\\
\end{array}
\end{array}
if (sqrt.f64 (*.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.0Initial program 15.1%
associate-*l/15.1%
Applied egg-rr15.1%
pow1/215.1%
associate-*l*35.9%
unpow-prod-down36.8%
pow1/236.8%
associate--l-36.8%
fma-def36.8%
associate-*l/36.8%
unpow236.8%
associate-*l*36.8%
Applied egg-rr36.8%
*-commutative36.8%
unpow1/236.8%
*-commutative36.8%
Simplified36.8%
if 0.0 < (sqrt.f64 (*.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.0Initial program 70.7%
associate-*l/80.0%
Applied egg-rr80.0%
if +inf.0 < (sqrt.f64 (*.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*))))) Initial program 0.0%
Simplified10.8%
Taylor expanded in l around inf 26.0%
associate-/l*28.4%
associate-*r/28.4%
metadata-eval28.4%
Simplified28.4%
add-cube-cbrt28.3%
cbrt-prod28.3%
add-sqr-sqrt28.3%
associate-*r*25.5%
associate-/r/25.5%
Applied egg-rr25.6%
associate-*l*25.6%
*-commutative25.6%
associate-*l*28.3%
*-commutative28.3%
Simplified28.3%
Final simplification65.7%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (pow (/ l Om) 2.0))
(t_2 (* (* n t_1) (- U* U)))
(t_3 (* (* 2.0 n) U))
(t_4 (sqrt (* t_3 (+ (- t (* 2.0 (/ (* l l) Om))) t_2)))))
(if (<= t_4 0.0)
(*
(sqrt (* 2.0 n))
(sqrt (* U (- t (fma 2.0 (/ (pow l 2.0) Om) (* n (* t_1 (- U U*))))))))
(if (<= t_4 INFINITY)
(sqrt (* t_3 (+ (- t (* 2.0 (* l (/ l Om)))) t_2)))
(*
(* l (sqrt 2.0))
(sqrt (* U (* n (- (/ n (/ (pow Om 2.0) (- U* U))) (/ 2.0 Om))))))))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = pow((l / Om), 2.0);
double t_2 = (n * t_1) * (U_42_ - U);
double t_3 = (2.0 * n) * U;
double t_4 = sqrt((t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2)));
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt((2.0 * n)) * sqrt((U * (t - fma(2.0, (pow(l, 2.0) / Om), (n * (t_1 * (U - U_42_)))))));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((t_3 * ((t - (2.0 * (l * (l / Om)))) + t_2)));
} else {
tmp = (l * sqrt(2.0)) * sqrt((U * (n * ((n / (pow(Om, 2.0) / (U_42_ - U))) - (2.0 / Om)))));
}
return tmp;
}
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(l / Om) ^ 2.0 t_2 = Float64(Float64(n * t_1) * Float64(U_42_ - U)) t_3 = Float64(Float64(2.0 * n) * U) t_4 = sqrt(Float64(t_3 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_2))) tmp = 0.0 if (t_4 <= 0.0) tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * Float64(t - fma(2.0, Float64((l ^ 2.0) / Om), Float64(n * Float64(t_1 * Float64(U - U_42_)))))))); elseif (t_4 <= Inf) tmp = sqrt(Float64(t_3 * Float64(Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))) + t_2))); else tmp = Float64(Float64(l * sqrt(2.0)) * sqrt(Float64(U * Float64(n * Float64(Float64(n / Float64((Om ^ 2.0) / Float64(U_42_ - U))) - Float64(2.0 / Om)))))); end return tmp end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(n * t$95$1), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(t$95$3 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(t - N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] + N[(n * N[(t$95$1 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(t$95$3 * N[(N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(U * N[(n * N[(N[(n / N[(N[Power[Om, 2.0], $MachinePrecision] / N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_2 := \left(n \cdot t_1\right) \cdot \left(U* - U\right)\\
t_3 := \left(2 \cdot n\right) \cdot U\\
t_4 := \sqrt{t_3 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_2\right)}\\
\mathbf{if}\;t_4 \leq 0:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(2, \frac{{\ell}^{2}}{Om}, n \cdot \left(t_1 \cdot \left(U - U*\right)\right)\right)\right)}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_3 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_2\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{U \cdot \left(n \cdot \left(\frac{n}{\frac{{Om}^{2}}{U* - U}} - \frac{2}{Om}\right)\right)}\\
\end{array}
\end{array}
if (sqrt.f64 (*.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.0Initial program 15.1%
associate-*l/15.1%
Applied egg-rr15.1%
pow1/215.1%
associate-*l*35.9%
unpow-prod-down36.8%
pow1/236.8%
associate--l-36.8%
fma-def36.8%
associate-*l/36.8%
unpow236.8%
associate-*l*36.8%
Applied egg-rr36.8%
*-commutative36.8%
unpow1/236.8%
*-commutative36.8%
Simplified36.8%
if 0.0 < (sqrt.f64 (*.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.0Initial program 70.7%
associate-*l/80.0%
Applied egg-rr80.0%
if +inf.0 < (sqrt.f64 (*.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*))))) Initial program 0.0%
Simplified10.8%
Taylor expanded in l around inf 26.0%
associate-/l*28.4%
associate-*r/28.4%
metadata-eval28.4%
Simplified28.4%
Final simplification65.7%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* n (pow (/ l Om) 2.0)) (- U* U)))
(t_2 (* (* 2.0 n) U))
(t_3 (sqrt (* t_2 (+ (- t (* 2.0 (/ (* l l) Om))) t_1)))))
(if (<= t_3 0.0)
(sqrt (* 2.0 (* U (* n (- t (* 2.0 (/ (pow l 2.0) Om)))))))
(if (<= t_3 INFINITY)
(sqrt (* t_2 (+ (- t (* 2.0 (* l (/ l Om)))) t_1)))
(* (sqrt (* U U*)) (/ l (/ (/ Om n) (sqrt 2.0))))))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (n * pow((l / Om), 2.0)) * (U_42_ - U);
double t_2 = (2.0 * n) * U;
double t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + t_1)));
double tmp;
if (t_3 <= 0.0) {
tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (pow(l, 2.0) / Om)))))));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) + t_1)));
} else {
tmp = sqrt((U * U_42_)) * (l / ((Om / n) / sqrt(2.0)));
}
return tmp;
}
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (n * Math.pow((l / Om), 2.0)) * (U_42_ - U);
double t_2 = (2.0 * n) * U;
double t_3 = Math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + t_1)));
double tmp;
if (t_3 <= 0.0) {
tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * (Math.pow(l, 2.0) / Om)))))));
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) + t_1)));
} else {
tmp = Math.sqrt((U * U_42_)) * (l / ((Om / n) / Math.sqrt(2.0)));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): t_1 = (n * math.pow((l / Om), 2.0)) * (U_42_ - U) t_2 = (2.0 * n) * U t_3 = math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + t_1))) tmp = 0 if t_3 <= 0.0: tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * (math.pow(l, 2.0) / Om))))))) elif t_3 <= math.inf: tmp = math.sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) + t_1))) else: tmp = math.sqrt((U * U_42_)) * (l / ((Om / n) / math.sqrt(2.0))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U_42_ - U)) t_2 = Float64(Float64(2.0 * n) * U) t_3 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_1))) tmp = 0.0 if (t_3 <= 0.0) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64((l ^ 2.0) / Om))))))); elseif (t_3 <= Inf) tmp = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))) + t_1))); else tmp = Float64(sqrt(Float64(U * U_42_)) * Float64(l / Float64(Float64(Om / n) / sqrt(2.0)))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (n * ((l / Om) ^ 2.0)) * (U_42_ - U); t_2 = (2.0 * n) * U; t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + t_1))); tmp = 0.0; if (t_3 <= 0.0) tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l ^ 2.0) / Om))))))); elseif (t_3 <= Inf) tmp = sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) + t_1))); else tmp = sqrt((U * U_42_)) * (l / ((Om / n) / sqrt(2.0))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(U * U$42$), $MachinePrecision]], $MachinePrecision] * N[(l / N[(N[(Om / n), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := \sqrt{t_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_1\right)}\\
\mathbf{if}\;t_3 \leq 0:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\sqrt{t_2 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_1\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{U \cdot U*} \cdot \frac{\ell}{\frac{\frac{Om}{n}}{\sqrt{2}}}\\
\end{array}
\end{array}
if (sqrt.f64 (*.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.0Initial program 15.1%
Simplified15.1%
Taylor expanded in n around 0 35.9%
if 0.0 < (sqrt.f64 (*.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.0Initial program 70.7%
associate-*l/80.0%
Applied egg-rr80.0%
if +inf.0 < (sqrt.f64 (*.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*))))) Initial program 0.0%
Simplified10.8%
Taylor expanded in U* around inf 24.0%
Taylor expanded in n around 0 17.0%
associate-*l/16.8%
*-commutative16.8%
associate-*l/17.0%
associate-/l*16.9%
associate-/r*16.9%
Simplified16.9%
Final simplification63.8%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2 (pow (/ l Om) 2.0))
(t_3 (* (* n t_2) (- U* U)))
(t_4 (* t_1 (+ (- t (* 2.0 (/ (* l l) Om))) t_3))))
(if (<= t_4 0.0)
(sqrt
(*
(* 2.0 n)
(* U (+ (+ t (* -2.0 (/ l (/ Om l)))) (* n (* t_2 (- U* U)))))))
(if (<= t_4 INFINITY)
(sqrt (* t_1 (+ (- t (* 2.0 (* l (/ l Om)))) t_3)))
(*
(* l (sqrt 2.0))
(sqrt (* U (* n (- (/ (* n U*) (pow Om 2.0)) (/ 2.0 Om))))))))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = pow((l / Om), 2.0);
double t_3 = (n * t_2) * (U_42_ - U);
double t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3);
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U)))))));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((t_1 * ((t - (2.0 * (l * (l / Om)))) + t_3)));
} else {
tmp = (l * sqrt(2.0)) * sqrt((U * (n * (((n * U_42_) / pow(Om, 2.0)) - (2.0 / Om)))));
}
return tmp;
}
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = Math.pow((l / Om), 2.0);
double t_3 = (n * t_2) * (U_42_ - U);
double t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3);
double tmp;
if (t_4 <= 0.0) {
tmp = Math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U)))))));
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_1 * ((t - (2.0 * (l * (l / Om)))) + t_3)));
} else {
tmp = (l * Math.sqrt(2.0)) * Math.sqrt((U * (n * (((n * U_42_) / Math.pow(Om, 2.0)) - (2.0 / Om)))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): t_1 = (2.0 * n) * U t_2 = math.pow((l / Om), 2.0) t_3 = (n * t_2) * (U_42_ - U) t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3) tmp = 0 if t_4 <= 0.0: tmp = math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U))))))) elif t_4 <= math.inf: tmp = math.sqrt((t_1 * ((t - (2.0 * (l * (l / Om)))) + t_3))) else: tmp = (l * math.sqrt(2.0)) * math.sqrt((U * (n * (((n * U_42_) / math.pow(Om, 2.0)) - (2.0 / Om))))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) t_2 = Float64(l / Om) ^ 2.0 t_3 = Float64(Float64(n * t_2) * Float64(U_42_ - U)) t_4 = Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_3)) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(Float64(t + Float64(-2.0 * Float64(l / Float64(Om / l)))) + Float64(n * Float64(t_2 * Float64(U_42_ - U))))))); elseif (t_4 <= Inf) tmp = sqrt(Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))) + t_3))); else tmp = Float64(Float64(l * sqrt(2.0)) * sqrt(Float64(U * Float64(n * Float64(Float64(Float64(n * U_42_) / (Om ^ 2.0)) - Float64(2.0 / Om)))))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (2.0 * n) * U; t_2 = (l / Om) ^ 2.0; t_3 = (n * t_2) * (U_42_ - U); t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3); tmp = 0.0; if (t_4 <= 0.0) tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U))))))); elseif (t_4 <= Inf) tmp = sqrt((t_1 * ((t - (2.0 * (l * (l / Om)))) + t_3))); else tmp = (l * sqrt(2.0)) * sqrt((U * (n * (((n * U_42_) / (Om ^ 2.0)) - (2.0 / Om))))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(n * t$95$2), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(t + N[(-2.0 * N[(l / N[(Om / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(t$95$2 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(t$95$1 * N[(N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(U * N[(n * N[(N[(N[(n * U$42$), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision] - N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(n \cdot t_2\right) \cdot \left(U* - U\right)\\
t_4 := t_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_3\right)\\
\mathbf{if}\;t_4 \leq 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t + -2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) + n \cdot \left(t_2 \cdot \left(U* - U\right)\right)\right)\right)}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_1 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_3\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot U*}{{Om}^{2}} - \frac{2}{Om}\right)\right)}\\
\end{array}
\end{array}
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.0Initial program 14.0%
Simplified35.7%
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.0Initial program 70.7%
associate-*l/80.0%
Applied egg-rr80.0%
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*)))) Initial program 0.0%
Simplified8.9%
Taylor expanded in l around inf 25.4%
associate-/l*27.9%
associate-*r/27.9%
metadata-eval27.9%
Simplified27.9%
Taylor expanded in U* around inf 25.4%
*-commutative25.4%
Simplified25.4%
Final simplification65.2%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2 (pow (/ l Om) 2.0))
(t_3 (* (* n t_2) (- U* U)))
(t_4 (* t_1 (+ (- t (* 2.0 (/ (* l l) Om))) t_3))))
(if (<= t_4 0.0)
(sqrt
(*
(* 2.0 n)
(* U (+ (+ t (* -2.0 (/ l (/ Om l)))) (* n (* t_2 (- U* U)))))))
(if (<= t_4 INFINITY)
(sqrt (* t_1 (+ (- t (* 2.0 (* l (/ l Om)))) t_3)))
(sqrt (* 2.0 (* (* U U*) (* (pow (* n l) 2.0) (pow Om -2.0)))))))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = pow((l / Om), 2.0);
double t_3 = (n * t_2) * (U_42_ - U);
double t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3);
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U)))))));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((t_1 * ((t - (2.0 * (l * (l / Om)))) + t_3)));
} else {
tmp = sqrt((2.0 * ((U * U_42_) * (pow((n * l), 2.0) * pow(Om, -2.0)))));
}
return tmp;
}
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = Math.pow((l / Om), 2.0);
double t_3 = (n * t_2) * (U_42_ - U);
double t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3);
double tmp;
if (t_4 <= 0.0) {
tmp = Math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U)))))));
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_1 * ((t - (2.0 * (l * (l / Om)))) + t_3)));
} else {
tmp = Math.sqrt((2.0 * ((U * U_42_) * (Math.pow((n * l), 2.0) * Math.pow(Om, -2.0)))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): t_1 = (2.0 * n) * U t_2 = math.pow((l / Om), 2.0) t_3 = (n * t_2) * (U_42_ - U) t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3) tmp = 0 if t_4 <= 0.0: tmp = math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U))))))) elif t_4 <= math.inf: tmp = math.sqrt((t_1 * ((t - (2.0 * (l * (l / Om)))) + t_3))) else: tmp = math.sqrt((2.0 * ((U * U_42_) * (math.pow((n * l), 2.0) * math.pow(Om, -2.0))))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) t_2 = Float64(l / Om) ^ 2.0 t_3 = Float64(Float64(n * t_2) * Float64(U_42_ - U)) t_4 = Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_3)) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(Float64(t + Float64(-2.0 * Float64(l / Float64(Om / l)))) + Float64(n * Float64(t_2 * Float64(U_42_ - U))))))); elseif (t_4 <= Inf) tmp = sqrt(Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))) + t_3))); else tmp = sqrt(Float64(2.0 * Float64(Float64(U * U_42_) * Float64((Float64(n * l) ^ 2.0) * (Om ^ -2.0))))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (2.0 * n) * U; t_2 = (l / Om) ^ 2.0; t_3 = (n * t_2) * (U_42_ - U); t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3); tmp = 0.0; if (t_4 <= 0.0) tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U))))))); elseif (t_4 <= Inf) tmp = sqrt((t_1 * ((t - (2.0 * (l * (l / Om)))) + t_3))); else tmp = sqrt((2.0 * ((U * U_42_) * (((n * l) ^ 2.0) * (Om ^ -2.0))))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(n * t$95$2), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(t + N[(-2.0 * N[(l / N[(Om / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(t$95$2 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(t$95$1 * N[(N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(N[(U * U$42$), $MachinePrecision] * N[(N[Power[N[(n * l), $MachinePrecision], 2.0], $MachinePrecision] * N[Power[Om, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(n \cdot t_2\right) \cdot \left(U* - U\right)\\
t_4 := t_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_3\right)\\
\mathbf{if}\;t_4 \leq 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t + -2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) + n \cdot \left(t_2 \cdot \left(U* - U\right)\right)\right)\right)}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_1 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_3\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(U \cdot U*\right) \cdot \left({\left(n \cdot \ell\right)}^{2} \cdot {Om}^{-2}\right)\right)}\\
\end{array}
\end{array}
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.0Initial program 14.0%
Simplified35.7%
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.0Initial program 70.7%
associate-*l/80.0%
Applied egg-rr80.0%
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*)))) Initial program 0.0%
Simplified8.9%
Taylor expanded in U* around inf 30.4%
expm1-log1p-u30.1%
expm1-udef30.1%
div-inv30.1%
associate-*r*30.0%
pow-prod-down30.7%
pow-flip30.7%
metadata-eval30.7%
Applied egg-rr30.7%
expm1-def30.7%
expm1-log1p30.9%
associate-*l*30.9%
Simplified30.9%
Final simplification66.0%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(if (<= U 8.4e+129)
(sqrt
(*
(* 2.0 n)
(*
U
(+
(+ t (* -2.0 (/ l (/ Om l))))
(* n (* (pow (/ l Om) 2.0) (- U* U)))))))
(sqrt (fabs (* t (* n (* 2.0 U)))))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 8.4e+129) {
tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (pow((l / Om), 2.0) * (U_42_ - U)))))));
} else {
tmp = sqrt(fabs((t * (n * (2.0 * U)))));
}
return tmp;
}
NOTE: l should be positive before calling this function
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
real(8) :: tmp
if (u <= 8.4d+129) then
tmp = sqrt(((2.0d0 * n) * (u * ((t + ((-2.0d0) * (l / (om / l)))) + (n * (((l / om) ** 2.0d0) * (u_42 - u)))))))
else
tmp = sqrt(abs((t * (n * (2.0d0 * u)))))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 8.4e+129) {
tmp = Math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (Math.pow((l / Om), 2.0) * (U_42_ - U)))))));
} else {
tmp = Math.sqrt(Math.abs((t * (n * (2.0 * U)))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if U <= 8.4e+129: tmp = math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (math.pow((l / Om), 2.0) * (U_42_ - U))))))) else: tmp = math.sqrt(math.fabs((t * (n * (2.0 * U))))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= 8.4e+129) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(Float64(t + Float64(-2.0 * Float64(l / Float64(Om / l)))) + Float64(n * Float64((Float64(l / Om) ^ 2.0) * Float64(U_42_ - U))))))); else tmp = sqrt(abs(Float64(t * Float64(n * Float64(2.0 * U))))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U <= 8.4e+129) tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (((l / Om) ^ 2.0) * (U_42_ - U))))))); else tmp = sqrt(abs((t * (n * (2.0 * U))))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, 8.4e+129], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(t + N[(-2.0 * N[(l / N[(Om / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[Abs[N[(t * N[(n * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;U \leq 8.4 \cdot 10^{+129}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t + -2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) + n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U* - U\right)\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left|t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right|}\\
\end{array}
\end{array}
if U < 8.39999999999999986e129Initial program 50.9%
Simplified56.6%
if 8.39999999999999986e129 < U Initial program 56.5%
associate-*l/74.0%
Applied egg-rr74.0%
Taylor expanded in t around inf 56.4%
associate-*r*39.0%
pow139.0%
metadata-eval39.0%
metadata-eval39.0%
metadata-eval39.0%
pow-prod-up48.1%
pow-prod-down42.3%
pow242.3%
metadata-eval42.3%
Applied egg-rr42.3%
unpow1/242.3%
unpow242.3%
rem-sqrt-square48.4%
associate-*r*65.8%
associate-*r*65.8%
*-commutative65.8%
*-commutative65.8%
*-commutative65.8%
*-commutative65.8%
associate-*l*65.8%
Simplified65.8%
Final simplification57.8%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(if (<= t -1.25e+38)
(pow (* (* 2.0 U) (* n t)) 0.5)
(if (<= t 4.3e+209)
(sqrt (* 2.0 (* U (* n (- t (* 2.0 (/ (pow l 2.0) Om)))))))
(* (sqrt (* n (* 2.0 U))) (sqrt t)))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= -1.25e+38) {
tmp = pow(((2.0 * U) * (n * t)), 0.5);
} else if (t <= 4.3e+209) {
tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (pow(l, 2.0) / Om)))))));
} else {
tmp = sqrt((n * (2.0 * U))) * sqrt(t);
}
return tmp;
}
NOTE: l should be positive before calling this function
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
real(8) :: tmp
if (t <= (-1.25d+38)) then
tmp = ((2.0d0 * u) * (n * t)) ** 0.5d0
else if (t <= 4.3d+209) then
tmp = sqrt((2.0d0 * (u * (n * (t - (2.0d0 * ((l ** 2.0d0) / om)))))))
else
tmp = sqrt((n * (2.0d0 * u))) * sqrt(t)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= -1.25e+38) {
tmp = Math.pow(((2.0 * U) * (n * t)), 0.5);
} else if (t <= 4.3e+209) {
tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * (Math.pow(l, 2.0) / Om)))))));
} else {
tmp = Math.sqrt((n * (2.0 * U))) * Math.sqrt(t);
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if t <= -1.25e+38: tmp = math.pow(((2.0 * U) * (n * t)), 0.5) elif t <= 4.3e+209: tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * (math.pow(l, 2.0) / Om))))))) else: tmp = math.sqrt((n * (2.0 * U))) * math.sqrt(t) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= -1.25e+38) tmp = Float64(Float64(2.0 * U) * Float64(n * t)) ^ 0.5; elseif (t <= 4.3e+209) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64((l ^ 2.0) / Om))))))); else tmp = Float64(sqrt(Float64(n * Float64(2.0 * U))) * sqrt(t)); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (t <= -1.25e+38) tmp = ((2.0 * U) * (n * t)) ^ 0.5; elseif (t <= 4.3e+209) tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l ^ 2.0) / Om))))))); else tmp = sqrt((n * (2.0 * U))) * sqrt(t); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, -1.25e+38], N[Power[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], If[LessEqual[t, 4.3e+209], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(n * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+38}:\\
\;\;\;\;{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{0.5}\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{+209}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{n \cdot \left(2 \cdot U\right)} \cdot \sqrt{t}\\
\end{array}
\end{array}
if t < -1.24999999999999992e38Initial program 49.7%
Simplified60.6%
Taylor expanded in l around 0 54.4%
pow1/263.5%
associate-*r*63.5%
Applied egg-rr63.5%
if -1.24999999999999992e38 < t < 4.29999999999999988e209Initial program 51.8%
Simplified56.8%
Taylor expanded in n around 0 45.7%
if 4.29999999999999988e209 < t Initial program 53.9%
associate-*l/63.3%
Applied egg-rr63.3%
Taylor expanded in t around inf 58.9%
sqrt-prod76.4%
associate-*l*76.4%
Applied egg-rr76.4%
*-commutative76.4%
*-commutative76.4%
*-commutative76.4%
associate-*l*76.4%
Simplified76.4%
Final simplification51.2%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (or (<= l 6.1e+63) (and (not (<= l 2.5e+166)) (<= l 2.8e+224))) (sqrt (fabs (* t (* n (* 2.0 U))))) (sqrt (* -4.0 (/ (* U (* n (pow l 2.0))) Om)))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if ((l <= 6.1e+63) || (!(l <= 2.5e+166) && (l <= 2.8e+224))) {
tmp = sqrt(fabs((t * (n * (2.0 * U)))));
} else {
tmp = sqrt((-4.0 * ((U * (n * pow(l, 2.0))) / Om)));
}
return tmp;
}
NOTE: l should be positive before calling this function
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
real(8) :: tmp
if ((l <= 6.1d+63) .or. (.not. (l <= 2.5d+166)) .and. (l <= 2.8d+224)) then
tmp = sqrt(abs((t * (n * (2.0d0 * u)))))
else
tmp = sqrt(((-4.0d0) * ((u * (n * (l ** 2.0d0))) / om)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if ((l <= 6.1e+63) || (!(l <= 2.5e+166) && (l <= 2.8e+224))) {
tmp = Math.sqrt(Math.abs((t * (n * (2.0 * U)))));
} else {
tmp = Math.sqrt((-4.0 * ((U * (n * Math.pow(l, 2.0))) / Om)));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if (l <= 6.1e+63) or (not (l <= 2.5e+166) and (l <= 2.8e+224)): tmp = math.sqrt(math.fabs((t * (n * (2.0 * U))))) else: tmp = math.sqrt((-4.0 * ((U * (n * math.pow(l, 2.0))) / Om))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if ((l <= 6.1e+63) || (!(l <= 2.5e+166) && (l <= 2.8e+224))) tmp = sqrt(abs(Float64(t * Float64(n * Float64(2.0 * U))))); else tmp = sqrt(Float64(-4.0 * Float64(Float64(U * Float64(n * (l ^ 2.0))) / Om))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if ((l <= 6.1e+63) || (~((l <= 2.5e+166)) && (l <= 2.8e+224))) tmp = sqrt(abs((t * (n * (2.0 * U))))); else tmp = sqrt((-4.0 * ((U * (n * (l ^ 2.0))) / Om))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := If[Or[LessEqual[l, 6.1e+63], And[N[Not[LessEqual[l, 2.5e+166]], $MachinePrecision], LessEqual[l, 2.8e+224]]], N[Sqrt[N[Abs[N[(t * N[(n * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(-4.0 * N[(N[(U * N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 6.1 \cdot 10^{+63} \lor \neg \left(\ell \leq 2.5 \cdot 10^{+166}\right) \land \ell \leq 2.8 \cdot 10^{+224}:\\
\;\;\;\;\sqrt{\left|t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right|}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{-4 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om}}\\
\end{array}
\end{array}
if l < 6.09999999999999968e63 or 2.5000000000000001e166 < l < 2.80000000000000008e224Initial program 53.8%
associate-*l/60.1%
Applied egg-rr60.1%
Taylor expanded in t around inf 40.2%
associate-*r*38.0%
pow138.0%
metadata-eval38.0%
metadata-eval38.0%
metadata-eval38.0%
pow-prod-up39.0%
pow-prod-down28.1%
pow228.1%
metadata-eval28.1%
Applied egg-rr28.1%
unpow1/228.1%
unpow228.1%
rem-sqrt-square39.5%
associate-*r*42.6%
associate-*r*42.6%
*-commutative42.6%
*-commutative42.6%
*-commutative42.6%
*-commutative42.6%
associate-*l*42.6%
Simplified42.6%
if 6.09999999999999968e63 < l < 2.5000000000000001e166 or 2.80000000000000008e224 < l Initial program 40.1%
associate-*l/50.4%
Applied egg-rr50.4%
Taylor expanded in n around 0 38.5%
Taylor expanded in t around 0 36.6%
Final simplification41.7%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (sqrt (fabs (* t (* n (* 2.0 U)))))) (t_2 (* n (pow l 2.0))))
(if (<= l 2.4e+61)
t_1
(if (<= l 3.2e+166)
(sqrt (* -4.0 (/ U (/ Om t_2))))
(if (<= l 5.8e+224) t_1 (sqrt (* -4.0 (/ (* U t_2) Om))))))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt(fabs((t * (n * (2.0 * U)))));
double t_2 = n * pow(l, 2.0);
double tmp;
if (l <= 2.4e+61) {
tmp = t_1;
} else if (l <= 3.2e+166) {
tmp = sqrt((-4.0 * (U / (Om / t_2))));
} else if (l <= 5.8e+224) {
tmp = t_1;
} else {
tmp = sqrt((-4.0 * ((U * t_2) / Om)));
}
return tmp;
}
NOTE: l should be positive before calling this function
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
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt(abs((t * (n * (2.0d0 * u)))))
t_2 = n * (l ** 2.0d0)
if (l <= 2.4d+61) then
tmp = t_1
else if (l <= 3.2d+166) then
tmp = sqrt(((-4.0d0) * (u / (om / t_2))))
else if (l <= 5.8d+224) then
tmp = t_1
else
tmp = sqrt(((-4.0d0) * ((u * t_2) / om)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = Math.sqrt(Math.abs((t * (n * (2.0 * U)))));
double t_2 = n * Math.pow(l, 2.0);
double tmp;
if (l <= 2.4e+61) {
tmp = t_1;
} else if (l <= 3.2e+166) {
tmp = Math.sqrt((-4.0 * (U / (Om / t_2))));
} else if (l <= 5.8e+224) {
tmp = t_1;
} else {
tmp = Math.sqrt((-4.0 * ((U * t_2) / Om)));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): t_1 = math.sqrt(math.fabs((t * (n * (2.0 * U))))) t_2 = n * math.pow(l, 2.0) tmp = 0 if l <= 2.4e+61: tmp = t_1 elif l <= 3.2e+166: tmp = math.sqrt((-4.0 * (U / (Om / t_2)))) elif l <= 5.8e+224: tmp = t_1 else: tmp = math.sqrt((-4.0 * ((U * t_2) / Om))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = sqrt(abs(Float64(t * Float64(n * Float64(2.0 * U))))) t_2 = Float64(n * (l ^ 2.0)) tmp = 0.0 if (l <= 2.4e+61) tmp = t_1; elseif (l <= 3.2e+166) tmp = sqrt(Float64(-4.0 * Float64(U / Float64(Om / t_2)))); elseif (l <= 5.8e+224) tmp = t_1; else tmp = sqrt(Float64(-4.0 * Float64(Float64(U * t_2) / Om))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = sqrt(abs((t * (n * (2.0 * U))))); t_2 = n * (l ^ 2.0); tmp = 0.0; if (l <= 2.4e+61) tmp = t_1; elseif (l <= 3.2e+166) tmp = sqrt((-4.0 * (U / (Om / t_2)))); elseif (l <= 5.8e+224) tmp = t_1; else tmp = sqrt((-4.0 * ((U * t_2) / Om))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[Abs[N[(t * N[(n * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, 2.4e+61], t$95$1, If[LessEqual[l, 3.2e+166], N[Sqrt[N[(-4.0 * N[(U / N[(Om / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 5.8e+224], t$95$1, N[Sqrt[N[(-4.0 * N[(N[(U * t$95$2), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\left|t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right|}\\
t_2 := n \cdot {\ell}^{2}\\
\mathbf{if}\;\ell \leq 2.4 \cdot 10^{+61}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq 3.2 \cdot 10^{+166}:\\
\;\;\;\;\sqrt{-4 \cdot \frac{U}{\frac{Om}{t_2}}}\\
\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{+224}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{-4 \cdot \frac{U \cdot t_2}{Om}}\\
\end{array}
\end{array}
if l < 2.3999999999999999e61 or 3.19999999999999968e166 < l < 5.79999999999999978e224Initial program 53.8%
associate-*l/60.1%
Applied egg-rr60.1%
Taylor expanded in t around inf 40.2%
associate-*r*38.0%
pow138.0%
metadata-eval38.0%
metadata-eval38.0%
metadata-eval38.0%
pow-prod-up39.0%
pow-prod-down28.1%
pow228.1%
metadata-eval28.1%
Applied egg-rr28.1%
unpow1/228.1%
unpow228.1%
rem-sqrt-square39.5%
associate-*r*42.6%
associate-*r*42.6%
*-commutative42.6%
*-commutative42.6%
*-commutative42.6%
*-commutative42.6%
associate-*l*42.6%
Simplified42.6%
if 2.3999999999999999e61 < l < 3.19999999999999968e166Initial program 51.7%
associate-*l/62.5%
Applied egg-rr62.5%
Taylor expanded in n around 0 46.3%
Taylor expanded in t around 0 41.0%
*-commutative41.0%
associate-/l*41.0%
*-commutative41.0%
Simplified41.0%
if 5.79999999999999978e224 < l Initial program 31.1%
associate-*l/41.0%
Applied egg-rr41.0%
Taylor expanded in n around 0 32.5%
Taylor expanded in t around 0 33.1%
Final simplification41.7%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(if (<= l 1.35e+61)
(sqrt (fabs (* t (* n (* 2.0 U)))))
(if (<= l 5.5e+149)
(sqrt (/ (* -4.0 (* n (* U (pow l 2.0)))) Om))
(* (* l (sqrt 2.0)) (sqrt (* -2.0 (/ (* n U) Om)))))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.35e+61) {
tmp = sqrt(fabs((t * (n * (2.0 * U)))));
} else if (l <= 5.5e+149) {
tmp = sqrt(((-4.0 * (n * (U * pow(l, 2.0)))) / Om));
} else {
tmp = (l * sqrt(2.0)) * sqrt((-2.0 * ((n * U) / Om)));
}
return tmp;
}
NOTE: l should be positive before calling this function
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
real(8) :: tmp
if (l <= 1.35d+61) then
tmp = sqrt(abs((t * (n * (2.0d0 * u)))))
else if (l <= 5.5d+149) then
tmp = sqrt((((-4.0d0) * (n * (u * (l ** 2.0d0)))) / om))
else
tmp = (l * sqrt(2.0d0)) * sqrt(((-2.0d0) * ((n * u) / om)))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.35e+61) {
tmp = Math.sqrt(Math.abs((t * (n * (2.0 * U)))));
} else if (l <= 5.5e+149) {
tmp = Math.sqrt(((-4.0 * (n * (U * Math.pow(l, 2.0)))) / Om));
} else {
tmp = (l * Math.sqrt(2.0)) * Math.sqrt((-2.0 * ((n * U) / Om)));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 1.35e+61: tmp = math.sqrt(math.fabs((t * (n * (2.0 * U))))) elif l <= 5.5e+149: tmp = math.sqrt(((-4.0 * (n * (U * math.pow(l, 2.0)))) / Om)) else: tmp = (l * math.sqrt(2.0)) * math.sqrt((-2.0 * ((n * U) / Om))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 1.35e+61) tmp = sqrt(abs(Float64(t * Float64(n * Float64(2.0 * U))))); elseif (l <= 5.5e+149) tmp = sqrt(Float64(Float64(-4.0 * Float64(n * Float64(U * (l ^ 2.0)))) / Om)); else tmp = Float64(Float64(l * sqrt(2.0)) * sqrt(Float64(-2.0 * Float64(Float64(n * U) / Om)))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 1.35e+61) tmp = sqrt(abs((t * (n * (2.0 * U))))); elseif (l <= 5.5e+149) tmp = sqrt(((-4.0 * (n * (U * (l ^ 2.0)))) / Om)); else tmp = (l * sqrt(2.0)) * sqrt((-2.0 * ((n * U) / Om))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 1.35e+61], N[Sqrt[N[Abs[N[(t * N[(n * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 5.5e+149], N[Sqrt[N[(N[(-4.0 * N[(n * N[(U * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]], $MachinePrecision], N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(-2.0 * N[(N[(n * U), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.35 \cdot 10^{+61}:\\
\;\;\;\;\sqrt{\left|t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right|}\\
\mathbf{elif}\;\ell \leq 5.5 \cdot 10^{+149}:\\
\;\;\;\;\sqrt{\frac{-4 \cdot \left(n \cdot \left(U \cdot {\ell}^{2}\right)\right)}{Om}}\\
\mathbf{else}:\\
\;\;\;\;\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{-2 \cdot \frac{n \cdot U}{Om}}\\
\end{array}
\end{array}
if l < 1.3500000000000001e61Initial program 56.3%
associate-*l/60.6%
Applied egg-rr60.6%
Taylor expanded in t around inf 42.0%
associate-*r*39.7%
pow139.7%
metadata-eval39.7%
metadata-eval39.7%
metadata-eval39.7%
pow-prod-up40.3%
pow-prod-down28.8%
pow228.8%
metadata-eval28.8%
Applied egg-rr28.8%
unpow1/228.8%
unpow228.8%
rem-sqrt-square40.7%
associate-*r*44.0%
associate-*r*44.0%
*-commutative44.0%
*-commutative44.0%
*-commutative44.0%
*-commutative44.0%
associate-*l*44.0%
Simplified44.0%
if 1.3500000000000001e61 < l < 5.49999999999999999e149Initial program 55.0%
associate-*l/55.0%
Applied egg-rr55.0%
Taylor expanded in n around 0 48.5%
Taylor expanded in t around 0 42.1%
associate-*r/42.1%
*-commutative42.1%
*-commutative42.1%
associate-*l*42.0%
Simplified42.0%
if 5.49999999999999999e149 < l Initial program 23.3%
Simplified50.3%
Taylor expanded in l around inf 54.4%
associate-/l*57.0%
associate-*r/57.0%
metadata-eval57.0%
Simplified57.0%
Taylor expanded in n around 0 44.3%
Final simplification43.9%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (sqrt (fabs (* t (* n (* 2.0 U))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt(fabs((t * (n * (2.0 * U)))));
}
NOTE: l should be positive before calling this function
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(abs((t * (n * (2.0d0 * u)))))
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt(Math.abs((t * (n * (2.0 * U)))));
}
l = abs(l) def code(n, U, t, l, Om, U_42_): return math.sqrt(math.fabs((t * (n * (2.0 * U)))))
l = abs(l) function code(n, U, t, l, Om, U_42_) return sqrt(abs(Float64(t * Float64(n * Float64(2.0 * U))))) end
l = abs(l) function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt(abs((t * (n * (2.0 * U))))); end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[Abs[N[(t * N[(n * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\sqrt{\left|t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right|}
\end{array}
Initial program 51.6%
associate-*l/58.5%
Applied egg-rr58.5%
Taylor expanded in t around inf 35.7%
associate-*r*34.0%
pow134.0%
metadata-eval34.0%
metadata-eval34.0%
metadata-eval34.0%
pow-prod-up35.7%
pow-prod-down26.6%
pow226.6%
metadata-eval26.6%
Applied egg-rr26.6%
unpow1/226.6%
unpow226.6%
rem-sqrt-square36.2%
associate-*r*38.7%
associate-*r*38.7%
*-commutative38.7%
*-commutative38.7%
*-commutative38.7%
*-commutative38.7%
associate-*l*38.7%
Simplified38.7%
Final simplification38.7%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (pow (* (* 2.0 U) (* n t)) 0.5))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
return pow(((2.0 * U) * (n * t)), 0.5);
}
NOTE: l should be positive before calling this function
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 = ((2.0d0 * u) * (n * t)) ** 0.5d0
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.pow(((2.0 * U) * (n * t)), 0.5);
}
l = abs(l) def code(n, U, t, l, Om, U_42_): return math.pow(((2.0 * U) * (n * t)), 0.5)
l = abs(l) function code(n, U, t, l, Om, U_42_) return Float64(Float64(2.0 * U) * Float64(n * t)) ^ 0.5 end
l = abs(l) function tmp = code(n, U, t, l, Om, U_42_) tmp = ((2.0 * U) * (n * t)) ^ 0.5; end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := N[Power[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{0.5}
\end{array}
Initial program 51.6%
Simplified55.1%
Taylor expanded in l around 0 35.6%
pow1/238.4%
associate-*r*38.4%
Applied egg-rr38.4%
Final simplification38.4%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2.0 (* U (* n t)))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((2.0 * (U * (n * t))));
}
NOTE: l should be positive before calling this function
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 * (u * (n * t))))
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((2.0 * (U * (n * t))));
}
l = abs(l) def code(n, U, t, l, Om, U_42_): return math.sqrt((2.0 * (U * (n * t))))
l = abs(l) function code(n, U, t, l, Om, U_42_) return sqrt(Float64(2.0 * Float64(U * Float64(n * t)))) end
l = abs(l) function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((2.0 * (U * (n * t)))); end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}
\end{array}
Initial program 51.6%
Simplified55.1%
Taylor expanded in l around 0 35.6%
Final simplification35.6%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2.0 (* t (* n U)))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((2.0 * (t * (n * U))));
}
NOTE: l should be positive before calling this function
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 * (t * (n * u))))
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((2.0 * (t * (n * U))));
}
l = abs(l) def code(n, U, t, l, Om, U_42_): return math.sqrt((2.0 * (t * (n * U))))
l = abs(l) function code(n, U, t, l, Om, U_42_) return sqrt(Float64(2.0 * Float64(t * Float64(n * U)))) end
l = abs(l) function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((2.0 * (t * (n * U)))); end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\sqrt{2 \cdot \left(t \cdot \left(n \cdot U\right)\right)}
\end{array}
Initial program 51.6%
Simplified55.1%
Taylor expanded in l around 0 35.6%
associate-*r*35.7%
*-commutative35.7%
Simplified35.7%
Final simplification35.7%
herbie shell --seed 2023308
(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*))))))