
(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 18 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 (* (* 2.0 n) U))
(t_2 (* n (pow (/ l Om) 2.0)))
(t_3 (sqrt (* t_1 (+ (- t (* 2.0 (/ (* l l) Om))) (* t_2 (- U* U)))))))
(if (<= t_3 4e-158)
(*
(sqrt (* 2.0 n))
(sqrt (* U (- t (fma 2.0 (/ (pow l 2.0) Om) (* t_2 (- U U*)))))))
(if (<= t_3 1e+138)
(sqrt
(*
t_1
(-
(- t (* 2.0 (* l (/ l Om))))
(* (- U U*) (pow (* (pow (cbrt (/ l Om)) 2.0) (cbrt n)) 3.0)))))
(*
(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 = (2.0 * n) * U;
double t_2 = n * pow((l / Om), 2.0);
double t_3 = sqrt((t_1 * ((t - (2.0 * ((l * l) / Om))) + (t_2 * (U_42_ - U)))));
double tmp;
if (t_3 <= 4e-158) {
tmp = sqrt((2.0 * n)) * sqrt((U * (t - fma(2.0, (pow(l, 2.0) / Om), (t_2 * (U - U_42_))))));
} else if (t_3 <= 1e+138) {
tmp = sqrt((t_1 * ((t - (2.0 * (l * (l / Om)))) - ((U - U_42_) * pow((pow(cbrt((l / Om)), 2.0) * cbrt(n)), 3.0)))));
} 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(Float64(2.0 * n) * U) t_2 = Float64(n * (Float64(l / Om) ^ 2.0)) t_3 = sqrt(Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + Float64(t_2 * Float64(U_42_ - U))))) tmp = 0.0 if (t_3 <= 4e-158) tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * Float64(t - fma(2.0, Float64((l ^ 2.0) / Om), Float64(t_2 * Float64(U - U_42_))))))); elseif (t_3 <= 1e+138) tmp = sqrt(Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))) - Float64(Float64(U - U_42_) * (Float64((cbrt(Float64(l / Om)) ^ 2.0) * cbrt(n)) ^ 3.0))))); 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[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$1 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 4e-158], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(t - N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] + N[(t$95$2 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e+138], N[Sqrt[N[(t$95$1 * N[(N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(U - U$42$), $MachinePrecision] * N[Power[N[(N[Power[N[Power[N[(l / Om), $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision] * N[Power[n, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $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}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \sqrt{t_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_2 \cdot \left(U* - U\right)\right)}\\
\mathbf{if}\;t_3 \leq 4 \cdot 10^{-158}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(2, \frac{{\ell}^{2}}{Om}, t_2 \cdot \left(U - U*\right)\right)\right)}\\
\mathbf{elif}\;t_3 \leq 10^{+138}:\\
\;\;\;\;\sqrt{t_1 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) - \left(U - U*\right) \cdot {\left({\left(\sqrt[3]{\frac{\ell}{Om}}\right)}^{2} \cdot \sqrt[3]{n}\right)}^{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 (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*))))) < 4.00000000000000026e-158Initial program 14.4%
associate-*l/14.4%
Applied egg-rr14.4%
pow1/214.4%
associate-*l*43.4%
unpow-prod-down51.2%
pow1/251.2%
Applied egg-rr51.2%
*-commutative51.2%
unpow1/251.2%
associate-*r*51.2%
Simplified51.2%
if 4.00000000000000026e-158 < (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*))))) < 1e138Initial program 97.3%
associate-*l/97.3%
Applied egg-rr97.3%
add-cube-cbrt97.2%
pow397.2%
Applied egg-rr97.2%
*-commutative97.2%
cbrt-prod97.2%
unpow297.2%
cbrt-prod98.0%
pow298.0%
Applied egg-rr98.0%
if 1e138 < (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 16.1%
Simplified27.4%
Taylor expanded in l around inf 22.0%
Final simplification58.7%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2 (* n (pow (/ l Om) 2.0)))
(t_3 (* t_2 (- U* U)))
(t_4 (sqrt (* t_1 (+ (- t (* 2.0 (/ (* l l) Om))) t_3)))))
(if (<= t_4 4e-158)
(*
(sqrt (* 2.0 n))
(sqrt (* U (- t (fma 2.0 (/ (pow l 2.0) Om) (* t_2 (- U U*)))))))
(if (<= t_4 1e+138)
(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 = (2.0 * n) * U;
double t_2 = n * pow((l / Om), 2.0);
double t_3 = t_2 * (U_42_ - U);
double t_4 = sqrt((t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3)));
double tmp;
if (t_4 <= 4e-158) {
tmp = sqrt((2.0 * n)) * sqrt((U * (t - fma(2.0, (pow(l, 2.0) / Om), (t_2 * (U - U_42_))))));
} else if (t_4 <= 1e+138) {
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 = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) t_2 = Float64(n * (Float64(l / Om) ^ 2.0)) t_3 = Float64(t_2 * Float64(U_42_ - U)) t_4 = sqrt(Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_3))) tmp = 0.0 if (t_4 <= 4e-158) tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * Float64(t - fma(2.0, Float64((l ^ 2.0) / Om), Float64(t_2 * Float64(U - U_42_))))))); elseif (t_4 <= 1e+138) 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
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(t$95$1 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 4e-158], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(t - N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] + N[(t$95$2 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 1e+138], 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 := \left(2 \cdot n\right) \cdot U\\
t_2 := n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := t_2 \cdot \left(U* - U\right)\\
t_4 := \sqrt{t_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_3\right)}\\
\mathbf{if}\;t_4 \leq 4 \cdot 10^{-158}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(2, \frac{{\ell}^{2}}{Om}, t_2 \cdot \left(U - U*\right)\right)\right)}\\
\mathbf{elif}\;t_4 \leq 10^{+138}:\\
\;\;\;\;\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 (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*))))) < 4.00000000000000026e-158Initial program 14.4%
associate-*l/14.4%
Applied egg-rr14.4%
pow1/214.4%
associate-*l*43.4%
unpow-prod-down51.2%
pow1/251.2%
Applied egg-rr51.2%
*-commutative51.2%
unpow1/251.2%
associate-*r*51.2%
Simplified51.2%
if 4.00000000000000026e-158 < (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*))))) < 1e138Initial program 97.3%
associate-*l/97.3%
Applied egg-rr97.3%
if 1e138 < (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 16.1%
Simplified27.4%
Taylor expanded in l around inf 22.0%
Final simplification58.4%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* n (pow (/ l Om) 2.0)) (- U* U)))
(t_2 (* (* 2.0 n) U))
(t_3 (sqrt (* t_2 (+ (- t (* 2.0 (/ (* l l) Om))) t_1)))))
(if (<= t_3 2e-161)
(* (sqrt (* 2.0 n)) (sqrt (* U t)))
(if (<= t_3 INFINITY)
(sqrt (* t_2 (+ (- t (* 2.0 (* l (/ l Om)))) t_1)))
(pow (* (* 2.0 (* n U)) (+ t (* (/ (pow l 2.0) Om) -2.0))) 0.5)))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (n * pow((l / Om), 2.0)) * (U_42_ - U);
double t_2 = (2.0 * n) * U;
double t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + t_1)));
double tmp;
if (t_3 <= 2e-161) {
tmp = sqrt((2.0 * n)) * sqrt((U * t));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) + t_1)));
} else {
tmp = pow(((2.0 * (n * U)) * (t + ((pow(l, 2.0) / Om) * -2.0))), 0.5);
}
return tmp;
}
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (n * Math.pow((l / Om), 2.0)) * (U_42_ - U);
double t_2 = (2.0 * n) * U;
double t_3 = Math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + t_1)));
double tmp;
if (t_3 <= 2e-161) {
tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * t));
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) + t_1)));
} else {
tmp = Math.pow(((2.0 * (n * U)) * (t + ((Math.pow(l, 2.0) / Om) * -2.0))), 0.5);
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): t_1 = (n * math.pow((l / Om), 2.0)) * (U_42_ - U) t_2 = (2.0 * n) * U t_3 = math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + t_1))) tmp = 0 if t_3 <= 2e-161: tmp = math.sqrt((2.0 * n)) * math.sqrt((U * t)) elif t_3 <= math.inf: tmp = math.sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) + t_1))) else: tmp = math.pow(((2.0 * (n * U)) * (t + ((math.pow(l, 2.0) / Om) * -2.0))), 0.5) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U_42_ - U)) t_2 = Float64(Float64(2.0 * n) * U) t_3 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_1))) tmp = 0.0 if (t_3 <= 2e-161) tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * t))); elseif (t_3 <= Inf) tmp = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))) + t_1))); else tmp = Float64(Float64(2.0 * Float64(n * U)) * Float64(t + Float64(Float64((l ^ 2.0) / Om) * -2.0))) ^ 0.5; end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (n * ((l / Om) ^ 2.0)) * (U_42_ - U); t_2 = (2.0 * n) * U; t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + t_1))); tmp = 0.0; if (t_3 <= 2e-161) tmp = sqrt((2.0 * n)) * sqrt((U * t)); elseif (t_3 <= Inf) tmp = sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) + t_1))); else tmp = ((2.0 * (n * U)) * (t + (((l ^ 2.0) / Om) * -2.0))) ^ 0.5; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 2e-161], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t + N[(N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := \sqrt{t_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_1\right)}\\
\mathbf{if}\;t_3 \leq 2 \cdot 10^{-161}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot t}\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\sqrt{t_2 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_1\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \frac{{\ell}^{2}}{Om} \cdot -2\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*))))) < 2.00000000000000006e-161Initial program 13.2%
Simplified42.8%
Taylor expanded in l around 0 41.9%
associate-*r*41.9%
sqrt-prod45.3%
*-commutative45.3%
Applied egg-rr45.3%
if 2.00000000000000006e-161 < (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 68.7%
associate-*l/73.5%
Applied egg-rr73.5%
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%
Simplified8.2%
Taylor expanded in Om around inf 7.0%
associate-*r/7.0%
associate-/l*7.0%
Simplified7.0%
pow1/234.5%
associate-*r*34.5%
div-inv34.5%
clear-num34.5%
unpow234.5%
associate-*l/34.4%
cancel-sign-sub-inv34.4%
associate-*l/34.5%
unpow234.5%
metadata-eval34.5%
Applied egg-rr34.5%
Final simplification63.5%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2 (pow (/ l Om) 2.0))
(t_3 (* (* n t_2) (- U* U)))
(t_4 (* t_1 (+ (- t (* 2.0 (/ (* l l) Om))) t_3))))
(if (<= t_4 0.0)
(sqrt
(*
(* 2.0 n)
(* U (+ (+ t (* -2.0 (/ l (/ Om l)))) (* n (* t_2 (- U* U)))))))
(if (<= t_4 1e+276)
(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 = (2.0 * n) * U;
double t_2 = pow((l / Om), 2.0);
double t_3 = (n * t_2) * (U_42_ - U);
double t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3);
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U)))))));
} else if (t_4 <= 1e+276) {
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;
}
NOTE: l should be positive before calling this function
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (2.0d0 * n) * u
t_2 = (l / om) ** 2.0d0
t_3 = (n * t_2) * (u_42 - u)
t_4 = t_1 * ((t - (2.0d0 * ((l * l) / om))) + t_3)
if (t_4 <= 0.0d0) then
tmp = sqrt(((2.0d0 * n) * (u * ((t + ((-2.0d0) * (l / (om / l)))) + (n * (t_2 * (u_42 - u)))))))
else if (t_4 <= 1d+276) then
tmp = sqrt((t_1 * ((t - (2.0d0 * (l * (l / om)))) + t_3)))
else
tmp = sqrt((u * (n * (((n * (u_42 - u)) / (om ** 2.0d0)) + (2.0d0 * ((-1.0d0) / om)))))) * (l * sqrt(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 = (2.0 * n) * U;
double t_2 = Math.pow((l / Om), 2.0);
double t_3 = (n * t_2) * (U_42_ - U);
double t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3);
double tmp;
if (t_4 <= 0.0) {
tmp = Math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U)))))));
} else if (t_4 <= 1e+276) {
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 = (2.0 * n) * U t_2 = math.pow((l / Om), 2.0) t_3 = (n * t_2) * (U_42_ - U) t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3) tmp = 0 if t_4 <= 0.0: tmp = math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U))))))) elif t_4 <= 1e+276: 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(Float64(2.0 * n) * U) t_2 = Float64(l / Om) ^ 2.0 t_3 = Float64(Float64(n * t_2) * Float64(U_42_ - U)) t_4 = Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_3)) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(Float64(t + Float64(-2.0 * Float64(l / Float64(Om / l)))) + Float64(n * Float64(t_2 * Float64(U_42_ - U))))))); elseif (t_4 <= 1e+276) 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 = (2.0 * n) * U; t_2 = (l / Om) ^ 2.0; t_3 = (n * t_2) * (U_42_ - U); t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3); tmp = 0.0; if (t_4 <= 0.0) tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U))))))); elseif (t_4 <= 1e+276) 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[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(n * t$95$2), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(t + N[(-2.0 * N[(l / N[(Om / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(t$95$2 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 1e+276], 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 := \left(2 \cdot n\right) \cdot U\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(n \cdot t_2\right) \cdot \left(U* - U\right)\\
t_4 := t_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_3\right)\\
\mathbf{if}\;t_4 \leq 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t + -2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) + n \cdot \left(t_2 \cdot \left(U* - U\right)\right)\right)\right)}\\
\mathbf{elif}\;t_4 \leq 10^{+276}:\\
\;\;\;\;\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 11.1%
Simplified44.3%
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*)))) < 1.0000000000000001e276Initial program 96.3%
associate-*l/96.4%
Applied egg-rr96.4%
if 1.0000000000000001e276 < (*.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 17.0%
Simplified26.0%
Taylor expanded in l around inf 23.3%
Final simplification58.4%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2 (pow (/ l Om) 2.0))
(t_3 (* (* n t_2) (- U* U)))
(t_4 (* t_1 (+ (- t (* 2.0 (/ (* l l) Om))) t_3))))
(if (<= t_4 0.0)
(sqrt
(*
(* 2.0 n)
(* U (+ (+ t (* -2.0 (/ l (/ Om l)))) (* n (* t_2 (- U* U)))))))
(if (<= t_4 1e+276)
(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 = (2.0 * n) * U;
double t_2 = pow((l / Om), 2.0);
double t_3 = (n * t_2) * (U_42_ - U);
double t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3);
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U)))))));
} else if (t_4 <= 1e+276) {
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;
}
NOTE: l should be positive before calling this function
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (2.0d0 * n) * u
t_2 = (l / om) ** 2.0d0
t_3 = (n * t_2) * (u_42 - u)
t_4 = t_1 * ((t - (2.0d0 * ((l * l) / om))) + t_3)
if (t_4 <= 0.0d0) then
tmp = sqrt(((2.0d0 * n) * (u * ((t + ((-2.0d0) * (l / (om / l)))) + (n * (t_2 * (u_42 - u)))))))
else if (t_4 <= 1d+276) then
tmp = sqrt((t_1 * ((t - (2.0d0 * (l * (l / om)))) + t_3)))
else
tmp = (l * sqrt(2.0d0)) * sqrt((u * (n * ((n / ((om ** 2.0d0) / (u_42 - u))) - (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 t_1 = (2.0 * n) * U;
double t_2 = Math.pow((l / Om), 2.0);
double t_3 = (n * t_2) * (U_42_ - U);
double t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3);
double tmp;
if (t_4 <= 0.0) {
tmp = Math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U)))))));
} else if (t_4 <= 1e+276) {
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 = (2.0 * n) * U t_2 = math.pow((l / Om), 2.0) t_3 = (n * t_2) * (U_42_ - U) t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3) tmp = 0 if t_4 <= 0.0: tmp = math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U))))))) elif t_4 <= 1e+276: 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(Float64(2.0 * n) * U) t_2 = Float64(l / Om) ^ 2.0 t_3 = Float64(Float64(n * t_2) * Float64(U_42_ - U)) t_4 = Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_3)) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(Float64(t + Float64(-2.0 * Float64(l / Float64(Om / l)))) + Float64(n * Float64(t_2 * Float64(U_42_ - U))))))); elseif (t_4 <= 1e+276) 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 = (2.0 * n) * U; t_2 = (l / Om) ^ 2.0; t_3 = (n * t_2) * (U_42_ - U); t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3); tmp = 0.0; if (t_4 <= 0.0) tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U))))))); elseif (t_4 <= 1e+276) 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[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(n * t$95$2), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(t + N[(-2.0 * N[(l / N[(Om / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(t$95$2 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 1e+276], 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 := \left(2 \cdot n\right) \cdot U\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(n \cdot t_2\right) \cdot \left(U* - U\right)\\
t_4 := t_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_3\right)\\
\mathbf{if}\;t_4 \leq 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t + -2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) + n \cdot \left(t_2 \cdot \left(U* - U\right)\right)\right)\right)}\\
\mathbf{elif}\;t_4 \leq 10^{+276}:\\
\;\;\;\;\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 11.1%
Simplified44.3%
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*)))) < 1.0000000000000001e276Initial program 96.3%
associate-*l/96.4%
Applied egg-rr96.4%
if 1.0000000000000001e276 < (*.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 17.0%
Simplified26.0%
Taylor expanded in l around inf 23.3%
associate-/l*23.3%
associate-*r/23.3%
metadata-eval23.3%
Simplified23.3%
Final simplification58.4%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2 (pow (/ l Om) 2.0))
(t_3 (* (* n t_2) (- U* U)))
(t_4 (* t_1 (+ (- t (* 2.0 (/ (* l l) Om))) t_3))))
(if (<= t_4 0.0)
(sqrt
(*
(* 2.0 n)
(* U (+ (+ t (* -2.0 (/ l (/ Om l)))) (* n (* t_2 (- U* U)))))))
(if (<= t_4 INFINITY)
(sqrt (* t_1 (+ (- t (* 2.0 (* l (/ l Om)))) t_3)))
(* (sqrt (* 2.0 (* (* U U*) (pow (* n l) 2.0)))) (/ 1.0 (fabs Om)))))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = pow((l / Om), 2.0);
double t_3 = (n * t_2) * (U_42_ - U);
double t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3);
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U)))))));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((t_1 * ((t - (2.0 * (l * (l / Om)))) + t_3)));
} else {
tmp = sqrt((2.0 * ((U * U_42_) * pow((n * l), 2.0)))) * (1.0 / fabs(Om));
}
return tmp;
}
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = Math.pow((l / Om), 2.0);
double t_3 = (n * t_2) * (U_42_ - U);
double t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3);
double tmp;
if (t_4 <= 0.0) {
tmp = Math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U)))))));
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_1 * ((t - (2.0 * (l * (l / Om)))) + t_3)));
} else {
tmp = Math.sqrt((2.0 * ((U * U_42_) * Math.pow((n * l), 2.0)))) * (1.0 / Math.abs(Om));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): t_1 = (2.0 * n) * U t_2 = math.pow((l / Om), 2.0) t_3 = (n * t_2) * (U_42_ - U) t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3) tmp = 0 if t_4 <= 0.0: tmp = math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U))))))) elif t_4 <= math.inf: tmp = math.sqrt((t_1 * ((t - (2.0 * (l * (l / Om)))) + t_3))) else: tmp = math.sqrt((2.0 * ((U * U_42_) * math.pow((n * l), 2.0)))) * (1.0 / math.fabs(Om)) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) t_2 = Float64(l / Om) ^ 2.0 t_3 = Float64(Float64(n * t_2) * Float64(U_42_ - U)) t_4 = Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_3)) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(Float64(t + Float64(-2.0 * Float64(l / Float64(Om / l)))) + Float64(n * Float64(t_2 * Float64(U_42_ - U))))))); elseif (t_4 <= Inf) tmp = sqrt(Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))) + t_3))); else tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(U * U_42_) * (Float64(n * l) ^ 2.0)))) * Float64(1.0 / abs(Om))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (2.0 * n) * U; t_2 = (l / Om) ^ 2.0; t_3 = (n * t_2) * (U_42_ - U); t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3); tmp = 0.0; if (t_4 <= 0.0) tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U))))))); elseif (t_4 <= Inf) tmp = sqrt((t_1 * ((t - (2.0 * (l * (l / Om)))) + t_3))); else tmp = sqrt((2.0 * ((U * U_42_) * ((n * l) ^ 2.0)))) * (1.0 / abs(Om)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(n * t$95$2), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(t + N[(-2.0 * N[(l / N[(Om / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(t$95$2 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(t$95$1 * N[(N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(N[(U * U$42$), $MachinePrecision] * N[Power[N[(n * l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Abs[Om], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(n \cdot t_2\right) \cdot \left(U* - U\right)\\
t_4 := t_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_3\right)\\
\mathbf{if}\;t_4 \leq 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t + -2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) + n \cdot \left(t_2 \cdot \left(U* - U\right)\right)\right)\right)}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_1 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_3\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(U \cdot U*\right) \cdot {\left(n \cdot \ell\right)}^{2}\right)} \cdot \frac{1}{\left|Om\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 11.1%
Simplified44.3%
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.4%
associate-*l/73.3%
Applied egg-rr73.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%
associate-*l/3.2%
Applied egg-rr3.2%
add-cube-cbrt3.2%
pow33.2%
Applied egg-rr3.2%
Taylor expanded in U* around inf 29.7%
associate-*r/29.7%
Simplified29.7%
pow1/230.6%
div-inv30.5%
unpow-prod-down30.5%
pow1/229.7%
associate-*r*29.7%
pow-prod-down33.3%
pow-flip33.3%
metadata-eval33.3%
Applied egg-rr33.3%
associate-*l*33.3%
unpow233.3%
swap-sqr29.7%
unpow229.7%
unpow229.7%
associate-*r*29.4%
unpow229.4%
unpow229.4%
swap-sqr36.0%
unpow236.0%
unpow1/236.0%
metadata-eval36.0%
pow-sqr36.1%
unpow-136.1%
unpow-136.1%
rem-sqrt-square42.7%
Simplified42.7%
Final simplification64.5%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2 (pow (/ l Om) 2.0))
(t_3 (* (* n t_2) (- U* U)))
(t_4 (* t_1 (+ (- t (* 2.0 (/ (* l l) Om))) t_3))))
(if (<= t_4 0.0)
(sqrt
(*
(* 2.0 n)
(* U (+ (+ t (* -2.0 (/ l (/ Om l)))) (* n (* t_2 (- U* U)))))))
(if (<= t_4 INFINITY)
(sqrt (* t_1 (+ (- t (* 2.0 (* l (/ l Om)))) t_3)))
(/ (sqrt (* 2.0 (* (* U U*) (pow (* n l) 2.0)))) (fabs Om))))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = pow((l / Om), 2.0);
double t_3 = (n * t_2) * (U_42_ - U);
double t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3);
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U)))))));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((t_1 * ((t - (2.0 * (l * (l / Om)))) + t_3)));
} else {
tmp = sqrt((2.0 * ((U * U_42_) * pow((n * l), 2.0)))) / fabs(Om);
}
return tmp;
}
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = Math.pow((l / Om), 2.0);
double t_3 = (n * t_2) * (U_42_ - U);
double t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3);
double tmp;
if (t_4 <= 0.0) {
tmp = Math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U)))))));
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_1 * ((t - (2.0 * (l * (l / Om)))) + t_3)));
} else {
tmp = Math.sqrt((2.0 * ((U * U_42_) * Math.pow((n * l), 2.0)))) / Math.abs(Om);
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): t_1 = (2.0 * n) * U t_2 = math.pow((l / Om), 2.0) t_3 = (n * t_2) * (U_42_ - U) t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3) tmp = 0 if t_4 <= 0.0: tmp = math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U))))))) elif t_4 <= math.inf: tmp = math.sqrt((t_1 * ((t - (2.0 * (l * (l / Om)))) + t_3))) else: tmp = math.sqrt((2.0 * ((U * U_42_) * math.pow((n * l), 2.0)))) / math.fabs(Om) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) t_2 = Float64(l / Om) ^ 2.0 t_3 = Float64(Float64(n * t_2) * Float64(U_42_ - U)) t_4 = Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_3)) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(Float64(t + Float64(-2.0 * Float64(l / Float64(Om / l)))) + Float64(n * Float64(t_2 * Float64(U_42_ - U))))))); elseif (t_4 <= Inf) tmp = sqrt(Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))) + t_3))); else tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(U * U_42_) * (Float64(n * l) ^ 2.0)))) / abs(Om)); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (2.0 * n) * U; t_2 = (l / Om) ^ 2.0; t_3 = (n * t_2) * (U_42_ - U); t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3); tmp = 0.0; if (t_4 <= 0.0) tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (t_2 * (U_42_ - U))))))); elseif (t_4 <= Inf) tmp = sqrt((t_1 * ((t - (2.0 * (l * (l / Om)))) + t_3))); else tmp = sqrt((2.0 * ((U * U_42_) * ((n * l) ^ 2.0)))) / abs(Om); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(n * t$95$2), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(t + N[(-2.0 * N[(l / N[(Om / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(t$95$2 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(t$95$1 * N[(N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(N[(U * U$42$), $MachinePrecision] * N[Power[N[(n * l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Abs[Om], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(n \cdot t_2\right) \cdot \left(U* - U\right)\\
t_4 := t_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_3\right)\\
\mathbf{if}\;t_4 \leq 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t + -2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) + n \cdot \left(t_2 \cdot \left(U* - U\right)\right)\right)\right)}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_1 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_3\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\left(U \cdot U*\right) \cdot {\left(n \cdot \ell\right)}^{2}\right)}}{\left|Om\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 11.1%
Simplified44.3%
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.4%
associate-*l/73.3%
Applied egg-rr73.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%
associate-*l/3.2%
Applied egg-rr3.2%
add-cube-cbrt3.2%
pow33.2%
Applied egg-rr3.2%
Taylor expanded in U* around inf 29.7%
associate-*r/29.7%
Simplified29.7%
sqrt-div29.7%
associate-*r*29.7%
pow-prod-down33.3%
Applied egg-rr33.3%
associate-*l*33.3%
unpow233.3%
swap-sqr29.7%
unpow229.7%
unpow229.7%
associate-*r*29.4%
unpow229.4%
unpow229.4%
swap-sqr36.0%
unpow236.0%
unpow236.0%
rem-sqrt-square42.7%
Simplified42.7%
Final simplification64.5%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(if (<= U -2.3e+32)
(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 <= -2.3e+32) {
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 <= (-2.3d+32)) 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 <= -2.3e+32) {
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 <= -2.3e+32: 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 <= -2.3e+32) tmp = Float64(Float64(2.0 * 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 <= -2.3e+32) 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, -2.3e+32], N[Power[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t + N[(N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] * -2.0), $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 -2.3 \cdot 10^{+32}:\\
\;\;\;\;{\left(\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \frac{{\ell}^{2}}{Om} \cdot -2\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 < -2.3e32Initial program 47.3%
Simplified48.7%
Taylor expanded in Om around inf 41.3%
associate-*r/41.3%
associate-/l*41.3%
Simplified41.3%
pow1/261.2%
associate-*r*61.2%
div-inv61.2%
clear-num61.2%
unpow261.2%
associate-*l/63.8%
cancel-sign-sub-inv63.8%
associate-*l/61.2%
unpow261.2%
metadata-eval61.2%
Applied egg-rr61.2%
if -2.3e32 < U Initial program 50.5%
Simplified58.8%
Final simplification59.1%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (or (<= U -3.8e-101) (not (<= U 1.52e-34))) (pow (* (* 2.0 (* n U)) (+ t (* (/ (pow l 2.0) Om) -2.0))) 0.5) (* (sqrt 2.0) (sqrt (* n (* U (+ t (* (* l (/ l Om)) -2.0))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if ((U <= -3.8e-101) || !(U <= 1.52e-34)) {
tmp = pow(((2.0 * (n * U)) * (t + ((pow(l, 2.0) / Om) * -2.0))), 0.5);
} else {
tmp = sqrt(2.0) * sqrt((n * (U * (t + ((l * (l / Om)) * -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) :: tmp
if ((u <= (-3.8d-101)) .or. (.not. (u <= 1.52d-34))) then
tmp = ((2.0d0 * (n * u)) * (t + (((l ** 2.0d0) / om) * (-2.0d0)))) ** 0.5d0
else
tmp = sqrt(2.0d0) * sqrt((n * (u * (t + ((l * (l / om)) * (-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 tmp;
if ((U <= -3.8e-101) || !(U <= 1.52e-34)) {
tmp = Math.pow(((2.0 * (n * U)) * (t + ((Math.pow(l, 2.0) / Om) * -2.0))), 0.5);
} else {
tmp = Math.sqrt(2.0) * Math.sqrt((n * (U * (t + ((l * (l / Om)) * -2.0)))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if (U <= -3.8e-101) or not (U <= 1.52e-34): tmp = math.pow(((2.0 * (n * U)) * (t + ((math.pow(l, 2.0) / Om) * -2.0))), 0.5) else: tmp = math.sqrt(2.0) * math.sqrt((n * (U * (t + ((l * (l / Om)) * -2.0))))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if ((U <= -3.8e-101) || !(U <= 1.52e-34)) tmp = Float64(Float64(2.0 * Float64(n * U)) * Float64(t + Float64(Float64((l ^ 2.0) / Om) * -2.0))) ^ 0.5; else tmp = Float64(sqrt(2.0) * sqrt(Float64(n * Float64(U * Float64(t + Float64(Float64(l * Float64(l / Om)) * -2.0)))))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if ((U <= -3.8e-101) || ~((U <= 1.52e-34))) tmp = ((2.0 * (n * U)) * (t + (((l ^ 2.0) / Om) * -2.0))) ^ 0.5; else tmp = sqrt(2.0) * sqrt((n * (U * (t + ((l * (l / Om)) * -2.0))))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := If[Or[LessEqual[U, -3.8e-101], N[Not[LessEqual[U, 1.52e-34]], $MachinePrecision]], N[Power[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t + N[(N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(n * N[(U * N[(t + N[(N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;U \leq -3.8 \cdot 10^{-101} \lor \neg \left(U \leq 1.52 \cdot 10^{-34}\right):\\
\;\;\;\;{\left(\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \frac{{\ell}^{2}}{Om} \cdot -2\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \sqrt{n \cdot \left(U \cdot \left(t + \left(\ell \cdot \frac{\ell}{Om}\right) \cdot -2\right)\right)}\\
\end{array}
\end{array}
if U < -3.8000000000000001e-101 or 1.52e-34 < U Initial program 63.3%
Simplified66.0%
Taylor expanded in Om around inf 56.2%
associate-*r/56.2%
associate-/l*56.2%
Simplified56.2%
pow1/265.5%
associate-*r*65.5%
div-inv65.5%
clear-num65.5%
unpow265.5%
associate-*l/67.9%
cancel-sign-sub-inv67.9%
associate-*l/65.5%
unpow265.5%
metadata-eval65.5%
Applied egg-rr65.5%
if -3.8000000000000001e-101 < U < 1.52e-34Initial program 38.2%
Simplified38.1%
Taylor expanded in Om around inf 37.7%
associate-*r/37.7%
associate-/l*37.7%
Simplified37.7%
pow1/239.2%
*-commutative39.2%
unpow-prod-down39.1%
Applied egg-rr45.6%
unpow245.6%
associate-*l/49.2%
Applied egg-rr49.2%
Final simplification56.9%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= U -6e+33) (pow (* 2.0 (* t (* n U))) 0.5) (* (sqrt 2.0) (sqrt (* n (* U (+ t (* (* l (/ l Om)) -2.0))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= -6e+33) {
tmp = pow((2.0 * (t * (n * U))), 0.5);
} else {
tmp = sqrt(2.0) * sqrt((n * (U * (t + ((l * (l / Om)) * -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) :: tmp
if (u <= (-6d+33)) then
tmp = (2.0d0 * (t * (n * u))) ** 0.5d0
else
tmp = sqrt(2.0d0) * sqrt((n * (u * (t + ((l * (l / om)) * (-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 tmp;
if (U <= -6e+33) {
tmp = Math.pow((2.0 * (t * (n * U))), 0.5);
} else {
tmp = Math.sqrt(2.0) * Math.sqrt((n * (U * (t + ((l * (l / Om)) * -2.0)))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if U <= -6e+33: tmp = math.pow((2.0 * (t * (n * U))), 0.5) else: tmp = math.sqrt(2.0) * math.sqrt((n * (U * (t + ((l * (l / Om)) * -2.0))))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= -6e+33) tmp = Float64(2.0 * Float64(t * Float64(n * U))) ^ 0.5; else tmp = Float64(sqrt(2.0) * sqrt(Float64(n * Float64(U * Float64(t + Float64(Float64(l * Float64(l / Om)) * -2.0)))))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U <= -6e+33) tmp = (2.0 * (t * (n * U))) ^ 0.5; else tmp = sqrt(2.0) * sqrt((n * (U * (t + ((l * (l / Om)) * -2.0))))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, -6e+33], N[Power[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(n * N[(U * N[(t + N[(N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;U \leq -6 \cdot 10^{+33}:\\
\;\;\;\;{\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \sqrt{n \cdot \left(U \cdot \left(t + \left(\ell \cdot \frac{\ell}{Om}\right) \cdot -2\right)\right)}\\
\end{array}
\end{array}
if U < -5.99999999999999967e33Initial program 49.9%
Simplified51.4%
Taylor expanded in t around inf 41.2%
pow1/241.4%
associate-*r*52.8%
*-commutative52.8%
Applied egg-rr52.8%
if -5.99999999999999967e33 < U Initial program 50.1%
Simplified51.3%
Taylor expanded in Om around inf 46.9%
associate-*r/46.9%
associate-/l*46.9%
Simplified46.9%
pow1/250.1%
*-commutative50.1%
unpow-prod-down50.0%
Applied egg-rr51.1%
unpow251.1%
associate-*l/53.8%
Applied egg-rr53.8%
Final simplification53.7%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (or (<= n 3.5e-290) (not (<= n 5.3e-185))) (sqrt (* 2.0 (* (* n U) (- t (* l (* 2.0 (/ l Om))))))) (* (sqrt (* 2.0 n)) (sqrt (* U t)))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if ((n <= 3.5e-290) || !(n <= 5.3e-185)) {
tmp = sqrt((2.0 * ((n * U) * (t - (l * (2.0 * (l / Om)))))));
} else {
tmp = sqrt((2.0 * n)) * sqrt((U * 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 ((n <= 3.5d-290) .or. (.not. (n <= 5.3d-185))) then
tmp = sqrt((2.0d0 * ((n * u) * (t - (l * (2.0d0 * (l / om)))))))
else
tmp = sqrt((2.0d0 * n)) * sqrt((u * 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 ((n <= 3.5e-290) || !(n <= 5.3e-185)) {
tmp = Math.sqrt((2.0 * ((n * U) * (t - (l * (2.0 * (l / Om)))))));
} else {
tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * t));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if (n <= 3.5e-290) or not (n <= 5.3e-185): tmp = math.sqrt((2.0 * ((n * U) * (t - (l * (2.0 * (l / Om))))))) else: tmp = math.sqrt((2.0 * n)) * math.sqrt((U * t)) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if ((n <= 3.5e-290) || !(n <= 5.3e-185)) tmp = sqrt(Float64(2.0 * Float64(Float64(n * U) * Float64(t - Float64(l * Float64(2.0 * Float64(l / Om))))))); else tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * t))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if ((n <= 3.5e-290) || ~((n <= 5.3e-185))) tmp = sqrt((2.0 * ((n * U) * (t - (l * (2.0 * (l / Om))))))); else tmp = sqrt((2.0 * n)) * sqrt((U * t)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := If[Or[LessEqual[n, 3.5e-290], N[Not[LessEqual[n, 5.3e-185]], $MachinePrecision]], N[Sqrt[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(t - N[(l * N[(2.0 * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;n \leq 3.5 \cdot 10^{-290} \lor \neg \left(n \leq 5.3 \cdot 10^{-185}\right):\\
\;\;\;\;\sqrt{2 \cdot \left(\left(n \cdot U\right) \cdot \left(t - \ell \cdot \left(2 \cdot \frac{\ell}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot t}\\
\end{array}
\end{array}
if n < 3.49999999999999981e-290 or 5.29999999999999973e-185 < n Initial program 52.1%
Simplified53.1%
Taylor expanded in Om around inf 48.0%
associate-*r/48.0%
associate-/l*48.0%
Simplified48.0%
div-inv48.0%
clear-num48.0%
unpow248.0%
associate-*l/51.9%
associate-*r*51.9%
Applied egg-rr51.9%
if 3.49999999999999981e-290 < n < 5.29999999999999973e-185Initial program 33.4%
Simplified55.3%
Taylor expanded in l around 0 48.5%
associate-*r*48.5%
sqrt-prod75.1%
*-commutative75.1%
Applied egg-rr75.1%
Final simplification54.4%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= t -7e+34) (sqrt (fabs (* 2.0 (* n (* U t))))) (sqrt (* 2.0 (* (* n U) (- t (* l (* 2.0 (/ l Om)))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= -7e+34) {
tmp = sqrt(fabs((2.0 * (n * (U * t)))));
} else {
tmp = sqrt((2.0 * ((n * U) * (t - (l * (2.0 * (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 (t <= (-7d+34)) then
tmp = sqrt(abs((2.0d0 * (n * (u * t)))))
else
tmp = sqrt((2.0d0 * ((n * u) * (t - (l * (2.0d0 * (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 (t <= -7e+34) {
tmp = Math.sqrt(Math.abs((2.0 * (n * (U * t)))));
} else {
tmp = Math.sqrt((2.0 * ((n * U) * (t - (l * (2.0 * (l / Om)))))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if t <= -7e+34: tmp = math.sqrt(math.fabs((2.0 * (n * (U * t))))) else: tmp = math.sqrt((2.0 * ((n * U) * (t - (l * (2.0 * (l / Om))))))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= -7e+34) tmp = sqrt(abs(Float64(2.0 * Float64(n * Float64(U * t))))); else tmp = sqrt(Float64(2.0 * Float64(Float64(n * U) * Float64(t - Float64(l * Float64(2.0 * 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 (t <= -7e+34) tmp = sqrt(abs((2.0 * (n * (U * t))))); else tmp = sqrt((2.0 * ((n * U) * (t - (l * (2.0 * (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[t, -7e+34], N[Sqrt[N[Abs[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(t - N[(l * N[(2.0 * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+34}:\\
\;\;\;\;\sqrt{\left|2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right|}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(n \cdot U\right) \cdot \left(t - \ell \cdot \left(2 \cdot \frac{\ell}{Om}\right)\right)\right)}\\
\end{array}
\end{array}
if t < -6.99999999999999996e34Initial program 41.7%
Simplified41.3%
Taylor expanded in t around inf 46.9%
add-sqr-sqrt46.9%
pow1/246.9%
pow1/252.2%
pow-prod-down31.1%
pow231.1%
associate-*r*27.7%
*-commutative27.7%
Applied egg-rr27.7%
unpow1/227.7%
unpow227.7%
rem-sqrt-square39.3%
associate-*l*49.3%
Simplified49.3%
if -6.99999999999999996e34 < t Initial program 52.5%
Simplified54.2%
Taylor expanded in Om around inf 48.7%
associate-*r/48.7%
associate-/l*48.7%
Simplified48.7%
div-inv48.7%
clear-num48.7%
unpow248.7%
associate-*l/52.6%
associate-*r*52.6%
Applied egg-rr52.6%
Final simplification51.9%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= t -1.16e+36) (sqrt (* 2.0 (fabs (* U (* n t))))) (sqrt (* 2.0 (* (* n U) (- t (* l (* 2.0 (/ l Om)))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= -1.16e+36) {
tmp = sqrt((2.0 * fabs((U * (n * t)))));
} else {
tmp = sqrt((2.0 * ((n * U) * (t - (l * (2.0 * (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 (t <= (-1.16d+36)) then
tmp = sqrt((2.0d0 * abs((u * (n * t)))))
else
tmp = sqrt((2.0d0 * ((n * u) * (t - (l * (2.0d0 * (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 (t <= -1.16e+36) {
tmp = Math.sqrt((2.0 * Math.abs((U * (n * t)))));
} else {
tmp = Math.sqrt((2.0 * ((n * U) * (t - (l * (2.0 * (l / Om)))))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if t <= -1.16e+36: tmp = math.sqrt((2.0 * math.fabs((U * (n * t))))) else: tmp = math.sqrt((2.0 * ((n * U) * (t - (l * (2.0 * (l / Om))))))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= -1.16e+36) tmp = sqrt(Float64(2.0 * abs(Float64(U * Float64(n * t))))); else tmp = sqrt(Float64(2.0 * Float64(Float64(n * U) * Float64(t - Float64(l * Float64(2.0 * 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 (t <= -1.16e+36) tmp = sqrt((2.0 * abs((U * (n * t))))); else tmp = sqrt((2.0 * ((n * U) * (t - (l * (2.0 * (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[t, -1.16e+36], N[Sqrt[N[(2.0 * N[Abs[N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(t - N[(l * N[(2.0 * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.16 \cdot 10^{+36}:\\
\;\;\;\;\sqrt{2 \cdot \left|U \cdot \left(n \cdot t\right)\right|}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(n \cdot U\right) \cdot \left(t - \ell \cdot \left(2 \cdot \frac{\ell}{Om}\right)\right)\right)}\\
\end{array}
\end{array}
if t < -1.15999999999999998e36Initial program 41.7%
Simplified52.1%
Taylor expanded in l around 0 46.9%
add-sqr-sqrt46.7%
sqrt-unprod26.0%
pow226.0%
associate-*r*27.7%
*-commutative27.7%
Applied egg-rr27.7%
unpow227.7%
rem-sqrt-square39.3%
associate-*r*52.7%
*-commutative52.7%
*-commutative52.7%
Simplified52.7%
if -1.15999999999999998e36 < t Initial program 52.5%
Simplified54.2%
Taylor expanded in Om around inf 48.7%
associate-*r/48.7%
associate-/l*48.7%
Simplified48.7%
div-inv48.7%
clear-num48.7%
unpow248.7%
associate-*l/52.6%
associate-*r*52.6%
Applied egg-rr52.6%
Final simplification52.6%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= l 1.18e-107) (sqrt (* 2.0 (* n (* U t)))) (sqrt (* 2.0 (* (* n U) (- t (* l (* 2.0 (/ l Om)))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.18e-107) {
tmp = sqrt((2.0 * (n * (U * t))));
} else {
tmp = sqrt((2.0 * ((n * U) * (t - (l * (2.0 * (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 (l <= 1.18d-107) then
tmp = sqrt((2.0d0 * (n * (u * t))))
else
tmp = sqrt((2.0d0 * ((n * u) * (t - (l * (2.0d0 * (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 (l <= 1.18e-107) {
tmp = Math.sqrt((2.0 * (n * (U * t))));
} else {
tmp = Math.sqrt((2.0 * ((n * U) * (t - (l * (2.0 * (l / Om)))))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 1.18e-107: tmp = math.sqrt((2.0 * (n * (U * t)))) else: tmp = math.sqrt((2.0 * ((n * U) * (t - (l * (2.0 * (l / Om))))))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 1.18e-107) tmp = sqrt(Float64(2.0 * Float64(n * Float64(U * t)))); else tmp = sqrt(Float64(2.0 * Float64(Float64(n * U) * Float64(t - Float64(l * Float64(2.0 * 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 (l <= 1.18e-107) tmp = sqrt((2.0 * (n * (U * t)))); else tmp = sqrt((2.0 * ((n * U) * (t - (l * (2.0 * (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[l, 1.18e-107], N[Sqrt[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(t - N[(l * N[(2.0 * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.18 \cdot 10^{-107}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(n \cdot U\right) \cdot \left(t - \ell \cdot \left(2 \cdot \frac{\ell}{Om}\right)\right)\right)}\\
\end{array}
\end{array}
if l < 1.17999999999999993e-107Initial program 51.1%
Simplified58.4%
Taylor expanded in l around 0 47.1%
if 1.17999999999999993e-107 < l Initial program 47.5%
Simplified54.0%
Taylor expanded in Om around inf 39.8%
associate-*r/39.8%
associate-/l*39.8%
Simplified39.8%
div-inv39.8%
clear-num39.8%
unpow239.8%
associate-*l/47.6%
associate-*r*47.6%
Applied egg-rr47.6%
Final simplification47.2%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= n 5.2e-213) (sqrt (* 2.0 (* U (* n t)))) (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 (n <= 5.2e-213) {
tmp = sqrt((2.0 * (U * (n * t))));
} 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 (n <= 5.2d-213) then
tmp = sqrt((2.0d0 * (u * (n * t))))
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 (n <= 5.2e-213) {
tmp = Math.sqrt((2.0 * (U * (n * t))));
} 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 n <= 5.2e-213: tmp = math.sqrt((2.0 * (U * (n * t)))) 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 (n <= 5.2e-213) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t)))); 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 (n <= 5.2e-213) tmp = sqrt((2.0 * (U * (n * t)))); 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[n, 5.2e-213], N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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}\;n \leq 5.2 \cdot 10^{-213}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\
\end{array}
\end{array}
if n < 5.2000000000000003e-213Initial program 44.5%
Simplified48.4%
Taylor expanded in t around inf 43.1%
if 5.2000000000000003e-213 < n Initial program 56.9%
Simplified54.8%
Taylor expanded in t around inf 38.2%
pow1/240.0%
associate-*r*45.7%
*-commutative45.7%
Applied egg-rr45.7%
Final simplification44.3%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= n 6.5e-214) (sqrt (* 2.0 (* U (* n t)))) (pow (* t (* 2.0 (* 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 (n <= 6.5e-214) {
tmp = sqrt((2.0 * (U * (n * t))));
} else {
tmp = pow((t * (2.0 * (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 (n <= 6.5d-214) then
tmp = sqrt((2.0d0 * (u * (n * t))))
else
tmp = (t * (2.0d0 * (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 (n <= 6.5e-214) {
tmp = Math.sqrt((2.0 * (U * (n * t))));
} else {
tmp = Math.pow((t * (2.0 * (n * U))), 0.5);
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if n <= 6.5e-214: tmp = math.sqrt((2.0 * (U * (n * t)))) else: tmp = math.pow((t * (2.0 * (n * U))), 0.5) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= 6.5e-214) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t)))); else tmp = Float64(t * Float64(2.0 * 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 (n <= 6.5e-214) tmp = sqrt((2.0 * (U * (n * t)))); else tmp = (t * (2.0 * (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[n, 6.5e-214], N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(t * N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;n \leq 6.5 \cdot 10^{-214}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(t \cdot \left(2 \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\
\end{array}
\end{array}
if n < 6.5000000000000004e-214Initial program 44.5%
Simplified48.4%
Taylor expanded in t around inf 43.1%
if 6.5000000000000004e-214 < n Initial program 56.9%
Simplified54.8%
Taylor expanded in t around inf 38.2%
associate-*r*43.1%
*-commutative43.1%
Simplified43.1%
pow1/245.7%
associate-*r*45.8%
Applied egg-rr45.8%
Final simplification44.3%
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 50.1%
Simplified51.3%
Taylor expanded in t around inf 40.9%
Final simplification40.9%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2.0 (* n (* U t)))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((2.0 * (n * (U * 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 * (n * (u * 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 * (n * (U * t))));
}
l = abs(l) def code(n, U, t, l, Om, U_42_): return math.sqrt((2.0 * (n * (U * t))))
l = abs(l) function code(n, U, t, l, Om, U_42_) return sqrt(Float64(2.0 * Float64(n * Float64(U * t)))) end
l = abs(l) function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((2.0 * (n * (U * 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[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right)}
\end{array}
Initial program 50.1%
Simplified56.5%
Taylor expanded in l around 0 41.7%
Final simplification41.7%
herbie shell --seed 2023306
(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*))))))