
(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 10 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)) (- U* U)))
(t_2 (sqrt (* (* (* 2.0 n) U) (+ (- t (* 2.0 (/ (* l l) Om))) t_1)))))
(if (<= t_2 1e-99)
(sqrt (* (* 2.0 n) (* U (+ (fma (* l (/ l Om)) -2.0 t) t_1))))
(if (<= t_2 5e+147)
t_2
(fabs (* (sqrt 2.0) (/ (* (sqrt (* U U*)) (* n l)) 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)) * (U_42_ - U);
double t_2 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + t_1)));
double tmp;
if (t_2 <= 1e-99) {
tmp = sqrt(((2.0 * n) * (U * (fma((l * (l / Om)), -2.0, t) + t_1))));
} else if (t_2 <= 5e+147) {
tmp = t_2;
} else {
tmp = fabs((sqrt(2.0) * ((sqrt((U * U_42_)) * (n * l)) / Om)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U_42_ - U)) t_2 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_1))) tmp = 0.0 if (t_2 <= 1e-99) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(fma(Float64(l * Float64(l / Om)), -2.0, t) + t_1)))); elseif (t_2 <= 5e+147) tmp = t_2; else tmp = abs(Float64(sqrt(2.0) * Float64(Float64(sqrt(Float64(U * U_42_)) * Float64(n * l)) / Om))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[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] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 1e-99], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] * -2.0 + t), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, 5e+147], t$95$2, N[Abs[N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Sqrt[N[(U * U$42$), $MachinePrecision]], $MachinePrecision] * N[(n * l), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\\
t_2 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_1\right)}\\
\mathbf{if}\;t_2 \leq 10^{-99}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\mathsf{fma}\left(\ell \cdot \frac{\ell}{Om}, -2, t\right) + t_1\right)\right)}\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+147}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left|\sqrt{2} \cdot \frac{\sqrt{U \cdot U*} \cdot \left(n \cdot \ell\right)}{Om}\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*))))) < 1e-99Initial program 43.4%
Simplified66.9%
add-sqr-sqrt43.8%
pow243.8%
sqrt-prod25.1%
unpow225.1%
sqrt-prod18.2%
add-sqr-sqrt25.1%
Applied egg-rr25.1%
unpow-prod-down25.1%
pow225.1%
add-sqr-sqrt66.9%
associate-*r*70.5%
cancel-sign-sub-inv70.5%
+-commutative70.5%
*-commutative70.5%
fma-def70.5%
div-inv70.5%
clear-num70.5%
Applied egg-rr70.5%
if 1e-99 < (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.0000000000000002e147Initial program 97.5%
if 5.0000000000000002e147 < (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 18.8%
Simplified22.2%
Taylor expanded in U* around inf 19.9%
add-sqr-sqrt19.9%
rem-sqrt-square19.9%
sqrt-prod19.9%
sqrt-div19.9%
Applied egg-rr41.4%
Final simplification66.4%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(sqrt
(*
(* (* 2.0 n) U)
(+
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U* U)))))))
(if (<= t_1 1e-99)
(sqrt (* (* 2.0 n) (* U (+ t (* -2.0 (/ (pow l 2.0) Om))))))
(if (<= t_1 5e+147)
t_1
(fabs (* (sqrt 2.0) (/ (* (sqrt (* U U*)) (* n l)) Om)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + ((n * pow((l / Om), 2.0)) * (U_42_ - U)))));
double tmp;
if (t_1 <= 1e-99) {
tmp = sqrt(((2.0 * n) * (U * (t + (-2.0 * (pow(l, 2.0) / Om))))));
} else if (t_1 <= 5e+147) {
tmp = t_1;
} else {
tmp = fabs((sqrt(2.0) * ((sqrt((U * U_42_)) * (n * l)) / Om)));
}
return tmp;
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) + ((n * ((l / om) ** 2.0d0)) * (u_42 - u)))))
if (t_1 <= 1d-99) then
tmp = sqrt(((2.0d0 * n) * (u * (t + ((-2.0d0) * ((l ** 2.0d0) / om))))))
else if (t_1 <= 5d+147) then
tmp = t_1
else
tmp = abs((sqrt(2.0d0) * ((sqrt((u * u_42)) * (n * l)) / om)))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + ((n * Math.pow((l / Om), 2.0)) * (U_42_ - U)))));
double tmp;
if (t_1 <= 1e-99) {
tmp = Math.sqrt(((2.0 * n) * (U * (t + (-2.0 * (Math.pow(l, 2.0) / Om))))));
} else if (t_1 <= 5e+147) {
tmp = t_1;
} else {
tmp = Math.abs((Math.sqrt(2.0) * ((Math.sqrt((U * U_42_)) * (n * l)) / Om)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + ((n * math.pow((l / Om), 2.0)) * (U_42_ - U))))) tmp = 0 if t_1 <= 1e-99: tmp = math.sqrt(((2.0 * n) * (U * (t + (-2.0 * (math.pow(l, 2.0) / Om)))))) elif t_1 <= 5e+147: tmp = t_1 else: tmp = math.fabs((math.sqrt(2.0) * ((math.sqrt((U * U_42_)) * (n * l)) / Om))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = 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_42_ - U))))) tmp = 0.0 if (t_1 <= 1e-99) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(-2.0 * Float64((l ^ 2.0) / Om)))))); elseif (t_1 <= 5e+147) tmp = t_1; else tmp = abs(Float64(sqrt(2.0) * Float64(Float64(sqrt(Float64(U * U_42_)) * Float64(n * l)) / Om))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + ((n * ((l / Om) ^ 2.0)) * (U_42_ - U))))); tmp = 0.0; if (t_1 <= 1e-99) tmp = sqrt(((2.0 * n) * (U * (t + (-2.0 * ((l ^ 2.0) / Om)))))); elseif (t_1 <= 5e+147) tmp = t_1; else tmp = abs((sqrt(2.0) * ((sqrt((U * U_42_)) * (n * l)) / Om))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = 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$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 1e-99], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(-2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 5e+147], t$95$1, N[Abs[N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Sqrt[N[(U * U$42$), $MachinePrecision]], $MachinePrecision] * N[(n * l), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \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)}\\
\mathbf{if}\;t_1 \leq 10^{-99}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+147}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left|\sqrt{2} \cdot \frac{\sqrt{U \cdot U*} \cdot \left(n \cdot \ell\right)}{Om}\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*))))) < 1e-99Initial program 43.4%
Simplified66.9%
Taylor expanded in Om around inf 68.7%
if 1e-99 < (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.0000000000000002e147Initial program 97.5%
if 5.0000000000000002e147 < (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 18.8%
Simplified22.2%
Taylor expanded in U* around inf 19.9%
add-sqr-sqrt19.9%
rem-sqrt-square19.9%
sqrt-prod19.9%
sqrt-div19.9%
Applied egg-rr41.4%
Final simplification66.0%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ l (/ Om l)))
(t_2 (* (* 2.0 n) U))
(t_3 (pow (/ l Om) 2.0))
(t_4 (* (* n t_3) (- U* U)))
(t_5 (* t_2 (+ (- t (* 2.0 (/ (* l l) Om))) t_4))))
(if (<= t_5 1e-198)
(sqrt (* (* 2.0 n) (* U (+ (+ t (* -2.0 t_1)) (* n (* t_3 (- U* U)))))))
(if (<= t_5 INFINITY)
(sqrt (* t_2 (+ t_4 (- t (* 2.0 t_1)))))
(/ (* (sqrt (* U U*)) (* l (* n (sqrt 2.0)))) Om)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = l / (Om / l);
double t_2 = (2.0 * n) * U;
double t_3 = pow((l / Om), 2.0);
double t_4 = (n * t_3) * (U_42_ - U);
double t_5 = t_2 * ((t - (2.0 * ((l * l) / Om))) + t_4);
double tmp;
if (t_5 <= 1e-198) {
tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * t_1)) + (n * (t_3 * (U_42_ - U)))))));
} else if (t_5 <= ((double) INFINITY)) {
tmp = sqrt((t_2 * (t_4 + (t - (2.0 * t_1)))));
} else {
tmp = (sqrt((U * U_42_)) * (l * (n * sqrt(2.0)))) / Om;
}
return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = l / (Om / l);
double t_2 = (2.0 * n) * U;
double t_3 = Math.pow((l / Om), 2.0);
double t_4 = (n * t_3) * (U_42_ - U);
double t_5 = t_2 * ((t - (2.0 * ((l * l) / Om))) + t_4);
double tmp;
if (t_5 <= 1e-198) {
tmp = Math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * t_1)) + (n * (t_3 * (U_42_ - U)))))));
} else if (t_5 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_2 * (t_4 + (t - (2.0 * t_1)))));
} else {
tmp = (Math.sqrt((U * U_42_)) * (l * (n * Math.sqrt(2.0)))) / Om;
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = l / (Om / l) t_2 = (2.0 * n) * U t_3 = math.pow((l / Om), 2.0) t_4 = (n * t_3) * (U_42_ - U) t_5 = t_2 * ((t - (2.0 * ((l * l) / Om))) + t_4) tmp = 0 if t_5 <= 1e-198: tmp = math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * t_1)) + (n * (t_3 * (U_42_ - U))))))) elif t_5 <= math.inf: tmp = math.sqrt((t_2 * (t_4 + (t - (2.0 * t_1))))) else: tmp = (math.sqrt((U * U_42_)) * (l * (n * math.sqrt(2.0)))) / Om return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(l / Float64(Om / l)) t_2 = Float64(Float64(2.0 * n) * U) t_3 = Float64(l / Om) ^ 2.0 t_4 = Float64(Float64(n * t_3) * Float64(U_42_ - U)) t_5 = Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_4)) tmp = 0.0 if (t_5 <= 1e-198) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(Float64(t + Float64(-2.0 * t_1)) + Float64(n * Float64(t_3 * Float64(U_42_ - U))))))); elseif (t_5 <= Inf) tmp = sqrt(Float64(t_2 * Float64(t_4 + Float64(t - Float64(2.0 * t_1))))); else tmp = Float64(Float64(sqrt(Float64(U * U_42_)) * Float64(l * Float64(n * sqrt(2.0)))) / Om); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = l / (Om / l); t_2 = (2.0 * n) * U; t_3 = (l / Om) ^ 2.0; t_4 = (n * t_3) * (U_42_ - U); t_5 = t_2 * ((t - (2.0 * ((l * l) / Om))) + t_4); tmp = 0.0; if (t_5 <= 1e-198) tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * t_1)) + (n * (t_3 * (U_42_ - U))))))); elseif (t_5 <= Inf) tmp = sqrt((t_2 * (t_4 + (t - (2.0 * t_1))))); else tmp = (sqrt((U * U_42_)) * (l * (n * sqrt(2.0)))) / Om; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(l / N[(Om / l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$4 = N[(N[(n * t$95$3), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, 1e-198], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(t + N[(-2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(n * N[(t$95$3 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[Sqrt[N[(t$95$2 * N[(t$95$4 + N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[Sqrt[N[(U * U$42$), $MachinePrecision]], $MachinePrecision] * N[(l * N[(n * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell}{\frac{Om}{\ell}}\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_4 := \left(n \cdot t_3\right) \cdot \left(U* - U\right)\\
t_5 := t_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_4\right)\\
\mathbf{if}\;t_5 \leq 10^{-198}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t + -2 \cdot t_1\right) + n \cdot \left(t_3 \cdot \left(U* - U\right)\right)\right)\right)}\\
\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;\sqrt{t_2 \cdot \left(t_4 + \left(t - 2 \cdot t_1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{U \cdot U*} \cdot \left(\ell \cdot \left(n \cdot \sqrt{2}\right)\right)}{Om}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < 9.9999999999999991e-199Initial program 39.7%
Simplified64.7%
if 9.9999999999999991e-199 < (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < +inf.0Initial program 68.2%
associate-/l*70.9%
add-sqr-sqrt34.4%
*-un-lft-identity34.4%
times-frac34.4%
Applied egg-rr34.4%
/-rgt-identity34.4%
associate-*r/34.4%
rem-square-sqrt70.9%
Simplified70.9%
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%
Simplified0.5%
Taylor expanded in U* around inf 18.5%
Taylor expanded in l around 0 8.9%
*-commutative8.9%
associate-*r/11.2%
Simplified11.2%
Final simplification59.7%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= U 20500.0)
(sqrt
(*
(* 2.0 n)
(*
U
(+
(+ t (* -2.0 (/ l (/ Om l))))
(* n (* (pow (/ l Om) 2.0) (- U* U)))))))
(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_) {
double tmp;
if (U <= 20500.0) {
tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (pow((l / Om), 2.0) * (U_42_ - U)))))));
} else {
tmp = pow(((2.0 * (n * U)) * (t - ((2.0 * pow(l, 2.0)) / Om))), 0.5);
}
return tmp;
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (u <= 20500.0d0) then
tmp = sqrt(((2.0d0 * n) * (u * ((t + ((-2.0d0) * (l / (om / l)))) + (n * (((l / om) ** 2.0d0) * (u_42 - u)))))))
else
tmp = ((2.0d0 * (n * u)) * (t - ((2.0d0 * (l ** 2.0d0)) / om))) ** 0.5d0
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 20500.0) {
tmp = Math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (Math.pow((l / Om), 2.0) * (U_42_ - U)))))));
} else {
tmp = Math.pow(((2.0 * (n * U)) * (t - ((2.0 * Math.pow(l, 2.0)) / Om))), 0.5);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if U <= 20500.0: tmp = math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (math.pow((l / Om), 2.0) * (U_42_ - U))))))) else: tmp = math.pow(((2.0 * (n * U)) * (t - ((2.0 * math.pow(l, 2.0)) / Om))), 0.5) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= 20500.0) 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(Float64(2.0 * Float64(n * U)) * Float64(t - Float64(Float64(2.0 * (l ^ 2.0)) / Om))) ^ 0.5; end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U <= 20500.0) tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (((l / Om) ^ 2.0) * (U_42_ - U))))))); else tmp = ((2.0 * (n * U)) * (t - ((2.0 * (l ^ 2.0)) / Om))) ^ 0.5; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, 20500.0], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(t + N[(-2.0 * N[(l / N[(Om / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[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], 0.5], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;U \leq 20500:\\
\;\;\;\;\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}:\\
\;\;\;\;{\left(\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \frac{2 \cdot {\ell}^{2}}{Om}\right)\right)}^{0.5}\\
\end{array}
\end{array}
if U < 20500Initial program 43.4%
Simplified51.8%
if 20500 < U Initial program 75.8%
Simplified75.3%
Taylor expanded in Om around inf 72.2%
pow1/274.1%
associate-*r*74.1%
associate-*r/74.1%
Applied egg-rr74.1%
Final simplification56.7%
(FPCore (n U t l Om U*) :precision binary64 (if (or (<= U -2.4e-77) (not (<= U 4.3e-83))) (pow (* (* 2.0 (* n U)) (- t (/ (* 2.0 (pow l 2.0)) Om))) 0.5) (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 ((U <= -2.4e-77) || !(U <= 4.3e-83)) {
tmp = pow(((2.0 * (n * U)) * (t - ((2.0 * pow(l, 2.0)) / Om))), 0.5);
} 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 ((u <= (-2.4d-77)) .or. (.not. (u <= 4.3d-83))) then
tmp = ((2.0d0 * (n * u)) * (t - ((2.0d0 * (l ** 2.0d0)) / om))) ** 0.5d0
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 ((U <= -2.4e-77) || !(U <= 4.3e-83)) {
tmp = Math.pow(((2.0 * (n * U)) * (t - ((2.0 * Math.pow(l, 2.0)) / Om))), 0.5);
} 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 (U <= -2.4e-77) or not (U <= 4.3e-83): tmp = math.pow(((2.0 * (n * U)) * (t - ((2.0 * math.pow(l, 2.0)) / Om))), 0.5) 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 ((U <= -2.4e-77) || !(U <= 4.3e-83)) tmp = Float64(Float64(2.0 * Float64(n * U)) * Float64(t - Float64(Float64(2.0 * (l ^ 2.0)) / Om))) ^ 0.5; else tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(-2.0 * Float64((l ^ 2.0) / Om)))))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if ((U <= -2.4e-77) || ~((U <= 4.3e-83))) tmp = ((2.0 * (n * U)) * (t - ((2.0 * (l ^ 2.0)) / Om))) ^ 0.5; 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[Or[LessEqual[U, -2.4e-77], N[Not[LessEqual[U, 4.3e-83]], $MachinePrecision]], N[Power[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], 0.5], $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(-2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;U \leq -2.4 \cdot 10^{-77} \lor \neg \left(U \leq 4.3 \cdot 10^{-83}\right):\\
\;\;\;\;{\left(\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \frac{2 \cdot {\ell}^{2}}{Om}\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}\\
\end{array}
\end{array}
if U < -2.3999999999999999e-77 or 4.30000000000000033e-83 < U Initial program 65.6%
Simplified64.5%
Taylor expanded in Om around inf 60.0%
pow1/263.4%
associate-*r*63.4%
associate-*r/63.4%
Applied egg-rr63.4%
if -2.3999999999999999e-77 < U < 4.30000000000000033e-83Initial program 35.6%
Simplified48.7%
Taylor expanded in Om around inf 44.3%
Final simplification53.8%
(FPCore (n U t l Om U*) :precision binary64 (if (<= t 2.9e+252) (sqrt (* (* 2.0 n) (* U (+ t (* -2.0 (/ (pow l 2.0) Om)))))) (sqrt (* 2.0 (fabs (* U (* n t)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= 2.9e+252) {
tmp = sqrt(((2.0 * n) * (U * (t + (-2.0 * (pow(l, 2.0) / Om))))));
} else {
tmp = sqrt((2.0 * fabs((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 (t <= 2.9d+252) then
tmp = sqrt(((2.0d0 * n) * (u * (t + ((-2.0d0) * ((l ** 2.0d0) / om))))))
else
tmp = sqrt((2.0d0 * abs((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 (t <= 2.9e+252) {
tmp = Math.sqrt(((2.0 * n) * (U * (t + (-2.0 * (Math.pow(l, 2.0) / Om))))));
} else {
tmp = Math.sqrt((2.0 * Math.abs((U * (n * t)))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if t <= 2.9e+252: tmp = math.sqrt(((2.0 * n) * (U * (t + (-2.0 * (math.pow(l, 2.0) / Om)))))) else: tmp = math.sqrt((2.0 * math.fabs((U * (n * t))))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= 2.9e+252) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(-2.0 * Float64((l ^ 2.0) / Om)))))); else tmp = sqrt(Float64(2.0 * abs(Float64(U * Float64(n * t))))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (t <= 2.9e+252) tmp = sqrt(((2.0 * n) * (U * (t + (-2.0 * ((l ^ 2.0) / Om)))))); else tmp = sqrt((2.0 * abs((U * (n * t))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, 2.9e+252], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(-2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[Abs[N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.9 \cdot 10^{+252}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left|U \cdot \left(n \cdot t\right)\right|}\\
\end{array}
\end{array}
if t < 2.89999999999999996e252Initial program 50.3%
Simplified55.1%
Taylor expanded in Om around inf 49.6%
if 2.89999999999999996e252 < t Initial program 52.0%
Simplified47.4%
Taylor expanded in t around inf 56.5%
associate-*r*43.5%
*-commutative43.5%
Simplified43.5%
add-sqr-sqrt43.3%
sqrt-unprod48.1%
pow248.1%
*-commutative48.1%
Applied egg-rr48.1%
unpow248.1%
rem-sqrt-square52.6%
*-commutative52.6%
*-commutative52.6%
associate-*r*65.6%
Simplified65.6%
Final simplification50.9%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2.0 (* U (* n (- t (* 2.0 (/ (pow l 2.0) Om))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((2.0 * (U * (n * (t - (2.0 * (pow(l, 2.0) / 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 * (u * (n * (t - (2.0d0 * ((l ** 2.0d0) / 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 * (U * (n * (t - (2.0 * (Math.pow(l, 2.0) / Om)))))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((2.0 * (U * (n * (t - (2.0 * (math.pow(l, 2.0) / Om)))))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64((l ^ 2.0) / Om))))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l ^ 2.0) / Om))))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := 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]
\begin{array}{l}
\\
\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}
\end{array}
Initial program 50.5%
Simplified49.2%
Taylor expanded in n around 0 49.1%
Final simplification49.1%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2.0 (fabs (* U (* n t))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((2.0 * fabs((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 * abs((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 * Math.abs((U * (n * t)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((2.0 * math.fabs((U * (n * t)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(2.0 * abs(Float64(U * Float64(n * t))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((2.0 * abs((U * (n * t))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[Abs[N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{2 \cdot \left|U \cdot \left(n \cdot t\right)\right|}
\end{array}
Initial program 50.5%
Simplified49.2%
Taylor expanded in t around inf 38.7%
associate-*r*35.3%
*-commutative35.3%
Simplified35.3%
add-sqr-sqrt35.2%
sqrt-unprod27.2%
pow227.2%
*-commutative27.2%
Applied egg-rr27.2%
unpow227.2%
rem-sqrt-square37.7%
*-commutative37.7%
*-commutative37.7%
associate-*r*41.5%
Simplified41.5%
Final simplification41.5%
(FPCore (n U t l Om U*) :precision binary64 (pow (* 2.0 (* n (* U t))) 0.5))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return pow((2.0 * (n * (U * t))), 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))) ** 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))), 0.5);
}
def code(n, U, t, l, Om, U_42_): return math.pow((2.0 * (n * (U * t))), 0.5)
function code(n, U, t, l, Om, U_42_) return Float64(2.0 * Float64(n * Float64(U * t))) ^ 0.5 end
function tmp = code(n, U, t, l, Om, U_42_) tmp = (2.0 * (n * (U * t))) ^ 0.5; end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Power[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]
\begin{array}{l}
\\
{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{0.5}
\end{array}
Initial program 50.5%
Simplified54.4%
Taylor expanded in t around inf 38.3%
pow1/239.9%
associate-*l*39.9%
Applied egg-rr39.9%
Final simplification39.9%
(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 50.5%
Simplified49.2%
Taylor expanded in t around inf 38.7%
Final simplification38.7%
herbie shell --seed 2023310
(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*))))))