
(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}
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* l (/ l Om)))
(t_2 (pow (/ l Om) 2.0))
(t_3 (* (* n t_2) (- U* U)))
(t_4 (* (* 2.0 n) U))
(t_5 (sqrt (* t_4 (+ (- t (* 2.0 (/ (* l l) Om))) t_3)))))
(if (<= t_5 5e-159)
(*
(sqrt (* 2.0 n))
(sqrt (* U (fma n (* t_2 (- U* U)) (fma t_1 -2.0 t)))))
(if (<= t_5 INFINITY)
(sqrt (* t_4 (+ (- t (* 2.0 t_1)) t_3)))
(*
(sqrt
(* U (* n (+ (/ (* n (- U* U)) (pow Om 2.0)) (* 2.0 (/ -1.0 Om))))))
(* l (sqrt 2.0)))))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = 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;
double t_5 = sqrt((t_4 * ((t - (2.0 * ((l * l) / Om))) + t_3)));
double tmp;
if (t_5 <= 5e-159) {
tmp = sqrt((2.0 * n)) * sqrt((U * fma(n, (t_2 * (U_42_ - U)), fma(t_1, -2.0, t))));
} else if (t_5 <= ((double) INFINITY)) {
tmp = sqrt((t_4 * ((t - (2.0 * t_1)) + t_3)));
} else {
tmp = sqrt((U * (n * (((n * (U_42_ - U)) / pow(Om, 2.0)) + (2.0 * (-1.0 / Om)))))) * (l * sqrt(2.0));
}
return tmp;
}
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(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(2.0 * n) * U) t_5 = sqrt(Float64(t_4 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_3))) tmp = 0.0 if (t_5 <= 5e-159) tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * fma(n, Float64(t_2 * Float64(U_42_ - U)), fma(t_1, -2.0, t))))); elseif (t_5 <= Inf) tmp = sqrt(Float64(t_4 * Float64(Float64(t - Float64(2.0 * t_1)) + t_3))); else tmp = Float64(sqrt(Float64(U * Float64(n * Float64(Float64(Float64(n * Float64(U_42_ - U)) / (Om ^ 2.0)) + Float64(2.0 * Float64(-1.0 / Om)))))) * Float64(l * sqrt(2.0))); end return tmp end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(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[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(t$95$4 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$5, 5e-159], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(n * N[(t$95$2 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * -2.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[Sqrt[N[(t$95$4 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(U * N[(n * N[(N[(N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(-1.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \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(2 \cdot n\right) \cdot U\\
t_5 := \sqrt{t_4 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_3\right)}\\
\mathbf{if}\;t_5 \leq 5 \cdot 10^{-159}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \mathsf{fma}\left(n, t_2 \cdot \left(U* - U\right), \mathsf{fma}\left(t_1, -2, t\right)\right)}\\
\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;\sqrt{t_4 \cdot \left(\left(t - 2 \cdot t_1\right) + t_3\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} + 2 \cdot \frac{-1}{Om}\right)\right)} \cdot \left(\ell \cdot \sqrt{2}\right)\\
\end{array}
\end{array}
if (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) < 5.00000000000000032e-159Initial program 8.3%
Simplified31.4%
pow1/231.4%
associate-*r*31.8%
unpow-prod-down35.3%
pow1/235.3%
pow1/235.3%
associate-*r/35.3%
pow235.3%
Applied egg-rr35.3%
*-commutative35.3%
*-commutative35.3%
Simplified35.3%
unpow235.3%
associate-*l/35.3%
Applied egg-rr35.3%
if 5.00000000000000032e-159 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) < +inf.0Initial program 67.9%
associate-*l/72.9%
Applied egg-rr72.9%
if +inf.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) Initial program 0.0%
Simplified15.8%
Taylor expanded in l around inf 29.7%
Final simplification62.7%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* l (/ l Om)))
(t_2 (* (* n (pow (/ l Om) 2.0)) (- U* U)))
(t_3 (* (* 2.0 n) U))
(t_4 (* t_3 (+ (- t (* 2.0 (/ (* l l) Om))) t_2))))
(if (<= t_4 0.0)
(sqrt (* 2.0 (* n (* U (+ t (* t_1 -2.0))))))
(if (<= t_4 INFINITY)
(sqrt (* t_3 (+ (- t (* 2.0 t_1)) t_2)))
(*
(sqrt
(* U (* n (+ (/ (* n (- U* U)) (pow Om 2.0)) (* 2.0 (/ -1.0 Om))))))
(* l (sqrt 2.0)))))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = l * (l / Om);
double t_2 = (n * pow((l / Om), 2.0)) * (U_42_ - U);
double t_3 = (2.0 * n) * U;
double t_4 = t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2);
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt((2.0 * (n * (U * (t + (t_1 * -2.0))))));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((t_3 * ((t - (2.0 * t_1)) + t_2)));
} else {
tmp = sqrt((U * (n * (((n * (U_42_ - U)) / pow(Om, 2.0)) + (2.0 * (-1.0 / Om)))))) * (l * sqrt(2.0));
}
return tmp;
}
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = l * (l / Om);
double t_2 = (n * Math.pow((l / Om), 2.0)) * (U_42_ - U);
double t_3 = (2.0 * n) * U;
double t_4 = t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2);
double tmp;
if (t_4 <= 0.0) {
tmp = Math.sqrt((2.0 * (n * (U * (t + (t_1 * -2.0))))));
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_3 * ((t - (2.0 * t_1)) + t_2)));
} else {
tmp = Math.sqrt((U * (n * (((n * (U_42_ - U)) / Math.pow(Om, 2.0)) + (2.0 * (-1.0 / Om)))))) * (l * Math.sqrt(2.0));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): t_1 = l * (l / Om) t_2 = (n * math.pow((l / Om), 2.0)) * (U_42_ - U) t_3 = (2.0 * n) * U t_4 = t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2) tmp = 0 if t_4 <= 0.0: tmp = math.sqrt((2.0 * (n * (U * (t + (t_1 * -2.0)))))) elif t_4 <= math.inf: tmp = math.sqrt((t_3 * ((t - (2.0 * t_1)) + t_2))) else: tmp = math.sqrt((U * (n * (((n * (U_42_ - U)) / math.pow(Om, 2.0)) + (2.0 * (-1.0 / Om)))))) * (l * math.sqrt(2.0)) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(l * Float64(l / Om)) t_2 = Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U_42_ - U)) t_3 = Float64(Float64(2.0 * n) * U) t_4 = Float64(t_3 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_2)) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(2.0 * Float64(n * Float64(U * Float64(t + Float64(t_1 * -2.0)))))); elseif (t_4 <= Inf) tmp = sqrt(Float64(t_3 * Float64(Float64(t - Float64(2.0 * t_1)) + t_2))); else tmp = Float64(sqrt(Float64(U * Float64(n * Float64(Float64(Float64(n * Float64(U_42_ - U)) / (Om ^ 2.0)) + Float64(2.0 * Float64(-1.0 / Om)))))) * Float64(l * sqrt(2.0))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = l * (l / Om); t_2 = (n * ((l / Om) ^ 2.0)) * (U_42_ - U); t_3 = (2.0 * n) * U; t_4 = t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2); tmp = 0.0; if (t_4 <= 0.0) tmp = sqrt((2.0 * (n * (U * (t + (t_1 * -2.0)))))); elseif (t_4 <= Inf) tmp = sqrt((t_3 * ((t - (2.0 * t_1)) + t_2))); else tmp = sqrt((U * (n * (((n * (U_42_ - U)) / (Om ^ 2.0)) + (2.0 * (-1.0 / Om)))))) * (l * sqrt(2.0)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(2.0 * N[(n * N[(U * N[(t + N[(t$95$1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(t$95$3 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(U * N[(n * N[(N[(N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(-1.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \ell \cdot \frac{\ell}{Om}\\
t_2 := \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\\
t_3 := \left(2 \cdot n\right) \cdot U\\
t_4 := t_3 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_2\right)\\
\mathbf{if}\;t_4 \leq 0:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot \left(t + t_1 \cdot -2\right)\right)\right)}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_3 \cdot \left(\left(t - 2 \cdot t_1\right) + t_2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} + 2 \cdot \frac{-1}{Om}\right)\right)} \cdot \left(\ell \cdot \sqrt{2}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < 0.0Initial program 5.0%
Simplified33.4%
Taylor expanded in n around 0 32.4%
unpow228.7%
associate-*l/28.7%
Applied egg-rr35.7%
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 67.8%
associate-*l/72.8%
Applied egg-rr72.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%
Simplified9.6%
Taylor expanded in l around inf 26.7%
Final simplification62.6%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* l (/ l Om)))
(t_2 (* (* n (pow (/ l Om) 2.0)) (- U* U)))
(t_3 (* (* 2.0 n) U))
(t_4 (* t_3 (+ (- t (* 2.0 (/ (* l l) Om))) t_2))))
(if (<= t_4 0.0)
(sqrt (* 2.0 (* n (* U (+ t (* t_1 -2.0))))))
(if (<= t_4 INFINITY)
(sqrt (* t_3 (+ (- t (* 2.0 t_1)) t_2)))
(*
(* l (sqrt 2.0))
(sqrt (* U (* n (- (/ n (/ (pow Om 2.0) (- U* U))) (/ 2.0 Om))))))))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = l * (l / Om);
double t_2 = (n * pow((l / Om), 2.0)) * (U_42_ - U);
double t_3 = (2.0 * n) * U;
double t_4 = t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2);
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt((2.0 * (n * (U * (t + (t_1 * -2.0))))));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((t_3 * ((t - (2.0 * t_1)) + t_2)));
} else {
tmp = (l * sqrt(2.0)) * sqrt((U * (n * ((n / (pow(Om, 2.0) / (U_42_ - U))) - (2.0 / Om)))));
}
return tmp;
}
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = l * (l / Om);
double t_2 = (n * Math.pow((l / Om), 2.0)) * (U_42_ - U);
double t_3 = (2.0 * n) * U;
double t_4 = t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2);
double tmp;
if (t_4 <= 0.0) {
tmp = Math.sqrt((2.0 * (n * (U * (t + (t_1 * -2.0))))));
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_3 * ((t - (2.0 * t_1)) + t_2)));
} else {
tmp = (l * Math.sqrt(2.0)) * Math.sqrt((U * (n * ((n / (Math.pow(Om, 2.0) / (U_42_ - U))) - (2.0 / Om)))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): t_1 = l * (l / Om) t_2 = (n * math.pow((l / Om), 2.0)) * (U_42_ - U) t_3 = (2.0 * n) * U t_4 = t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2) tmp = 0 if t_4 <= 0.0: tmp = math.sqrt((2.0 * (n * (U * (t + (t_1 * -2.0)))))) elif t_4 <= math.inf: tmp = math.sqrt((t_3 * ((t - (2.0 * t_1)) + t_2))) else: tmp = (l * math.sqrt(2.0)) * math.sqrt((U * (n * ((n / (math.pow(Om, 2.0) / (U_42_ - U))) - (2.0 / Om))))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(l * Float64(l / Om)) t_2 = Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U_42_ - U)) t_3 = Float64(Float64(2.0 * n) * U) t_4 = Float64(t_3 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_2)) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(2.0 * Float64(n * Float64(U * Float64(t + Float64(t_1 * -2.0)))))); elseif (t_4 <= Inf) tmp = sqrt(Float64(t_3 * Float64(Float64(t - Float64(2.0 * t_1)) + t_2))); else tmp = Float64(Float64(l * sqrt(2.0)) * sqrt(Float64(U * Float64(n * Float64(Float64(n / Float64((Om ^ 2.0) / Float64(U_42_ - U))) - Float64(2.0 / Om)))))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = l * (l / Om); t_2 = (n * ((l / Om) ^ 2.0)) * (U_42_ - U); t_3 = (2.0 * n) * U; t_4 = t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2); tmp = 0.0; if (t_4 <= 0.0) tmp = sqrt((2.0 * (n * (U * (t + (t_1 * -2.0)))))); elseif (t_4 <= Inf) tmp = sqrt((t_3 * ((t - (2.0 * t_1)) + t_2))); else tmp = (l * sqrt(2.0)) * sqrt((U * (n * ((n / ((Om ^ 2.0) / (U_42_ - U))) - (2.0 / Om))))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(2.0 * N[(n * N[(U * N[(t + N[(t$95$1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(t$95$3 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(U * N[(n * N[(N[(n / N[(N[Power[Om, 2.0], $MachinePrecision] / N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \ell \cdot \frac{\ell}{Om}\\
t_2 := \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\\
t_3 := \left(2 \cdot n\right) \cdot U\\
t_4 := t_3 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_2\right)\\
\mathbf{if}\;t_4 \leq 0:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot \left(t + t_1 \cdot -2\right)\right)\right)}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_3 \cdot \left(\left(t - 2 \cdot t_1\right) + t_2\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{U \cdot \left(n \cdot \left(\frac{n}{\frac{{Om}^{2}}{U* - U}} - \frac{2}{Om}\right)\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < 0.0Initial program 5.0%
Simplified33.4%
Taylor expanded in n around 0 32.4%
unpow228.7%
associate-*l/28.7%
Applied egg-rr35.7%
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 67.8%
associate-*l/72.8%
Applied egg-rr72.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%
Simplified9.6%
Taylor expanded in l around inf 26.7%
associate-/l*22.5%
associate-*r/22.5%
metadata-eval22.5%
Simplified22.5%
Final simplification62.1%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* l (/ l Om)))
(t_2 (* (* n (pow (/ l Om) 2.0)) (- U* U)))
(t_3 (* (* 2.0 n) U))
(t_4 (* t_3 (+ (- t (* 2.0 (/ (* l l) Om))) t_2))))
(if (<= t_4 0.0)
(sqrt (* 2.0 (* n (* U (+ t (* t_1 -2.0))))))
(if (<= t_4 INFINITY)
(sqrt (* t_3 (+ (- t (* 2.0 t_1)) t_2)))
(pow (* -4.0 (/ U (/ Om (* n (pow l 2.0))))) 0.5)))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = l * (l / Om);
double t_2 = (n * pow((l / Om), 2.0)) * (U_42_ - U);
double t_3 = (2.0 * n) * U;
double t_4 = t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2);
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt((2.0 * (n * (U * (t + (t_1 * -2.0))))));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((t_3 * ((t - (2.0 * t_1)) + t_2)));
} else {
tmp = pow((-4.0 * (U / (Om / (n * pow(l, 2.0))))), 0.5);
}
return tmp;
}
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = l * (l / Om);
double t_2 = (n * Math.pow((l / Om), 2.0)) * (U_42_ - U);
double t_3 = (2.0 * n) * U;
double t_4 = t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2);
double tmp;
if (t_4 <= 0.0) {
tmp = Math.sqrt((2.0 * (n * (U * (t + (t_1 * -2.0))))));
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_3 * ((t - (2.0 * t_1)) + t_2)));
} else {
tmp = Math.pow((-4.0 * (U / (Om / (n * Math.pow(l, 2.0))))), 0.5);
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): t_1 = l * (l / Om) t_2 = (n * math.pow((l / Om), 2.0)) * (U_42_ - U) t_3 = (2.0 * n) * U t_4 = t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2) tmp = 0 if t_4 <= 0.0: tmp = math.sqrt((2.0 * (n * (U * (t + (t_1 * -2.0)))))) elif t_4 <= math.inf: tmp = math.sqrt((t_3 * ((t - (2.0 * t_1)) + t_2))) else: tmp = math.pow((-4.0 * (U / (Om / (n * math.pow(l, 2.0))))), 0.5) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(l * Float64(l / Om)) t_2 = Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U_42_ - U)) t_3 = Float64(Float64(2.0 * n) * U) t_4 = Float64(t_3 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_2)) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(2.0 * Float64(n * Float64(U * Float64(t + Float64(t_1 * -2.0)))))); elseif (t_4 <= Inf) tmp = sqrt(Float64(t_3 * Float64(Float64(t - Float64(2.0 * t_1)) + t_2))); else tmp = Float64(-4.0 * Float64(U / Float64(Om / Float64(n * (l ^ 2.0))))) ^ 0.5; end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = l * (l / Om); t_2 = (n * ((l / Om) ^ 2.0)) * (U_42_ - U); t_3 = (2.0 * n) * U; t_4 = t_3 * ((t - (2.0 * ((l * l) / Om))) + t_2); tmp = 0.0; if (t_4 <= 0.0) tmp = sqrt((2.0 * (n * (U * (t + (t_1 * -2.0)))))); elseif (t_4 <= Inf) tmp = sqrt((t_3 * ((t - (2.0 * t_1)) + t_2))); else tmp = (-4.0 * (U / (Om / (n * (l ^ 2.0))))) ^ 0.5; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(2.0 * N[(n * N[(U * N[(t + N[(t$95$1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(t$95$3 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(-4.0 * N[(U / N[(Om / N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \ell \cdot \frac{\ell}{Om}\\
t_2 := \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\\
t_3 := \left(2 \cdot n\right) \cdot U\\
t_4 := t_3 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_2\right)\\
\mathbf{if}\;t_4 \leq 0:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot \left(t + t_1 \cdot -2\right)\right)\right)}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_3 \cdot \left(\left(t - 2 \cdot t_1\right) + t_2\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(-4 \cdot \frac{U}{\frac{Om}{n \cdot {\ell}^{2}}}\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 5.0%
Simplified33.4%
Taylor expanded in n around 0 32.4%
unpow228.7%
associate-*l/28.7%
Applied egg-rr35.7%
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 67.8%
associate-*l/72.8%
Applied egg-rr72.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%
Simplified9.6%
Taylor expanded in n around 0 2.3%
Taylor expanded in t around 0 11.8%
pow1/231.9%
associate-*r*31.9%
metadata-eval31.9%
associate-/l*31.9%
*-commutative31.9%
Applied egg-rr31.9%
Final simplification63.2%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(if (<= U -7.4e-37)
(pow (* 2.0 (* (* n U) (fma -2.0 (* l (/ l Om)) t))) 0.5)
(if (<= U 2.45e+76)
(sqrt
(*
(* 2.0 n)
(*
U
(+
(+ t (* -2.0 (/ l (/ Om l))))
(* n (* (pow (/ l Om) 2.0) (- U* U)))))))
(* (sqrt (* 2.0 U)) (sqrt (* n t))))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= -7.4e-37) {
tmp = pow((2.0 * ((n * U) * fma(-2.0, (l * (l / Om)), t))), 0.5);
} else if (U <= 2.45e+76) {
tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (pow((l / Om), 2.0) * (U_42_ - U)))))));
} else {
tmp = sqrt((2.0 * U)) * sqrt((n * t));
}
return tmp;
}
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= -7.4e-37) tmp = Float64(2.0 * Float64(Float64(n * U) * fma(-2.0, Float64(l * Float64(l / Om)), t))) ^ 0.5; elseif (U <= 2.45e+76) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(Float64(t + Float64(-2.0 * Float64(l / Float64(Om / l)))) + Float64(n * Float64((Float64(l / Om) ^ 2.0) * Float64(U_42_ - U))))))); else tmp = Float64(sqrt(Float64(2.0 * U)) * sqrt(Float64(n * t))); end return tmp end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, -7.4e-37], N[Power[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], If[LessEqual[U, 2.45e+76], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(t + N[(-2.0 * N[(l / N[(Om / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(2.0 * U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(n * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;U \leq -7.4 \cdot 10^{-37}:\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right)\right)\right)}^{0.5}\\
\mathbf{elif}\;U \leq 2.45 \cdot 10^{+76}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t + -2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) + n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U* - U\right)\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\
\end{array}
\end{array}
if U < -7.4e-37Initial program 66.6%
Simplified64.7%
Taylor expanded in n around 0 61.0%
pow1/263.2%
associate-*r*68.6%
+-commutative68.6%
fma-def68.6%
Applied egg-rr68.6%
unpow228.7%
associate-*l/28.7%
Applied egg-rr73.7%
if -7.4e-37 < U < 2.45000000000000013e76Initial program 44.8%
Simplified52.7%
if 2.45000000000000013e76 < U Initial program 59.2%
Simplified49.4%
Taylor expanded in l around 0 48.6%
pow1/248.6%
associate-*r*48.6%
unpow-prod-down70.1%
pow1/270.1%
Applied egg-rr70.1%
unpow1/270.1%
Simplified70.1%
Final simplification59.9%
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* l (/ l Om))))
(if (<= t -2.5e+35)
(sqrt (* 2.0 (* n (* U (+ t (* t_1 -2.0))))))
(pow (* 2.0 (* (* n U) (fma -2.0 t_1 t))) 0.5))))l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = l * (l / Om);
double tmp;
if (t <= -2.5e+35) {
tmp = sqrt((2.0 * (n * (U * (t + (t_1 * -2.0))))));
} else {
tmp = pow((2.0 * ((n * U) * fma(-2.0, t_1, t))), 0.5);
}
return tmp;
}
l = abs(l) function code(n, U, t, l, Om, U_42_) t_1 = Float64(l * Float64(l / Om)) tmp = 0.0 if (t <= -2.5e+35) tmp = sqrt(Float64(2.0 * Float64(n * Float64(U * Float64(t + Float64(t_1 * -2.0)))))); else tmp = Float64(2.0 * Float64(Float64(n * U) * fma(-2.0, t_1, t))) ^ 0.5; end return tmp end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.5e+35], N[Sqrt[N[(2.0 * N[(n * N[(U * N[(t + N[(t$95$1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(-2.0 * t$95$1 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \ell \cdot \frac{\ell}{Om}\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{+35}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot \left(t + t_1 \cdot -2\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \mathsf{fma}\left(-2, t_1, t\right)\right)\right)}^{0.5}\\
\end{array}
\end{array}
if t < -2.50000000000000011e35Initial program 40.4%
Simplified52.8%
Taylor expanded in n around 0 45.6%
unpow232.3%
associate-*l/34.1%
Applied egg-rr53.0%
if -2.50000000000000011e35 < t Initial program 54.8%
Simplified55.3%
Taylor expanded in n around 0 43.3%
pow1/246.4%
associate-*r*51.2%
+-commutative51.2%
fma-def51.2%
Applied egg-rr51.2%
unpow226.2%
associate-*l/28.1%
Applied egg-rr55.6%
Final simplification55.0%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= U 3.5e+75) (sqrt (* 2.0 (* n (* U (+ t (* (* l (/ l Om)) -2.0)))))) (* (sqrt (* 2.0 U)) (sqrt (* n t)))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 3.5e+75) {
tmp = sqrt((2.0 * (n * (U * (t + ((l * (l / Om)) * -2.0))))));
} else {
tmp = sqrt((2.0 * U)) * sqrt((n * t));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (u <= 3.5d+75) then
tmp = sqrt((2.0d0 * (n * (u * (t + ((l * (l / om)) * (-2.0d0)))))))
else
tmp = sqrt((2.0d0 * u)) * sqrt((n * t))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 3.5e+75) {
tmp = Math.sqrt((2.0 * (n * (U * (t + ((l * (l / Om)) * -2.0))))));
} else {
tmp = Math.sqrt((2.0 * U)) * Math.sqrt((n * t));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if U <= 3.5e+75: tmp = math.sqrt((2.0 * (n * (U * (t + ((l * (l / Om)) * -2.0)))))) else: tmp = math.sqrt((2.0 * U)) * math.sqrt((n * t)) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= 3.5e+75) tmp = sqrt(Float64(2.0 * Float64(n * Float64(U * Float64(t + Float64(Float64(l * Float64(l / Om)) * -2.0)))))); else tmp = Float64(sqrt(Float64(2.0 * U)) * sqrt(Float64(n * t))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U <= 3.5e+75) tmp = sqrt((2.0 * (n * (U * (t + ((l * (l / Om)) * -2.0)))))); else tmp = sqrt((2.0 * U)) * sqrt((n * t)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, 3.5e+75], N[Sqrt[N[(2.0 * N[(n * N[(U * N[(t + N[(N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]), $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}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;U \leq 3.5 \cdot 10^{+75}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot \left(t + \left(\ell \cdot \frac{\ell}{Om}\right) \cdot -2\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\
\end{array}
\end{array}
if U < 3.4999999999999998e75Initial program 50.4%
Simplified55.7%
Taylor expanded in n around 0 42.7%
unpow226.8%
associate-*l/29.0%
Applied egg-rr48.4%
if 3.4999999999999998e75 < U Initial program 59.2%
Simplified49.4%
Taylor expanded in l around 0 48.6%
pow1/248.6%
associate-*r*48.6%
unpow-prod-down70.1%
pow1/270.1%
Applied egg-rr70.1%
unpow1/270.1%
Simplified70.1%
Final simplification51.7%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2.0 (* n (* U (+ t (* (* l (/ l Om)) -2.0)))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((2.0 * (n * (U * (t + ((l * (l / Om)) * -2.0))))));
}
NOTE: l should be positive before calling this function
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((2.0d0 * (n * (u * (t + ((l * (l / om)) * (-2.0d0)))))))
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((2.0 * (n * (U * (t + ((l * (l / Om)) * -2.0))))));
}
l = abs(l) def code(n, U, t, l, Om, U_42_): return math.sqrt((2.0 * (n * (U * (t + ((l * (l / Om)) * -2.0))))))
l = abs(l) function code(n, U, t, l, Om, U_42_) return sqrt(Float64(2.0 * Float64(n * Float64(U * Float64(t + Float64(Float64(l * Float64(l / Om)) * -2.0)))))) end
l = abs(l) function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((2.0 * (n * (U * (t + ((l * (l / Om)) * -2.0)))))); end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[(n * N[(U * N[(t + N[(N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\sqrt{2 \cdot \left(n \cdot \left(U \cdot \left(t + \left(\ell \cdot \frac{\ell}{Om}\right) \cdot -2\right)\right)\right)}
\end{array}
Initial program 51.8%
Simplified54.8%
Taylor expanded in n around 0 43.7%
unpow227.5%
associate-*l/29.3%
Applied egg-rr48.6%
Final simplification48.6%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= U* 6e-55) (sqrt (* (* (* 2.0 n) U) t)) (pow (* 2.0 (* U (* n t))) 0.5)))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U_42_ <= 6e-55) {
tmp = sqrt((((2.0 * n) * U) * t));
} else {
tmp = pow((2.0 * (U * (n * t))), 0.5);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (u_42 <= 6d-55) then
tmp = sqrt((((2.0d0 * n) * u) * t))
else
tmp = (2.0d0 * (u * (n * t))) ** 0.5d0
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U_42_ <= 6e-55) {
tmp = Math.sqrt((((2.0 * n) * U) * t));
} else {
tmp = Math.pow((2.0 * (U * (n * t))), 0.5);
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if U_42_ <= 6e-55: tmp = math.sqrt((((2.0 * n) * U) * t)) else: tmp = math.pow((2.0 * (U * (n * t))), 0.5) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U_42_ <= 6e-55) tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * t)); else tmp = Float64(2.0 * Float64(U * Float64(n * t))) ^ 0.5; end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U_42_ <= 6e-55) tmp = sqrt((((2.0 * n) * U) * t)); else tmp = (2.0 * (U * (n * t))) ^ 0.5; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U$42$, 6e-55], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], N[Power[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;U* \leq 6 \cdot 10^{-55}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.5}\\
\end{array}
\end{array}
if U* < 6.00000000000000033e-55Initial program 51.2%
associate-*l/56.3%
Applied egg-rr56.3%
Taylor expanded in t around inf 36.2%
associate-*r*41.7%
*-commutative41.7%
associate-*r*39.8%
associate-*r*39.9%
*-commutative39.9%
Simplified39.9%
expm1-log1p-u38.8%
expm1-udef21.2%
*-commutative21.2%
Applied egg-rr21.2%
expm1-def38.8%
expm1-log1p39.9%
associate-*r*41.7%
*-commutative41.7%
*-commutative41.7%
*-commutative41.7%
Simplified41.7%
if 6.00000000000000033e-55 < U* Initial program 53.0%
Simplified55.3%
Taylor expanded in n around 0 37.1%
pow1/240.8%
associate-*r*41.7%
+-commutative41.7%
fma-def41.7%
Applied egg-rr41.7%
Taylor expanded in l around 0 35.2%
Final simplification39.6%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= n 6.8e-226) (sqrt (* 2.0 (* n (* U t)))) (sqrt (* 2.0 (* U (* n t))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= 6.8e-226) {
tmp = sqrt((2.0 * (n * (U * t))));
} else {
tmp = sqrt((2.0 * (U * (n * t))));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (n <= 6.8d-226) then
tmp = sqrt((2.0d0 * (n * (u * t))))
else
tmp = sqrt((2.0d0 * (u * (n * t))))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= 6.8e-226) {
tmp = Math.sqrt((2.0 * (n * (U * t))));
} else {
tmp = Math.sqrt((2.0 * (U * (n * t))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if n <= 6.8e-226: tmp = math.sqrt((2.0 * (n * (U * t)))) else: tmp = math.sqrt((2.0 * (U * (n * t)))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= 6.8e-226) tmp = sqrt(Float64(2.0 * Float64(n * Float64(U * t)))); else tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t)))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (n <= 6.8e-226) tmp = sqrt((2.0 * (n * (U * t)))); else tmp = sqrt((2.0 * (U * (n * t)))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, 6.8e-226], N[Sqrt[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;n \leq 6.8 \cdot 10^{-226}:\\
\;\;\;\;\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 n < 6.80000000000000014e-226Initial program 50.5%
Simplified55.0%
Taylor expanded in l around 0 37.5%
if 6.80000000000000014e-226 < n Initial program 54.2%
Simplified54.4%
Taylor expanded in l around 0 39.8%
Final simplification38.3%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= t -6e+35) (sqrt (* 2.0 (* n (* U t)))) (sqrt (* 2.0 (* t (* n U))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= -6e+35) {
tmp = sqrt((2.0 * (n * (U * t))));
} else {
tmp = sqrt((2.0 * (t * (n * U))));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (t <= (-6d+35)) then
tmp = sqrt((2.0d0 * (n * (u * t))))
else
tmp = sqrt((2.0d0 * (t * (n * u))))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= -6e+35) {
tmp = Math.sqrt((2.0 * (n * (U * t))));
} else {
tmp = Math.sqrt((2.0 * (t * (n * U))));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if t <= -6e+35: tmp = math.sqrt((2.0 * (n * (U * t)))) else: tmp = math.sqrt((2.0 * (t * (n * U)))) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= -6e+35) tmp = sqrt(Float64(2.0 * Float64(n * Float64(U * t)))); else tmp = sqrt(Float64(2.0 * Float64(t * Float64(n * U)))); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (t <= -6e+35) tmp = sqrt((2.0 * (n * (U * t)))); else tmp = sqrt((2.0 * (t * (n * U)))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, -6e+35], N[Sqrt[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{+35}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(t \cdot \left(n \cdot U\right)\right)}\\
\end{array}
\end{array}
if t < -5.99999999999999981e35Initial program 40.4%
Simplified52.8%
Taylor expanded in l around 0 46.8%
if -5.99999999999999981e35 < t Initial program 54.8%
Simplified55.3%
Taylor expanded in l around 0 33.0%
associate-*r*37.6%
*-commutative37.6%
Simplified37.6%
Final simplification39.5%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (if (<= t -5e+37) (sqrt (* 2.0 (* n (* U t)))) (sqrt (* (* (* 2.0 n) U) t))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= -5e+37) {
tmp = sqrt((2.0 * (n * (U * t))));
} else {
tmp = sqrt((((2.0 * n) * U) * t));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (t <= (-5d+37)) then
tmp = sqrt((2.0d0 * (n * (u * t))))
else
tmp = sqrt((((2.0d0 * n) * u) * t))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= -5e+37) {
tmp = Math.sqrt((2.0 * (n * (U * t))));
} else {
tmp = Math.sqrt((((2.0 * n) * U) * t));
}
return tmp;
}
l = abs(l) def code(n, U, t, l, Om, U_42_): tmp = 0 if t <= -5e+37: tmp = math.sqrt((2.0 * (n * (U * t)))) else: tmp = math.sqrt((((2.0 * n) * U) * t)) return tmp
l = abs(l) function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= -5e+37) tmp = sqrt(Float64(2.0 * Float64(n * Float64(U * t)))); else tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * t)); end return tmp end
l = abs(l) function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (t <= -5e+37) tmp = sqrt((2.0 * (n * (U * t)))); else tmp = sqrt((((2.0 * n) * U) * t)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, -5e+37], N[Sqrt[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+37}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\
\end{array}
\end{array}
if t < -4.99999999999999989e37Initial program 40.4%
Simplified52.8%
Taylor expanded in l around 0 46.8%
if -4.99999999999999989e37 < t Initial program 54.8%
associate-*l/59.1%
Applied egg-rr59.1%
Taylor expanded in t around inf 33.0%
associate-*r*37.6%
*-commutative37.6%
associate-*r*33.9%
associate-*r*33.9%
*-commutative33.9%
Simplified33.9%
expm1-log1p-u33.1%
expm1-udef18.1%
*-commutative18.1%
Applied egg-rr18.1%
expm1-def33.1%
expm1-log1p33.9%
associate-*r*37.6%
*-commutative37.6%
*-commutative37.6%
*-commutative37.6%
Simplified37.6%
Final simplification39.5%
NOTE: l should be positive before calling this function (FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2.0 (* U (* n t)))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((2.0 * (U * (n * t))));
}
NOTE: l should be positive before calling this function
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((2.0d0 * (u * (n * t))))
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((2.0 * (U * (n * t))));
}
l = abs(l) def code(n, U, t, l, Om, U_42_): return math.sqrt((2.0 * (U * (n * t))))
l = abs(l) function code(n, U, t, l, Om, U_42_) return sqrt(Float64(2.0 * Float64(U * Float64(n * t)))) end
l = abs(l) function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((2.0 * (U * (n * t)))); end
NOTE: l should be positive before calling this function code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}
\end{array}
Initial program 51.8%
Simplified54.8%
Taylor expanded in l around 0 35.5%
Final simplification35.5%
herbie shell --seed 2023309
(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*))))))