
(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 9 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
(sqrt
(*
(* (* 2.0 n) U)
(+ (- t (* 2.0 (/ (* l l) Om))) (* t_1 (- U* U)))))))
(if (<= t_2 4e-160)
(*
(sqrt (* 2.0 n))
(sqrt (* U (- t (fma (- U U*) t_1 (/ (* 2.0 (pow l 2.0)) Om))))))
(if (<= t_2 INFINITY)
(sqrt
(* (* 2.0 (* n U)) (- t (+ (* 2.0 (* l (/ l Om))) (* t_1 (- U U*))))))
(pow (* -4.0 (/ (* U (* n (pow l 2.0))) Om)) 0.5)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = n * pow((l / Om), 2.0);
double t_2 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + (t_1 * (U_42_ - U)))));
double tmp;
if (t_2 <= 4e-160) {
tmp = sqrt((2.0 * n)) * sqrt((U * (t - fma((U - U_42_), t_1, ((2.0 * pow(l, 2.0)) / Om)))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt(((2.0 * (n * U)) * (t - ((2.0 * (l * (l / Om))) + (t_1 * (U - U_42_))))));
} else {
tmp = pow((-4.0 * ((U * (n * pow(l, 2.0))) / Om)), 0.5);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(n * (Float64(l / Om) ^ 2.0)) t_2 = sqrt(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))))) tmp = 0.0 if (t_2 <= 4e-160) tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * Float64(t - fma(Float64(U - U_42_), t_1, Float64(Float64(2.0 * (l ^ 2.0)) / Om)))))); elseif (t_2 <= Inf) tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t - Float64(Float64(2.0 * Float64(l * Float64(l / Om))) + Float64(t_1 * Float64(U - U_42_)))))); else tmp = Float64(-4.0 * Float64(Float64(U * Float64(n * (l ^ 2.0))) / Om)) ^ 0.5; end return 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[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[(t$95$1 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 4e-160], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(t - N[(N[(U - U$42$), $MachinePrecision] * t$95$1 + N[(N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $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[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(-4.0 * N[(N[(U * N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\\
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 \cdot \left(U* - U\right)\right)}\\
\mathbf{if}\;t\_2 \leq 4 \cdot 10^{-160}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(U - U*, t\_1, \frac{2 \cdot {\ell}^{2}}{Om}\right)\right)}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \left(2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right) + t\_1 \cdot \left(U - U*\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(-4 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om}\right)}^{0.5}\\
\end{array}
\end{array}
if (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*))))) < 4e-160Initial program 14.3%
Simplified33.0%
sqrt-prod52.3%
fma-undefine52.3%
associate-*r*55.5%
+-commutative55.5%
*-commutative55.5%
fma-define55.5%
associate-*r/52.4%
pow252.4%
Applied egg-rr52.4%
*-commutative52.4%
associate-*r/52.4%
Simplified52.4%
if 4e-160 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) < +inf.0Initial program 66.1%
Simplified68.1%
if +inf.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) Initial program 0.0%
Simplified3.3%
Taylor expanded in n around 0 5.4%
pow1/231.0%
associate-*r*31.0%
*-commutative31.0%
cancel-sign-sub-inv31.0%
metadata-eval31.0%
Applied egg-rr31.0%
Taylor expanded in t around 0 36.3%
Final simplification61.6%
(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))))))
(if (<= t_2 0.0)
(* (sqrt (* 2.0 n)) (sqrt (* U t)))
(if (<= t_2 INFINITY)
(sqrt
(* (* 2.0 (* n U)) (- t (+ (* 2.0 (* l (/ l Om))) (* t_1 (- U U*))))))
(pow (* -4.0 (/ (* U (* n (pow l 2.0))) Om)) 0.5)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = n * pow((l / Om), 2.0);
double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + (t_1 * (U_42_ - U)));
double tmp;
if (t_2 <= 0.0) {
tmp = sqrt((2.0 * n)) * sqrt((U * t));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt(((2.0 * (n * U)) * (t - ((2.0 * (l * (l / Om))) + (t_1 * (U - U_42_))))));
} else {
tmp = pow((-4.0 * ((U * (n * pow(l, 2.0))) / Om)), 0.5);
}
return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = n * Math.pow((l / Om), 2.0);
double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + (t_1 * (U_42_ - U)));
double tmp;
if (t_2 <= 0.0) {
tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * t));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt(((2.0 * (n * U)) * (t - ((2.0 * (l * (l / Om))) + (t_1 * (U - U_42_))))));
} else {
tmp = Math.pow((-4.0 * ((U * (n * Math.pow(l, 2.0))) / Om)), 0.5);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = n * math.pow((l / Om), 2.0) t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + (t_1 * (U_42_ - U))) tmp = 0 if t_2 <= 0.0: tmp = math.sqrt((2.0 * n)) * math.sqrt((U * t)) elif t_2 <= math.inf: tmp = math.sqrt(((2.0 * (n * U)) * (t - ((2.0 * (l * (l / Om))) + (t_1 * (U - U_42_)))))) else: tmp = math.pow((-4.0 * ((U * (n * math.pow(l, 2.0))) / Om)), 0.5) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(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)))) tmp = 0.0 if (t_2 <= 0.0) tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * t))); elseif (t_2 <= Inf) tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t - Float64(Float64(2.0 * Float64(l * Float64(l / Om))) + Float64(t_1 * Float64(U - U_42_)))))); else tmp = Float64(-4.0 * Float64(Float64(U * Float64(n * (l ^ 2.0))) / Om)) ^ 0.5; end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = n * ((l / Om) ^ 2.0); t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + (t_1 * (U_42_ - U))); tmp = 0.0; if (t_2 <= 0.0) tmp = sqrt((2.0 * n)) * sqrt((U * t)); elseif (t_2 <= Inf) tmp = sqrt(((2.0 * (n * U)) * (t - ((2.0 * (l * (l / Om))) + (t_1 * (U - U_42_)))))); else tmp = (-4.0 * ((U * (n * (l ^ 2.0))) / Om)) ^ 0.5; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(n * N[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]}, If[LessEqual[t$95$2, 0.0], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t - N[(N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(-4.0 * N[(N[(U * N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 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)\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot t}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \left(2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right) + t\_1 \cdot \left(U - U*\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(-4 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om}\right)}^{0.5}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < 0.0Initial program 10.5%
Simplified33.1%
Taylor expanded in t around inf 31.7%
sqrt-prod40.6%
Applied egg-rr40.6%
*-commutative40.6%
Simplified40.6%
if 0.0 < (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < +inf.0Initial program 65.8%
Simplified67.8%
if +inf.0 < (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) Initial program 0.0%
Simplified0.7%
Taylor expanded in n around 0 4.9%
pow1/234.9%
associate-*r*34.9%
*-commutative34.9%
cancel-sign-sub-inv34.9%
metadata-eval34.9%
Applied egg-rr34.9%
Taylor expanded in t around 0 42.4%
Final simplification61.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (sqrt (fabs (* (* 2.0 U) (* n t))))))
(if (<= l 2.8e-111)
t_1
(if (<= l 3.8e-91)
(/ (* (* (* n l) (sqrt 2.0)) (sqrt (* U U*))) Om)
(if (<= l 2e+96)
t_1
(pow (* -4.0 (* U (* (pow l 2.0) (/ n Om)))) 0.5))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt(fabs(((2.0 * U) * (n * t))));
double tmp;
if (l <= 2.8e-111) {
tmp = t_1;
} else if (l <= 3.8e-91) {
tmp = (((n * l) * sqrt(2.0)) * sqrt((U * U_42_))) / Om;
} else if (l <= 2e+96) {
tmp = t_1;
} else {
tmp = pow((-4.0 * (U * (pow(l, 2.0) * (n / 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) :: t_1
real(8) :: tmp
t_1 = sqrt(abs(((2.0d0 * u) * (n * t))))
if (l <= 2.8d-111) then
tmp = t_1
else if (l <= 3.8d-91) then
tmp = (((n * l) * sqrt(2.0d0)) * sqrt((u * u_42))) / om
else if (l <= 2d+96) then
tmp = t_1
else
tmp = ((-4.0d0) * (u * ((l ** 2.0d0) * (n / 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 t_1 = Math.sqrt(Math.abs(((2.0 * U) * (n * t))));
double tmp;
if (l <= 2.8e-111) {
tmp = t_1;
} else if (l <= 3.8e-91) {
tmp = (((n * l) * Math.sqrt(2.0)) * Math.sqrt((U * U_42_))) / Om;
} else if (l <= 2e+96) {
tmp = t_1;
} else {
tmp = Math.pow((-4.0 * (U * (Math.pow(l, 2.0) * (n / Om)))), 0.5);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = math.sqrt(math.fabs(((2.0 * U) * (n * t)))) tmp = 0 if l <= 2.8e-111: tmp = t_1 elif l <= 3.8e-91: tmp = (((n * l) * math.sqrt(2.0)) * math.sqrt((U * U_42_))) / Om elif l <= 2e+96: tmp = t_1 else: tmp = math.pow((-4.0 * (U * (math.pow(l, 2.0) * (n / Om)))), 0.5) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = sqrt(abs(Float64(Float64(2.0 * U) * Float64(n * t)))) tmp = 0.0 if (l <= 2.8e-111) tmp = t_1; elseif (l <= 3.8e-91) tmp = Float64(Float64(Float64(Float64(n * l) * sqrt(2.0)) * sqrt(Float64(U * U_42_))) / Om); elseif (l <= 2e+96) tmp = t_1; else tmp = Float64(-4.0 * Float64(U * Float64((l ^ 2.0) * Float64(n / Om)))) ^ 0.5; end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = sqrt(abs(((2.0 * U) * (n * t)))); tmp = 0.0; if (l <= 2.8e-111) tmp = t_1; elseif (l <= 3.8e-91) tmp = (((n * l) * sqrt(2.0)) * sqrt((U * U_42_))) / Om; elseif (l <= 2e+96) tmp = t_1; else tmp = (-4.0 * (U * ((l ^ 2.0) * (n / Om)))) ^ 0.5; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[Abs[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, 2.8e-111], t$95$1, If[LessEqual[l, 3.8e-91], N[(N[(N[(N[(n * l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(U * U$42$), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision], If[LessEqual[l, 2e+96], t$95$1, N[Power[N[(-4.0 * N[(U * N[(N[Power[l, 2.0], $MachinePrecision] * N[(n / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\left|\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right|}\\
\mathbf{if}\;\ell \leq 2.8 \cdot 10^{-111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-91}:\\
\;\;\;\;\frac{\left(\left(n \cdot \ell\right) \cdot \sqrt{2}\right) \cdot \sqrt{U \cdot U*}}{Om}\\
\mathbf{elif}\;\ell \leq 2 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;{\left(-4 \cdot \left(U \cdot \left({\ell}^{2} \cdot \frac{n}{Om}\right)\right)\right)}^{0.5}\\
\end{array}
\end{array}
if l < 2.79999999999999995e-111 or 3.79999999999999978e-91 < l < 2.0000000000000001e96Initial program 54.2%
Simplified55.1%
Taylor expanded in t around inf 43.0%
add-sqr-sqrt43.0%
pow1/243.0%
pow1/243.1%
pow-prod-down33.5%
pow233.5%
Applied egg-rr33.5%
unpow1/233.5%
unpow233.5%
rem-sqrt-square43.8%
associate-*l*43.6%
associate-*r*44.2%
*-commutative44.2%
associate-*r*48.8%
associate-*r*48.9%
*-commutative48.9%
Simplified48.9%
if 2.79999999999999995e-111 < l < 3.79999999999999978e-91Initial program 36.2%
Simplified20.2%
Taylor expanded in U* around inf 67.0%
associate-*l/67.5%
associate-*r*67.5%
Applied egg-rr67.5%
if 2.0000000000000001e96 < l Initial program 31.9%
Simplified34.5%
Taylor expanded in n around 0 27.7%
pow1/246.5%
associate-*r*46.5%
*-commutative46.5%
cancel-sign-sub-inv46.5%
metadata-eval46.5%
Applied egg-rr46.5%
Taylor expanded in t around 0 46.5%
associate-/l*44.0%
associate-/l*44.0%
Simplified44.0%
Final simplification48.6%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= t -3.7e+98)
(sqrt (fabs (* (* 2.0 U) (* n t))))
(if (<= t 2.5e+177)
(sqrt (* 2.0 (* U (* n (- t (* 2.0 (/ (pow l 2.0) Om)))))))
(* (sqrt (* (* 2.0 n) U)) (sqrt t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= -3.7e+98) {
tmp = sqrt(fabs(((2.0 * U) * (n * t))));
} else if (t <= 2.5e+177) {
tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (pow(l, 2.0) / Om)))))));
} else {
tmp = sqrt(((2.0 * n) * U)) * sqrt(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 <= (-3.7d+98)) then
tmp = sqrt(abs(((2.0d0 * u) * (n * t))))
else if (t <= 2.5d+177) then
tmp = sqrt((2.0d0 * (u * (n * (t - (2.0d0 * ((l ** 2.0d0) / om)))))))
else
tmp = sqrt(((2.0d0 * n) * u)) * sqrt(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 <= -3.7e+98) {
tmp = Math.sqrt(Math.abs(((2.0 * U) * (n * t))));
} else if (t <= 2.5e+177) {
tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * (Math.pow(l, 2.0) / Om)))))));
} else {
tmp = Math.sqrt(((2.0 * n) * U)) * Math.sqrt(t);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if t <= -3.7e+98: tmp = math.sqrt(math.fabs(((2.0 * U) * (n * t)))) elif t <= 2.5e+177: tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * (math.pow(l, 2.0) / Om))))))) else: tmp = math.sqrt(((2.0 * n) * U)) * math.sqrt(t) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= -3.7e+98) tmp = sqrt(abs(Float64(Float64(2.0 * U) * Float64(n * t)))); elseif (t <= 2.5e+177) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64((l ^ 2.0) / Om))))))); else tmp = Float64(sqrt(Float64(Float64(2.0 * n) * U)) * sqrt(t)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (t <= -3.7e+98) tmp = sqrt(abs(((2.0 * U) * (n * t)))); elseif (t <= 2.5e+177) tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l ^ 2.0) / Om))))))); else tmp = sqrt(((2.0 * n) * U)) * sqrt(t); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, -3.7e+98], N[Sqrt[N[Abs[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 2.5e+177], 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[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{+98}:\\
\;\;\;\;\sqrt{\left|\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right|}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+177}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot U} \cdot \sqrt{t}\\
\end{array}
\end{array}
if t < -3.6999999999999999e98Initial program 48.3%
Simplified46.8%
Taylor expanded in t around inf 45.3%
add-sqr-sqrt45.3%
pow1/245.3%
pow1/245.5%
pow-prod-down44.1%
pow244.1%
Applied egg-rr44.1%
unpow1/244.1%
unpow244.1%
rem-sqrt-square46.0%
associate-*l*46.0%
associate-*r*45.8%
*-commutative45.8%
associate-*r*57.4%
associate-*r*57.4%
*-commutative57.4%
Simplified57.4%
if -3.6999999999999999e98 < t < 2.5000000000000001e177Initial program 53.1%
Simplified55.4%
Taylor expanded in n around 0 47.7%
if 2.5000000000000001e177 < t Initial program 40.1%
Simplified37.5%
Taylor expanded in t around inf 38.8%
pow1/238.8%
associate-*r*44.6%
unpow-prod-down63.6%
pow1/263.6%
Applied egg-rr63.6%
unpow1/263.6%
*-commutative63.6%
*-commutative63.6%
Simplified63.6%
Final simplification51.8%
(FPCore (n U t l Om U*) :precision binary64 (if (<= t 2.1e+222) (pow (* (* 2.0 U) (* n (+ t (* -2.0 (/ (pow l 2.0) Om))))) 0.5) (* (sqrt (* (* 2.0 n) U)) (sqrt t))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= 2.1e+222) {
tmp = pow(((2.0 * U) * (n * (t + (-2.0 * (pow(l, 2.0) / Om))))), 0.5);
} else {
tmp = sqrt(((2.0 * n) * U)) * sqrt(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.1d+222) then
tmp = ((2.0d0 * u) * (n * (t + ((-2.0d0) * ((l ** 2.0d0) / om))))) ** 0.5d0
else
tmp = sqrt(((2.0d0 * n) * u)) * sqrt(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.1e+222) {
tmp = Math.pow(((2.0 * U) * (n * (t + (-2.0 * (Math.pow(l, 2.0) / Om))))), 0.5);
} else {
tmp = Math.sqrt(((2.0 * n) * U)) * Math.sqrt(t);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if t <= 2.1e+222: tmp = math.pow(((2.0 * U) * (n * (t + (-2.0 * (math.pow(l, 2.0) / Om))))), 0.5) else: tmp = math.sqrt(((2.0 * n) * U)) * math.sqrt(t) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= 2.1e+222) tmp = Float64(Float64(2.0 * U) * Float64(n * Float64(t + Float64(-2.0 * Float64((l ^ 2.0) / Om))))) ^ 0.5; else tmp = Float64(sqrt(Float64(Float64(2.0 * n) * U)) * sqrt(t)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (t <= 2.1e+222) tmp = ((2.0 * U) * (n * (t + (-2.0 * ((l ^ 2.0) / Om))))) ^ 0.5; else tmp = sqrt(((2.0 * n) * U)) * sqrt(t); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, 2.1e+222], N[Power[N[(N[(2.0 * U), $MachinePrecision] * N[(n * N[(t + N[(-2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[(N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.1 \cdot 10^{+222}:\\
\;\;\;\;{\left(\left(2 \cdot U\right) \cdot \left(n \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot U} \cdot \sqrt{t}\\
\end{array}
\end{array}
if t < 2.1000000000000001e222Initial program 50.9%
Simplified53.1%
Taylor expanded in n around 0 46.7%
pow1/252.2%
associate-*r*52.3%
*-commutative52.3%
cancel-sign-sub-inv52.3%
metadata-eval52.3%
Applied egg-rr52.3%
if 2.1000000000000001e222 < t Initial program 44.9%
Simplified36.2%
Taylor expanded in t around inf 38.1%
pow1/238.1%
associate-*r*52.0%
unpow-prod-down73.9%
pow1/273.9%
Applied egg-rr73.9%
unpow1/273.9%
*-commutative73.9%
*-commutative73.9%
Simplified73.9%
Final simplification54.1%
(FPCore (n U t l Om U*) :precision binary64 (if (<= U 3.4e-277) (sqrt (fabs (* (* 2.0 U) (* n t)))) (* (sqrt (* 2.0 U)) (sqrt (* n t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 3.4e-277) {
tmp = sqrt(fabs(((2.0 * U) * (n * t))));
} else {
tmp = sqrt((2.0 * U)) * sqrt((n * t));
}
return tmp;
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (u <= 3.4d-277) then
tmp = sqrt(abs(((2.0d0 * u) * (n * t))))
else
tmp = sqrt((2.0d0 * u)) * sqrt((n * t))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 3.4e-277) {
tmp = Math.sqrt(Math.abs(((2.0 * U) * (n * t))));
} else {
tmp = Math.sqrt((2.0 * U)) * Math.sqrt((n * t));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if U <= 3.4e-277: tmp = math.sqrt(math.fabs(((2.0 * U) * (n * t)))) else: tmp = math.sqrt((2.0 * U)) * math.sqrt((n * t)) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= 3.4e-277) tmp = sqrt(abs(Float64(Float64(2.0 * U) * Float64(n * t)))); else tmp = Float64(sqrt(Float64(2.0 * U)) * sqrt(Float64(n * t))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U <= 3.4e-277) tmp = sqrt(abs(((2.0 * U) * (n * t)))); else tmp = sqrt((2.0 * U)) * sqrt((n * t)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, 3.4e-277], N[Sqrt[N[Abs[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $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 3.4 \cdot 10^{-277}:\\
\;\;\;\;\sqrt{\left|\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right|}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\
\end{array}
\end{array}
if U < 3.39999999999999982e-277Initial program 44.0%
Simplified47.0%
Taylor expanded in t around inf 36.4%
add-sqr-sqrt36.4%
pow1/236.4%
pow1/236.5%
pow-prod-down30.1%
pow230.1%
Applied egg-rr30.1%
unpow1/230.1%
unpow230.1%
rem-sqrt-square37.5%
associate-*l*37.5%
associate-*r*36.7%
*-commutative36.7%
associate-*r*39.2%
associate-*r*39.2%
*-commutative39.2%
Simplified39.2%
if 3.39999999999999982e-277 < U Initial program 58.1%
Simplified59.0%
Taylor expanded in t around inf 46.6%
pow1/246.7%
associate-*r*46.9%
*-commutative46.9%
unpow-prod-down54.5%
pow1/254.5%
pow1/254.4%
Applied egg-rr54.4%
Final simplification46.1%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (fabs (* (* 2.0 U) (* n t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt(fabs(((2.0 * U) * (n * t))));
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt(abs(((2.0d0 * u) * (n * t))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt(Math.abs(((2.0 * U) * (n * t))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt(math.fabs(((2.0 * U) * (n * t))))
function code(n, U, t, l, Om, U_42_) return sqrt(abs(Float64(Float64(2.0 * U) * Float64(n * t)))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt(abs(((2.0 * U) * (n * t)))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[Abs[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left|\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right|}
\end{array}
Initial program 50.4%
Simplified50.8%
Taylor expanded in t around inf 37.4%
add-sqr-sqrt37.4%
pow1/237.4%
pow1/237.5%
pow-prod-down30.5%
pow230.5%
Applied egg-rr30.5%
unpow1/230.5%
unpow230.5%
rem-sqrt-square38.3%
associate-*l*38.2%
associate-*r*39.1%
*-commutative39.1%
associate-*r*42.9%
associate-*r*43.0%
*-commutative43.0%
Simplified43.0%
Final simplification43.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 50.4%
Simplified52.4%
Taylor expanded in t around inf 42.0%
pow1/242.1%
associate-*r*42.2%
*-commutative42.2%
Applied egg-rr42.2%
Final simplification42.2%
(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.4%
Simplified52.4%
Taylor expanded in t around inf 42.0%
Final simplification42.0%
herbie shell --seed 2024057
(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*))))))