
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}
\end{array}
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* n (pow (/ l Om) 2.0)))
(t_2
(* (* (* 2.0 n) U) (+ (- t (* 2.0 (/ (* l l) Om))) (* t_1 (- U* U)))))
(t_3 (* n (- U U*))))
(if (<= t_2 0.0)
(sqrt
(*
(* 2.0 n)
(* U (+ t (/ (- (* (pow l 2.0) -2.0) (/ (* (pow l 2.0) t_3) Om)) Om)))))
(if (<= t_2 INFINITY)
(sqrt
(* (* 2.0 (* n U)) (- t (+ (* t_1 (- U U*)) (* 2.0 (* l (/ l Om)))))))
(sqrt
(* -2.0 (/ (* U (* (pow l 2.0) (* n (+ 2.0 (/ t_3 Om))))) Om)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = n * pow((l / Om), 2.0);
double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + (t_1 * (U_42_ - U)));
double t_3 = n * (U - U_42_);
double tmp;
if (t_2 <= 0.0) {
tmp = sqrt(((2.0 * n) * (U * (t + (((pow(l, 2.0) * -2.0) - ((pow(l, 2.0) * t_3) / Om)) / Om)))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l * (l / Om)))))));
} else {
tmp = sqrt((-2.0 * ((U * (pow(l, 2.0) * (n * (2.0 + (t_3 / Om))))) / Om)));
}
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);
double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + (t_1 * (U_42_ - U)));
double t_3 = n * (U - U_42_);
double tmp;
if (t_2 <= 0.0) {
tmp = Math.sqrt(((2.0 * n) * (U * (t + (((Math.pow(l, 2.0) * -2.0) - ((Math.pow(l, 2.0) * t_3) / Om)) / Om)))));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l * (l / Om)))))));
} else {
tmp = Math.sqrt((-2.0 * ((U * (Math.pow(l, 2.0) * (n * (2.0 + (t_3 / Om))))) / Om)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = n * math.pow((l / Om), 2.0) t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + (t_1 * (U_42_ - U))) t_3 = n * (U - U_42_) tmp = 0 if t_2 <= 0.0: tmp = math.sqrt(((2.0 * n) * (U * (t + (((math.pow(l, 2.0) * -2.0) - ((math.pow(l, 2.0) * t_3) / Om)) / Om))))) elif t_2 <= math.inf: tmp = math.sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l * (l / Om))))))) else: tmp = math.sqrt((-2.0 * ((U * (math.pow(l, 2.0) * (n * (2.0 + (t_3 / Om))))) / Om))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(n * (Float64(l / Om) ^ 2.0)) t_2 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + Float64(t_1 * Float64(U_42_ - U)))) t_3 = Float64(n * Float64(U - U_42_)) tmp = 0.0 if (t_2 <= 0.0) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(Float64(Float64((l ^ 2.0) * -2.0) - Float64(Float64((l ^ 2.0) * t_3) / Om)) / Om))))); elseif (t_2 <= Inf) tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t - Float64(Float64(t_1 * Float64(U - U_42_)) + Float64(2.0 * Float64(l * Float64(l / Om))))))); else tmp = sqrt(Float64(-2.0 * Float64(Float64(U * Float64((l ^ 2.0) * Float64(n * Float64(2.0 + Float64(t_3 / Om))))) / Om))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = n * ((l / Om) ^ 2.0); t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + (t_1 * (U_42_ - U))); t_3 = n * (U - U_42_); tmp = 0.0; if (t_2 <= 0.0) tmp = sqrt(((2.0 * n) * (U * (t + ((((l ^ 2.0) * -2.0) - (((l ^ 2.0) * t_3) / Om)) / Om))))); elseif (t_2 <= Inf) tmp = sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l * (l / Om))))))); else tmp = sqrt((-2.0 * ((U * ((l ^ 2.0) * (n * (2.0 + (t_3 / Om))))) / Om))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $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] + N[(t$95$1 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(N[(N[(N[Power[l, 2.0], $MachinePrecision] * -2.0), $MachinePrecision] - N[(N[(N[Power[l, 2.0], $MachinePrecision] * t$95$3), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t - N[(N[(t$95$1 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(-2.0 * N[(N[(U * N[(N[Power[l, 2.0], $MachinePrecision] * N[(n * N[(2.0 + N[(t$95$3 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\\
t_2 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t\_1 \cdot \left(U* - U\right)\right)\\
t_3 := n \cdot \left(U - U*\right)\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{{\ell}^{2} \cdot -2 - \frac{{\ell}^{2} \cdot t\_3}{Om}}{Om}\right)\right)}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \left(t\_1 \cdot \left(U - U*\right) + 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(n \cdot \left(2 + \frac{t\_3}{Om}\right)\right)\right)}{Om}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 16.2%
Simplified36.4%
Taylor expanded in Om around -inf 42.2%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 66.5%
Simplified74.0%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Simplified7.8%
Taylor expanded in Om around -inf 10.0%
Taylor expanded in l around inf 46.1%
Final simplification65.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* n (pow (/ l Om) 2.0)))
(t_2 (- t (* 2.0 (/ (* l l) Om))))
(t_3 (* (* (* 2.0 n) U) (+ t_2 (* t_1 (- U* U))))))
(if (<= t_3 0.0)
(sqrt (* (* 2.0 n) (* U t_2)))
(if (<= t_3 INFINITY)
(sqrt
(* (* 2.0 (* n U)) (- t (+ (* t_1 (- U U*)) (* 2.0 (* l (/ l Om)))))))
(sqrt
(*
-2.0
(/ (* U (* (pow l 2.0) (* n (+ 2.0 (/ (* n (- U U*)) Om))))) Om)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = n * pow((l / Om), 2.0);
double t_2 = t - (2.0 * ((l * l) / Om));
double t_3 = ((2.0 * n) * U) * (t_2 + (t_1 * (U_42_ - U)));
double tmp;
if (t_3 <= 0.0) {
tmp = sqrt(((2.0 * n) * (U * t_2)));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l * (l / Om)))))));
} else {
tmp = sqrt((-2.0 * ((U * (pow(l, 2.0) * (n * (2.0 + ((n * (U - U_42_)) / Om))))) / Om)));
}
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);
double t_2 = t - (2.0 * ((l * l) / Om));
double t_3 = ((2.0 * n) * U) * (t_2 + (t_1 * (U_42_ - U)));
double tmp;
if (t_3 <= 0.0) {
tmp = Math.sqrt(((2.0 * n) * (U * t_2)));
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l * (l / Om)))))));
} else {
tmp = Math.sqrt((-2.0 * ((U * (Math.pow(l, 2.0) * (n * (2.0 + ((n * (U - U_42_)) / Om))))) / Om)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = n * math.pow((l / Om), 2.0) t_2 = t - (2.0 * ((l * l) / Om)) t_3 = ((2.0 * n) * U) * (t_2 + (t_1 * (U_42_ - U))) tmp = 0 if t_3 <= 0.0: tmp = math.sqrt(((2.0 * n) * (U * t_2))) elif t_3 <= math.inf: tmp = math.sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l * (l / Om))))))) else: tmp = math.sqrt((-2.0 * ((U * (math.pow(l, 2.0) * (n * (2.0 + ((n * (U - U_42_)) / Om))))) / Om))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(n * (Float64(l / Om) ^ 2.0)) t_2 = Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) t_3 = Float64(Float64(Float64(2.0 * n) * U) * Float64(t_2 + Float64(t_1 * Float64(U_42_ - U)))) tmp = 0.0 if (t_3 <= 0.0) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * t_2))); elseif (t_3 <= Inf) tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t - Float64(Float64(t_1 * Float64(U - U_42_)) + Float64(2.0 * Float64(l * Float64(l / Om))))))); else tmp = sqrt(Float64(-2.0 * Float64(Float64(U * Float64((l ^ 2.0) * Float64(n * Float64(2.0 + Float64(Float64(n * Float64(U - U_42_)) / Om))))) / Om))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = n * ((l / Om) ^ 2.0); t_2 = t - (2.0 * ((l * l) / Om)); t_3 = ((2.0 * n) * U) * (t_2 + (t_1 * (U_42_ - U))); tmp = 0.0; if (t_3 <= 0.0) tmp = sqrt(((2.0 * n) * (U * t_2))); elseif (t_3 <= Inf) tmp = sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l * (l / Om))))))); else tmp = sqrt((-2.0 * ((U * ((l ^ 2.0) * (n * (2.0 + ((n * (U - U_42_)) / Om))))) / Om))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(t$95$2 + N[(t$95$1 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t - N[(N[(t$95$1 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(-2.0 * N[(N[(U * N[(N[Power[l, 2.0], $MachinePrecision] * N[(n * N[(2.0 + N[(N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\\
t_2 := t - 2 \cdot \frac{\ell \cdot \ell}{Om}\\
t_3 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t\_2 + t\_1 \cdot \left(U* - U\right)\right)\\
\mathbf{if}\;t\_3 \leq 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\_2\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \left(t\_1 \cdot \left(U - U*\right) + 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(n \cdot \left(2 + \frac{n \cdot \left(U - U*\right)}{Om}\right)\right)\right)}{Om}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 16.2%
Simplified36.4%
Taylor expanded in n around 0 39.3%
unpow239.3%
Applied egg-rr39.3%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 66.5%
Simplified74.0%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Simplified7.8%
Taylor expanded in Om around -inf 10.0%
Taylor expanded in l around inf 46.1%
Final simplification64.7%
(FPCore (n U t l Om U*) :precision binary64 (if (or (<= n -1.15e-171) (not (<= n 7.8e-166))) (pow (* (* (* 2.0 n) U) (+ t (* -2.0 (/ (pow l 2.0) Om)))) 0.5) (sqrt (+ (* -4.0 (/ (* U (* n (pow l 2.0))) Om)) (* 2.0 (* U (* n t)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if ((n <= -1.15e-171) || !(n <= 7.8e-166)) {
tmp = pow((((2.0 * n) * U) * (t + (-2.0 * (pow(l, 2.0) / Om)))), 0.5);
} else {
tmp = sqrt(((-4.0 * ((U * (n * pow(l, 2.0))) / Om)) + (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 ((n <= (-1.15d-171)) .or. (.not. (n <= 7.8d-166))) then
tmp = (((2.0d0 * n) * u) * (t + ((-2.0d0) * ((l ** 2.0d0) / om)))) ** 0.5d0
else
tmp = sqrt((((-4.0d0) * ((u * (n * (l ** 2.0d0))) / om)) + (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 ((n <= -1.15e-171) || !(n <= 7.8e-166)) {
tmp = Math.pow((((2.0 * n) * U) * (t + (-2.0 * (Math.pow(l, 2.0) / Om)))), 0.5);
} else {
tmp = Math.sqrt(((-4.0 * ((U * (n * Math.pow(l, 2.0))) / Om)) + (2.0 * (U * (n * t)))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if (n <= -1.15e-171) or not (n <= 7.8e-166): tmp = math.pow((((2.0 * n) * U) * (t + (-2.0 * (math.pow(l, 2.0) / Om)))), 0.5) else: tmp = math.sqrt(((-4.0 * ((U * (n * math.pow(l, 2.0))) / Om)) + (2.0 * (U * (n * t))))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if ((n <= -1.15e-171) || !(n <= 7.8e-166)) tmp = Float64(Float64(Float64(2.0 * n) * U) * Float64(t + Float64(-2.0 * Float64((l ^ 2.0) / Om)))) ^ 0.5; else tmp = sqrt(Float64(Float64(-4.0 * Float64(Float64(U * Float64(n * (l ^ 2.0))) / Om)) + Float64(2.0 * Float64(U * Float64(n * t))))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if ((n <= -1.15e-171) || ~((n <= 7.8e-166))) tmp = (((2.0 * n) * U) * (t + (-2.0 * ((l ^ 2.0) / Om)))) ^ 0.5; else tmp = sqrt(((-4.0 * ((U * (n * (l ^ 2.0))) / Om)) + (2.0 * (U * (n * t))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[Or[LessEqual[n, -1.15e-171], N[Not[LessEqual[n, 7.8e-166]], $MachinePrecision]], N[Power[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(t + N[(-2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Sqrt[N[(N[(-4.0 * N[(N[(U * N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.15 \cdot 10^{-171} \lor \neg \left(n \leq 7.8 \cdot 10^{-166}\right):\\
\;\;\;\;{\left(\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{-4 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om} + 2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\
\end{array}
\end{array}
if n < -1.14999999999999989e-171 or 7.79999999999999998e-166 < n Initial program 49.7%
Simplified55.6%
Taylor expanded in n around 0 40.0%
pow1/248.5%
associate-*r*50.6%
cancel-sign-sub-inv50.6%
metadata-eval50.6%
Applied egg-rr50.6%
if -1.14999999999999989e-171 < n < 7.79999999999999998e-166Initial program 45.9%
Simplified47.4%
Taylor expanded in Om around inf 57.2%
Final simplification52.4%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= l 1.15e-56)
(pow (pow (* 2.0 (* t (* n U))) 0.25) 2.0)
(if (<= l 2.35e+169)
(sqrt (* 2.0 (* U (* n (- t (* (pow l 2.0) (/ 2.0 Om)))))))
(/ (* l (* (sqrt 2.0) (* n (sqrt (* U U*))))) Om))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.15e-56) {
tmp = pow(pow((2.0 * (t * (n * U))), 0.25), 2.0);
} else if (l <= 2.35e+169) {
tmp = sqrt((2.0 * (U * (n * (t - (pow(l, 2.0) * (2.0 / Om)))))));
} else {
tmp = (l * (sqrt(2.0) * (n * sqrt((U * U_42_))))) / Om;
}
return tmp;
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (l <= 1.15d-56) then
tmp = ((2.0d0 * (t * (n * u))) ** 0.25d0) ** 2.0d0
else if (l <= 2.35d+169) then
tmp = sqrt((2.0d0 * (u * (n * (t - ((l ** 2.0d0) * (2.0d0 / om)))))))
else
tmp = (l * (sqrt(2.0d0) * (n * sqrt((u * u_42))))) / om
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.15e-56) {
tmp = Math.pow(Math.pow((2.0 * (t * (n * U))), 0.25), 2.0);
} else if (l <= 2.35e+169) {
tmp = Math.sqrt((2.0 * (U * (n * (t - (Math.pow(l, 2.0) * (2.0 / Om)))))));
} else {
tmp = (l * (Math.sqrt(2.0) * (n * Math.sqrt((U * U_42_))))) / Om;
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 1.15e-56: tmp = math.pow(math.pow((2.0 * (t * (n * U))), 0.25), 2.0) elif l <= 2.35e+169: tmp = math.sqrt((2.0 * (U * (n * (t - (math.pow(l, 2.0) * (2.0 / Om))))))) else: tmp = (l * (math.sqrt(2.0) * (n * math.sqrt((U * U_42_))))) / Om return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 1.15e-56) tmp = (Float64(2.0 * Float64(t * Float64(n * U))) ^ 0.25) ^ 2.0; elseif (l <= 2.35e+169) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64((l ^ 2.0) * Float64(2.0 / Om))))))); else tmp = Float64(Float64(l * Float64(sqrt(2.0) * Float64(n * sqrt(Float64(U * U_42_))))) / Om); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 1.15e-56) tmp = ((2.0 * (t * (n * U))) ^ 0.25) ^ 2.0; elseif (l <= 2.35e+169) tmp = sqrt((2.0 * (U * (n * (t - ((l ^ 2.0) * (2.0 / Om))))))); else tmp = (l * (sqrt(2.0) * (n * sqrt((U * U_42_))))) / Om; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 1.15e-56], N[Power[N[Power[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[l, 2.35e+169], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(N[Power[l, 2.0], $MachinePrecision] * N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[(n * N[Sqrt[N[(U * U$42$), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.15 \cdot 10^{-56}:\\
\;\;\;\;{\left({\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.25}\right)}^{2}\\
\mathbf{elif}\;\ell \leq 2.35 \cdot 10^{+169}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - {\ell}^{2} \cdot \frac{2}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \left(\sqrt{2} \cdot \left(n \cdot \sqrt{U \cdot U*}\right)\right)}{Om}\\
\end{array}
\end{array}
if l < 1.15000000000000001e-56Initial program 57.5%
Simplified57.0%
Taylor expanded in t around inf 42.5%
add-sqr-sqrt42.3%
pow242.3%
associate-*r*42.4%
Applied egg-rr42.4%
add-cbrt-cube42.1%
pow1/339.8%
add-sqr-sqrt39.8%
pow139.8%
pow1/239.8%
pow-prod-up39.8%
metadata-eval39.8%
Applied egg-rr39.8%
*-un-lft-identity39.8%
pow-pow42.4%
sqrt-pow244.6%
associate-*l*44.6%
metadata-eval44.6%
metadata-eval44.6%
Applied egg-rr44.6%
*-lft-identity44.6%
associate-*r*46.8%
Simplified46.8%
if 1.15000000000000001e-56 < l < 2.3499999999999999e169Initial program 41.6%
Simplified45.7%
associate-*r*45.7%
fma-define45.7%
associate-*r*49.9%
Applied egg-rr49.9%
Taylor expanded in n around 0 35.5%
associate-*r/35.5%
associate-*l/35.5%
Simplified35.5%
if 2.3499999999999999e169 < l Initial program 2.2%
Simplified34.2%
Taylor expanded in U* around inf 8.6%
associate-*l/8.7%
Simplified8.7%
pow18.7%
associate-*l*9.0%
*-commutative9.0%
Applied egg-rr9.0%
unpow19.0%
associate-*l*9.0%
Simplified9.0%
Final simplification40.6%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= l 3.3e-56)
(pow (pow (* 2.0 (* t (* n U))) 0.25) 2.0)
(if (<= l 1.4e+169)
(sqrt (* 2.0 (* U (* n (- t (* 2.0 (/ (pow l 2.0) Om)))))))
(/ (* l (* (sqrt 2.0) (* n (sqrt (* U U*))))) Om))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 3.3e-56) {
tmp = pow(pow((2.0 * (t * (n * U))), 0.25), 2.0);
} else if (l <= 1.4e+169) {
tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (pow(l, 2.0) / Om)))))));
} else {
tmp = (l * (sqrt(2.0) * (n * sqrt((U * U_42_))))) / Om;
}
return tmp;
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (l <= 3.3d-56) then
tmp = ((2.0d0 * (t * (n * u))) ** 0.25d0) ** 2.0d0
else if (l <= 1.4d+169) then
tmp = sqrt((2.0d0 * (u * (n * (t - (2.0d0 * ((l ** 2.0d0) / om)))))))
else
tmp = (l * (sqrt(2.0d0) * (n * sqrt((u * u_42))))) / om
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 3.3e-56) {
tmp = Math.pow(Math.pow((2.0 * (t * (n * U))), 0.25), 2.0);
} else if (l <= 1.4e+169) {
tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * (Math.pow(l, 2.0) / Om)))))));
} else {
tmp = (l * (Math.sqrt(2.0) * (n * Math.sqrt((U * U_42_))))) / Om;
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 3.3e-56: tmp = math.pow(math.pow((2.0 * (t * (n * U))), 0.25), 2.0) elif l <= 1.4e+169: tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * (math.pow(l, 2.0) / Om))))))) else: tmp = (l * (math.sqrt(2.0) * (n * math.sqrt((U * U_42_))))) / Om return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 3.3e-56) tmp = (Float64(2.0 * Float64(t * Float64(n * U))) ^ 0.25) ^ 2.0; elseif (l <= 1.4e+169) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64((l ^ 2.0) / Om))))))); else tmp = Float64(Float64(l * Float64(sqrt(2.0) * Float64(n * sqrt(Float64(U * U_42_))))) / Om); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 3.3e-56) tmp = ((2.0 * (t * (n * U))) ^ 0.25) ^ 2.0; elseif (l <= 1.4e+169) tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l ^ 2.0) / Om))))))); else tmp = (l * (sqrt(2.0) * (n * sqrt((U * U_42_))))) / Om; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 3.3e-56], N[Power[N[Power[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[l, 1.4e+169], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[(n * N[Sqrt[N[(U * U$42$), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.3 \cdot 10^{-56}:\\
\;\;\;\;{\left({\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.25}\right)}^{2}\\
\mathbf{elif}\;\ell \leq 1.4 \cdot 10^{+169}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \left(\sqrt{2} \cdot \left(n \cdot \sqrt{U \cdot U*}\right)\right)}{Om}\\
\end{array}
\end{array}
if l < 3.29999999999999984e-56Initial program 57.5%
Simplified57.0%
Taylor expanded in t around inf 42.5%
add-sqr-sqrt42.3%
pow242.3%
associate-*r*42.4%
Applied egg-rr42.4%
add-cbrt-cube42.1%
pow1/339.8%
add-sqr-sqrt39.8%
pow139.8%
pow1/239.8%
pow-prod-up39.8%
metadata-eval39.8%
Applied egg-rr39.8%
*-un-lft-identity39.8%
pow-pow42.4%
sqrt-pow244.6%
associate-*l*44.6%
metadata-eval44.6%
metadata-eval44.6%
Applied egg-rr44.6%
*-lft-identity44.6%
associate-*r*46.8%
Simplified46.8%
if 3.29999999999999984e-56 < l < 1.4000000000000001e169Initial program 41.6%
Simplified50.3%
Taylor expanded in n around 0 35.5%
if 1.4000000000000001e169 < l Initial program 2.2%
Simplified34.2%
Taylor expanded in U* around inf 8.6%
associate-*l/8.7%
Simplified8.7%
pow18.7%
associate-*l*9.0%
*-commutative9.0%
Applied egg-rr9.0%
unpow19.0%
associate-*l*9.0%
Simplified9.0%
Final simplification40.6%
(FPCore (n U t l Om U*) :precision binary64 (if (<= n 6.6e-164) (sqrt (* 2.0 (* U (* n (- t (* (pow l 2.0) (/ 2.0 Om))))))) (sqrt (* (* 2.0 (* n U)) (- t (/ (* 2.0 (pow l 2.0)) Om))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= 6.6e-164) {
tmp = sqrt((2.0 * (U * (n * (t - (pow(l, 2.0) * (2.0 / Om)))))));
} else {
tmp = sqrt(((2.0 * (n * U)) * (t - ((2.0 * pow(l, 2.0)) / Om))));
}
return tmp;
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (n <= 6.6d-164) then
tmp = sqrt((2.0d0 * (u * (n * (t - ((l ** 2.0d0) * (2.0d0 / om)))))))
else
tmp = sqrt(((2.0d0 * (n * u)) * (t - ((2.0d0 * (l ** 2.0d0)) / om))))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= 6.6e-164) {
tmp = Math.sqrt((2.0 * (U * (n * (t - (Math.pow(l, 2.0) * (2.0 / Om)))))));
} else {
tmp = Math.sqrt(((2.0 * (n * U)) * (t - ((2.0 * Math.pow(l, 2.0)) / Om))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if n <= 6.6e-164: tmp = math.sqrt((2.0 * (U * (n * (t - (math.pow(l, 2.0) * (2.0 / Om))))))) else: tmp = math.sqrt(((2.0 * (n * U)) * (t - ((2.0 * math.pow(l, 2.0)) / Om)))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= 6.6e-164) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64((l ^ 2.0) * Float64(2.0 / Om))))))); else tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t - Float64(Float64(2.0 * (l ^ 2.0)) / Om)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (n <= 6.6e-164) tmp = sqrt((2.0 * (U * (n * (t - ((l ^ 2.0) * (2.0 / Om))))))); else tmp = sqrt(((2.0 * (n * U)) * (t - ((2.0 * (l ^ 2.0)) / Om)))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, 6.6e-164], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(N[Power[l, 2.0], $MachinePrecision] * N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t - N[(N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 6.6 \cdot 10^{-164}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - {\ell}^{2} \cdot \frac{2}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \frac{2 \cdot {\ell}^{2}}{Om}\right)}\\
\end{array}
\end{array}
if n < 6.6e-164Initial program 45.5%
Simplified52.0%
associate-*r*52.0%
fma-define53.8%
associate-*r*51.4%
Applied egg-rr51.4%
Taylor expanded in n around 0 45.1%
associate-*r/45.1%
associate-*l/45.1%
Simplified45.1%
if 6.6e-164 < n Initial program 54.4%
Simplified57.8%
Taylor expanded in Om around inf 47.7%
associate-*r/47.7%
Simplified47.7%
Final simplification46.0%
(FPCore (n U t l Om U*) :precision binary64 (pow (* (* (* 2.0 n) U) (+ t (* -2.0 (/ (pow l 2.0) Om)))) 0.5))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return pow((((2.0 * n) * U) * (t + (-2.0 * (pow(l, 2.0) / Om)))), 0.5);
}
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 = (((2.0d0 * n) * u) * (t + ((-2.0d0) * ((l ** 2.0d0) / om)))) ** 0.5d0
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.pow((((2.0 * n) * U) * (t + (-2.0 * (Math.pow(l, 2.0) / Om)))), 0.5);
}
def code(n, U, t, l, Om, U_42_): return math.pow((((2.0 * n) * U) * (t + (-2.0 * (math.pow(l, 2.0) / Om)))), 0.5)
function code(n, U, t, l, Om, U_42_) return Float64(Float64(Float64(2.0 * n) * U) * Float64(t + Float64(-2.0 * Float64((l ^ 2.0) / Om)))) ^ 0.5 end
function tmp = code(n, U, t, l, Om, U_42_) tmp = (((2.0 * n) * U) * (t + (-2.0 * ((l ^ 2.0) / Om)))) ^ 0.5; end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Power[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(t + N[(-2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]
\begin{array}{l}
\\
{\left(\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}^{0.5}
\end{array}
Initial program 48.6%
Simplified53.3%
Taylor expanded in n around 0 41.5%
pow1/247.7%
associate-*r*49.0%
cancel-sign-sub-inv49.0%
metadata-eval49.0%
Applied egg-rr49.0%
(FPCore (n U t l Om U*) :precision binary64 (if (<= U 4.6e+148) (sqrt (* (* 2.0 n) (* U (- t (* 2.0 (/ (* l l) Om)))))) (* (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 <= 4.6e+148) {
tmp = sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om))))));
} 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 <= 4.6d+148) then
tmp = sqrt(((2.0d0 * n) * (u * (t - (2.0d0 * ((l * l) / om))))))
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 <= 4.6e+148) {
tmp = Math.sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om))))));
} 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 <= 4.6e+148: tmp = math.sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om)))))) 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 <= 4.6e+148) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om)))))); 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 <= 4.6e+148) tmp = sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om)))))); 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, 4.6e+148], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $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}
\\
\begin{array}{l}
\mathbf{if}\;U \leq 4.6 \cdot 10^{+148}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\
\end{array}
\end{array}
if U < 4.6000000000000001e148Initial program 46.9%
Simplified52.8%
Taylor expanded in n around 0 40.5%
unpow240.5%
Applied egg-rr40.5%
if 4.6000000000000001e148 < U Initial program 70.0%
Simplified59.9%
Taylor expanded in t around inf 70.0%
pow1/270.0%
associate-*r*70.0%
unpow-prod-down85.6%
pow1/285.6%
Applied egg-rr85.6%
unpow1/285.6%
Simplified85.6%
(FPCore (n U t l Om U*) :precision binary64 (if (<= t 7.8e+163) (sqrt (* (* 2.0 n) (* U (- t (* 2.0 (/ (* l l) Om)))))) (sqrt (* t (* 2.0 (fabs (* n U)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= 7.8e+163) {
tmp = sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om))))));
} else {
tmp = sqrt((t * (2.0 * fabs((n * U)))));
}
return tmp;
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (t <= 7.8d+163) then
tmp = sqrt(((2.0d0 * n) * (u * (t - (2.0d0 * ((l * l) / om))))))
else
tmp = sqrt((t * (2.0d0 * abs((n * u)))))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= 7.8e+163) {
tmp = Math.sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om))))));
} else {
tmp = Math.sqrt((t * (2.0 * Math.abs((n * U)))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if t <= 7.8e+163: tmp = math.sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om)))))) else: tmp = math.sqrt((t * (2.0 * math.fabs((n * U))))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= 7.8e+163) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om)))))); else tmp = sqrt(Float64(t * Float64(2.0 * abs(Float64(n * U))))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (t <= 7.8e+163) tmp = sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om)))))); else tmp = sqrt((t * (2.0 * abs((n * U))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, 7.8e+163], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(t * N[(2.0 * N[Abs[N[(n * U), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7.8 \cdot 10^{+163}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t \cdot \left(2 \cdot \left|n \cdot U\right|\right)}\\
\end{array}
\end{array}
if t < 7.80000000000000047e163Initial program 48.5%
Simplified54.1%
Taylor expanded in n around 0 41.5%
unpow241.5%
Applied egg-rr41.5%
if 7.80000000000000047e163 < t Initial program 49.9%
Simplified53.7%
associate-*r*53.7%
fma-define61.7%
associate-*r*53.9%
Applied egg-rr53.9%
Taylor expanded in t around inf 54.3%
add-sqr-sqrt54.3%
sqrt-unprod51.0%
pow251.0%
Applied egg-rr51.0%
*-commutative51.0%
unpow251.0%
rem-sqrt-square58.7%
Simplified58.7%
Final simplification43.2%
(FPCore (n U t l Om U*) :precision binary64 (if (<= U 1.15e+33) (sqrt (* (* 2.0 n) (* U (- t (* 2.0 (/ (* l l) Om)))))) (sqrt (fabs (* (* n t) (* 2.0 U))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 1.15e+33) {
tmp = sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om))))));
} else {
tmp = sqrt(fabs(((n * t) * (2.0 * U))));
}
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.15d+33) then
tmp = sqrt(((2.0d0 * n) * (u * (t - (2.0d0 * ((l * l) / om))))))
else
tmp = sqrt(abs(((n * t) * (2.0d0 * u))))
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.15e+33) {
tmp = Math.sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om))))));
} else {
tmp = Math.sqrt(Math.abs(((n * t) * (2.0 * U))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if U <= 1.15e+33: tmp = math.sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om)))))) else: tmp = math.sqrt(math.fabs(((n * t) * (2.0 * U)))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= 1.15e+33) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om)))))); else tmp = sqrt(abs(Float64(Float64(n * t) * Float64(2.0 * U)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U <= 1.15e+33) tmp = sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om)))))); else tmp = sqrt(abs(((n * t) * (2.0 * U)))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, 1.15e+33], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[Abs[N[(N[(n * t), $MachinePrecision] * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;U \leq 1.15 \cdot 10^{+33}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left|\left(n \cdot t\right) \cdot \left(2 \cdot U\right)\right|}\\
\end{array}
\end{array}
if U < 1.15000000000000005e33Initial program 46.1%
Simplified52.9%
Taylor expanded in n around 0 40.5%
unpow240.5%
Applied egg-rr40.5%
if 1.15000000000000005e33 < U Initial program 64.4%
Simplified67.1%
associate-*r*67.1%
fma-define67.1%
associate-*r*61.6%
Applied egg-rr61.6%
Taylor expanded in t around inf 50.4%
pow150.4%
metadata-eval50.4%
metadata-eval50.4%
pow-sqr56.1%
pow-prod-down43.1%
swap-sqr28.1%
*-commutative28.1%
associate-*r*28.1%
*-commutative28.1%
associate-*r*28.1%
swap-sqr43.1%
associate-*r*43.0%
associate-*r*45.8%
pow245.8%
associate-*l*45.8%
metadata-eval45.8%
Applied egg-rr45.8%
unpow1/245.8%
unpow245.8%
rem-sqrt-square59.7%
associate-*r*59.7%
*-commutative59.7%
Simplified59.7%
Final simplification43.1%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* 2.0 n) (* U (- t (* 2.0 (/ (* l l) Om)))))))
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))))));
}
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))))))
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))))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om))))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om)))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om)))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)}
\end{array}
Initial program 48.6%
Simplified53.3%
Taylor expanded in n around 0 41.5%
unpow241.5%
Applied egg-rr41.5%
(FPCore (n U t l Om U*) :precision binary64 (pow (* (* n t) (* 2.0 U)) 0.5))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return pow(((n * t) * (2.0 * U)), 0.5);
}
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 = ((n * t) * (2.0d0 * u)) ** 0.5d0
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.pow(((n * t) * (2.0 * U)), 0.5);
}
def code(n, U, t, l, Om, U_42_): return math.pow(((n * t) * (2.0 * U)), 0.5)
function code(n, U, t, l, Om, U_42_) return Float64(Float64(n * t) * Float64(2.0 * U)) ^ 0.5 end
function tmp = code(n, U, t, l, Om, U_42_) tmp = ((n * t) * (2.0 * U)) ^ 0.5; end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Power[N[(N[(n * t), $MachinePrecision] * N[(2.0 * U), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]
\begin{array}{l}
\\
{\left(\left(n \cdot t\right) \cdot \left(2 \cdot U\right)\right)}^{0.5}
\end{array}
Initial program 48.6%
Simplified53.3%
Taylor expanded in t around inf 34.6%
pow1/236.6%
associate-*r*36.6%
Applied egg-rr36.6%
Final simplification36.6%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* t (* 2.0 (* n U)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((t * (2.0 * (n * U))));
}
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((t * (2.0d0 * (n * u))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((t * (2.0 * (n * U))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((t * (2.0 * (n * U))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(t * Float64(2.0 * Float64(n * U)))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((t * (2.0 * (n * U)))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(t * N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{t \cdot \left(2 \cdot \left(n \cdot U\right)\right)}
\end{array}
Initial program 48.6%
Simplified54.0%
associate-*r*54.0%
fma-define56.4%
associate-*r*56.0%
Applied egg-rr56.0%
Taylor expanded in t around inf 36.1%
Final simplification36.1%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2.0 (* t (* n U)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((2.0 * (t * (n * U))));
}
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 * (t * (n * u))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((2.0 * (t * (n * U))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((2.0 * (t * (n * U))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(2.0 * Float64(t * Float64(n * U)))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((2.0 * (t * (n * U)))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{2 \cdot \left(t \cdot \left(n \cdot U\right)\right)}
\end{array}
Initial program 48.6%
Simplified53.3%
Taylor expanded in t around inf 34.6%
associate-*r*36.1%
Simplified36.1%
Final simplification36.1%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2.0 (* U (* n t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((2.0 * (U * (n * t))));
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((2.0d0 * (u * (n * t))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((2.0 * (U * (n * t))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((2.0 * (U * (n * t))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(2.0 * Float64(U * Float64(n * t)))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((2.0 * (U * (n * t)))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}
\end{array}
Initial program 48.6%
Simplified53.3%
Taylor expanded in t around inf 34.6%
herbie shell --seed 2024125
(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*))))))