
(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 (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
(+ (fma (/ 1.0 (/ Om (pow l 2.0))) -2.0 t) (* t_1 (* n (- U* U)))))))
(if (<= t_4 INFINITY)
(sqrt (* t_3 (+ (- t (* 2.0 (* l (/ l Om)))) t_2)))
(*
(sqrt (* U (* n (- (/ n (/ (pow Om 2.0) (- U* U))) (/ 2.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 = 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 * (fma((1.0 / (Om / pow(l, 2.0))), -2.0, t) + (t_1 * (n * (U_42_ - U))))));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((t_3 * ((t - (2.0 * (l * (l / Om)))) + t_2)));
} else {
tmp = sqrt((U * (n * ((n / (pow(Om, 2.0) / (U_42_ - U))) - (2.0 / Om))))) * (l * sqrt(2.0));
}
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(fma(Float64(1.0 / Float64(Om / (l ^ 2.0))), -2.0, t) + Float64(t_1 * Float64(n * Float64(U_42_ - U))))))); 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(sqrt(Float64(U * Float64(n * Float64(Float64(n / Float64((Om ^ 2.0) / Float64(U_42_ - U))) - Float64(2.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[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[(N[(N[(1.0 / N[(Om / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0 + t), $MachinePrecision] + N[(t$95$1 * N[(n * N[(U$42$ - U), $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[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] * N[(l * N[Sqrt[2.0], $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(\mathsf{fma}\left(\frac{1}{\frac{Om}{{\ell}^{2}}}, -2, t\right) + t_1 \cdot \left(n \cdot \left(U* - U\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}:\\
\;\;\;\;\sqrt{U \cdot \left(n \cdot \left(\frac{n}{\frac{{Om}^{2}}{U* - U}} - \frac{2}{Om}\right)\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 18.3%
Simplified18.3%
Applied egg-rr35.0%
*-commutative35.0%
*-commutative35.0%
Simplified35.0%
clear-num35.1%
inv-pow35.1%
Applied egg-rr35.1%
unpow-135.1%
Simplified35.1%
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 66.7%
associate-*l/70.3%
Applied egg-rr70.3%
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%
Simplified11.3%
Taylor expanded in l around inf 17.4%
associate-/l*17.5%
associate-*r/17.5%
metadata-eval17.5%
Simplified17.5%
Final simplification58.3%
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 (* (* n (pow (/ l Om) 2.0)) (- 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 (* -2.0 t_1)))))
(if (<= t_4 INFINITY)
(sqrt (* t_3 (+ (- t (* 2.0 t_1)) t_2)))
(*
(sqrt (* U (* n (- (/ n (/ (pow Om 2.0) (- U* U))) (/ 2.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 = (n * pow((l / Om), 2.0)) * (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 + (-2.0 * t_1))));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((t_3 * ((t - (2.0 * t_1)) + t_2)));
} else {
tmp = sqrt((U * (n * ((n / (pow(Om, 2.0) / (U_42_ - U))) - (2.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 = l * (l / Om);
double t_2 = (n * Math.pow((l / Om), 2.0)) * (U_42_ - U);
double t_3 = (2.0 * n) * U;
double t_4 = Math.sqrt((t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2)));
double tmp;
if (t_4 <= 0.0) {
tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * (t + (-2.0 * t_1))));
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_3 * ((t - (2.0 * t_1)) + t_2)));
} else {
tmp = Math.sqrt((U * (n * ((n / (Math.pow(Om, 2.0) / (U_42_ - U))) - (2.0 / Om))))) * (l * Math.sqrt(2.0));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): t_1 = l * (l / Om) t_2 = (n * math.pow((l / Om), 2.0)) * (U_42_ - U) t_3 = (2.0 * n) * U t_4 = math.sqrt((t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2))) tmp = 0 if t_4 <= 0.0: tmp = math.sqrt((2.0 * n)) * math.sqrt((U * (t + (-2.0 * t_1)))) elif t_4 <= math.inf: tmp = math.sqrt((t_3 * ((t - (2.0 * t_1)) + t_2))) else: tmp = math.sqrt((U * (n * ((n / (math.pow(Om, 2.0) / (U_42_ - U))) - (2.0 / Om))))) * (l * math.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(Float64(n * (Float64(l / Om) ^ 2.0)) * 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 + Float64(-2.0 * t_1))))); elseif (t_4 <= Inf) tmp = sqrt(Float64(t_3 * Float64(Float64(t - Float64(2.0 * t_1)) + t_2))); else tmp = Float64(sqrt(Float64(U * Float64(n * Float64(Float64(n / Float64((Om ^ 2.0) / Float64(U_42_ - U))) - Float64(2.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 = l * (l / Om); t_2 = (n * ((l / Om) ^ 2.0)) * (U_42_ - U); t_3 = (2.0 * n) * U; t_4 = sqrt((t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2))); tmp = 0.0; if (t_4 <= 0.0) tmp = sqrt((2.0 * n)) * sqrt((U * (t + (-2.0 * t_1)))); elseif (t_4 <= Inf) tmp = sqrt((t_3 * ((t - (2.0 * t_1)) + t_2))); else tmp = sqrt((U * (n * ((n / ((Om ^ 2.0) / (U_42_ - U))) - (2.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[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $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 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(t$95$3 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(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] * 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 := \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\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 + -2 \cdot t_1\right)}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_3 \cdot \left(\left(t - 2 \cdot t_1\right) + t_2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{U \cdot \left(n \cdot \left(\frac{n}{\frac{{Om}^{2}}{U* - U}} - \frac{2}{Om}\right)\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 18.3%
Simplified18.3%
Applied egg-rr35.0%
*-commutative35.0%
*-commutative35.0%
Simplified35.0%
Taylor expanded in n around 0 35.0%
unpow235.0%
associate-*l/35.0%
Applied egg-rr35.0%
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 66.7%
associate-*l/70.3%
Applied egg-rr70.3%
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%
Simplified11.3%
Taylor expanded in l around inf 17.4%
associate-/l*17.5%
associate-*r/17.5%
metadata-eval17.5%
Simplified17.5%
Final simplification58.3%
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 (* (* n (pow (/ l Om) 2.0)) (- 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 (* -2.0 t_1)))))
(if (<= t_4 INFINITY)
(sqrt (* t_3 (+ (- t (* 2.0 t_1)) t_2)))
(pow (* (* 2.0 n) (* U (fma -2.0 (/ (pow l 2.0) Om) t))) 0.5)))))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 = (n * pow((l / Om), 2.0)) * (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 + (-2.0 * t_1))));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((t_3 * ((t - (2.0 * t_1)) + t_2)));
} else {
tmp = pow(((2.0 * n) * (U * fma(-2.0, (pow(l, 2.0) / Om), t))), 0.5);
}
return tmp;
}
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(l * Float64(l / Om)) t_2 = Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * 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 + Float64(-2.0 * t_1))))); elseif (t_4 <= Inf) tmp = sqrt(Float64(t_3 * Float64(Float64(t - Float64(2.0 * t_1)) + t_2))); else tmp = Float64(Float64(2.0 * n) * Float64(U * fma(-2.0, Float64((l ^ 2.0) / Om), t))) ^ 0.5; 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[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $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 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(t$95$3 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(-2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \ell \cdot \frac{\ell}{Om}\\
t_2 := \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\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 + -2 \cdot t_1\right)}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_3 \cdot \left(\left(t - 2 \cdot t_1\right) + t_2\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\left(2 \cdot n\right) \cdot \left(U \cdot \mathsf{fma}\left(-2, \frac{{\ell}^{2}}{Om}, t\right)\right)\right)}^{0.5}\\
\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 18.3%
Simplified18.3%
Applied egg-rr35.0%
*-commutative35.0%
*-commutative35.0%
Simplified35.0%
Taylor expanded in n around 0 35.0%
unpow235.0%
associate-*l/35.0%
Applied egg-rr35.0%
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 66.7%
associate-*l/70.3%
Applied egg-rr70.3%
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%
Simplified0.5%
Applied egg-rr0.5%
*-commutative0.5%
*-commutative0.5%
Simplified0.5%
Taylor expanded in n around 0 6.6%
*-commutative6.6%
pow1/226.0%
pow1/226.0%
*-commutative26.0%
pow-prod-down35.4%
+-commutative35.4%
fma-def35.4%
Applied egg-rr35.4%
Final simplification60.8%
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 (* (* n (pow (/ l Om) 2.0)) (- U* U)))
(t_3 (* (* 2.0 n) U))
(t_4 (* t_3 (+ (- t (* 2.0 (/ (* l l) Om))) t_2))))
(if (<= t_4 0.0)
(* (sqrt (* 2.0 n)) (sqrt (* U (+ t (* -2.0 t_1)))))
(if (<= t_4 INFINITY)
(sqrt (* t_3 (+ (- t (* 2.0 t_1)) t_2)))
(sqrt
(+ (* -4.0 (/ (* U (* n (pow l 2.0))) Om)) (* 2.0 (* U (* n t)))))))))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 = (n * pow((l / Om), 2.0)) * (U_42_ - U);
double t_3 = (2.0 * n) * U;
double t_4 = 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 + (-2.0 * t_1))));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((t_3 * ((t - (2.0 * t_1)) + t_2)));
} else {
tmp = sqrt(((-4.0 * ((U * (n * pow(l, 2.0))) / Om)) + (2.0 * (U * (n * t)))));
}
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 = l * (l / Om);
double t_2 = (n * Math.pow((l / Om), 2.0)) * (U_42_ - U);
double t_3 = (2.0 * n) * U;
double t_4 = t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2);
double tmp;
if (t_4 <= 0.0) {
tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * (t + (-2.0 * t_1))));
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_3 * ((t - (2.0 * t_1)) + t_2)));
} else {
tmp = Math.sqrt(((-4.0 * ((U * (n * Math.pow(l, 2.0))) / Om)) + (2.0 * (U * (n * t)))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): t_1 = l * (l / Om) t_2 = (n * math.pow((l / Om), 2.0)) * (U_42_ - U) t_3 = (2.0 * n) * U t_4 = t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2) tmp = 0 if t_4 <= 0.0: tmp = math.sqrt((2.0 * n)) * math.sqrt((U * (t + (-2.0 * t_1)))) elif t_4 <= math.inf: tmp = math.sqrt((t_3 * ((t - (2.0 * t_1)) + t_2))) else: tmp = math.sqrt(((-4.0 * ((U * (n * math.pow(l, 2.0))) / Om)) + (2.0 * (U * (n * t))))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(l * Float64(l / Om)) t_2 = Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U_42_ - U)) t_3 = Float64(Float64(2.0 * n) * U) t_4 = 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 + Float64(-2.0 * t_1))))); elseif (t_4 <= Inf) tmp = sqrt(Float64(t_3 * Float64(Float64(t - Float64(2.0 * t_1)) + t_2))); else tmp = sqrt(Float64(Float64(-4.0 * Float64(Float64(U * Float64(n * (l ^ 2.0))) / Om)) + Float64(2.0 * Float64(U * Float64(n * t))))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = l * (l / Om); t_2 = (n * ((l / Om) ^ 2.0)) * (U_42_ - U); t_3 = (2.0 * n) * U; t_4 = t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2); tmp = 0.0; if (t_4 <= 0.0) tmp = sqrt((2.0 * n)) * sqrt((U * (t + (-2.0 * t_1)))); elseif (t_4 <= Inf) tmp = sqrt((t_3 * ((t - (2.0 * t_1)) + t_2))); else tmp = sqrt(((-4.0 * ((U * (n * (l ^ 2.0))) / Om)) + (2.0 * (U * (n * t))))); 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]}, Block[{t$95$2 = N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $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 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(t$95$3 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(-4.0 * N[(N[(U * N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \ell \cdot \frac{\ell}{Om}\\
t_2 := \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\\
t_3 := \left(2 \cdot n\right) \cdot U\\
t_4 := 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 + -2 \cdot t_1\right)}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_3 \cdot \left(\left(t - 2 \cdot t_1\right) + t_2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{-4 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om} + 2 \cdot \left(U \cdot \left(n \cdot t\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 17.7%
Simplified17.7%
Applied egg-rr33.9%
*-commutative33.9%
*-commutative33.9%
Simplified33.9%
Taylor expanded in n around 0 34.0%
unpow234.0%
associate-*l/34.0%
Applied egg-rr34.0%
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 66.7%
associate-*l/70.3%
Applied egg-rr70.3%
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%
Taylor expanded in Om around inf 20.6%
Final simplification58.6%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(sqrt
(*
(* 2.0 n)
(*
U
(+
(+ t (* -2.0 (/ l (/ Om l))))
(* n (* (pow (/ l Om) 2.0) (- U* U)))))))))
(if (<= n -1.85e-122)
t_1
(if (<= n 1.05e-276)
(sqrt (+ (* -4.0 (/ (* U (* n (pow l 2.0))) Om)) (* 2.0 (* U (* n t)))))
(if (<= n 5.5e-121)
(* (sqrt (* 2.0 n)) (sqrt (* U (+ t (* -2.0 (* l (/ l Om)))))))
t_1)))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (pow((l / Om), 2.0) * (U_42_ - U)))))));
double tmp;
if (n <= -1.85e-122) {
tmp = t_1;
} else if (n <= 1.05e-276) {
tmp = sqrt(((-4.0 * ((U * (n * pow(l, 2.0))) / Om)) + (2.0 * (U * (n * t)))));
} else if (n <= 5.5e-121) {
tmp = sqrt((2.0 * n)) * sqrt((U * (t + (-2.0 * (l * (l / Om))))));
} else {
tmp = t_1;
}
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 = sqrt(((2.0d0 * n) * (u * ((t + ((-2.0d0) * (l / (om / l)))) + (n * (((l / om) ** 2.0d0) * (u_42 - u)))))))
if (n <= (-1.85d-122)) then
tmp = t_1
else if (n <= 1.05d-276) then
tmp = sqrt((((-4.0d0) * ((u * (n * (l ** 2.0d0))) / om)) + (2.0d0 * (u * (n * t)))))
else if (n <= 5.5d-121) then
tmp = sqrt((2.0d0 * n)) * sqrt((u * (t + ((-2.0d0) * (l * (l / om))))))
else
tmp = t_1
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(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (Math.pow((l / Om), 2.0) * (U_42_ - U)))))));
double tmp;
if (n <= -1.85e-122) {
tmp = t_1;
} else if (n <= 1.05e-276) {
tmp = Math.sqrt(((-4.0 * ((U * (n * Math.pow(l, 2.0))) / Om)) + (2.0 * (U * (n * t)))));
} else if (n <= 5.5e-121) {
tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * (t + (-2.0 * (l * (l / Om))))));
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): t_1 = math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (math.pow((l / Om), 2.0) * (U_42_ - U))))))) tmp = 0 if n <= -1.85e-122: tmp = t_1 elif n <= 1.05e-276: tmp = math.sqrt(((-4.0 * ((U * (n * math.pow(l, 2.0))) / Om)) + (2.0 * (U * (n * t))))) elif n <= 5.5e-121: tmp = math.sqrt((2.0 * n)) * math.sqrt((U * (t + (-2.0 * (l * (l / Om)))))) else: tmp = t_1 return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = 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))))))) tmp = 0.0 if (n <= -1.85e-122) tmp = t_1; elseif (n <= 1.05e-276) tmp = sqrt(Float64(Float64(-4.0 * Float64(Float64(U * Float64(n * (l ^ 2.0))) / Om)) + Float64(2.0 * Float64(U * Float64(n * t))))); elseif (n <= 5.5e-121) tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * Float64(t + Float64(-2.0 * Float64(l * Float64(l / Om))))))); else tmp = t_1; end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (((l / Om) ^ 2.0) * (U_42_ - U))))))); tmp = 0.0; if (n <= -1.85e-122) tmp = t_1; elseif (n <= 1.05e-276) tmp = sqrt(((-4.0 * ((U * (n * (l ^ 2.0))) / Om)) + (2.0 * (U * (n * t))))); elseif (n <= 5.5e-121) tmp = sqrt((2.0 * n)) * sqrt((U * (t + (-2.0 * (l * (l / Om)))))); else tmp = t_1; 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[(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]}, If[LessEqual[n, -1.85e-122], t$95$1, If[LessEqual[n, 1.05e-276], N[Sqrt[N[(N[(-4.0 * N[(N[(U * N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 5.5e-121], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(t + N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \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{if}\;n \leq -1.85 \cdot 10^{-122}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;n \leq 1.05 \cdot 10^{-276}:\\
\;\;\;\;\sqrt{-4 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om} + 2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\
\mathbf{elif}\;n \leq 5.5 \cdot 10^{-121}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if n < -1.8499999999999999e-122 or 5.50000000000000031e-121 < n Initial program 54.3%
Simplified58.6%
if -1.8499999999999999e-122 < n < 1.05e-276Initial program 55.8%
Taylor expanded in Om around inf 60.5%
if 1.05e-276 < n < 5.50000000000000031e-121Initial program 32.0%
Simplified39.4%
Applied egg-rr47.6%
*-commutative47.6%
*-commutative47.6%
Simplified47.6%
Taylor expanded in n around 0 48.4%
unpow248.4%
associate-*l/60.1%
Applied egg-rr60.1%
Final simplification59.2%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= n 8.8e-281) (sqrt (* 2.0 (* n (+ (* -2.0 (/ 1.0 (/ Om (* U (pow l 2.0))))) (* U t))))) (* (sqrt (* 2.0 n)) (sqrt (* U (+ t (* -2.0 (* l (/ l Om)))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= 8.8e-281) {
tmp = sqrt((2.0 * (n * ((-2.0 * (1.0 / (Om / (U * pow(l, 2.0))))) + (U * t)))));
} else {
tmp = sqrt((2.0 * n)) * sqrt((U * (t + (-2.0 * (l * (l / 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 (n <= 8.8d-281) then
tmp = sqrt((2.0d0 * (n * (((-2.0d0) * (1.0d0 / (om / (u * (l ** 2.0d0))))) + (u * t)))))
else
tmp = sqrt((2.0d0 * n)) * sqrt((u * (t + ((-2.0d0) * (l * (l / 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 (n <= 8.8e-281) {
tmp = Math.sqrt((2.0 * (n * ((-2.0 * (1.0 / (Om / (U * Math.pow(l, 2.0))))) + (U * t)))));
} else {
tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * (t + (-2.0 * (l * (l / Om))))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if n <= 8.8e-281: tmp = math.sqrt((2.0 * (n * ((-2.0 * (1.0 / (Om / (U * math.pow(l, 2.0))))) + (U * t))))) else: tmp = math.sqrt((2.0 * n)) * math.sqrt((U * (t + (-2.0 * (l * (l / Om)))))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= 8.8e-281) tmp = sqrt(Float64(2.0 * Float64(n * Float64(Float64(-2.0 * Float64(1.0 / Float64(Om / Float64(U * (l ^ 2.0))))) + Float64(U * t))))); else tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * Float64(t + Float64(-2.0 * Float64(l * Float64(l / Om))))))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (n <= 8.8e-281) tmp = sqrt((2.0 * (n * ((-2.0 * (1.0 / (Om / (U * (l ^ 2.0))))) + (U * t))))); else tmp = sqrt((2.0 * n)) * sqrt((U * (t + (-2.0 * (l * (l / 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[n, 8.8e-281], N[Sqrt[N[(2.0 * N[(n * N[(N[(-2.0 * N[(1.0 / N[(Om / N[(U * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(t + N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;n \leq 8.8 \cdot 10^{-281}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(-2 \cdot \frac{1}{\frac{Om}{U \cdot {\ell}^{2}}} + U \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\\
\end{array}
\end{array}
if n < 8.80000000000000016e-281Initial program 56.2%
Simplified57.2%
Taylor expanded in Om around inf 50.6%
clear-num50.6%
inv-pow50.6%
Applied egg-rr50.6%
unpow-150.6%
Simplified50.6%
if 8.80000000000000016e-281 < n Initial program 45.4%
Simplified46.9%
Applied egg-rr51.0%
*-commutative51.0%
*-commutative51.0%
Simplified51.0%
Taylor expanded in n around 0 46.1%
unpow246.1%
associate-*l/51.6%
Applied egg-rr51.6%
Final simplification51.1%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= n 5.6e-275) (sqrt (+ (* -4.0 (/ (* U (* n (pow l 2.0))) Om)) (* 2.0 (* U (* n t))))) (* (sqrt (* 2.0 n)) (sqrt (* U (+ t (* -2.0 (* l (/ l Om)))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= 5.6e-275) {
tmp = sqrt(((-4.0 * ((U * (n * pow(l, 2.0))) / Om)) + (2.0 * (U * (n * t)))));
} else {
tmp = sqrt((2.0 * n)) * sqrt((U * (t + (-2.0 * (l * (l / 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 (n <= 5.6d-275) then
tmp = sqrt((((-4.0d0) * ((u * (n * (l ** 2.0d0))) / om)) + (2.0d0 * (u * (n * t)))))
else
tmp = sqrt((2.0d0 * n)) * sqrt((u * (t + ((-2.0d0) * (l * (l / 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 (n <= 5.6e-275) {
tmp = Math.sqrt(((-4.0 * ((U * (n * Math.pow(l, 2.0))) / Om)) + (2.0 * (U * (n * t)))));
} else {
tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * (t + (-2.0 * (l * (l / Om))))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if n <= 5.6e-275: tmp = math.sqrt(((-4.0 * ((U * (n * math.pow(l, 2.0))) / Om)) + (2.0 * (U * (n * t))))) else: tmp = math.sqrt((2.0 * n)) * math.sqrt((U * (t + (-2.0 * (l * (l / Om)))))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= 5.6e-275) tmp = sqrt(Float64(Float64(-4.0 * Float64(Float64(U * Float64(n * (l ^ 2.0))) / Om)) + Float64(2.0 * Float64(U * Float64(n * t))))); else tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * Float64(t + Float64(-2.0 * Float64(l * Float64(l / Om))))))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (n <= 5.6e-275) tmp = sqrt(((-4.0 * ((U * (n * (l ^ 2.0))) / Om)) + (2.0 * (U * (n * t))))); else tmp = sqrt((2.0 * n)) * sqrt((U * (t + (-2.0 * (l * (l / 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[n, 5.6e-275], N[Sqrt[N[(N[(-4.0 * N[(N[(U * N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(t + N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;n \leq 5.6 \cdot 10^{-275}:\\
\;\;\;\;\sqrt{-4 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om} + 2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\\
\end{array}
\end{array}
if n < 5.59999999999999989e-275Initial program 56.2%
Taylor expanded in Om around inf 51.4%
if 5.59999999999999989e-275 < n Initial program 45.4%
Simplified46.9%
Applied egg-rr51.0%
*-commutative51.0%
*-commutative51.0%
Simplified51.0%
Taylor expanded in n around 0 46.1%
unpow246.1%
associate-*l/51.6%
Applied egg-rr51.6%
Final simplification51.5%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= n 7.2e-281) (sqrt (* 2.0 (* n (+ (* U t) (* -2.0 (/ (* U (pow l 2.0)) Om)))))) (* (sqrt (* 2.0 n)) (sqrt (* U (+ t (* -2.0 (* l (/ l Om)))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= 7.2e-281) {
tmp = sqrt((2.0 * (n * ((U * t) + (-2.0 * ((U * pow(l, 2.0)) / Om))))));
} else {
tmp = sqrt((2.0 * n)) * sqrt((U * (t + (-2.0 * (l * (l / 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 (n <= 7.2d-281) then
tmp = sqrt((2.0d0 * (n * ((u * t) + ((-2.0d0) * ((u * (l ** 2.0d0)) / om))))))
else
tmp = sqrt((2.0d0 * n)) * sqrt((u * (t + ((-2.0d0) * (l * (l / 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 (n <= 7.2e-281) {
tmp = Math.sqrt((2.0 * (n * ((U * t) + (-2.0 * ((U * Math.pow(l, 2.0)) / Om))))));
} else {
tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * (t + (-2.0 * (l * (l / Om))))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if n <= 7.2e-281: tmp = math.sqrt((2.0 * (n * ((U * t) + (-2.0 * ((U * math.pow(l, 2.0)) / Om)))))) else: tmp = math.sqrt((2.0 * n)) * math.sqrt((U * (t + (-2.0 * (l * (l / Om)))))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= 7.2e-281) tmp = sqrt(Float64(2.0 * Float64(n * Float64(Float64(U * t) + Float64(-2.0 * Float64(Float64(U * (l ^ 2.0)) / Om)))))); else tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * Float64(t + Float64(-2.0 * Float64(l * Float64(l / Om))))))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (n <= 7.2e-281) tmp = sqrt((2.0 * (n * ((U * t) + (-2.0 * ((U * (l ^ 2.0)) / Om)))))); else tmp = sqrt((2.0 * n)) * sqrt((U * (t + (-2.0 * (l * (l / 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[n, 7.2e-281], N[Sqrt[N[(2.0 * N[(n * N[(N[(U * t), $MachinePrecision] + N[(-2.0 * N[(N[(U * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(t + N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;n \leq 7.2 \cdot 10^{-281}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t + -2 \cdot \frac{U \cdot {\ell}^{2}}{Om}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\\
\end{array}
\end{array}
if n < 7.20000000000000013e-281Initial program 56.2%
Simplified57.2%
Taylor expanded in Om around inf 50.6%
if 7.20000000000000013e-281 < n Initial program 45.4%
Simplified46.9%
Applied egg-rr51.0%
*-commutative51.0%
*-commutative51.0%
Simplified51.0%
Taylor expanded in n around 0 46.1%
unpow246.1%
associate-*l/51.6%
Applied egg-rr51.6%
Final simplification51.1%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= n 3.1e-308) (sqrt (* 2.0 (* (- t (/ 2.0 (/ Om (pow l 2.0)))) (* n U)))) (* (sqrt (* 2.0 n)) (sqrt (* U (+ t (* -2.0 (* l (/ l Om)))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= 3.1e-308) {
tmp = sqrt((2.0 * ((t - (2.0 / (Om / pow(l, 2.0)))) * (n * U))));
} else {
tmp = sqrt((2.0 * n)) * sqrt((U * (t + (-2.0 * (l * (l / 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 (n <= 3.1d-308) then
tmp = sqrt((2.0d0 * ((t - (2.0d0 / (om / (l ** 2.0d0)))) * (n * u))))
else
tmp = sqrt((2.0d0 * n)) * sqrt((u * (t + ((-2.0d0) * (l * (l / 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 (n <= 3.1e-308) {
tmp = Math.sqrt((2.0 * ((t - (2.0 / (Om / Math.pow(l, 2.0)))) * (n * U))));
} else {
tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * (t + (-2.0 * (l * (l / Om))))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if n <= 3.1e-308: tmp = math.sqrt((2.0 * ((t - (2.0 / (Om / math.pow(l, 2.0)))) * (n * U)))) else: tmp = math.sqrt((2.0 * n)) * math.sqrt((U * (t + (-2.0 * (l * (l / Om)))))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= 3.1e-308) tmp = sqrt(Float64(2.0 * Float64(Float64(t - Float64(2.0 / Float64(Om / (l ^ 2.0)))) * Float64(n * U)))); else tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * Float64(t + Float64(-2.0 * Float64(l * Float64(l / Om))))))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (n <= 3.1e-308) tmp = sqrt((2.0 * ((t - (2.0 / (Om / (l ^ 2.0)))) * (n * U)))); else tmp = sqrt((2.0 * n)) * sqrt((U * (t + (-2.0 * (l * (l / 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[n, 3.1e-308], N[Sqrt[N[(2.0 * N[(N[(t - N[(2.0 / N[(Om / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(t + N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;n \leq 3.1 \cdot 10^{-308}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(t - \frac{2}{\frac{Om}{{\ell}^{2}}}\right) \cdot \left(n \cdot U\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\\
\end{array}
\end{array}
if n < 3.09999999999999992e-308Initial program 56.4%
Simplified56.1%
Taylor expanded in Om around inf 49.1%
associate-*r/49.1%
associate-/l*49.1%
Simplified49.1%
if 3.09999999999999992e-308 < n Initial program 45.7%
Simplified47.0%
Applied egg-rr50.7%
*-commutative50.7%
*-commutative50.7%
Simplified50.7%
Taylor expanded in n around 0 46.7%
unpow246.7%
associate-*l/52.0%
Applied egg-rr52.0%
Final simplification50.5%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(if (<= l 4e-171)
(sqrt (* 2.0 (* n (* U t))))
(if (<= l 1.4e+55)
(pow (* (* n t) (* 2.0 U)) 0.5)
(sqrt (* 2.0 (/ (* -2.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 <= 4e-171) {
tmp = sqrt((2.0 * (n * (U * t))));
} else if (l <= 1.4e+55) {
tmp = pow(((n * t) * (2.0 * U)), 0.5);
} else {
tmp = sqrt((2.0 * ((-2.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 <= 4d-171) then
tmp = sqrt((2.0d0 * (n * (u * t))))
else if (l <= 1.4d+55) then
tmp = ((n * t) * (2.0d0 * u)) ** 0.5d0
else
tmp = sqrt((2.0d0 * (((-2.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 <= 4e-171) {
tmp = Math.sqrt((2.0 * (n * (U * t))));
} else if (l <= 1.4e+55) {
tmp = Math.pow(((n * t) * (2.0 * U)), 0.5);
} else {
tmp = Math.sqrt((2.0 * ((-2.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 <= 4e-171: tmp = math.sqrt((2.0 * (n * (U * t)))) elif l <= 1.4e+55: tmp = math.pow(((n * t) * (2.0 * U)), 0.5) else: tmp = math.sqrt((2.0 * ((-2.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 <= 4e-171) tmp = sqrt(Float64(2.0 * Float64(n * Float64(U * t)))); elseif (l <= 1.4e+55) tmp = Float64(Float64(n * t) * Float64(2.0 * U)) ^ 0.5; else tmp = sqrt(Float64(2.0 * Float64(Float64(-2.0 * 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 <= 4e-171) tmp = sqrt((2.0 * (n * (U * t)))); elseif (l <= 1.4e+55) tmp = ((n * t) * (2.0 * U)) ^ 0.5; else tmp = sqrt((2.0 * ((-2.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[LessEqual[l, 4e-171], N[Sqrt[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 1.4e+55], N[Power[N[(N[(n * t), $MachinePrecision] * N[(2.0 * U), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Sqrt[N[(2.0 * N[(N[(-2.0 * N[(U * N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4 \cdot 10^{-171}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right)}\\
\mathbf{elif}\;\ell \leq 1.4 \cdot 10^{+55}:\\
\;\;\;\;{\left(\left(n \cdot t\right) \cdot \left(2 \cdot U\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \frac{-2 \cdot \left(U \cdot \left(n \cdot {\ell}^{2}\right)\right)}{Om}}\\
\end{array}
\end{array}
if l < 3.9999999999999999e-171Initial program 51.7%
Simplified57.8%
Taylor expanded in l around 0 40.6%
if 3.9999999999999999e-171 < l < 1.4e55Initial program 63.6%
Simplified61.0%
Taylor expanded in t around inf 42.4%
pow1/244.9%
associate-*r*44.9%
Applied egg-rr44.9%
if 1.4e55 < l Initial program 35.2%
Simplified35.4%
Taylor expanded in Om around inf 33.1%
Taylor expanded in l around inf 30.2%
associate-*r/30.2%
*-commutative30.2%
Simplified30.2%
Final simplification39.7%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= l 5.4e-173) (sqrt (* 2.0 (* n (* U t)))) (sqrt (* 2.0 (* U (* n (- t (* 2.0 (/ (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 <= 5.4e-173) {
tmp = sqrt((2.0 * (n * (U * t))));
} else {
tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (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 <= 5.4d-173) then
tmp = sqrt((2.0d0 * (n * (u * t))))
else
tmp = sqrt((2.0d0 * (u * (n * (t - (2.0d0 * ((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 <= 5.4e-173) {
tmp = Math.sqrt((2.0 * (n * (U * t))));
} else {
tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * (Math.pow(l, 2.0) / Om)))))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 5.4e-173: tmp = math.sqrt((2.0 * (n * (U * t)))) else: tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * (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 <= 5.4e-173) tmp = sqrt(Float64(2.0 * Float64(n * Float64(U * t)))); else tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64((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 <= 5.4e-173) tmp = sqrt((2.0 * (n * (U * t)))); else tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((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[LessEqual[l, 5.4e-173], N[Sqrt[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 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]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 5.4 \cdot 10^{-173}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}\\
\end{array}
\end{array}
if l < 5.3999999999999999e-173Initial program 51.7%
Simplified57.8%
Taylor expanded in l around 0 40.6%
if 5.3999999999999999e-173 < l Initial program 49.5%
Simplified50.7%
Taylor expanded in n around 0 41.0%
Final simplification40.7%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= t -1.8e-189) (pow (* (* n t) (* 2.0 U)) 0.5) (sqrt (fabs (* t (* 2.0 (* n U)))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= -1.8e-189) {
tmp = pow(((n * t) * (2.0 * U)), 0.5);
} else {
tmp = sqrt(fabs((t * (2.0 * (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 (t <= (-1.8d-189)) then
tmp = ((n * t) * (2.0d0 * u)) ** 0.5d0
else
tmp = sqrt(abs((t * (2.0d0 * (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 (t <= -1.8e-189) {
tmp = Math.pow(((n * t) * (2.0 * U)), 0.5);
} else {
tmp = Math.sqrt(Math.abs((t * (2.0 * (n * U)))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if t <= -1.8e-189: tmp = math.pow(((n * t) * (2.0 * U)), 0.5) else: tmp = math.sqrt(math.fabs((t * (2.0 * (n * U))))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= -1.8e-189) tmp = Float64(Float64(n * t) * Float64(2.0 * U)) ^ 0.5; else tmp = sqrt(abs(Float64(t * Float64(2.0 * 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 (t <= -1.8e-189) tmp = ((n * t) * (2.0 * U)) ^ 0.5; else tmp = sqrt(abs((t * (2.0 * (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[t, -1.8e-189], N[Power[N[(N[(n * t), $MachinePrecision] * N[(2.0 * U), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Sqrt[N[Abs[N[(t * N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-189}:\\
\;\;\;\;{\left(\left(n \cdot t\right) \cdot \left(2 \cdot U\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left|t \cdot \left(2 \cdot \left(n \cdot U\right)\right)\right|}\\
\end{array}
\end{array}
if t < -1.80000000000000008e-189Initial program 51.6%
Simplified51.4%
Taylor expanded in t around inf 46.4%
pow1/247.4%
associate-*r*47.4%
Applied egg-rr47.4%
if -1.80000000000000008e-189 < t Initial program 50.7%
associate-*l/53.7%
Applied egg-rr53.7%
Taylor expanded in t around inf 31.8%
add-sqr-sqrt31.8%
pow1/231.8%
pow1/233.1%
pow-prod-down24.3%
pow224.3%
*-commutative24.3%
associate-*l*24.3%
Applied egg-rr24.3%
unpow1/224.3%
unpow224.3%
rem-sqrt-square34.0%
*-commutative34.0%
Simplified34.0%
Final simplification39.2%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= l 3e-170) (sqrt (* 2.0 (* n (* U t)))) (pow (* (* n t) (* 2.0 U)) 0.5)))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 3e-170) {
tmp = sqrt((2.0 * (n * (U * t))));
} else {
tmp = pow(((n * t) * (2.0 * 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 (l <= 3d-170) then
tmp = sqrt((2.0d0 * (n * (u * t))))
else
tmp = ((n * t) * (2.0d0 * 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 (l <= 3e-170) {
tmp = Math.sqrt((2.0 * (n * (U * t))));
} else {
tmp = Math.pow(((n * t) * (2.0 * U)), 0.5);
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 3e-170: tmp = math.sqrt((2.0 * (n * (U * t)))) else: tmp = math.pow(((n * t) * (2.0 * U)), 0.5) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 3e-170) tmp = sqrt(Float64(2.0 * Float64(n * Float64(U * t)))); else tmp = Float64(Float64(n * t) * Float64(2.0 * 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 (l <= 3e-170) tmp = sqrt((2.0 * (n * (U * t)))); else tmp = ((n * t) * (2.0 * 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[l, 3e-170], N[Sqrt[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(N[(n * t), $MachinePrecision] * N[(2.0 * U), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3 \cdot 10^{-170}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\left(n \cdot t\right) \cdot \left(2 \cdot U\right)\right)}^{0.5}\\
\end{array}
\end{array}
if l < 3.00000000000000013e-170Initial program 51.7%
Simplified57.8%
Taylor expanded in l around 0 40.6%
if 3.00000000000000013e-170 < l Initial program 49.5%
Simplified50.7%
Taylor expanded in t around inf 26.4%
pow1/227.7%
associate-*r*27.7%
Applied egg-rr27.7%
Final simplification36.6%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= l 2.1e-169) (sqrt (* 2.0 (* n (* U t)))) (sqrt (* 2.0 (* U (* n t))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 2.1e-169) {
tmp = sqrt((2.0 * (n * (U * t))));
} else {
tmp = sqrt((2.0 * (U * (n * 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 (l <= 2.1d-169) then
tmp = sqrt((2.0d0 * (n * (u * t))))
else
tmp = sqrt((2.0d0 * (u * (n * 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 (l <= 2.1e-169) {
tmp = Math.sqrt((2.0 * (n * (U * t))));
} else {
tmp = Math.sqrt((2.0 * (U * (n * t))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 2.1e-169: tmp = math.sqrt((2.0 * (n * (U * t)))) else: tmp = math.sqrt((2.0 * (U * (n * t)))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 2.1e-169) tmp = sqrt(Float64(2.0 * Float64(n * Float64(U * t)))); else tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t)))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 2.1e-169) tmp = sqrt((2.0 * (n * (U * t)))); else tmp = sqrt((2.0 * (U * (n * 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[l, 2.1e-169], N[Sqrt[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.1 \cdot 10^{-169}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\
\end{array}
\end{array}
if l < 2.1000000000000001e-169Initial program 51.7%
Simplified57.8%
Taylor expanded in l around 0 40.6%
if 2.1000000000000001e-169 < l Initial program 49.5%
Simplified50.7%
Taylor expanded in t around inf 26.4%
Final simplification36.2%
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.0%
Simplified51.5%
Taylor expanded in t around inf 34.4%
Final simplification34.4%
herbie shell --seed 2023320
(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*))))))