
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}
\end{array}
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (pow (/ l Om) 2.0))
(t_2
(sqrt
(*
(* (* 2.0 n) U)
(+ (- t (* 2.0 (/ (* l l) Om))) (* (* n t_1) (- U* U)))))))
(if (<= t_2 0.0)
(*
(sqrt (* U (- t (fma 2.0 (/ (pow l 2.0) Om) (* t_1 (* n U))))))
(sqrt (* 2.0 n)))
(if (<= t_2 INFINITY)
(sqrt
(*
(* 2.0 (* n U))
(- t (fma (* 2.0 l) (/ l Om) (* (* t_1 U*) (- n))))))
(sqrt
(*
(* 2.0 n)
(+ (* U t) (/ (* U (* U* (* (pow l 2.0) (/ n Om)))) Om))))))))
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 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))));
double tmp;
if (t_2 <= 0.0) {
tmp = sqrt((U * (t - fma(2.0, (pow(l, 2.0) / Om), (t_1 * (n * U)))))) * sqrt((2.0 * n));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt(((2.0 * (n * U)) * (t - fma((2.0 * l), (l / Om), ((t_1 * U_42_) * -n)))));
} else {
tmp = sqrt(((2.0 * n) * ((U * t) + ((U * (U_42_ * (pow(l, 2.0) * (n / Om)))) / Om))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(l / Om) ^ 2.0 t_2 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + Float64(Float64(n * t_1) * Float64(U_42_ - U))))) tmp = 0.0 if (t_2 <= 0.0) tmp = Float64(sqrt(Float64(U * Float64(t - fma(2.0, Float64((l ^ 2.0) / Om), Float64(t_1 * Float64(n * U)))))) * sqrt(Float64(2.0 * n))); elseif (t_2 <= Inf) tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t - fma(Float64(2.0 * l), Float64(l / Om), Float64(Float64(t_1 * U_42_) * Float64(-n)))))); else tmp = sqrt(Float64(Float64(2.0 * n) * Float64(Float64(U * t) + Float64(Float64(U * Float64(U_42_ * Float64((l ^ 2.0) * Float64(n / Om)))) / Om)))); end return tmp end
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[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 * t$95$1), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[(N[Sqrt[N[(U * N[(t - N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] + N[(t$95$1 * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t - N[(N[(2.0 * l), $MachinePrecision] * N[(l / Om), $MachinePrecision] + N[(N[(t$95$1 * U$42$), $MachinePrecision] * (-n)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(N[(U * t), $MachinePrecision] + N[(N[(U * N[(U$42$ * N[(N[Power[l, 2.0], $MachinePrecision] * N[(n / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_2 := \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 t\_1\right) \cdot \left(U* - U\right)\right)}\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;\sqrt{U \cdot \left(t - \mathsf{fma}\left(2, \frac{{\ell}^{2}}{Om}, t\_1 \cdot \left(n \cdot U\right)\right)\right)} \cdot \sqrt{2 \cdot n}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \mathsf{fma}\left(2 \cdot \ell, \frac{\ell}{Om}, \left(t\_1 \cdot U*\right) \cdot \left(-n\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t + \frac{U \cdot \left(U* \cdot \left({\ell}^{2} \cdot \frac{n}{Om}\right)\right)}{Om}\right)}\\
\end{array}
\end{array}
if (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 0.0Initial program 11.3%
Simplified32.2%
Taylor expanded in U around inf 26.7%
associate-/l*26.7%
unpow226.7%
unpow226.7%
times-frac32.3%
unpow232.3%
Simplified32.3%
pow1/232.3%
*-commutative32.3%
unpow-prod-down40.5%
pow1/240.5%
associate-*r/40.5%
unpow240.5%
associate-*r*40.5%
pow1/240.5%
Applied egg-rr40.5%
if 0.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < +inf.0Initial program 69.6%
Simplified76.9%
associate-*r*76.9%
fma-define76.9%
associate-*r*77.4%
Applied egg-rr77.4%
Taylor expanded in U around 0 59.2%
associate-/l*62.7%
unpow262.7%
unpow262.7%
times-frac77.4%
unpow277.4%
neg-mul-177.4%
distribute-lft-neg-out77.4%
*-commutative77.4%
Simplified77.4%
if +inf.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) Initial program 0.0%
Simplified9.0%
Taylor expanded in Om around -inf 14.8%
+-commutative14.8%
mul-1-neg14.8%
unsub-neg14.8%
fma-define14.8%
associate-/l*16.8%
associate-/l*16.8%
Simplified16.8%
Taylor expanded in U* around inf 28.9%
mul-1-neg28.9%
associate-/l*28.9%
associate-/l*28.8%
associate-/l*30.7%
Simplified30.7%
Final simplification63.3%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (pow (/ l Om) 2.0))
(t_2
(*
(* (* 2.0 n) U)
(+ (- t (* 2.0 (/ (* l l) Om))) (* (* n t_1) (- U* U))))))
(if (<= t_2 0.0)
(sqrt (* 2.0 (* U (* n (- t (* 2.0 (* l (/ l Om))))))))
(if (<= t_2 INFINITY)
(sqrt
(*
(* 2.0 (* n U))
(- t (fma (* 2.0 l) (/ l Om) (* (* t_1 U*) (- n))))))
(sqrt
(*
(* 2.0 n)
(+ (* U t) (/ (* U (* U* (* (pow l 2.0) (/ n Om)))) Om))))))))
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 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)));
double tmp;
if (t_2 <= 0.0) {
tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om))))))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt(((2.0 * (n * U)) * (t - fma((2.0 * l), (l / Om), ((t_1 * U_42_) * -n)))));
} else {
tmp = sqrt(((2.0 * n) * ((U * t) + ((U * (U_42_ * (pow(l, 2.0) * (n / Om)))) / Om))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(l / Om) ^ 2.0 t_2 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + Float64(Float64(n * t_1) * Float64(U_42_ - U)))) tmp = 0.0 if (t_2 <= 0.0) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))))))); elseif (t_2 <= Inf) tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t - fma(Float64(2.0 * l), Float64(l / Om), Float64(Float64(t_1 * U_42_) * Float64(-n)))))); else tmp = sqrt(Float64(Float64(2.0 * n) * Float64(Float64(U * t) + Float64(Float64(U * Float64(U_42_ * Float64((l ^ 2.0) * Float64(n / Om)))) / Om)))); end return tmp end
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[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(n * t$95$1), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t - N[(N[(2.0 * l), $MachinePrecision] * N[(l / Om), $MachinePrecision] + N[(N[(t$95$1 * U$42$), $MachinePrecision] * (-n)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(N[(U * t), $MachinePrecision] + N[(N[(U * N[(U$42$ * N[(N[Power[l, 2.0], $MachinePrecision] * N[(n / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_2 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + \left(n \cdot t\_1\right) \cdot \left(U* - U\right)\right)\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \mathsf{fma}\left(2 \cdot \ell, \frac{\ell}{Om}, \left(t\_1 \cdot U*\right) \cdot \left(-n\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t + \frac{U \cdot \left(U* \cdot \left({\ell}^{2} \cdot \frac{n}{Om}\right)\right)}{Om}\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 9.2%
Simplified31.2%
Taylor expanded in n around 0 28.8%
unpow228.8%
associate-*r/33.3%
*-commutative33.3%
Applied egg-rr33.3%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 69.6%
Simplified76.9%
associate-*r*76.9%
fma-define76.9%
associate-*r*77.4%
Applied egg-rr77.4%
Taylor expanded in U around 0 59.2%
associate-/l*62.7%
unpow262.7%
unpow262.7%
times-frac77.4%
unpow277.4%
neg-mul-177.4%
distribute-lft-neg-out77.4%
*-commutative77.4%
Simplified77.4%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Simplified5.7%
Taylor expanded in Om around -inf 15.2%
+-commutative15.2%
mul-1-neg15.2%
unsub-neg15.2%
fma-define15.2%
associate-/l*17.6%
associate-/l*17.5%
Simplified17.5%
Taylor expanded in U* around inf 34.0%
mul-1-neg34.0%
associate-/l*33.9%
associate-/l*33.8%
associate-/l*36.1%
Simplified36.1%
Final simplification63.2%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (pow (/ l Om) 2.0))
(t_2
(*
(* (* 2.0 n) U)
(+ (- t (* 2.0 (/ (* l l) Om))) (* (* n t_1) (- U* U))))))
(if (<= t_2 0.0)
(sqrt (* 2.0 (* U (* n (- t (* 2.0 (* l (/ l Om))))))))
(if (<= t_2 INFINITY)
(sqrt
(* (* 2.0 (* n U)) (+ t (- (* n (* t_1 U*)) (* (/ l Om) (* 2.0 l))))))
(sqrt
(*
(* 2.0 n)
(+ (* U t) (/ (* U (* U* (* (pow l 2.0) (/ n Om)))) Om))))))))
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 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)));
double tmp;
if (t_2 <= 0.0) {
tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om))))))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt(((2.0 * (n * U)) * (t + ((n * (t_1 * U_42_)) - ((l / Om) * (2.0 * l))))));
} else {
tmp = sqrt(((2.0 * n) * ((U * t) + ((U * (U_42_ * (pow(l, 2.0) * (n / Om)))) / Om))));
}
return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = Math.pow((l / Om), 2.0);
double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)));
double tmp;
if (t_2 <= 0.0) {
tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om))))))));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt(((2.0 * (n * U)) * (t + ((n * (t_1 * U_42_)) - ((l / Om) * (2.0 * l))))));
} else {
tmp = Math.sqrt(((2.0 * n) * ((U * t) + ((U * (U_42_ * (Math.pow(l, 2.0) * (n / Om)))) / Om))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = math.pow((l / Om), 2.0) t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U))) tmp = 0 if t_2 <= 0.0: tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om)))))))) elif t_2 <= math.inf: tmp = math.sqrt(((2.0 * (n * U)) * (t + ((n * (t_1 * U_42_)) - ((l / Om) * (2.0 * l)))))) else: tmp = math.sqrt(((2.0 * n) * ((U * t) + ((U * (U_42_ * (math.pow(l, 2.0) * (n / Om)))) / Om)))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(l / Om) ^ 2.0 t_2 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + Float64(Float64(n * t_1) * Float64(U_42_ - U)))) tmp = 0.0 if (t_2 <= 0.0) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))))))); elseif (t_2 <= Inf) tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t + Float64(Float64(n * Float64(t_1 * U_42_)) - Float64(Float64(l / Om) * Float64(2.0 * l)))))); else tmp = sqrt(Float64(Float64(2.0 * n) * Float64(Float64(U * t) + Float64(Float64(U * Float64(U_42_ * Float64((l ^ 2.0) * Float64(n / Om)))) / Om)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (l / Om) ^ 2.0; t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U))); tmp = 0.0; if (t_2 <= 0.0) tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om)))))))); elseif (t_2 <= Inf) tmp = sqrt(((2.0 * (n * U)) * (t + ((n * (t_1 * U_42_)) - ((l / Om) * (2.0 * l)))))); else tmp = sqrt(((2.0 * n) * ((U * t) + ((U * (U_42_ * ((l ^ 2.0) * (n / Om)))) / Om)))); end tmp_2 = tmp; end
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[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(n * t$95$1), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t + N[(N[(n * N[(t$95$1 * U$42$), $MachinePrecision]), $MachinePrecision] - N[(N[(l / Om), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(N[(U * t), $MachinePrecision] + N[(N[(U * N[(U$42$ * N[(N[Power[l, 2.0], $MachinePrecision] * N[(n / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_2 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + \left(n \cdot t\_1\right) \cdot \left(U* - U\right)\right)\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(n \cdot \left(t\_1 \cdot U*\right) - \frac{\ell}{Om} \cdot \left(2 \cdot \ell\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t + \frac{U \cdot \left(U* \cdot \left({\ell}^{2} \cdot \frac{n}{Om}\right)\right)}{Om}\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 9.2%
Simplified31.2%
Taylor expanded in n around 0 28.8%
unpow228.8%
associate-*r/33.3%
*-commutative33.3%
Applied egg-rr33.3%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 69.6%
Simplified76.9%
associate-*r*76.9%
fma-define76.9%
associate-*r*77.4%
Applied egg-rr77.4%
Taylor expanded in U around 0 59.2%
associate-/l*62.7%
unpow262.7%
unpow262.7%
times-frac77.4%
unpow277.4%
neg-mul-177.4%
distribute-lft-neg-out77.4%
*-commutative77.4%
Simplified77.4%
fma-undefine77.4%
Applied egg-rr77.4%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Simplified5.7%
Taylor expanded in Om around -inf 15.2%
+-commutative15.2%
mul-1-neg15.2%
unsub-neg15.2%
fma-define15.2%
associate-/l*17.6%
associate-/l*17.5%
Simplified17.5%
Taylor expanded in U* around inf 34.0%
mul-1-neg34.0%
associate-/l*33.9%
associate-/l*33.8%
associate-/l*36.1%
Simplified36.1%
Final simplification63.2%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (sqrt (* 2.0 (* U (* n (- t (* 2.0 (* l (/ l Om))))))))))
(if (<= Om -8.2e+15)
t_1
(if (<= Om 2.22e-97)
(sqrt
(* (* 2.0 n) (+ (* U t) (/ (* U (* U* (* (pow l 2.0) (/ n Om)))) Om))))
(if (<= Om 2.3e+150)
(pow (* 2.0 (* (* n U) (+ t (* (/ (pow l 2.0) Om) -2.0)))) 0.5)
t_1)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om))))))));
double tmp;
if (Om <= -8.2e+15) {
tmp = t_1;
} else if (Om <= 2.22e-97) {
tmp = sqrt(((2.0 * n) * ((U * t) + ((U * (U_42_ * (pow(l, 2.0) * (n / Om)))) / Om))));
} else if (Om <= 2.3e+150) {
tmp = pow((2.0 * ((n * U) * (t + ((pow(l, 2.0) / Om) * -2.0)))), 0.5);
} else {
tmp = t_1;
}
return tmp;
}
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 * (u * (n * (t - (2.0d0 * (l * (l / om))))))))
if (om <= (-8.2d+15)) then
tmp = t_1
else if (om <= 2.22d-97) then
tmp = sqrt(((2.0d0 * n) * ((u * t) + ((u * (u_42 * ((l ** 2.0d0) * (n / om)))) / om))))
else if (om <= 2.3d+150) then
tmp = (2.0d0 * ((n * u) * (t + (((l ** 2.0d0) / om) * (-2.0d0))))) ** 0.5d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = Math.sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om))))))));
double tmp;
if (Om <= -8.2e+15) {
tmp = t_1;
} else if (Om <= 2.22e-97) {
tmp = Math.sqrt(((2.0 * n) * ((U * t) + ((U * (U_42_ * (Math.pow(l, 2.0) * (n / Om)))) / Om))));
} else if (Om <= 2.3e+150) {
tmp = Math.pow((2.0 * ((n * U) * (t + ((Math.pow(l, 2.0) / Om) * -2.0)))), 0.5);
} else {
tmp = t_1;
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = math.sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om)))))))) tmp = 0 if Om <= -8.2e+15: tmp = t_1 elif Om <= 2.22e-97: tmp = math.sqrt(((2.0 * n) * ((U * t) + ((U * (U_42_ * (math.pow(l, 2.0) * (n / Om)))) / Om)))) elif Om <= 2.3e+150: tmp = math.pow((2.0 * ((n * U) * (t + ((math.pow(l, 2.0) / Om) * -2.0)))), 0.5) else: tmp = t_1 return tmp
function code(n, U, t, l, Om, U_42_) t_1 = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))))))) tmp = 0.0 if (Om <= -8.2e+15) tmp = t_1; elseif (Om <= 2.22e-97) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(Float64(U * t) + Float64(Float64(U * Float64(U_42_ * Float64((l ^ 2.0) * Float64(n / Om)))) / Om)))); elseif (Om <= 2.3e+150) tmp = Float64(2.0 * Float64(Float64(n * U) * Float64(t + Float64(Float64((l ^ 2.0) / Om) * -2.0)))) ^ 0.5; else tmp = t_1; end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om)))))))); tmp = 0.0; if (Om <= -8.2e+15) tmp = t_1; elseif (Om <= 2.22e-97) tmp = sqrt(((2.0 * n) * ((U * t) + ((U * (U_42_ * ((l ^ 2.0) * (n / Om)))) / Om)))); elseif (Om <= 2.3e+150) tmp = (2.0 * ((n * U) * (t + (((l ^ 2.0) / Om) * -2.0)))) ^ 0.5; else tmp = t_1; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[Om, -8.2e+15], t$95$1, If[LessEqual[Om, 2.22e-97], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(N[(U * t), $MachinePrecision] + N[(N[(U * N[(U$42$ * N[(N[Power[l, 2.0], $MachinePrecision] * N[(n / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[Om, 2.3e+150], N[Power[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(t + N[(N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\
\mathbf{if}\;Om \leq -8.2 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;Om \leq 2.22 \cdot 10^{-97}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t + \frac{U \cdot \left(U* \cdot \left({\ell}^{2} \cdot \frac{n}{Om}\right)\right)}{Om}\right)}\\
\mathbf{elif}\;Om \leq 2.3 \cdot 10^{+150}:\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + \frac{{\ell}^{2}}{Om} \cdot -2\right)\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if Om < -8.2e15 or 2.30000000000000001e150 < Om Initial program 54.7%
Simplified65.8%
Taylor expanded in n around 0 54.1%
unpow254.1%
associate-*r/65.7%
*-commutative65.7%
Applied egg-rr65.7%
if -8.2e15 < Om < 2.21999999999999991e-97Initial program 39.3%
Simplified46.4%
Taylor expanded in Om around -inf 45.6%
+-commutative45.6%
mul-1-neg45.6%
unsub-neg45.6%
fma-define45.6%
associate-/l*49.8%
associate-/l*50.2%
Simplified50.2%
Taylor expanded in U* around inf 51.2%
mul-1-neg51.2%
associate-/l*54.1%
associate-/l*54.0%
associate-/l*52.0%
Simplified52.0%
if 2.21999999999999991e-97 < Om < 2.30000000000000001e150Initial program 45.9%
Simplified40.3%
Taylor expanded in n around 0 39.3%
pow1/247.5%
associate-*r*54.1%
*-commutative54.1%
cancel-sign-sub-inv54.1%
metadata-eval54.1%
Applied egg-rr54.1%
Final simplification59.1%
(FPCore (n U t l Om U*) :precision binary64 (if (or (<= Om -1.3e-15) (not (<= Om 6.1e+150))) (sqrt (* 2.0 (* U (* n (- t (* 2.0 (* l (/ l Om)))))))) (pow (* 2.0 (* (* n U) (+ t (* (/ (pow l 2.0) Om) -2.0)))) 0.5)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if ((Om <= -1.3e-15) || !(Om <= 6.1e+150)) {
tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om))))))));
} else {
tmp = pow((2.0 * ((n * U) * (t + ((pow(l, 2.0) / Om) * -2.0)))), 0.5);
}
return tmp;
}
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 ((om <= (-1.3d-15)) .or. (.not. (om <= 6.1d+150))) then
tmp = sqrt((2.0d0 * (u * (n * (t - (2.0d0 * (l * (l / om))))))))
else
tmp = (2.0d0 * ((n * u) * (t + (((l ** 2.0d0) / om) * (-2.0d0))))) ** 0.5d0
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if ((Om <= -1.3e-15) || !(Om <= 6.1e+150)) {
tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om))))))));
} else {
tmp = Math.pow((2.0 * ((n * U) * (t + ((Math.pow(l, 2.0) / Om) * -2.0)))), 0.5);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if (Om <= -1.3e-15) or not (Om <= 6.1e+150): tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om)))))))) else: tmp = math.pow((2.0 * ((n * U) * (t + ((math.pow(l, 2.0) / Om) * -2.0)))), 0.5) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if ((Om <= -1.3e-15) || !(Om <= 6.1e+150)) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))))))); else tmp = Float64(2.0 * Float64(Float64(n * U) * Float64(t + Float64(Float64((l ^ 2.0) / Om) * -2.0)))) ^ 0.5; end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if ((Om <= -1.3e-15) || ~((Om <= 6.1e+150))) tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om)))))))); else tmp = (2.0 * ((n * U) * (t + (((l ^ 2.0) / Om) * -2.0)))) ^ 0.5; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[Or[LessEqual[Om, -1.3e-15], N[Not[LessEqual[Om, 6.1e+150]], $MachinePrecision]], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(t + N[(N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;Om \leq -1.3 \cdot 10^{-15} \lor \neg \left(Om \leq 6.1 \cdot 10^{+150}\right):\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + \frac{{\ell}^{2}}{Om} \cdot -2\right)\right)\right)}^{0.5}\\
\end{array}
\end{array}
if Om < -1.30000000000000002e-15 or 6.10000000000000026e150 < Om Initial program 53.9%
Simplified65.4%
Taylor expanded in n around 0 54.0%
unpow254.0%
associate-*r/65.3%
*-commutative65.3%
Applied egg-rr65.3%
if -1.30000000000000002e-15 < Om < 6.10000000000000026e150Initial program 42.2%
Simplified43.8%
Taylor expanded in n around 0 32.5%
pow1/244.7%
associate-*r*47.0%
*-commutative47.0%
cancel-sign-sub-inv47.0%
metadata-eval47.0%
Applied egg-rr47.0%
Final simplification56.2%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 2e-79) (sqrt (* 2.0 (fabs (* t (* n U))))) (sqrt (* 2.0 (* U (* n (- t (* 2.0 (* l (/ l Om))))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 2e-79) {
tmp = sqrt((2.0 * fabs((t * (n * U)))));
} else {
tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om))))))));
}
return tmp;
}
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 <= 2d-79) then
tmp = sqrt((2.0d0 * abs((t * (n * u)))))
else
tmp = sqrt((2.0d0 * (u * (n * (t - (2.0d0 * (l * (l / om))))))))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 2e-79) {
tmp = Math.sqrt((2.0 * Math.abs((t * (n * U)))));
} else {
tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om))))))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 2e-79: tmp = math.sqrt((2.0 * math.fabs((t * (n * U))))) else: tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om)))))))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 2e-79) tmp = sqrt(Float64(2.0 * abs(Float64(t * Float64(n * U))))); else tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))))))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 2e-79) tmp = sqrt((2.0 * abs((t * (n * U))))); else tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om)))))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 2e-79], N[Sqrt[N[(2.0 * N[Abs[N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2 \cdot 10^{-79}:\\
\;\;\;\;\sqrt{2 \cdot \left|t \cdot \left(n \cdot U\right)\right|}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\
\end{array}
\end{array}
if l < 2e-79Initial program 52.3%
Simplified56.4%
Taylor expanded in t around inf 40.3%
associate-*r*42.0%
Simplified42.0%
pow142.0%
associate-*r*40.3%
add-sqr-sqrt40.2%
unpow240.2%
metadata-eval40.2%
pow-prod-up40.2%
pow-prod-down28.4%
pow-prod-down28.4%
add-sqr-sqrt32.4%
Applied egg-rr32.4%
unpow1/232.4%
unpow232.4%
rem-sqrt-square42.9%
associate-*r*45.7%
Simplified45.7%
if 2e-79 < l Initial program 38.6%
Simplified50.6%
Taylor expanded in n around 0 41.2%
unpow241.2%
associate-*r/49.9%
*-commutative49.9%
Applied egg-rr49.9%
Final simplification46.9%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 2.7e-79) (pow (* (* (* 2.0 n) U) t) 0.5) (sqrt (* 2.0 (* U (* n (- t (* 2.0 (* l (/ l Om))))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 2.7e-79) {
tmp = pow((((2.0 * n) * U) * t), 0.5);
} else {
tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om))))))));
}
return tmp;
}
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.7d-79) then
tmp = (((2.0d0 * n) * u) * t) ** 0.5d0
else
tmp = sqrt((2.0d0 * (u * (n * (t - (2.0d0 * (l * (l / om))))))))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 2.7e-79) {
tmp = Math.pow((((2.0 * n) * U) * t), 0.5);
} else {
tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om))))))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 2.7e-79: tmp = math.pow((((2.0 * n) * U) * t), 0.5) else: tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om)))))))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 2.7e-79) tmp = Float64(Float64(Float64(2.0 * n) * U) * t) ^ 0.5; else tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))))))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 2.7e-79) tmp = (((2.0 * n) * U) * t) ^ 0.5; else tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om)))))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 2.7e-79], N[Power[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision], 0.5], $MachinePrecision], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.7 \cdot 10^{-79}:\\
\;\;\;\;{\left(\left(\left(2 \cdot n\right) \cdot U\right) \cdot t\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\
\end{array}
\end{array}
if l < 2.7000000000000002e-79Initial program 52.3%
Simplified56.4%
Taylor expanded in t around inf 40.3%
associate-*r*42.0%
Simplified42.0%
pow1/245.0%
associate-*r*45.0%
*-commutative45.0%
associate-*r*45.0%
*-commutative45.0%
Applied egg-rr45.0%
if 2.7000000000000002e-79 < l Initial program 38.6%
Simplified50.6%
Taylor expanded in n around 0 41.2%
unpow241.2%
associate-*r/49.9%
*-commutative49.9%
Applied egg-rr49.9%
Final simplification46.5%
(FPCore (n U t l Om U*) :precision binary64 (if (<= t -5e-135) (pow (* (* 2.0 U) (* n t)) 0.5) (pow (* (* (* 2.0 n) U) t) 0.5)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= -5e-135) {
tmp = pow(((2.0 * U) * (n * t)), 0.5);
} else {
tmp = pow((((2.0 * n) * U) * t), 0.5);
}
return tmp;
}
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 <= (-5d-135)) then
tmp = ((2.0d0 * u) * (n * t)) ** 0.5d0
else
tmp = (((2.0d0 * n) * u) * t) ** 0.5d0
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= -5e-135) {
tmp = Math.pow(((2.0 * U) * (n * t)), 0.5);
} else {
tmp = Math.pow((((2.0 * n) * U) * t), 0.5);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if t <= -5e-135: tmp = math.pow(((2.0 * U) * (n * t)), 0.5) else: tmp = math.pow((((2.0 * n) * U) * t), 0.5) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= -5e-135) tmp = Float64(Float64(2.0 * U) * Float64(n * t)) ^ 0.5; else tmp = Float64(Float64(Float64(2.0 * n) * U) * t) ^ 0.5; end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (t <= -5e-135) tmp = ((2.0 * U) * (n * t)) ^ 0.5; else tmp = (((2.0 * n) * U) * t) ^ 0.5; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, -5e-135], N[Power[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Power[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-135}:\\
\;\;\;\;{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;{\left(\left(\left(2 \cdot n\right) \cdot U\right) \cdot t\right)}^{0.5}\\
\end{array}
\end{array}
if t < -5.0000000000000002e-135Initial program 49.8%
Simplified58.4%
Taylor expanded in t around inf 44.2%
pow1/246.3%
associate-*r*46.3%
Applied egg-rr46.3%
if -5.0000000000000002e-135 < t Initial program 47.1%
Simplified52.4%
Taylor expanded in t around inf 31.2%
associate-*r*34.2%
Simplified34.2%
pow1/238.2%
associate-*r*38.2%
*-commutative38.2%
associate-*r*38.2%
*-commutative38.2%
Applied egg-rr38.2%
Final simplification41.2%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 1.8e-217) (pow (* 2.0 (* n (* U t))) 0.5) (pow (* (* 2.0 U) (* n t)) 0.5)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.8e-217) {
tmp = pow((2.0 * (n * (U * t))), 0.5);
} else {
tmp = pow(((2.0 * U) * (n * t)), 0.5);
}
return tmp;
}
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.8d-217) then
tmp = (2.0d0 * (n * (u * t))) ** 0.5d0
else
tmp = ((2.0d0 * u) * (n * t)) ** 0.5d0
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.8e-217) {
tmp = Math.pow((2.0 * (n * (U * t))), 0.5);
} else {
tmp = Math.pow(((2.0 * U) * (n * t)), 0.5);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 1.8e-217: tmp = math.pow((2.0 * (n * (U * t))), 0.5) else: tmp = math.pow(((2.0 * U) * (n * t)), 0.5) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 1.8e-217) tmp = Float64(2.0 * Float64(n * Float64(U * t))) ^ 0.5; else tmp = Float64(Float64(2.0 * U) * Float64(n * t)) ^ 0.5; end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 1.8e-217) tmp = (2.0 * (n * (U * t))) ^ 0.5; else tmp = ((2.0 * U) * (n * t)) ^ 0.5; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 1.8e-217], N[Power[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Power[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.8 \cdot 10^{-217}:\\
\;\;\;\;{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{0.5}\\
\end{array}
\end{array}
if l < 1.79999999999999991e-217Initial program 50.6%
Simplified55.6%
Taylor expanded in t around inf 38.1%
add-sqr-sqrt38.0%
pow238.0%
Applied egg-rr38.0%
unpow238.0%
add-sqr-sqrt38.1%
*-commutative38.1%
Applied egg-rr38.1%
associate-*l*38.7%
Simplified38.7%
pow1/240.8%
*-commutative40.8%
Applied egg-rr40.8%
if 1.79999999999999991e-217 < l Initial program 44.4%
Simplified53.3%
Taylor expanded in t around inf 32.9%
pow1/234.9%
associate-*r*34.9%
Applied egg-rr34.9%
(FPCore (n U t l Om U*) :precision binary64 (if (<= Om 2e+21) (pow (* 2.0 (* n (* U t))) 0.5) (sqrt (* 2.0 (* U (* n t))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (Om <= 2e+21) {
tmp = pow((2.0 * (n * (U * t))), 0.5);
} else {
tmp = sqrt((2.0 * (U * (n * t))));
}
return tmp;
}
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 (om <= 2d+21) then
tmp = (2.0d0 * (n * (u * t))) ** 0.5d0
else
tmp = sqrt((2.0d0 * (u * (n * t))))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (Om <= 2e+21) {
tmp = Math.pow((2.0 * (n * (U * t))), 0.5);
} else {
tmp = Math.sqrt((2.0 * (U * (n * t))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if Om <= 2e+21: tmp = math.pow((2.0 * (n * (U * t))), 0.5) else: tmp = math.sqrt((2.0 * (U * (n * t)))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (Om <= 2e+21) tmp = Float64(2.0 * Float64(n * Float64(U * t))) ^ 0.5; else tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (Om <= 2e+21) tmp = (2.0 * (n * (U * t))) ^ 0.5; else tmp = sqrt((2.0 * (U * (n * t)))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[Om, 2e+21], N[Power[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;Om \leq 2 \cdot 10^{+21}:\\
\;\;\;\;{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\
\end{array}
\end{array}
if Om < 2e21Initial program 46.0%
Simplified52.7%
Taylor expanded in t around inf 29.0%
add-sqr-sqrt29.0%
pow229.0%
Applied egg-rr29.0%
unpow229.0%
add-sqr-sqrt29.0%
*-commutative29.0%
Applied egg-rr29.0%
associate-*l*32.5%
Simplified32.5%
pow1/234.2%
*-commutative34.2%
Applied egg-rr34.2%
if 2e21 < Om Initial program 52.9%
Simplified59.2%
Taylor expanded in t around inf 52.3%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 4.4e-240) (sqrt (* 2.0 (* n (* U t)))) (sqrt (* 2.0 (* U (* n t))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 4.4e-240) {
tmp = sqrt((2.0 * (n * (U * t))));
} else {
tmp = sqrt((2.0 * (U * (n * t))));
}
return tmp;
}
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 <= 4.4d-240) then
tmp = sqrt((2.0d0 * (n * (u * t))))
else
tmp = sqrt((2.0d0 * (u * (n * t))))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 4.4e-240) {
tmp = Math.sqrt((2.0 * (n * (U * t))));
} else {
tmp = Math.sqrt((2.0 * (U * (n * t))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 4.4e-240: tmp = math.sqrt((2.0 * (n * (U * t)))) else: tmp = math.sqrt((2.0 * (U * (n * t)))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 4.4e-240) 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
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 4.4e-240) tmp = sqrt((2.0 * (n * (U * t)))); else tmp = sqrt((2.0 * (U * (n * t)))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 4.4e-240], 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}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4.4 \cdot 10^{-240}:\\
\;\;\;\;\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 < 4.3999999999999999e-240Initial program 50.5%
Simplified55.7%
Taylor expanded in t around inf 37.7%
add-sqr-sqrt37.7%
pow237.7%
Applied egg-rr37.7%
unpow237.7%
add-sqr-sqrt37.7%
*-commutative37.7%
Applied egg-rr37.7%
associate-*l*38.3%
Simplified38.3%
if 4.3999999999999999e-240 < l Initial program 44.7%
Simplified53.3%
Taylor expanded in t around inf 33.7%
Final simplification36.4%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2.0 (* U (* n t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((2.0 * (U * (n * t))));
}
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
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))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((2.0 * (U * (n * t))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(2.0 * Float64(U * Float64(n * t)))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((2.0 * (U * (n * t)))); end
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}
\\
\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}
\end{array}
Initial program 48.1%
Simplified54.7%
Taylor expanded in t around inf 36.0%
herbie shell --seed 2024137
(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*))))))