
(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 13 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 (* l (/ l Om)))
(t_2 (pow (/ l Om) 2.0))
(t_3 (* (* n t_2) (- U* U)))
(t_4 (* (* (* 2.0 n) U) (+ (- t (* 2.0 (/ (* l l) Om))) t_3))))
(if (<= t_4 1e-7)
(sqrt (* (* 2.0 n) (* U (- t (fma 2.0 t_1 (* t_2 (* n (- U U*))))))))
(if (<= t_4 INFINITY)
(sqrt (* (* 2.0 (* n U)) (+ t (- t_3 (* 2.0 t_1)))))
(sqrt (/ (* 2.0 (* U (* U* (pow (* n l) 2.0)))) (pow Om 2.0)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = l * (l / Om);
double t_2 = pow((l / Om), 2.0);
double t_3 = (n * t_2) * (U_42_ - U);
double t_4 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + t_3);
double tmp;
if (t_4 <= 1e-7) {
tmp = sqrt(((2.0 * n) * (U * (t - fma(2.0, t_1, (t_2 * (n * (U - U_42_))))))));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt(((2.0 * (n * U)) * (t + (t_3 - (2.0 * t_1)))));
} else {
tmp = sqrt(((2.0 * (U * (U_42_ * pow((n * l), 2.0)))) / pow(Om, 2.0)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(l * Float64(l / Om)) t_2 = Float64(l / Om) ^ 2.0 t_3 = Float64(Float64(n * t_2) * Float64(U_42_ - U)) t_4 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_3)) tmp = 0.0 if (t_4 <= 1e-7) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - fma(2.0, t_1, Float64(t_2 * Float64(n * Float64(U - U_42_)))))))); elseif (t_4 <= Inf) tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t + Float64(t_3 - Float64(2.0 * t_1))))); else tmp = sqrt(Float64(Float64(2.0 * Float64(U * Float64(U_42_ * (Float64(n * l) ^ 2.0)))) / (Om ^ 2.0))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(n * t$95$2), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * 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, 1e-7], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(2.0 * t$95$1 + N[(t$95$2 * N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t + N[(t$95$3 - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * N[(U * N[(U$42$ * N[Power[N[(n * l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \ell \cdot \frac{\ell}{Om}\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(n \cdot t\_2\right) \cdot \left(U* - U\right)\\
t_4 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t\_3\right)\\
\mathbf{if}\;t\_4 \leq 10^{-7}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, t\_1, t\_2 \cdot \left(n \cdot \left(U - U*\right)\right)\right)\right)\right)}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(t\_3 - 2 \cdot t\_1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{2 \cdot \left(U \cdot \left(U* \cdot {\left(n \cdot \ell\right)}^{2}\right)\right)}{{Om}^{2}}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < 9.9999999999999995e-8Initial program 59.5%
Simplified69.8%
Taylor expanded in U around 0 69.4%
+-commutative69.4%
associate-/l*69.4%
*-commutative69.4%
associate-/l*69.4%
unpow269.4%
unpow269.4%
times-frac69.4%
unpow269.4%
associate-*r*69.4%
mul-1-neg69.4%
associate-/l*68.3%
distribute-lft-neg-in68.3%
*-commutative68.3%
associate-/l*69.5%
unpow269.5%
unpow269.5%
times-frac73.1%
unpow273.1%
Simplified73.0%
if 9.9999999999999995e-8 < (*.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 64.3%
Simplified68.8%
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%
Simplified4.8%
Taylor expanded in U around 0 0.3%
+-commutative0.3%
associate-/l*0.1%
*-commutative0.1%
associate-/l*0.0%
unpow20.0%
unpow20.0%
times-frac0.1%
unpow20.1%
associate-*r*0.1%
mul-1-neg0.1%
associate-/l*0.1%
distribute-lft-neg-in0.1%
*-commutative0.1%
associate-/l*0.1%
unpow20.1%
unpow20.1%
times-frac4.1%
unpow24.1%
Simplified4.8%
Taylor expanded in U* around inf 45.1%
*-commutative45.1%
associate-*l/45.1%
*-commutative45.1%
unpow245.1%
unpow245.1%
swap-sqr46.7%
unpow246.7%
Simplified46.7%
Final simplification67.9%
(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 (* 2.0 (/ (* l l) Om))) t_1))))
(if (<= t_2 0.0)
(sqrt (fabs (* 2.0 (* U (* n t)))))
(if (<= t_2 INFINITY)
(sqrt (* (* 2.0 (* n U)) (+ t (- t_1 (* 2.0 (* l (/ l Om)))))))
(sqrt (/ (* 2.0 (* U (* U* (pow (* n l) 2.0)))) (pow Om 2.0)))))))
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) * ((t - (2.0 * ((l * l) / Om))) + t_1);
double tmp;
if (t_2 <= 0.0) {
tmp = sqrt(fabs((2.0 * (U * (n * t)))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt(((2.0 * (n * U)) * (t + (t_1 - (2.0 * (l * (l / Om)))))));
} else {
tmp = sqrt(((2.0 * (U * (U_42_ * pow((n * l), 2.0)))) / pow(Om, 2.0)));
}
return tmp;
}
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) * ((t - (2.0 * ((l * l) / Om))) + t_1);
double tmp;
if (t_2 <= 0.0) {
tmp = Math.sqrt(Math.abs((2.0 * (U * (n * t)))));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt(((2.0 * (n * U)) * (t + (t_1 - (2.0 * (l * (l / Om)))))));
} else {
tmp = Math.sqrt(((2.0 * (U * (U_42_ * Math.pow((n * l), 2.0)))) / Math.pow(Om, 2.0)));
}
return tmp;
}
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 - (2.0 * ((l * l) / Om))) + t_1) tmp = 0 if t_2 <= 0.0: tmp = math.sqrt(math.fabs((2.0 * (U * (n * t))))) elif t_2 <= math.inf: tmp = math.sqrt(((2.0 * (n * U)) * (t + (t_1 - (2.0 * (l * (l / Om))))))) else: tmp = math.sqrt(((2.0 * (U * (U_42_ * math.pow((n * l), 2.0)))) / math.pow(Om, 2.0))) return tmp
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(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_1)) tmp = 0.0 if (t_2 <= 0.0) tmp = sqrt(abs(Float64(2.0 * Float64(U * Float64(n * t))))); elseif (t_2 <= Inf) tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t + Float64(t_1 - Float64(2.0 * Float64(l * Float64(l / Om))))))); else tmp = sqrt(Float64(Float64(2.0 * Float64(U * Float64(U_42_ * (Float64(n * l) ^ 2.0)))) / (Om ^ 2.0))); end return tmp end
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 - (2.0 * ((l * l) / Om))) + t_1); tmp = 0.0; if (t_2 <= 0.0) tmp = sqrt(abs((2.0 * (U * (n * t))))); elseif (t_2 <= Inf) tmp = sqrt(((2.0 * (n * U)) * (t + (t_1 - (2.0 * (l * (l / Om))))))); else tmp = sqrt(((2.0 * (U * (U_42_ * ((n * l) ^ 2.0)))) / (Om ^ 2.0))); end tmp_2 = tmp; end
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[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[Sqrt[N[Abs[N[(2.0 * N[(U * N[(n * t), $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[(t$95$1 - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * N[(U * N[(U$42$ * N[Power[N[(n * l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\\
t_2 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t\_1\right)\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;\sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(t\_1 - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{2 \cdot \left(U \cdot \left(U* \cdot {\left(n \cdot \ell\right)}^{2}\right)\right)}{{Om}^{2}}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < 0.0Initial program 10.3%
Simplified16.0%
Taylor expanded in t around inf 42.9%
add-sqr-sqrt42.9%
pow1/242.9%
pow1/242.9%
pow-prod-down19.0%
pow219.0%
associate-*r*13.7%
Applied egg-rr13.7%
unpow1/213.7%
unpow213.7%
rem-sqrt-square16.5%
associate-*r*43.4%
Simplified43.4%
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 72.1%
Simplified75.4%
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%
Simplified4.8%
Taylor expanded in U around 0 0.3%
+-commutative0.3%
associate-/l*0.1%
*-commutative0.1%
associate-/l*0.0%
unpow20.0%
unpow20.0%
times-frac0.1%
unpow20.1%
associate-*r*0.1%
mul-1-neg0.1%
associate-/l*0.1%
distribute-lft-neg-in0.1%
*-commutative0.1%
associate-/l*0.1%
unpow20.1%
unpow20.1%
times-frac4.1%
unpow24.1%
Simplified4.8%
Taylor expanded in U* around inf 45.1%
*-commutative45.1%
associate-*l/45.1%
*-commutative45.1%
unpow245.1%
unpow245.1%
swap-sqr46.7%
unpow246.7%
Simplified46.7%
Final simplification67.9%
(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 (* 2.0 (/ (* l l) Om))) t_1))))
(if (<= t_2 0.0)
(sqrt (fabs (* 2.0 (* U (* n t)))))
(if (<= t_2 INFINITY)
(sqrt (* (* 2.0 (* n U)) (+ t (- t_1 (* 2.0 (* l (/ l Om)))))))
(pow (* -4.0 (/ (* U (* n (pow l 2.0))) Om)) 0.5)))))
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) * ((t - (2.0 * ((l * l) / Om))) + t_1);
double tmp;
if (t_2 <= 0.0) {
tmp = sqrt(fabs((2.0 * (U * (n * t)))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt(((2.0 * (n * U)) * (t + (t_1 - (2.0 * (l * (l / Om)))))));
} else {
tmp = pow((-4.0 * ((U * (n * pow(l, 2.0))) / Om)), 0.5);
}
return tmp;
}
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) * ((t - (2.0 * ((l * l) / Om))) + t_1);
double tmp;
if (t_2 <= 0.0) {
tmp = Math.sqrt(Math.abs((2.0 * (U * (n * t)))));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt(((2.0 * (n * U)) * (t + (t_1 - (2.0 * (l * (l / Om)))))));
} else {
tmp = Math.pow((-4.0 * ((U * (n * Math.pow(l, 2.0))) / Om)), 0.5);
}
return tmp;
}
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 - (2.0 * ((l * l) / Om))) + t_1) tmp = 0 if t_2 <= 0.0: tmp = math.sqrt(math.fabs((2.0 * (U * (n * t))))) elif t_2 <= math.inf: tmp = math.sqrt(((2.0 * (n * U)) * (t + (t_1 - (2.0 * (l * (l / Om))))))) else: tmp = math.pow((-4.0 * ((U * (n * math.pow(l, 2.0))) / Om)), 0.5) return tmp
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(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_1)) tmp = 0.0 if (t_2 <= 0.0) tmp = sqrt(abs(Float64(2.0 * Float64(U * Float64(n * t))))); elseif (t_2 <= Inf) tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t + Float64(t_1 - Float64(2.0 * Float64(l * Float64(l / Om))))))); else tmp = Float64(-4.0 * Float64(Float64(U * Float64(n * (l ^ 2.0))) / Om)) ^ 0.5; end return tmp end
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 - (2.0 * ((l * l) / Om))) + t_1); tmp = 0.0; if (t_2 <= 0.0) tmp = sqrt(abs((2.0 * (U * (n * t))))); elseif (t_2 <= Inf) tmp = sqrt(((2.0 * (n * U)) * (t + (t_1 - (2.0 * (l * (l / Om))))))); else tmp = (-4.0 * ((U * (n * (l ^ 2.0))) / Om)) ^ 0.5; end tmp_2 = tmp; end
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[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[Sqrt[N[Abs[N[(2.0 * N[(U * N[(n * t), $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[(t$95$1 - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(-4.0 * N[(N[(U * N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\\
t_2 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t\_1\right)\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;\sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(t\_1 - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(-4 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om}\right)}^{0.5}\\
\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 10.3%
Simplified16.0%
Taylor expanded in t around inf 42.9%
add-sqr-sqrt42.9%
pow1/242.9%
pow1/242.9%
pow-prod-down19.0%
pow219.0%
associate-*r*13.7%
Applied egg-rr13.7%
unpow1/213.7%
unpow213.7%
rem-sqrt-square16.5%
associate-*r*43.4%
Simplified43.4%
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 72.1%
Simplified75.4%
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%
Simplified4.8%
Taylor expanded in n around 0 2.4%
associate-*r/2.4%
Simplified2.4%
Taylor expanded in t around 0 3.8%
associate-*r/3.8%
associate-*r*2.6%
Simplified2.6%
pow1/236.6%
associate-/l*36.6%
associate-*l*41.5%
Applied egg-rr41.5%
Final simplification67.4%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= l 3.4e-249)
(* (sqrt 2.0) (sqrt (* t (* n U))))
(if (<= l 3.7e+130)
(sqrt (* 2.0 (* U (* n (- t (/ (* 2.0 (pow l 2.0)) Om))))))
(pow (* -4.0 (/ (* U (* n (pow l 2.0))) Om)) 0.5))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 3.4e-249) {
tmp = sqrt(2.0) * sqrt((t * (n * U)));
} else if (l <= 3.7e+130) {
tmp = sqrt((2.0 * (U * (n * (t - ((2.0 * pow(l, 2.0)) / Om))))));
} else {
tmp = pow((-4.0 * ((U * (n * pow(l, 2.0))) / Om)), 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 <= 3.4d-249) then
tmp = sqrt(2.0d0) * sqrt((t * (n * u)))
else if (l <= 3.7d+130) then
tmp = sqrt((2.0d0 * (u * (n * (t - ((2.0d0 * (l ** 2.0d0)) / om))))))
else
tmp = ((-4.0d0) * ((u * (n * (l ** 2.0d0))) / om)) ** 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 <= 3.4e-249) {
tmp = Math.sqrt(2.0) * Math.sqrt((t * (n * U)));
} else if (l <= 3.7e+130) {
tmp = Math.sqrt((2.0 * (U * (n * (t - ((2.0 * Math.pow(l, 2.0)) / Om))))));
} else {
tmp = Math.pow((-4.0 * ((U * (n * Math.pow(l, 2.0))) / Om)), 0.5);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 3.4e-249: tmp = math.sqrt(2.0) * math.sqrt((t * (n * U))) elif l <= 3.7e+130: tmp = math.sqrt((2.0 * (U * (n * (t - ((2.0 * math.pow(l, 2.0)) / Om)))))) else: tmp = math.pow((-4.0 * ((U * (n * math.pow(l, 2.0))) / Om)), 0.5) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 3.4e-249) tmp = Float64(sqrt(2.0) * sqrt(Float64(t * Float64(n * U)))); elseif (l <= 3.7e+130) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(Float64(2.0 * (l ^ 2.0)) / Om)))))); else tmp = Float64(-4.0 * Float64(Float64(U * Float64(n * (l ^ 2.0))) / Om)) ^ 0.5; end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 3.4e-249) tmp = sqrt(2.0) * sqrt((t * (n * U))); elseif (l <= 3.7e+130) tmp = sqrt((2.0 * (U * (n * (t - ((2.0 * (l ^ 2.0)) / Om)))))); else tmp = (-4.0 * ((U * (n * (l ^ 2.0))) / Om)) ^ 0.5; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 3.4e-249], N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.7e+130], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(-4.0 * N[(N[(U * N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.4 \cdot 10^{-249}:\\
\;\;\;\;\sqrt{2} \cdot \sqrt{t \cdot \left(n \cdot U\right)}\\
\mathbf{elif}\;\ell \leq 3.7 \cdot 10^{+130}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - \frac{2 \cdot {\ell}^{2}}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(-4 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om}\right)}^{0.5}\\
\end{array}
\end{array}
if l < 3.3999999999999998e-249Initial program 56.8%
Simplified56.9%
Taylor expanded in t around inf 40.9%
*-commutative40.9%
associate-*r*42.6%
Simplified42.6%
if 3.3999999999999998e-249 < l < 3.7000000000000001e130Initial program 67.8%
Simplified67.8%
Taylor expanded in n around 0 65.3%
associate-*r/65.3%
Simplified65.3%
if 3.7000000000000001e130 < l Initial program 13.9%
Simplified29.3%
Taylor expanded in n around 0 10.5%
associate-*r/10.5%
Simplified10.5%
Taylor expanded in t around 0 11.8%
associate-*r/11.8%
associate-*r*10.5%
Simplified10.5%
pow1/230.9%
associate-/l*30.9%
associate-*l*36.2%
Applied egg-rr36.2%
Final simplification48.6%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= Om -3.2e-162)
(sqrt (* 2.0 (* U (* n (- t (/ (* 2.0 (pow l 2.0)) Om))))))
(if (<= Om 4.9e+44)
(sqrt (* (* 2.0 n) (* U (* (* n (pow (/ l Om) 2.0)) U*))))
(pow (* 2.0 (* t (* n U))) 0.5))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (Om <= -3.2e-162) {
tmp = sqrt((2.0 * (U * (n * (t - ((2.0 * pow(l, 2.0)) / Om))))));
} else if (Om <= 4.9e+44) {
tmp = sqrt(((2.0 * n) * (U * ((n * pow((l / Om), 2.0)) * U_42_))));
} else {
tmp = pow((2.0 * (t * (n * U))), 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 <= (-3.2d-162)) then
tmp = sqrt((2.0d0 * (u * (n * (t - ((2.0d0 * (l ** 2.0d0)) / om))))))
else if (om <= 4.9d+44) then
tmp = sqrt(((2.0d0 * n) * (u * ((n * ((l / om) ** 2.0d0)) * u_42))))
else
tmp = (2.0d0 * (t * (n * u))) ** 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 <= -3.2e-162) {
tmp = Math.sqrt((2.0 * (U * (n * (t - ((2.0 * Math.pow(l, 2.0)) / Om))))));
} else if (Om <= 4.9e+44) {
tmp = Math.sqrt(((2.0 * n) * (U * ((n * Math.pow((l / Om), 2.0)) * U_42_))));
} else {
tmp = Math.pow((2.0 * (t * (n * U))), 0.5);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if Om <= -3.2e-162: tmp = math.sqrt((2.0 * (U * (n * (t - ((2.0 * math.pow(l, 2.0)) / Om)))))) elif Om <= 4.9e+44: tmp = math.sqrt(((2.0 * n) * (U * ((n * math.pow((l / Om), 2.0)) * U_42_)))) else: tmp = math.pow((2.0 * (t * (n * U))), 0.5) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (Om <= -3.2e-162) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(Float64(2.0 * (l ^ 2.0)) / Om)))))); elseif (Om <= 4.9e+44) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * U_42_)))); else tmp = Float64(2.0 * Float64(t * Float64(n * U))) ^ 0.5; end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (Om <= -3.2e-162) tmp = sqrt((2.0 * (U * (n * (t - ((2.0 * (l ^ 2.0)) / Om)))))); elseif (Om <= 4.9e+44) tmp = sqrt(((2.0 * n) * (U * ((n * ((l / Om) ^ 2.0)) * U_42_)))); else tmp = (2.0 * (t * (n * U))) ^ 0.5; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[Om, -3.2e-162], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[Om, 4.9e+44], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;Om \leq -3.2 \cdot 10^{-162}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - \frac{2 \cdot {\ell}^{2}}{Om}\right)\right)\right)}\\
\mathbf{elif}\;Om \leq 4.9 \cdot 10^{+44}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot U*\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\
\end{array}
\end{array}
if Om < -3.19999999999999975e-162Initial program 59.6%
Simplified62.9%
Taylor expanded in n around 0 57.3%
associate-*r/57.3%
Simplified57.3%
if -3.19999999999999975e-162 < Om < 4.90000000000000035e44Initial program 56.7%
Simplified50.8%
Taylor expanded in U* around inf 41.5%
associate-/l*38.9%
associate-/l*38.9%
*-commutative38.9%
associate-/l*40.2%
unpow240.2%
unpow240.2%
times-frac51.1%
unpow251.1%
Simplified51.1%
if 4.90000000000000035e44 < Om Initial program 49.5%
Simplified56.2%
Taylor expanded in t around inf 52.5%
pow1/252.6%
associate-*r*53.8%
Applied egg-rr53.8%
Final simplification54.5%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= Om -1.6e-160)
(sqrt (* (* 2.0 n) (* U (- t (/ (* 2.0 (pow l 2.0)) Om)))))
(if (<= Om 2.4e+45)
(sqrt (* (* 2.0 n) (* U (* (* n (pow (/ l Om) 2.0)) U*))))
(pow (* 2.0 (* t (* n U))) 0.5))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (Om <= -1.6e-160) {
tmp = sqrt(((2.0 * n) * (U * (t - ((2.0 * pow(l, 2.0)) / Om)))));
} else if (Om <= 2.4e+45) {
tmp = sqrt(((2.0 * n) * (U * ((n * pow((l / Om), 2.0)) * U_42_))));
} else {
tmp = pow((2.0 * (t * (n * U))), 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.6d-160)) then
tmp = sqrt(((2.0d0 * n) * (u * (t - ((2.0d0 * (l ** 2.0d0)) / om)))))
else if (om <= 2.4d+45) then
tmp = sqrt(((2.0d0 * n) * (u * ((n * ((l / om) ** 2.0d0)) * u_42))))
else
tmp = (2.0d0 * (t * (n * u))) ** 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.6e-160) {
tmp = Math.sqrt(((2.0 * n) * (U * (t - ((2.0 * Math.pow(l, 2.0)) / Om)))));
} else if (Om <= 2.4e+45) {
tmp = Math.sqrt(((2.0 * n) * (U * ((n * Math.pow((l / Om), 2.0)) * U_42_))));
} else {
tmp = Math.pow((2.0 * (t * (n * U))), 0.5);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if Om <= -1.6e-160: tmp = math.sqrt(((2.0 * n) * (U * (t - ((2.0 * math.pow(l, 2.0)) / Om))))) elif Om <= 2.4e+45: tmp = math.sqrt(((2.0 * n) * (U * ((n * math.pow((l / Om), 2.0)) * U_42_)))) else: tmp = math.pow((2.0 * (t * (n * U))), 0.5) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (Om <= -1.6e-160) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - Float64(Float64(2.0 * (l ^ 2.0)) / Om))))); elseif (Om <= 2.4e+45) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * U_42_)))); else tmp = Float64(2.0 * Float64(t * Float64(n * U))) ^ 0.5; end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (Om <= -1.6e-160) tmp = sqrt(((2.0 * n) * (U * (t - ((2.0 * (l ^ 2.0)) / Om))))); elseif (Om <= 2.4e+45) tmp = sqrt(((2.0 * n) * (U * ((n * ((l / Om) ^ 2.0)) * U_42_)))); else tmp = (2.0 * (t * (n * U))) ^ 0.5; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[Om, -1.6e-160], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[Om, 2.4e+45], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;Om \leq -1.6 \cdot 10^{-160}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \frac{2 \cdot {\ell}^{2}}{Om}\right)\right)}\\
\mathbf{elif}\;Om \leq 2.4 \cdot 10^{+45}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot U*\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\
\end{array}
\end{array}
if Om < -1.60000000000000004e-160Initial program 59.6%
Simplified64.1%
Taylor expanded in n around 0 58.7%
associate-*r/58.7%
Simplified58.7%
if -1.60000000000000004e-160 < Om < 2.39999999999999989e45Initial program 56.7%
Simplified50.8%
Taylor expanded in U* around inf 41.5%
associate-/l*38.9%
associate-/l*38.9%
*-commutative38.9%
associate-/l*40.2%
unpow240.2%
unpow240.2%
times-frac51.1%
unpow251.1%
Simplified51.1%
if 2.39999999999999989e45 < Om Initial program 49.5%
Simplified56.2%
Taylor expanded in t around inf 52.5%
pow1/252.6%
associate-*r*53.8%
Applied egg-rr53.8%
Final simplification55.1%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= l 2.9e-248)
(* (sqrt 2.0) (sqrt (* t (* n U))))
(if (<= l 2.6e+31)
(sqrt (fabs (* 2.0 (* U (* n t)))))
(pow (* -4.0 (/ (* U (* n (pow l 2.0))) Om)) 0.5))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 2.9e-248) {
tmp = sqrt(2.0) * sqrt((t * (n * U)));
} else if (l <= 2.6e+31) {
tmp = sqrt(fabs((2.0 * (U * (n * t)))));
} else {
tmp = pow((-4.0 * ((U * (n * pow(l, 2.0))) / Om)), 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 <= 2.9d-248) then
tmp = sqrt(2.0d0) * sqrt((t * (n * u)))
else if (l <= 2.6d+31) then
tmp = sqrt(abs((2.0d0 * (u * (n * t)))))
else
tmp = ((-4.0d0) * ((u * (n * (l ** 2.0d0))) / om)) ** 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 <= 2.9e-248) {
tmp = Math.sqrt(2.0) * Math.sqrt((t * (n * U)));
} else if (l <= 2.6e+31) {
tmp = Math.sqrt(Math.abs((2.0 * (U * (n * t)))));
} else {
tmp = Math.pow((-4.0 * ((U * (n * Math.pow(l, 2.0))) / Om)), 0.5);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 2.9e-248: tmp = math.sqrt(2.0) * math.sqrt((t * (n * U))) elif l <= 2.6e+31: tmp = math.sqrt(math.fabs((2.0 * (U * (n * t))))) else: tmp = math.pow((-4.0 * ((U * (n * math.pow(l, 2.0))) / Om)), 0.5) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 2.9e-248) tmp = Float64(sqrt(2.0) * sqrt(Float64(t * Float64(n * U)))); elseif (l <= 2.6e+31) tmp = sqrt(abs(Float64(2.0 * Float64(U * Float64(n * t))))); else tmp = Float64(-4.0 * Float64(Float64(U * Float64(n * (l ^ 2.0))) / Om)) ^ 0.5; end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 2.9e-248) tmp = sqrt(2.0) * sqrt((t * (n * U))); elseif (l <= 2.6e+31) tmp = sqrt(abs((2.0 * (U * (n * t))))); else tmp = (-4.0 * ((U * (n * (l ^ 2.0))) / Om)) ^ 0.5; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 2.9e-248], N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.6e+31], N[Sqrt[N[Abs[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[Power[N[(-4.0 * N[(N[(U * N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.9 \cdot 10^{-248}:\\
\;\;\;\;\sqrt{2} \cdot \sqrt{t \cdot \left(n \cdot U\right)}\\
\mathbf{elif}\;\ell \leq 2.6 \cdot 10^{+31}:\\
\;\;\;\;\sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}\\
\mathbf{else}:\\
\;\;\;\;{\left(-4 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om}\right)}^{0.5}\\
\end{array}
\end{array}
if l < 2.9000000000000001e-248Initial program 56.5%
Simplified56.6%
Taylor expanded in t around inf 40.6%
*-commutative40.6%
associate-*r*42.4%
Simplified42.4%
if 2.9000000000000001e-248 < l < 2.6e31Initial program 66.5%
Simplified66.5%
Taylor expanded in t around inf 59.9%
add-sqr-sqrt59.9%
pow1/259.9%
pow1/261.6%
pow-prod-down43.3%
pow243.3%
associate-*r*45.0%
Applied egg-rr45.0%
unpow1/245.0%
unpow245.0%
rem-sqrt-square58.1%
associate-*r*62.1%
Simplified62.1%
if 2.6e31 < l Initial program 39.0%
Simplified48.6%
Taylor expanded in n around 0 37.1%
associate-*r/37.1%
Simplified37.1%
Taylor expanded in t around 0 26.9%
associate-*r/26.9%
associate-*r*23.9%
Simplified23.9%
pow1/236.0%
associate-/l*36.0%
associate-*l*41.5%
Applied egg-rr41.5%
Final simplification46.6%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 2.2e-248) (* (sqrt 2.0) (sqrt (* t (* n U)))) (sqrt (fabs (* 2.0 (* U (* n t)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 2.2e-248) {
tmp = sqrt(2.0) * sqrt((t * (n * U)));
} else {
tmp = sqrt(fabs((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 <= 2.2d-248) then
tmp = sqrt(2.0d0) * sqrt((t * (n * u)))
else
tmp = sqrt(abs((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 <= 2.2e-248) {
tmp = Math.sqrt(2.0) * Math.sqrt((t * (n * U)));
} else {
tmp = Math.sqrt(Math.abs((2.0 * (U * (n * t)))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 2.2e-248: tmp = math.sqrt(2.0) * math.sqrt((t * (n * U))) else: tmp = math.sqrt(math.fabs((2.0 * (U * (n * t))))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 2.2e-248) tmp = Float64(sqrt(2.0) * sqrt(Float64(t * Float64(n * U)))); else tmp = sqrt(abs(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 <= 2.2e-248) tmp = sqrt(2.0) * sqrt((t * (n * U))); else tmp = sqrt(abs((2.0 * (U * (n * t))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 2.2e-248], N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[Abs[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.2 \cdot 10^{-248}:\\
\;\;\;\;\sqrt{2} \cdot \sqrt{t \cdot \left(n \cdot U\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}\\
\end{array}
\end{array}
if l < 2.19999999999999999e-248Initial program 56.5%
Simplified56.6%
Taylor expanded in t around inf 40.6%
*-commutative40.6%
associate-*r*42.4%
Simplified42.4%
if 2.19999999999999999e-248 < l Initial program 54.8%
Simplified59.7%
Taylor expanded in t around inf 43.5%
add-sqr-sqrt43.5%
pow1/243.5%
pow1/245.5%
pow-prod-down32.3%
pow232.3%
associate-*r*34.2%
Applied egg-rr34.2%
unpow1/234.2%
unpow234.2%
rem-sqrt-square41.9%
associate-*r*46.2%
Simplified46.2%
Final simplification43.9%
(FPCore (n U t l Om U*) :precision binary64 (if (<= U -4e-310) (sqrt (fabs (* 2.0 (* U (* n t))))) (* (sqrt (* 2.0 U)) (sqrt (* n t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= -4e-310) {
tmp = sqrt(fabs((2.0 * (U * (n * t)))));
} else {
tmp = sqrt((2.0 * U)) * sqrt((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 (u <= (-4d-310)) then
tmp = sqrt(abs((2.0d0 * (u * (n * t)))))
else
tmp = sqrt((2.0d0 * u)) * sqrt((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 (U <= -4e-310) {
tmp = Math.sqrt(Math.abs((2.0 * (U * (n * t)))));
} else {
tmp = Math.sqrt((2.0 * U)) * Math.sqrt((n * t));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if U <= -4e-310: tmp = math.sqrt(math.fabs((2.0 * (U * (n * t))))) else: tmp = math.sqrt((2.0 * U)) * math.sqrt((n * t)) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= -4e-310) tmp = sqrt(abs(Float64(2.0 * Float64(U * Float64(n * t))))); else tmp = Float64(sqrt(Float64(2.0 * U)) * sqrt(Float64(n * t))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U <= -4e-310) tmp = sqrt(abs((2.0 * (U * (n * t))))); else tmp = sqrt((2.0 * U)) * sqrt((n * t)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, -4e-310], N[Sqrt[N[Abs[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(2.0 * U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(n * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;U \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\
\end{array}
\end{array}
if U < -3.999999999999988e-310Initial program 52.3%
Simplified55.9%
Taylor expanded in t around inf 38.5%
add-sqr-sqrt38.5%
pow1/238.5%
pow1/240.8%
pow-prod-down27.7%
pow227.7%
associate-*r*27.3%
Applied egg-rr27.3%
unpow1/227.3%
unpow227.3%
rem-sqrt-square40.7%
associate-*r*41.5%
Simplified41.5%
if -3.999999999999988e-310 < U Initial program 59.7%
Simplified62.7%
Taylor expanded in t around inf 44.7%
pow1/245.6%
associate-*r*45.6%
unpow-prod-down55.1%
pow1/254.2%
Applied egg-rr54.2%
unpow1/254.2%
*-commutative54.2%
Simplified54.2%
Final simplification47.6%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (fabs (* 2.0 (* U (* n t))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt(fabs((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(abs((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(Math.abs((2.0 * (U * (n * t)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt(math.fabs((2.0 * (U * (n * t)))))
function code(n, U, t, l, Om, U_42_) return sqrt(abs(Float64(2.0 * Float64(U * Float64(n * t))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt(abs((2.0 * (U * (n * t))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[Abs[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}
\end{array}
Initial program 55.8%
Simplified59.1%
Taylor expanded in t around inf 41.5%
add-sqr-sqrt41.5%
pow1/241.5%
pow1/243.1%
pow-prod-down30.5%
pow230.5%
associate-*r*30.9%
Applied egg-rr30.9%
unpow1/230.9%
unpow230.9%
rem-sqrt-square43.5%
associate-*r*43.8%
Simplified43.8%
Final simplification43.8%
(FPCore (n U t l Om U*) :precision binary64 (if (<= U -1.2e-81) (pow (* 2.0 (* t (* n U))) 0.5) (sqrt (* (* 2.0 n) (* U t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= -1.2e-81) {
tmp = pow((2.0 * (t * (n * U))), 0.5);
} else {
tmp = sqrt(((2.0 * n) * (U * 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 (u <= (-1.2d-81)) then
tmp = (2.0d0 * (t * (n * u))) ** 0.5d0
else
tmp = sqrt(((2.0d0 * n) * (u * 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 (U <= -1.2e-81) {
tmp = Math.pow((2.0 * (t * (n * U))), 0.5);
} else {
tmp = Math.sqrt(((2.0 * n) * (U * t)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if U <= -1.2e-81: tmp = math.pow((2.0 * (t * (n * U))), 0.5) else: tmp = math.sqrt(((2.0 * n) * (U * t))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= -1.2e-81) tmp = Float64(2.0 * Float64(t * Float64(n * U))) ^ 0.5; else tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * t))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U <= -1.2e-81) tmp = (2.0 * (t * (n * U))) ^ 0.5; else tmp = sqrt(((2.0 * n) * (U * t))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, -1.2e-81], N[Power[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;U \leq -1.2 \cdot 10^{-81}:\\
\;\;\;\;{\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\
\end{array}
\end{array}
if U < -1.2e-81Initial program 63.4%
Simplified64.7%
Taylor expanded in t around inf 41.8%
pow1/245.9%
associate-*r*48.5%
Applied egg-rr48.5%
if -1.2e-81 < U Initial program 52.8%
Simplified59.5%
Taylor expanded in t around inf 43.3%
Final simplification44.8%
(FPCore (n U t l Om U*) :precision binary64 (if (<= U -5e-81) (sqrt (* t (* n (* 2.0 U)))) (sqrt (* (* 2.0 n) (* U t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= -5e-81) {
tmp = sqrt((t * (n * (2.0 * U))));
} else {
tmp = sqrt(((2.0 * n) * (U * 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 (u <= (-5d-81)) then
tmp = sqrt((t * (n * (2.0d0 * u))))
else
tmp = sqrt(((2.0d0 * n) * (u * 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 (U <= -5e-81) {
tmp = Math.sqrt((t * (n * (2.0 * U))));
} else {
tmp = Math.sqrt(((2.0 * n) * (U * t)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if U <= -5e-81: tmp = math.sqrt((t * (n * (2.0 * U)))) else: tmp = math.sqrt(((2.0 * n) * (U * t))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= -5e-81) tmp = sqrt(Float64(t * Float64(n * Float64(2.0 * U)))); else tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * t))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U <= -5e-81) tmp = sqrt((t * (n * (2.0 * U)))); else tmp = sqrt(((2.0 * n) * (U * t))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, -5e-81], N[Sqrt[N[(t * N[(n * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;U \leq -5 \cdot 10^{-81}:\\
\;\;\;\;\sqrt{t \cdot \left(n \cdot \left(2 \cdot U\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\
\end{array}
\end{array}
if U < -4.99999999999999981e-81Initial program 63.4%
Simplified64.7%
Taylor expanded in t around inf 41.8%
associate-*r*41.8%
associate-*l*44.4%
*-commutative44.4%
*-commutative44.4%
*-commutative44.4%
Simplified44.4%
if -4.99999999999999981e-81 < U Initial program 52.8%
Simplified59.5%
Taylor expanded in t around inf 43.3%
Final simplification43.6%
(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 55.8%
Simplified59.1%
Taylor expanded in t around inf 41.5%
Final simplification41.5%
herbie shell --seed 2024050
(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*))))))