
(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 15 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 (* 2.0 n)))
(t_2 (pow (/ l Om) 2.0))
(t_3 (* (- U* U) (* n t_2)))
(t_4 (* t_1 (+ (- t (* 2.0 (/ (* l l) Om))) t_3)))
(t_5 (* l (/ l Om)))
(t_6
(*
(sqrt (fabs (* 2.0 (* n U))))
(sqrt (fabs (- t (fma 2.0 t_5 (* t_2 (* n (- U U*))))))))))
(if (<= t_4 0.0)
t_6
(if (<= t_4 1e+305)
(sqrt (* t_1 (+ (- t (* 2.0 t_5)) t_3)))
(if (<= t_4 INFINITY)
t_6
(*
(sqrt
(* U (* n (+ (/ (* n (- U* U)) (pow Om 2.0)) (* 2.0 (/ -1.0 Om))))))
(* 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 * (2.0 * n);
double t_2 = pow((l / Om), 2.0);
double t_3 = (U_42_ - U) * (n * t_2);
double t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3);
double t_5 = l * (l / Om);
double t_6 = sqrt(fabs((2.0 * (n * U)))) * sqrt(fabs((t - fma(2.0, t_5, (t_2 * (n * (U - U_42_)))))));
double tmp;
if (t_4 <= 0.0) {
tmp = t_6;
} else if (t_4 <= 1e+305) {
tmp = sqrt((t_1 * ((t - (2.0 * t_5)) + t_3)));
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_6;
} else {
tmp = sqrt((U * (n * (((n * (U_42_ - U)) / pow(Om, 2.0)) + (2.0 * (-1.0 / Om)))))) * (l * sqrt(2.0));
}
return tmp;
}
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(U * Float64(2.0 * n)) t_2 = Float64(l / Om) ^ 2.0 t_3 = Float64(Float64(U_42_ - U) * Float64(n * t_2)) t_4 = Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_3)) t_5 = Float64(l * Float64(l / Om)) t_6 = Float64(sqrt(abs(Float64(2.0 * Float64(n * U)))) * sqrt(abs(Float64(t - fma(2.0, t_5, Float64(t_2 * Float64(n * Float64(U - U_42_)))))))) tmp = 0.0 if (t_4 <= 0.0) tmp = t_6; elseif (t_4 <= 1e+305) tmp = sqrt(Float64(t_1 * Float64(Float64(t - Float64(2.0 * t_5)) + t_3))); elseif (t_4 <= Inf) tmp = t_6; else tmp = Float64(sqrt(Float64(U * Float64(n * Float64(Float64(Float64(n * Float64(U_42_ - U)) / (Om ^ 2.0)) + Float64(2.0 * Float64(-1.0 / Om)))))) * 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[(2.0 * n), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(U$42$ - U), $MachinePrecision] * N[(n * t$95$2), $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]}, Block[{t$95$5 = N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[Sqrt[N[Abs[N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Abs[N[(t - N[(2.0 * t$95$5 + N[(t$95$2 * N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], t$95$6, If[LessEqual[t$95$4, 1e+305], N[Sqrt[N[(t$95$1 * N[(N[(t - N[(2.0 * t$95$5), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$6, N[(N[Sqrt[N[(U * N[(n * N[(N[(N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(-1.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := U \cdot \left(2 \cdot n\right)\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(U* - U\right) \cdot \left(n \cdot t_2\right)\\
t_4 := t_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_3\right)\\
t_5 := \ell \cdot \frac{\ell}{Om}\\
t_6 := \sqrt{\left|2 \cdot \left(n \cdot U\right)\right|} \cdot \sqrt{\left|t - \mathsf{fma}\left(2, t_5, t_2 \cdot \left(n \cdot \left(U - U*\right)\right)\right)\right|}\\
\mathbf{if}\;t_4 \leq 0:\\
\;\;\;\;t_6\\
\mathbf{elif}\;t_4 \leq 10^{+305}:\\
\;\;\;\;\sqrt{t_1 \cdot \left(\left(t - 2 \cdot t_5\right) + t_3\right)}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;t_6\\
\mathbf{else}:\\
\;\;\;\;\sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} + 2 \cdot \frac{-1}{Om}\right)\right)} \cdot \left(\ell \cdot \sqrt{2}\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.0 or 9.9999999999999994e304 < (*.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 26.0%
Simplified42.1%
Applied egg-rr23.4%
unpow1/223.4%
unpow223.4%
rem-sqrt-square23.4%
Simplified23.4%
pow1/223.4%
fabs-mul23.4%
unpow-prod-down37.4%
*-commutative37.4%
*-commutative37.4%
*-commutative37.4%
associate-*l*37.4%
Applied egg-rr37.4%
unpow1/237.4%
*-commutative37.4%
unpow1/237.4%
Simplified37.4%
unpow237.4%
associate-*l/50.2%
Applied egg-rr50.2%
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*)))) < 9.9999999999999994e304Initial program 98.4%
associate-*l/98.5%
Applied egg-rr98.5%
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.8%
Taylor expanded in l around inf 22.8%
Final simplification64.8%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(if (<= l 1.06e+86)
(*
(pow
(cbrt
(sqrt
(fabs
(-
t
(fma 2.0 (/ (pow l 2.0) Om) (* n (* (- U U*) (pow (/ l Om) 2.0))))))))
3.0)
(sqrt (fabs (* 2.0 (* n U)))))
(*
(sqrt (* U (* n (+ (/ (* n (- U* U)) (pow Om 2.0)) (* 2.0 (/ -1.0 Om))))))
(* l (sqrt 2.0)))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.06e+86) {
tmp = pow(cbrt(sqrt(fabs((t - fma(2.0, (pow(l, 2.0) / Om), (n * ((U - U_42_) * pow((l / Om), 2.0)))))))), 3.0) * sqrt(fabs((2.0 * (n * U))));
} else {
tmp = sqrt((U * (n * (((n * (U_42_ - U)) / pow(Om, 2.0)) + (2.0 * (-1.0 / Om)))))) * (l * sqrt(2.0));
}
return tmp;
}
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 1.06e+86) tmp = Float64((cbrt(sqrt(abs(Float64(t - fma(2.0, Float64((l ^ 2.0) / Om), Float64(n * Float64(Float64(U - U_42_) * (Float64(l / Om) ^ 2.0)))))))) ^ 3.0) * sqrt(abs(Float64(2.0 * Float64(n * U))))); else tmp = Float64(sqrt(Float64(U * Float64(n * Float64(Float64(Float64(n * Float64(U_42_ - U)) / (Om ^ 2.0)) + Float64(2.0 * Float64(-1.0 / Om)))))) * 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$_] := If[LessEqual[l, 1.06e+86], N[(N[Power[N[Power[N[Sqrt[N[Abs[N[(t - N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] + N[(n * N[(N[(U - U$42$), $MachinePrecision] * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] * N[Sqrt[N[Abs[N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(U * N[(n * N[(N[(N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(-1.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.06 \cdot 10^{+86}:\\
\;\;\;\;{\left(\sqrt[3]{\sqrt{\left|t - \mathsf{fma}\left(2, \frac{{\ell}^{2}}{Om}, n \cdot \left(\left(U - U*\right) \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)\right)\right|}}\right)}^{3} \cdot \sqrt{\left|2 \cdot \left(n \cdot U\right)\right|}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} + 2 \cdot \frac{-1}{Om}\right)\right)} \cdot \left(\ell \cdot \sqrt{2}\right)\\
\end{array}
\end{array}
if l < 1.06e86Initial program 54.0%
Simplified57.3%
Applied egg-rr34.2%
unpow1/234.2%
unpow234.2%
rem-sqrt-square49.4%
Simplified49.4%
pow1/249.4%
fabs-mul49.4%
unpow-prod-down57.0%
*-commutative57.0%
*-commutative57.0%
*-commutative57.0%
associate-*l*56.9%
Applied egg-rr56.9%
unpow1/256.9%
*-commutative56.9%
unpow1/256.9%
Simplified56.9%
add-cube-cbrt56.2%
pow356.1%
associate-*l*62.5%
Applied egg-rr62.5%
if 1.06e86 < l Initial program 29.1%
Simplified44.0%
Taylor expanded in l around inf 61.9%
Final simplification62.4%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* U (* 2.0 n)))
(t_2 (pow (/ l Om) 2.0))
(t_3 (* (- U* U) (* n t_2)))
(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
(* U (* n (+ (/ (* n (- U* U)) (pow Om 2.0)) (* 2.0 (/ -1.0 Om))))))
(* 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 * (2.0 * n);
double t_2 = pow((l / Om), 2.0);
double t_3 = (U_42_ - U) * (n * t_2);
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((U * (n * (((n * (U_42_ - U)) / pow(Om, 2.0)) + (2.0 * (-1.0 / Om)))))) * (l * 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 = U * (2.0 * n);
double t_2 = Math.pow((l / Om), 2.0);
double t_3 = (U_42_ - U) * (n * t_2);
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((U * (n * (((n * (U_42_ - U)) / Math.pow(Om, 2.0)) + (2.0 * (-1.0 / Om)))))) * (l * Math.sqrt(2.0));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): t_1 = U * (2.0 * n) t_2 = math.pow((l / Om), 2.0) t_3 = (U_42_ - U) * (n * t_2) 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((U * (n * (((n * (U_42_ - U)) / math.pow(Om, 2.0)) + (2.0 * (-1.0 / Om)))))) * (l * math.sqrt(2.0)) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(U * Float64(2.0 * n)) t_2 = Float64(l / Om) ^ 2.0 t_3 = Float64(Float64(U_42_ - U) * Float64(n * t_2)) 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(sqrt(Float64(U * Float64(n * Float64(Float64(Float64(n * Float64(U_42_ - U)) / (Om ^ 2.0)) + Float64(2.0 * Float64(-1.0 / Om)))))) * Float64(l * sqrt(2.0))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = U * (2.0 * n); t_2 = (l / Om) ^ 2.0; t_3 = (U_42_ - U) * (n * t_2); 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((U * (n * (((n * (U_42_ - U)) / (Om ^ 2.0)) + (2.0 * (-1.0 / Om)))))) * (l * 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[(U * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(U$42$ - U), $MachinePrecision] * N[(n * t$95$2), $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[Sqrt[N[(U * N[(n * N[(N[(N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(-1.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := U \cdot \left(2 \cdot n\right)\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(U* - U\right) \cdot \left(n \cdot t_2\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{U \cdot \left(n \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} + 2 \cdot \frac{-1}{Om}\right)\right)} \cdot \left(\ell \cdot \sqrt{2}\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 12.5%
Simplified38.1%
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 68.7%
associate-*l/74.6%
Applied egg-rr74.6%
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.8%
Taylor expanded in l around inf 22.8%
Final simplification61.5%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* l (/ l Om)))
(t_2 (* U (* 2.0 n)))
(t_3 (pow (/ l Om) 2.0))
(t_4 (* (- U* U) (* n t_3)))
(t_5 (* t_2 (+ (- t (* 2.0 (/ (* l l) Om))) t_4))))
(if (<= t_5 0.0)
(sqrt (* 2.0 (* n (* U (fma n (* t_3 (- U* U)) (fma t_1 -2.0 t))))))
(if (<= t_5 INFINITY)
(sqrt (* t_2 (+ (- t (* 2.0 t_1)) t_4)))
(*
(sqrt
(* U (* n (+ (/ (* n (- U* U)) (pow Om 2.0)) (* 2.0 (/ -1.0 Om))))))
(* 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 = l * (l / Om);
double t_2 = U * (2.0 * n);
double t_3 = pow((l / Om), 2.0);
double t_4 = (U_42_ - U) * (n * t_3);
double t_5 = t_2 * ((t - (2.0 * ((l * l) / Om))) + t_4);
double tmp;
if (t_5 <= 0.0) {
tmp = sqrt((2.0 * (n * (U * fma(n, (t_3 * (U_42_ - U)), fma(t_1, -2.0, t))))));
} else if (t_5 <= ((double) INFINITY)) {
tmp = sqrt((t_2 * ((t - (2.0 * t_1)) + t_4)));
} else {
tmp = sqrt((U * (n * (((n * (U_42_ - U)) / pow(Om, 2.0)) + (2.0 * (-1.0 / Om)))))) * (l * sqrt(2.0));
}
return tmp;
}
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(l * Float64(l / Om)) t_2 = Float64(U * Float64(2.0 * n)) t_3 = Float64(l / Om) ^ 2.0 t_4 = Float64(Float64(U_42_ - U) * Float64(n * t_3)) t_5 = Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_4)) tmp = 0.0 if (t_5 <= 0.0) tmp = sqrt(Float64(2.0 * Float64(n * Float64(U * fma(n, Float64(t_3 * Float64(U_42_ - U)), fma(t_1, -2.0, t)))))); elseif (t_5 <= Inf) tmp = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * t_1)) + t_4))); else tmp = Float64(sqrt(Float64(U * Float64(n * Float64(Float64(Float64(n * Float64(U_42_ - U)) / (Om ^ 2.0)) + Float64(2.0 * Float64(-1.0 / Om)))))) * 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[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(U * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$4 = N[(N[(U$42$ - U), $MachinePrecision] * N[(n * t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, 0.0], N[Sqrt[N[(2.0 * N[(n * N[(U * N[(n * N[(t$95$3 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * -2.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(U * N[(n * N[(N[(N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(-1.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \ell \cdot \frac{\ell}{Om}\\
t_2 := U \cdot \left(2 \cdot n\right)\\
t_3 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_4 := \left(U* - U\right) \cdot \left(n \cdot t_3\right)\\
t_5 := t_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_4\right)\\
\mathbf{if}\;t_5 \leq 0:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot \mathsf{fma}\left(n, t_3 \cdot \left(U* - U\right), \mathsf{fma}\left(t_1, -2, t\right)\right)\right)\right)}\\
\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;\sqrt{t_2 \cdot \left(\left(t - 2 \cdot t_1\right) + t_4\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} + 2 \cdot \frac{-1}{Om}\right)\right)} \cdot \left(\ell \cdot \sqrt{2}\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 12.5%
Simplified38.1%
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 68.7%
associate-*l/74.6%
Applied egg-rr74.6%
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.8%
Taylor expanded in l around inf 22.8%
Final simplification61.5%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* U (* 2.0 n)))
(t_2 (pow (/ l Om) 2.0))
(t_3 (* (- U* U) (* n t_2)))
(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 (/ (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 = U * (2.0 * n);
double t_2 = pow((l / Om), 2.0);
double t_3 = (U_42_ - U) * (n * t_2);
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 / (pow(Om, 2.0) / (U_42_ - U))) - (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 = U * (2.0 * n);
double t_2 = Math.pow((l / Om), 2.0);
double t_3 = (U_42_ - U) * (n * t_2);
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 / (Math.pow(Om, 2.0) / (U_42_ - U))) - (2.0 / Om)))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): t_1 = U * (2.0 * n) t_2 = math.pow((l / Om), 2.0) t_3 = (U_42_ - U) * (n * t_2) 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 / (math.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(U * Float64(2.0 * n)) t_2 = Float64(l / Om) ^ 2.0 t_3 = Float64(Float64(U_42_ - U) * Float64(n * t_2)) 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(n / Float64((Om ^ 2.0) / Float64(U_42_ - U))) - Float64(2.0 / Om)))))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = U * (2.0 * n); t_2 = (l / Om) ^ 2.0; t_3 = (U_42_ - U) * (n * t_2); 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 / ((Om ^ 2.0) / (U_42_ - U))) - (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[(U * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(U$42$ - U), $MachinePrecision] * N[(n * t$95$2), $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[(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 := U \cdot \left(2 \cdot n\right)\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(U* - U\right) \cdot \left(n \cdot t_2\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}{\frac{{Om}^{2}}{U* - U}} - \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 12.5%
Simplified38.1%
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 68.7%
associate-*l/74.6%
Applied egg-rr74.6%
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.8%
Taylor expanded in l around inf 22.8%
associate-/l*22.9%
associate-*r/22.9%
metadata-eval22.9%
Simplified22.9%
Final simplification61.5%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* U (* 2.0 n)))
(t_2 (pow (/ l Om) 2.0))
(t_3 (* (- U* U) (* n t_2)))
(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 (* U (- U* U))))) (/ 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 = U * (2.0 * n);
double t_2 = pow((l / Om), 2.0);
double t_3 = (U_42_ - U) * (n * t_2);
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((U * (U_42_ - U)))) / (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 = U * (2.0 * n);
double t_2 = Math.pow((l / Om), 2.0);
double t_3 = (U_42_ - U) * (n * t_2);
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((U * (U_42_ - U)))) / (Om / (n * Math.sqrt(2.0)));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): t_1 = U * (2.0 * n) t_2 = math.pow((l / Om), 2.0) t_3 = (U_42_ - U) * (n * t_2) 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((U * (U_42_ - U)))) / (Om / (n * math.sqrt(2.0))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(U * Float64(2.0 * n)) t_2 = Float64(l / Om) ^ 2.0 t_3 = Float64(Float64(U_42_ - U) * Float64(n * t_2)) 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 * Float64(-sqrt(Float64(U * Float64(U_42_ - U))))) / Float64(Om / Float64(n * sqrt(2.0)))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = U * (2.0 * n); t_2 = (l / Om) ^ 2.0; t_3 = (U_42_ - U) * (n * t_2); 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((U * (U_42_ - U)))) / (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[(U * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(U$42$ - U), $MachinePrecision] * N[(n * t$95$2), $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[N[(U * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(Om / N[(n * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := U \cdot \left(2 \cdot n\right)\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(U* - U\right) \cdot \left(n \cdot t_2\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}:\\
\;\;\;\;\frac{\ell \cdot \left(-\sqrt{U \cdot \left(U* - U\right)}\right)}{\frac{Om}{n \cdot \sqrt{2}}}\\
\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 12.5%
Simplified38.1%
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 68.7%
associate-*l/74.6%
Applied egg-rr74.6%
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.8%
Taylor expanded in n around inf 25.4%
Taylor expanded in n around -inf 22.1%
mul-1-neg22.1%
distribute-rgt-neg-in22.1%
associate-/l*22.0%
Simplified22.0%
associate-*l/22.2%
Applied egg-rr22.2%
Final simplification61.4%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(if (<= U -7.5e+94)
(pow (* 2.0 (* (* n U) (+ t (* (/ (pow l 2.0) Om) -2.0)))) 0.5)
(sqrt
(*
(* 2.0 n)
(*
U
(+
(+ t (* -2.0 (/ l (/ Om l))))
(* n (* (pow (/ l Om) 2.0) (- U* U)))))))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= -7.5e+94) {
tmp = pow((2.0 * ((n * U) * (t + ((pow(l, 2.0) / Om) * -2.0)))), 0.5);
} else {
tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (pow((l / Om), 2.0) * (U_42_ - 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 <= (-7.5d+94)) then
tmp = (2.0d0 * ((n * u) * (t + (((l ** 2.0d0) / om) * (-2.0d0))))) ** 0.5d0
else
tmp = sqrt(((2.0d0 * n) * (u * ((t + ((-2.0d0) * (l / (om / l)))) + (n * (((l / om) ** 2.0d0) * (u_42 - 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 <= -7.5e+94) {
tmp = Math.pow((2.0 * ((n * U) * (t + ((Math.pow(l, 2.0) / Om) * -2.0)))), 0.5);
} else {
tmp = Math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (Math.pow((l / Om), 2.0) * (U_42_ - U)))))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if U <= -7.5e+94: tmp = math.pow((2.0 * ((n * U) * (t + ((math.pow(l, 2.0) / Om) * -2.0)))), 0.5) else: tmp = math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (math.pow((l / Om), 2.0) * (U_42_ - U))))))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= -7.5e+94) tmp = Float64(2.0 * Float64(Float64(n * U) * Float64(t + Float64(Float64((l ^ 2.0) / Om) * -2.0)))) ^ 0.5; else 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))))))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U <= -7.5e+94) tmp = (2.0 * ((n * U) * (t + (((l ^ 2.0) / Om) * -2.0)))) ^ 0.5; else tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (((l / Om) ^ 2.0) * (U_42_ - 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, -7.5e+94], N[Power[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(t + N[(N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], 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]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;U \leq -7.5 \cdot 10^{+94}:\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + \frac{{\ell}^{2}}{Om} \cdot -2\right)\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;\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)}\\
\end{array}
\end{array}
if U < -7.49999999999999978e94Initial program 56.1%
Simplified47.2%
Taylor expanded in n around 0 53.6%
pow1/262.2%
associate-*r*62.1%
cancel-sign-sub-inv62.1%
metadata-eval62.1%
Applied egg-rr62.1%
if -7.49999999999999978e94 < U Initial program 49.2%
Simplified57.2%
Final simplification57.9%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* l (/ l Om))))
(if (<= n -450.0)
(pow (* 2.0 (* (* n U) (+ t (* (/ (pow l 2.0) Om) -2.0)))) 0.5)
(if (<= n 7e-287)
(sqrt (* 2.0 (* U (* n (- t (* 2.0 t_1))))))
(if (<= n 3.3e-175)
(* (sqrt (* 2.0 n)) (sqrt (* t U)))
(* (sqrt 2.0) (sqrt (* (* n U) (+ t (* t_1 -2.0))))))))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = l * (l / Om);
double tmp;
if (n <= -450.0) {
tmp = pow((2.0 * ((n * U) * (t + ((pow(l, 2.0) / Om) * -2.0)))), 0.5);
} else if (n <= 7e-287) {
tmp = sqrt((2.0 * (U * (n * (t - (2.0 * t_1))))));
} else if (n <= 3.3e-175) {
tmp = sqrt((2.0 * n)) * sqrt((t * U));
} else {
tmp = sqrt(2.0) * sqrt(((n * U) * (t + (t_1 * -2.0))));
}
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) :: tmp
t_1 = l * (l / om)
if (n <= (-450.0d0)) then
tmp = (2.0d0 * ((n * u) * (t + (((l ** 2.0d0) / om) * (-2.0d0))))) ** 0.5d0
else if (n <= 7d-287) then
tmp = sqrt((2.0d0 * (u * (n * (t - (2.0d0 * t_1))))))
else if (n <= 3.3d-175) then
tmp = sqrt((2.0d0 * n)) * sqrt((t * u))
else
tmp = sqrt(2.0d0) * sqrt(((n * u) * (t + (t_1 * (-2.0d0)))))
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 = l * (l / Om);
double tmp;
if (n <= -450.0) {
tmp = Math.pow((2.0 * ((n * U) * (t + ((Math.pow(l, 2.0) / Om) * -2.0)))), 0.5);
} else if (n <= 7e-287) {
tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * t_1))))));
} else if (n <= 3.3e-175) {
tmp = Math.sqrt((2.0 * n)) * Math.sqrt((t * U));
} else {
tmp = Math.sqrt(2.0) * Math.sqrt(((n * U) * (t + (t_1 * -2.0))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): t_1 = l * (l / Om) tmp = 0 if n <= -450.0: tmp = math.pow((2.0 * ((n * U) * (t + ((math.pow(l, 2.0) / Om) * -2.0)))), 0.5) elif n <= 7e-287: tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * t_1)))))) elif n <= 3.3e-175: tmp = math.sqrt((2.0 * n)) * math.sqrt((t * U)) else: tmp = math.sqrt(2.0) * math.sqrt(((n * U) * (t + (t_1 * -2.0)))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(l * Float64(l / Om)) tmp = 0.0 if (n <= -450.0) tmp = Float64(2.0 * Float64(Float64(n * U) * Float64(t + Float64(Float64((l ^ 2.0) / Om) * -2.0)))) ^ 0.5; elseif (n <= 7e-287) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * t_1)))))); elseif (n <= 3.3e-175) tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(t * U))); else tmp = Float64(sqrt(2.0) * sqrt(Float64(Float64(n * U) * Float64(t + Float64(t_1 * -2.0))))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = l * (l / Om); tmp = 0.0; if (n <= -450.0) tmp = (2.0 * ((n * U) * (t + (((l ^ 2.0) / Om) * -2.0)))) ^ 0.5; elseif (n <= 7e-287) tmp = sqrt((2.0 * (U * (n * (t - (2.0 * t_1)))))); elseif (n <= 3.3e-175) tmp = sqrt((2.0 * n)) * sqrt((t * U)); else tmp = sqrt(2.0) * sqrt(((n * U) * (t + (t_1 * -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[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -450.0], N[Power[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(t + N[(N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], If[LessEqual[n, 7e-287], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 3.3e-175], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(t * U), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(N[(n * U), $MachinePrecision] * N[(t + N[(t$95$1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \ell \cdot \frac{\ell}{Om}\\
\mathbf{if}\;n \leq -450:\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + \frac{{\ell}^{2}}{Om} \cdot -2\right)\right)\right)}^{0.5}\\
\mathbf{elif}\;n \leq 7 \cdot 10^{-287}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot t_1\right)\right)\right)}\\
\mathbf{elif}\;n \leq 3.3 \cdot 10^{-175}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{t \cdot U}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \sqrt{\left(n \cdot U\right) \cdot \left(t + t_1 \cdot -2\right)}\\
\end{array}
\end{array}
if n < -450Initial program 59.5%
Simplified55.6%
Taylor expanded in n around 0 43.2%
pow1/258.1%
associate-*r*59.7%
cancel-sign-sub-inv59.7%
metadata-eval59.7%
Applied egg-rr59.7%
if -450 < n < 7e-287Initial program 41.4%
Simplified53.3%
Taylor expanded in n around 0 44.3%
unpow248.4%
associate-*l/59.2%
Applied egg-rr56.0%
if 7e-287 < n < 3.29999999999999999e-175Initial program 32.1%
Simplified44.4%
Taylor expanded in l around 0 40.6%
pow1/240.6%
associate-*r*40.6%
unpow-prod-down62.6%
pow1/262.6%
pow1/262.6%
Applied egg-rr62.6%
*-commutative62.6%
Simplified62.6%
if 3.29999999999999999e-175 < n Initial program 57.4%
Simplified51.9%
Taylor expanded in n around 0 47.3%
pow1/251.3%
*-commutative51.3%
unpow-prod-down51.3%
pow1/247.2%
associate-*r*49.2%
cancel-sign-sub-inv49.2%
metadata-eval49.2%
pow1/249.2%
Applied egg-rr49.2%
unpow256.8%
associate-*l/62.2%
Applied egg-rr52.5%
Final simplification56.1%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2.0 (* U (* n (- t (* 2.0 (* l (/ l Om)))))))))
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 - (2.0 * (l * (l / Om))))))));
}
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 - (2.0d0 * (l * (l / om))))))))
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 - (2.0 * (l * (l / Om))))))));
}
l = abs(l) def code(n, U, t, l, Om, U_42_): return math.sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om))))))))
l = abs(l) function code(n, U, t, l, Om, U_42_) return sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))))))) end
l = abs(l) function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om)))))))); 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 * N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)\right)}
\end{array}
Initial program 50.2%
Simplified51.5%
Taylor expanded in n around 0 44.3%
unpow252.6%
associate-*l/58.7%
Applied egg-rr50.0%
Final simplification50.0%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= U -6.5e-182) (pow (* 2.0 (* U (* t n))) 0.5) (sqrt (* 2.0 (* t (* n U))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= -6.5e-182) {
tmp = pow((2.0 * (U * (t * n))), 0.5);
} else {
tmp = sqrt((2.0 * (t * (n * 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 <= (-6.5d-182)) then
tmp = (2.0d0 * (u * (t * n))) ** 0.5d0
else
tmp = sqrt((2.0d0 * (t * (n * 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 <= -6.5e-182) {
tmp = Math.pow((2.0 * (U * (t * n))), 0.5);
} else {
tmp = Math.sqrt((2.0 * (t * (n * U))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if U <= -6.5e-182: tmp = math.pow((2.0 * (U * (t * n))), 0.5) else: tmp = math.sqrt((2.0 * (t * (n * U)))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= -6.5e-182) tmp = Float64(2.0 * Float64(U * Float64(t * n))) ^ 0.5; else tmp = sqrt(Float64(2.0 * Float64(t * Float64(n * U)))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U <= -6.5e-182) tmp = (2.0 * (U * (t * n))) ^ 0.5; else tmp = sqrt((2.0 * (t * (n * 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, -6.5e-182], N[Power[N[(2.0 * N[(U * N[(t * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Sqrt[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;U \leq -6.5 \cdot 10^{-182}:\\
\;\;\;\;{\left(2 \cdot \left(U \cdot \left(t \cdot n\right)\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(t \cdot \left(n \cdot U\right)\right)}\\
\end{array}
\end{array}
if U < -6.49999999999999997e-182Initial program 58.1%
Simplified59.3%
Taylor expanded in l around 0 48.5%
pow1/249.5%
pow-to-exp45.7%
associate-*r*42.5%
Applied egg-rr42.5%
Taylor expanded in t around 0 29.4%
*-commutative29.4%
+-commutative29.4%
log-prod42.5%
associate-*l*42.5%
*-commutative42.5%
associate-*r*45.7%
Simplified45.7%
exp-to-pow49.5%
Applied egg-rr49.5%
if -6.49999999999999997e-182 < U Initial program 44.8%
Simplified52.5%
Taylor expanded in l around 0 27.0%
associate-*r*32.0%
*-commutative32.0%
Simplified32.0%
Final simplification39.1%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= U -3e-179) (pow (* 2.0 (* U (* t n))) 0.5) (pow (* 2.0 (* t (* n U))) 0.5)))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= -3e-179) {
tmp = pow((2.0 * (U * (t * n))), 0.5);
} else {
tmp = pow((2.0 * (t * (n * U))), 0.5);
}
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 <= (-3d-179)) then
tmp = (2.0d0 * (u * (t * n))) ** 0.5d0
else
tmp = (2.0d0 * (t * (n * u))) ** 0.5d0
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 <= -3e-179) {
tmp = Math.pow((2.0 * (U * (t * n))), 0.5);
} else {
tmp = Math.pow((2.0 * (t * (n * U))), 0.5);
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if U <= -3e-179: tmp = math.pow((2.0 * (U * (t * n))), 0.5) else: tmp = math.pow((2.0 * (t * (n * U))), 0.5) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= -3e-179) tmp = Float64(2.0 * Float64(U * Float64(t * n))) ^ 0.5; else tmp = Float64(2.0 * Float64(t * Float64(n * U))) ^ 0.5; end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U <= -3e-179) tmp = (2.0 * (U * (t * n))) ^ 0.5; else tmp = (2.0 * (t * (n * U))) ^ 0.5; 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, -3e-179], N[Power[N[(2.0 * N[(U * N[(t * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Power[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;U \leq -3 \cdot 10^{-179}:\\
\;\;\;\;{\left(2 \cdot \left(U \cdot \left(t \cdot n\right)\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;{\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\
\end{array}
\end{array}
if U < -3.00000000000000006e-179Initial program 58.1%
Simplified59.3%
Taylor expanded in l around 0 48.5%
pow1/249.5%
pow-to-exp45.7%
associate-*r*42.5%
Applied egg-rr42.5%
Taylor expanded in t around 0 29.4%
*-commutative29.4%
+-commutative29.4%
log-prod42.5%
associate-*l*42.5%
*-commutative42.5%
associate-*r*45.7%
Simplified45.7%
exp-to-pow49.5%
Applied egg-rr49.5%
if -3.00000000000000006e-179 < U Initial program 44.8%
Simplified52.5%
Taylor expanded in l around 0 27.0%
pow1/227.9%
associate-*r*32.8%
Applied egg-rr32.8%
Final simplification39.6%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= U -2.8e-58) (sqrt (* 2.0 (* U (* t n)))) (sqrt (* 2.0 (* n (* t U))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= -2.8e-58) {
tmp = sqrt((2.0 * (U * (t * n))));
} else {
tmp = sqrt((2.0 * (n * (t * 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 <= (-2.8d-58)) then
tmp = sqrt((2.0d0 * (u * (t * n))))
else
tmp = sqrt((2.0d0 * (n * (t * 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 <= -2.8e-58) {
tmp = Math.sqrt((2.0 * (U * (t * n))));
} else {
tmp = Math.sqrt((2.0 * (n * (t * U))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if U <= -2.8e-58: tmp = math.sqrt((2.0 * (U * (t * n)))) else: tmp = math.sqrt((2.0 * (n * (t * U)))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= -2.8e-58) tmp = sqrt(Float64(2.0 * Float64(U * Float64(t * n)))); else tmp = sqrt(Float64(2.0 * Float64(n * Float64(t * U)))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U <= -2.8e-58) tmp = sqrt((2.0 * (U * (t * n)))); else tmp = sqrt((2.0 * (n * (t * 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, -2.8e-58], N[Sqrt[N[(2.0 * N[(U * N[(t * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(n * N[(t * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;U \leq -2.8 \cdot 10^{-58}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(t \cdot n\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(t \cdot U\right)\right)}\\
\end{array}
\end{array}
if U < -2.8000000000000001e-58Initial program 65.3%
Simplified60.1%
Taylor expanded in l around 0 54.5%
if -2.8000000000000001e-58 < U Initial program 45.1%
Simplified53.6%
Taylor expanded in l around 0 33.1%
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 (* t n)))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((2.0 * (U * (t * n))));
}
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 * (t * n))))
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 * (t * n))));
}
l = abs(l) def code(n, U, t, l, Om, U_42_): return math.sqrt((2.0 * (U * (t * n))))
l = abs(l) function code(n, U, t, l, Om, U_42_) return sqrt(Float64(2.0 * Float64(U * Float64(t * n)))) end
l = abs(l) function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((2.0 * (U * (t * n)))); 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[(t * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\sqrt{2 \cdot \left(U \cdot \left(t \cdot n\right)\right)}
\end{array}
Initial program 50.2%
Simplified55.2%
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 50.2%
Simplified55.2%
Taylor expanded in l around 0 35.6%
associate-*r*37.2%
*-commutative37.2%
Simplified37.2%
Final simplification37.2%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (sqrt (* t (* U (* 2.0 n)))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((t * (U * (2.0 * n))));
}
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((t * (u * (2.0d0 * n))))
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((t * (U * (2.0 * n))));
}
l = abs(l) def code(n, U, t, l, Om, U_42_): return math.sqrt((t * (U * (2.0 * n))))
l = abs(l) function code(n, U, t, l, Om, U_42_) return sqrt(Float64(t * Float64(U * Float64(2.0 * n)))) end
l = abs(l) function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((t * (U * (2.0 * n)))); end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(t * N[(U * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\sqrt{t \cdot \left(U \cdot \left(2 \cdot n\right)\right)}
\end{array}
Initial program 50.2%
associate-/l*55.1%
clear-num55.1%
inv-pow55.1%
Applied egg-rr55.1%
Taylor expanded in t around inf 37.3%
Final simplification37.3%
herbie shell --seed 2023300
(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*))))))