
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}
\end{array}
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (- t (* l (* 2.0 (/ l Om)))))
(t_2 (pow (/ l Om) 2.0))
(t_3 (* (* n t_2) (- U* U)))
(t_4 (* (* (* 2.0 n) U) (+ (- t (* 2.0 (/ (* l l) Om))) t_3))))
(if (<= t_4 0.0)
(sqrt (* (* 2.0 n) (* U (+ t_1 (* n (* t_2 (- U* U)))))))
(if (<= t_4 4e+298)
(sqrt t_4)
(if (<= t_4 INFINITY)
(sqrt (* (* 2.0 n) (* U (+ t_1 t_3))))
(pow
(fma -4.0 (/ U (/ Om (* n (pow l 2.0)))) (* (* 2.0 U) (* n t)))
0.5))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = t - (l * (2.0 * (l / Om)));
double t_2 = pow((l / Om), 2.0);
double t_3 = (n * t_2) * (U_42_ - U);
double t_4 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + t_3);
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt(((2.0 * n) * (U * (t_1 + (n * (t_2 * (U_42_ - U)))))));
} else if (t_4 <= 4e+298) {
tmp = sqrt(t_4);
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt(((2.0 * n) * (U * (t_1 + t_3))));
} else {
tmp = pow(fma(-4.0, (U / (Om / (n * pow(l, 2.0)))), ((2.0 * U) * (n * t))), 0.5);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(t - Float64(l * Float64(2.0 * Float64(l / Om)))) t_2 = Float64(l / Om) ^ 2.0 t_3 = Float64(Float64(n * t_2) * Float64(U_42_ - U)) t_4 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_3)) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t_1 + Float64(n * Float64(t_2 * Float64(U_42_ - U))))))); elseif (t_4 <= 4e+298) tmp = sqrt(t_4); elseif (t_4 <= Inf) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t_1 + t_3)))); else tmp = fma(-4.0, Float64(U / Float64(Om / Float64(n * (l ^ 2.0)))), Float64(Float64(2.0 * U) * Float64(n * t))) ^ 0.5; end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(t - N[(l * N[(2.0 * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(n * t$95$2), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t$95$1 + N[(n * N[(t$95$2 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 4e+298], N[Sqrt[t$95$4], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t$95$1 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(-4.0 * N[(U / N[(Om / N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \ell \cdot \left(2 \cdot \frac{\ell}{Om}\right)\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(n \cdot t_2\right) \cdot \left(U* - U\right)\\
t_4 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_3\right)\\
\mathbf{if}\;t_4 \leq 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t_1 + n \cdot \left(t_2 \cdot \left(U* - U\right)\right)\right)\right)}\\
\mathbf{elif}\;t_4 \leq 4 \cdot 10^{+298}:\\
\;\;\;\;\sqrt{t_4}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t_1 + t_3\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(-4, \frac{U}{\frac{Om}{n \cdot {\ell}^{2}}}, \left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)\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 7.3%
Simplified31.3%
associate-*r/31.3%
associate-*l/34.4%
associate-*r*34.4%
Applied egg-rr34.4%
if 0.0 < (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < 3.9999999999999998e298Initial program 95.1%
if 3.9999999999999998e298 < (*.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 39.4%
Simplified42.8%
associate-*r/42.8%
associate-*l/51.2%
associate-*r*51.2%
Applied egg-rr51.2%
associate-*r*51.3%
sub-neg51.3%
distribute-lft-in24.4%
Applied egg-rr24.4%
distribute-lft-out51.3%
sub-neg51.3%
*-commutative51.3%
Simplified51.3%
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%
Simplified11.3%
Taylor expanded in Om around inf 5.0%
pow1/228.7%
fma-def28.7%
associate-/l*31.3%
*-commutative31.3%
associate-*r*31.3%
Applied egg-rr31.3%
Final simplification63.9%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (- t (* l (* 2.0 (/ l Om)))))
(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 0.0)
(sqrt (* (* 2.0 n) (* U (+ t_1 (* n (* t_3 (- U* U)))))))
(if (<= t_5 4e+298)
(sqrt t_5)
(if (<= t_5 INFINITY)
(sqrt (* (* 2.0 n) (* U (+ t_1 t_4))))
(pow (* t_2 (fma (/ (pow l 2.0) Om) -2.0 t)) 0.5))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = t - (l * (2.0 * (l / Om)));
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 <= 0.0) {
tmp = sqrt(((2.0 * n) * (U * (t_1 + (n * (t_3 * (U_42_ - U)))))));
} else if (t_5 <= 4e+298) {
tmp = sqrt(t_5);
} else if (t_5 <= ((double) INFINITY)) {
tmp = sqrt(((2.0 * n) * (U * (t_1 + t_4))));
} else {
tmp = pow((t_2 * fma((pow(l, 2.0) / Om), -2.0, t)), 0.5);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(t - Float64(l * Float64(2.0 * Float64(l / Om)))) 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 <= 0.0) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t_1 + Float64(n * Float64(t_3 * Float64(U_42_ - U))))))); elseif (t_5 <= 4e+298) tmp = sqrt(t_5); elseif (t_5 <= Inf) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t_1 + t_4)))); else tmp = Float64(t_2 * fma(Float64((l ^ 2.0) / Om), -2.0, t)) ^ 0.5; end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(t - N[(l * N[(2.0 * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $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, 0.0], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t$95$1 + N[(n * N[(t$95$3 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$5, 4e+298], N[Sqrt[t$95$5], $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t$95$1 + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(t$95$2 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] * -2.0 + t), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \ell \cdot \left(2 \cdot \frac{\ell}{Om}\right)\\
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 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t_1 + n \cdot \left(t_3 \cdot \left(U* - U\right)\right)\right)\right)}\\
\mathbf{elif}\;t_5 \leq 4 \cdot 10^{+298}:\\
\;\;\;\;\sqrt{t_5}\\
\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t_1 + t_4\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(t_2 \cdot \mathsf{fma}\left(\frac{{\ell}^{2}}{Om}, -2, t\right)\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 7.3%
Simplified31.3%
associate-*r/31.3%
associate-*l/34.4%
associate-*r*34.4%
Applied egg-rr34.4%
if 0.0 < (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < 3.9999999999999998e298Initial program 95.1%
if 3.9999999999999998e298 < (*.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 39.4%
Simplified42.8%
associate-*r/42.8%
associate-*l/51.2%
associate-*r*51.2%
Applied egg-rr51.2%
associate-*r*51.3%
sub-neg51.3%
distribute-lft-in24.4%
Applied egg-rr24.4%
distribute-lft-out51.3%
sub-neg51.3%
*-commutative51.3%
Simplified51.3%
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%
Simplified1.1%
associate-*r/1.1%
associate-*l/11.3%
associate-*r*11.3%
Applied egg-rr11.3%
Taylor expanded in n around 0 5.0%
associate-*r*1.3%
*-commutative1.3%
sub-neg1.3%
*-commutative1.3%
distribute-rgt-neg-in1.3%
metadata-eval1.3%
Simplified1.3%
pow1/230.1%
associate-*r*30.1%
associate-*l*30.1%
*-commutative30.1%
*-commutative30.1%
+-commutative30.1%
fma-def30.1%
Applied egg-rr30.1%
Final simplification63.7%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (- t (* l (* 2.0 (/ l Om)))))
(t_2 (pow (/ l Om) 2.0))
(t_3 (* (* n t_2) (- U* U)))
(t_4 (sqrt (* (* (* 2.0 n) U) (+ (- t (* 2.0 (/ (* l l) Om))) t_3)))))
(if (<= t_4 0.0)
(sqrt (* (* 2.0 n) (* U (+ t_1 t_3))))
(if (<= t_4 2e+149)
t_4
(sqrt (* (* 2.0 n) (* U (+ t_1 (* n (* t_2 (- U* U)))))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = t - (l * (2.0 * (l / Om)));
double t_2 = pow((l / Om), 2.0);
double t_3 = (n * t_2) * (U_42_ - U);
double t_4 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + t_3)));
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt(((2.0 * n) * (U * (t_1 + t_3))));
} else if (t_4 <= 2e+149) {
tmp = t_4;
} else {
tmp = sqrt(((2.0 * n) * (U * (t_1 + (n * (t_2 * (U_42_ - 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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = t - (l * (2.0d0 * (l / om)))
t_2 = (l / om) ** 2.0d0
t_3 = (n * t_2) * (u_42 - u)
t_4 = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) + t_3)))
if (t_4 <= 0.0d0) then
tmp = sqrt(((2.0d0 * n) * (u * (t_1 + t_3))))
else if (t_4 <= 2d+149) then
tmp = t_4
else
tmp = sqrt(((2.0d0 * n) * (u * (t_1 + (n * (t_2 * (u_42 - 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 t_1 = t - (l * (2.0 * (l / Om)));
double t_2 = Math.pow((l / Om), 2.0);
double t_3 = (n * t_2) * (U_42_ - U);
double t_4 = Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + t_3)));
double tmp;
if (t_4 <= 0.0) {
tmp = Math.sqrt(((2.0 * n) * (U * (t_1 + t_3))));
} else if (t_4 <= 2e+149) {
tmp = t_4;
} else {
tmp = Math.sqrt(((2.0 * n) * (U * (t_1 + (n * (t_2 * (U_42_ - U)))))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = t - (l * (2.0 * (l / Om))) t_2 = math.pow((l / Om), 2.0) t_3 = (n * t_2) * (U_42_ - U) t_4 = math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + t_3))) tmp = 0 if t_4 <= 0.0: tmp = math.sqrt(((2.0 * n) * (U * (t_1 + t_3)))) elif t_4 <= 2e+149: tmp = t_4 else: tmp = math.sqrt(((2.0 * n) * (U * (t_1 + (n * (t_2 * (U_42_ - U))))))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(t - Float64(l * Float64(2.0 * Float64(l / Om)))) t_2 = Float64(l / Om) ^ 2.0 t_3 = Float64(Float64(n * t_2) * Float64(U_42_ - U)) t_4 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_3))) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t_1 + t_3)))); elseif (t_4 <= 2e+149) tmp = t_4; else tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t_1 + Float64(n * Float64(t_2 * Float64(U_42_ - U))))))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = t - (l * (2.0 * (l / Om))); t_2 = (l / Om) ^ 2.0; t_3 = (n * t_2) * (U_42_ - U); t_4 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + t_3))); tmp = 0.0; if (t_4 <= 0.0) tmp = sqrt(((2.0 * n) * (U * (t_1 + t_3)))); elseif (t_4 <= 2e+149) tmp = t_4; else tmp = sqrt(((2.0 * n) * (U * (t_1 + (n * (t_2 * (U_42_ - U))))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(t - N[(l * N[(2.0 * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $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[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$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t$95$1 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 2e+149], t$95$4, N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t$95$1 + N[(n * N[(t$95$2 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \ell \cdot \left(2 \cdot \frac{\ell}{Om}\right)\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(n \cdot t_2\right) \cdot \left(U* - U\right)\\
t_4 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_3\right)}\\
\mathbf{if}\;t_4 \leq 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t_1 + t_3\right)\right)}\\
\mathbf{elif}\;t_4 \leq 2 \cdot 10^{+149}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t_1 + n \cdot \left(t_2 \cdot \left(U* - U\right)\right)\right)\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*))))) < 0.0Initial program 8.9%
Simplified34.4%
associate-*r/34.4%
associate-*l/34.4%
associate-*r*34.4%
Applied egg-rr34.4%
associate-*r*38.2%
sub-neg38.2%
distribute-lft-in38.2%
Applied egg-rr38.2%
distribute-lft-out38.2%
sub-neg38.2%
*-commutative38.2%
Simplified38.2%
if 0.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*))))) < 2.0000000000000001e149Initial program 95.1%
if 2.0000000000000001e149 < (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 25.3%
Simplified28.7%
associate-*r/28.7%
associate-*l/38.0%
associate-*r*38.0%
Applied egg-rr38.0%
Final simplification61.2%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= U 2.2e+32)
(sqrt
(*
(* 2.0 n)
(*
U
(+ (- t (* l (* 2.0 (/ l Om)))) (* n (* (pow (/ l Om) 2.0) (- U* U)))))))
(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_) {
double tmp;
if (U <= 2.2e+32) {
tmp = sqrt(((2.0 * n) * (U * ((t - (l * (2.0 * (l / Om)))) + (n * (pow((l / Om), 2.0) * (U_42_ - U)))))));
} else {
tmp = sqrt((2.0 * (U * (n * (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.2d+32) then
tmp = sqrt(((2.0d0 * n) * (u * ((t - (l * (2.0d0 * (l / om)))) + (n * (((l / om) ** 2.0d0) * (u_42 - u)))))))
else
tmp = sqrt((2.0d0 * (u * (n * (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.2e+32) {
tmp = Math.sqrt(((2.0 * n) * (U * ((t - (l * (2.0 * (l / Om)))) + (n * (Math.pow((l / Om), 2.0) * (U_42_ - U)))))));
} else {
tmp = Math.sqrt((2.0 * (U * (n * (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.2e+32: tmp = math.sqrt(((2.0 * n) * (U * ((t - (l * (2.0 * (l / Om)))) + (n * (math.pow((l / Om), 2.0) * (U_42_ - U))))))) else: tmp = math.sqrt((2.0 * (U * (n * (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.2e+32) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(Float64(t - Float64(l * Float64(2.0 * Float64(l / Om)))) + Float64(n * Float64((Float64(l / Om) ^ 2.0) * Float64(U_42_ - U))))))); else tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * 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.2e+32) tmp = sqrt(((2.0 * n) * (U * ((t - (l * (2.0 * (l / Om)))) + (n * (((l / Om) ^ 2.0) * (U_42_ - U))))))); else tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l ^ 2.0) / Om))))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, 2.2e+32], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(t - N[(l * N[(2.0 * N[(l / Om), $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[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}
\\
\begin{array}{l}
\mathbf{if}\;U \leq 2.2 \cdot 10^{+32}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t - \ell \cdot \left(2 \cdot \frac{\ell}{Om}\right)\right) + n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U* - U\right)\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}\\
\end{array}
\end{array}
if U < 2.20000000000000001e32Initial program 46.8%
Simplified46.9%
associate-*r/46.9%
associate-*l/52.5%
associate-*r*52.5%
Applied egg-rr52.5%
if 2.20000000000000001e32 < U Initial program 76.5%
Simplified55.1%
Taylor expanded in n around 0 76.4%
Final simplification56.7%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= U 1.95e+32)
(sqrt
(*
(* 2.0 n)
(*
U
(+ (- t (* l (* 2.0 (/ l Om)))) (* (* n (pow (/ l Om) 2.0)) (- U* U))))))
(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_) {
double tmp;
if (U <= 1.95e+32) {
tmp = sqrt(((2.0 * n) * (U * ((t - (l * (2.0 * (l / Om)))) + ((n * pow((l / Om), 2.0)) * (U_42_ - U))))));
} else {
tmp = sqrt((2.0 * (U * (n * (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 <= 1.95d+32) then
tmp = sqrt(((2.0d0 * n) * (u * ((t - (l * (2.0d0 * (l / om)))) + ((n * ((l / om) ** 2.0d0)) * (u_42 - u))))))
else
tmp = sqrt((2.0d0 * (u * (n * (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 <= 1.95e+32) {
tmp = Math.sqrt(((2.0 * n) * (U * ((t - (l * (2.0 * (l / Om)))) + ((n * Math.pow((l / Om), 2.0)) * (U_42_ - U))))));
} else {
tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * (Math.pow(l, 2.0) / Om)))))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if U <= 1.95e+32: tmp = math.sqrt(((2.0 * n) * (U * ((t - (l * (2.0 * (l / Om)))) + ((n * math.pow((l / Om), 2.0)) * (U_42_ - U)))))) else: tmp = math.sqrt((2.0 * (U * (n * (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 <= 1.95e+32) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(Float64(t - Float64(l * Float64(2.0 * Float64(l / Om)))) + Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U_42_ - U)))))); else tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * 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 <= 1.95e+32) tmp = sqrt(((2.0 * n) * (U * ((t - (l * (2.0 * (l / Om)))) + ((n * ((l / Om) ^ 2.0)) * (U_42_ - U)))))); else tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l ^ 2.0) / Om))))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, 1.95e+32], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(t - N[(l * N[(2.0 * N[(l / Om), $MachinePrecision]), $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]], $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;U \leq 1.95 \cdot 10^{+32}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t - \ell \cdot \left(2 \cdot \frac{\ell}{Om}\right)\right) + \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}\\
\end{array}
\end{array}
if U < 1.95e32Initial program 46.8%
Simplified46.9%
associate-*r/46.9%
associate-*l/52.5%
associate-*r*52.5%
Applied egg-rr52.5%
associate-*r*53.4%
sub-neg53.4%
distribute-lft-in44.8%
Applied egg-rr44.8%
distribute-lft-out53.4%
sub-neg53.4%
*-commutative53.4%
Simplified53.4%
if 1.95e32 < U Initial program 76.5%
Simplified55.1%
Taylor expanded in n around 0 76.4%
Final simplification57.4%
(FPCore (n U t l Om U*) :precision binary64 (if (<= t 1.8e+74) (sqrt (* 2.0 (* U (* n (- 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 <= 1.8e+74) {
tmp = sqrt((2.0 * (U * (n * (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 <= 1.8d+74) then
tmp = sqrt((2.0d0 * (u * (n * (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 <= 1.8e+74) {
tmp = Math.sqrt((2.0 * (U * (n * (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 <= 1.8e+74: tmp = math.sqrt((2.0 * (U * (n * (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 <= 1.8e+74) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * 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 <= 1.8e+74) tmp = sqrt((2.0 * (U * (n * (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, 1.8e+74], 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[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 1.8 \cdot 10^{+74}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left|U \cdot \left(n \cdot t\right)\right|}\\
\end{array}
\end{array}
if t < 1.79999999999999994e74Initial program 52.4%
Simplified54.0%
Taylor expanded in n around 0 48.6%
if 1.79999999999999994e74 < t Initial program 49.9%
Simplified47.4%
Taylor expanded in t around inf 51.7%
add-sqr-sqrt51.6%
pow1/251.6%
pow1/261.2%
pow-prod-down36.7%
pow236.7%
Applied egg-rr36.7%
unpow1/236.7%
unpow236.7%
rem-sqrt-square61.8%
Simplified61.8%
Final simplification50.8%
(FPCore (n U t l Om U*) :precision binary64 (if (<= t 4.3e+74) (sqrt (* (* 2.0 U) (* n (+ t (* (/ (pow l 2.0) Om) -2.0))))) (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 <= 4.3e+74) {
tmp = sqrt(((2.0 * U) * (n * (t + ((pow(l, 2.0) / Om) * -2.0)))));
} 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 <= 4.3d+74) then
tmp = sqrt(((2.0d0 * u) * (n * (t + (((l ** 2.0d0) / om) * (-2.0d0))))))
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 <= 4.3e+74) {
tmp = Math.sqrt(((2.0 * U) * (n * (t + ((Math.pow(l, 2.0) / Om) * -2.0)))));
} 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 <= 4.3e+74: tmp = math.sqrt(((2.0 * U) * (n * (t + ((math.pow(l, 2.0) / Om) * -2.0))))) 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 <= 4.3e+74) tmp = sqrt(Float64(Float64(2.0 * U) * Float64(n * Float64(t + Float64(Float64((l ^ 2.0) / Om) * -2.0))))); 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 <= 4.3e+74) tmp = sqrt(((2.0 * U) * (n * (t + (((l ^ 2.0) / Om) * -2.0))))); 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, 4.3e+74], N[Sqrt[N[(N[(2.0 * U), $MachinePrecision] * N[(n * N[(t + N[(N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] * -2.0), $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 4.3 \cdot 10^{+74}:\\
\;\;\;\;\sqrt{\left(2 \cdot U\right) \cdot \left(n \cdot \left(t + \frac{{\ell}^{2}}{Om} \cdot -2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left|U \cdot \left(n \cdot t\right)\right|}\\
\end{array}
\end{array}
if t < 4.30000000000000001e74Initial program 52.4%
Simplified49.0%
associate-*r/49.0%
associate-*l/54.0%
associate-*r*54.0%
Applied egg-rr54.0%
associate-*r*54.9%
sub-neg54.9%
distribute-lft-in45.7%
Applied egg-rr45.7%
distribute-lft-out54.9%
sub-neg54.9%
*-commutative54.9%
Simplified54.9%
Taylor expanded in n around 0 48.6%
associate-*r*48.6%
sub-neg48.6%
*-commutative48.6%
distribute-rgt-neg-in48.6%
metadata-eval48.6%
Simplified48.6%
if 4.30000000000000001e74 < t Initial program 49.9%
Simplified47.4%
Taylor expanded in t around inf 51.7%
add-sqr-sqrt51.6%
pow1/251.6%
pow1/261.2%
pow-prod-down36.7%
pow236.7%
Applied egg-rr36.7%
unpow1/236.7%
unpow236.7%
rem-sqrt-square61.8%
Simplified61.8%
Final simplification50.8%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 3.9e+80) (sqrt (* 2.0 (fabs (* U (* n t))))) (sqrt (* -4.0 (* (* n (pow l 2.0)) (/ U Om))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 3.9e+80) {
tmp = sqrt((2.0 * fabs((U * (n * t)))));
} else {
tmp = sqrt((-4.0 * ((n * pow(l, 2.0)) * (U / 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.9d+80) then
tmp = sqrt((2.0d0 * abs((u * (n * t)))))
else
tmp = sqrt(((-4.0d0) * ((n * (l ** 2.0d0)) * (u / 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.9e+80) {
tmp = Math.sqrt((2.0 * Math.abs((U * (n * t)))));
} else {
tmp = Math.sqrt((-4.0 * ((n * Math.pow(l, 2.0)) * (U / Om))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 3.9e+80: tmp = math.sqrt((2.0 * math.fabs((U * (n * t))))) else: tmp = math.sqrt((-4.0 * ((n * math.pow(l, 2.0)) * (U / Om)))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 3.9e+80) tmp = sqrt(Float64(2.0 * abs(Float64(U * Float64(n * t))))); else tmp = sqrt(Float64(-4.0 * Float64(Float64(n * (l ^ 2.0)) * Float64(U / Om)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 3.9e+80) tmp = sqrt((2.0 * abs((U * (n * t))))); else tmp = sqrt((-4.0 * ((n * (l ^ 2.0)) * (U / Om)))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 3.9e+80], N[Sqrt[N[(2.0 * N[Abs[N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(-4.0 * N[(N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(U / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.9 \cdot 10^{+80}:\\
\;\;\;\;\sqrt{2 \cdot \left|U \cdot \left(n \cdot t\right)\right|}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{-4 \cdot \left(\left(n \cdot {\ell}^{2}\right) \cdot \frac{U}{Om}\right)}\\
\end{array}
\end{array}
if l < 3.89999999999999999e80Initial program 56.6%
Simplified54.5%
Taylor expanded in t around inf 44.5%
add-sqr-sqrt44.4%
pow1/244.4%
pow1/246.4%
pow-prod-down28.1%
pow228.1%
Applied egg-rr28.1%
unpow1/228.1%
unpow228.1%
rem-sqrt-square47.1%
Simplified47.1%
if 3.89999999999999999e80 < l Initial program 30.2%
Simplified32.4%
associate-*r/32.4%
associate-*l/45.3%
associate-*r*45.3%
Applied egg-rr45.3%
Taylor expanded in n around 0 30.8%
associate-*r*26.2%
*-commutative26.2%
sub-neg26.2%
*-commutative26.2%
distribute-rgt-neg-in26.2%
metadata-eval26.2%
Simplified26.2%
Taylor expanded in t around 0 28.4%
*-commutative28.4%
associate-*l/28.1%
Simplified28.1%
Final simplification43.8%
(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 52.0%
Simplified52.9%
Taylor expanded in t around inf 38.6%
add-sqr-sqrt38.6%
pow1/238.6%
pow1/241.0%
pow-prod-down26.4%
pow226.4%
Applied egg-rr26.4%
unpow1/226.4%
unpow226.4%
rem-sqrt-square41.7%
Simplified41.7%
Final simplification41.7%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 1.9e+33) (sqrt (* 2.0 (* U (* n t)))) (pow (* n (* t (* 2.0 U))) 0.5)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.9e+33) {
tmp = sqrt((2.0 * (U * (n * t))));
} else {
tmp = pow((n * (t * (2.0 * U))), 0.5);
}
return tmp;
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (l <= 1.9d+33) then
tmp = sqrt((2.0d0 * (u * (n * t))))
else
tmp = (n * (t * (2.0d0 * u))) ** 0.5d0
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.9e+33) {
tmp = Math.sqrt((2.0 * (U * (n * t))));
} else {
tmp = Math.pow((n * (t * (2.0 * U))), 0.5);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 1.9e+33: tmp = math.sqrt((2.0 * (U * (n * t)))) else: tmp = math.pow((n * (t * (2.0 * U))), 0.5) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 1.9e+33) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t)))); else tmp = Float64(n * Float64(t * Float64(2.0 * U))) ^ 0.5; end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 1.9e+33) tmp = sqrt((2.0 * (U * (n * t)))); else tmp = (n * (t * (2.0 * U))) ^ 0.5; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 1.9e+33], N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(n * N[(t * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.9 \cdot 10^{+33}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(n \cdot \left(t \cdot \left(2 \cdot U\right)\right)\right)}^{0.5}\\
\end{array}
\end{array}
if l < 1.90000000000000001e33Initial program 56.6%
Simplified54.4%
Taylor expanded in t around inf 45.4%
if 1.90000000000000001e33 < l Initial program 34.7%
Simplified47.4%
Taylor expanded in t around inf 13.5%
associate-*r*11.7%
*-commutative11.7%
associate-*l*11.7%
*-commutative11.7%
associate-*r*11.7%
*-commutative11.7%
Simplified11.7%
pow1/215.4%
associate-*l*15.4%
Applied egg-rr15.4%
Taylor expanded in t around 0 17.2%
associate-*r*17.2%
*-commutative17.2%
*-commutative17.2%
associate-*l*15.5%
Simplified15.5%
Final simplification39.1%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 1.36e+32) (sqrt (* 2.0 (* U (* n t)))) (pow (* t (* n (* 2.0 U))) 0.5)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.36e+32) {
tmp = sqrt((2.0 * (U * (n * t))));
} else {
tmp = pow((t * (n * (2.0 * U))), 0.5);
}
return tmp;
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (l <= 1.36d+32) then
tmp = sqrt((2.0d0 * (u * (n * t))))
else
tmp = (t * (n * (2.0d0 * u))) ** 0.5d0
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.36e+32) {
tmp = Math.sqrt((2.0 * (U * (n * t))));
} else {
tmp = Math.pow((t * (n * (2.0 * U))), 0.5);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 1.36e+32: tmp = math.sqrt((2.0 * (U * (n * t)))) else: tmp = math.pow((t * (n * (2.0 * U))), 0.5) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 1.36e+32) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t)))); else tmp = Float64(t * Float64(n * Float64(2.0 * U))) ^ 0.5; end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 1.36e+32) tmp = sqrt((2.0 * (U * (n * t)))); else tmp = (t * (n * (2.0 * U))) ^ 0.5; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 1.36e+32], N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(t * N[(n * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.36 \cdot 10^{+32}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right)}^{0.5}\\
\end{array}
\end{array}
if l < 1.3599999999999999e32Initial program 56.5%
Simplified54.3%
Taylor expanded in t around inf 45.6%
if 1.3599999999999999e32 < l Initial program 35.8%
Simplified48.0%
Taylor expanded in t around inf 13.7%
associate-*r*11.9%
*-commutative11.9%
associate-*l*12.0%
*-commutative12.0%
associate-*r*12.0%
*-commutative12.0%
Simplified12.0%
pow1/215.5%
associate-*l*15.5%
Applied egg-rr15.5%
Final simplification39.0%
(FPCore (n U t l Om U*) :precision binary64 (pow (* (* 2.0 U) (* n t)) 0.5))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return pow(((2.0 * U) * (n * 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 * u) * (n * 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 * U) * (n * t)), 0.5);
}
def code(n, U, t, l, Om, U_42_): return math.pow(((2.0 * U) * (n * t)), 0.5)
function code(n, U, t, l, Om, U_42_) return Float64(Float64(2.0 * U) * Float64(n * t)) ^ 0.5 end
function tmp = code(n, U, t, l, Om, U_42_) tmp = ((2.0 * U) * (n * t)) ^ 0.5; end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Power[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]
\begin{array}{l}
\\
{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{0.5}
\end{array}
Initial program 52.0%
Simplified52.9%
Taylor expanded in t around inf 38.6%
pow1/241.1%
associate-*r*41.1%
Applied egg-rr41.1%
Final simplification41.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 52.0%
Simplified52.9%
Taylor expanded in t around inf 38.6%
Final simplification38.6%
herbie shell --seed 2024024
(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*))))))