
(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 17 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
(if (<= n 1.55e+118)
(sqrt
(fma
(* (* -2.0 U) l)
(* (* (/ l Om) n) (fma (- U U*) (/ n Om) 2.0))
(* (* (* t n) U) 2.0)))
(* (sqrt (* (* (fma (* (/ l Om) l) -2.0 t) U) 2.0)) (sqrt n))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= 1.55e+118) {
tmp = sqrt(fma(((-2.0 * U) * l), (((l / Om) * n) * fma((U - U_42_), (n / Om), 2.0)), (((t * n) * U) * 2.0)));
} else {
tmp = sqrt(((fma(((l / Om) * l), -2.0, t) * U) * 2.0)) * sqrt(n);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= 1.55e+118) tmp = sqrt(fma(Float64(Float64(-2.0 * U) * l), Float64(Float64(Float64(l / Om) * n) * fma(Float64(U - U_42_), Float64(n / Om), 2.0)), Float64(Float64(Float64(t * n) * U) * 2.0))); else tmp = Float64(sqrt(Float64(Float64(fma(Float64(Float64(l / Om) * l), -2.0, t) * U) * 2.0)) * sqrt(n)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, 1.55e+118], N[Sqrt[N[(N[(N[(-2.0 * U), $MachinePrecision] * l), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision] * N[(N[(U - U$42$), $MachinePrecision] * N[(n / Om), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * -2.0 + t), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[n], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 1.55 \cdot 10^{+118}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\left(-2 \cdot U\right) \cdot \ell, \left(\frac{\ell}{Om} \cdot n\right) \cdot \mathsf{fma}\left(U - U*, \frac{n}{Om}, 2\right), \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(\frac{\ell}{Om} \cdot \ell, -2, t\right) \cdot U\right) \cdot 2} \cdot \sqrt{n}\\
\end{array}
\end{array}
if n < 1.54999999999999993e118Initial program 47.9%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites55.7%
Applied rewrites61.6%
Applied rewrites67.9%
if 1.54999999999999993e118 < n Initial program 59.0%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
Applied rewrites44.1%
Taylor expanded in n around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f6461.4
Applied rewrites61.4%
Applied rewrites66.7%
Final simplification67.7%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (fma (/ n Om) (- U U*) 2.0))
(t_2 (* (* 2.0 n) U))
(t_3
(*
(-
(* (- U* U) (* (pow (/ l Om) 2.0) n))
(- (* (/ (* l l) Om) 2.0) t))
t_2)))
(if (<= t_3 2e-320)
(sqrt (fma (* -2.0 U) (* (* (/ (* t_1 l) Om) l) n) (* (* (* t n) U) 2.0)))
(if (<= t_3 2e+306)
(sqrt (* (- t (/ (* (* l l) (fma (- U U*) (/ n Om) 2.0)) Om)) t_2))
(sqrt (* (* (* (* -2.0 U) l) (* (/ l Om) n)) t_1))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma((n / Om), (U - U_42_), 2.0);
double t_2 = (2.0 * n) * U;
double t_3 = (((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((((l * l) / Om) * 2.0) - t)) * t_2;
double tmp;
if (t_3 <= 2e-320) {
tmp = sqrt(fma((-2.0 * U), ((((t_1 * l) / Om) * l) * n), (((t * n) * U) * 2.0)));
} else if (t_3 <= 2e+306) {
tmp = sqrt(((t - (((l * l) * fma((U - U_42_), (n / Om), 2.0)) / Om)) * t_2));
} else {
tmp = sqrt(((((-2.0 * U) * l) * ((l / Om) * n)) * t_1));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = fma(Float64(n / Om), Float64(U - U_42_), 2.0) t_2 = Float64(Float64(2.0 * n) * U) t_3 = Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(Float64(Float64(l * l) / Om) * 2.0) - t)) * t_2) tmp = 0.0 if (t_3 <= 2e-320) tmp = sqrt(fma(Float64(-2.0 * U), Float64(Float64(Float64(Float64(t_1 * l) / Om) * l) * n), Float64(Float64(Float64(t * n) * U) * 2.0))); elseif (t_3 <= 2e+306) tmp = sqrt(Float64(Float64(t - Float64(Float64(Float64(l * l) * fma(Float64(U - U_42_), Float64(n / Om), 2.0)) / Om)) * t_2)); else tmp = sqrt(Float64(Float64(Float64(Float64(-2.0 * U) * l) * Float64(Float64(l / Om) * n)) * t_1)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(n / Om), $MachinePrecision] * N[(U - U$42$), $MachinePrecision] + 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision] * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, 2e-320], N[Sqrt[N[(N[(-2.0 * U), $MachinePrecision] * N[(N[(N[(N[(t$95$1 * l), $MachinePrecision] / Om), $MachinePrecision] * l), $MachinePrecision] * n), $MachinePrecision] + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, 2e+306], N[Sqrt[N[(N[(t - N[(N[(N[(l * l), $MachinePrecision] * N[(N[(U - U$42$), $MachinePrecision] * N[(n / Om), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(-2.0 * U), $MachinePrecision] * l), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{n}{Om}, U - U*, 2\right)\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := \left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(\frac{\ell \cdot \ell}{Om} \cdot 2 - t\right)\right) \cdot t\_2\\
\mathbf{if}\;t\_3 \leq 2 \cdot 10^{-320}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(-2 \cdot U, \left(\frac{t\_1 \cdot \ell}{Om} \cdot \ell\right) \cdot n, \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;\sqrt{\left(t - \frac{\left(\ell \cdot \ell\right) \cdot \mathsf{fma}\left(U - U*, \frac{n}{Om}, 2\right)}{Om}\right) \cdot t\_2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\left(-2 \cdot U\right) \cdot \ell\right) \cdot \left(\frac{\ell}{Om} \cdot n\right)\right) \cdot t\_1}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1.99998e-320Initial program 9.7%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites42.7%
Applied rewrites53.6%
if 1.99998e-320 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 2.00000000000000003e306Initial program 96.8%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
unpow2N/A
associate-/r*N/A
metadata-evalN/A
cancel-sign-sub-invN/A
associate-*r/N/A
div-subN/A
lower-/.f64N/A
Applied rewrites92.7%
if 2.00000000000000003e306 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 24.0%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites29.7%
Taylor expanded in t around 0
Applied rewrites30.1%
Applied rewrites49.5%
Final simplification66.5%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2
(*
(-
(* (- U* U) (* (pow (/ l Om) 2.0) n))
(- (* (/ (* l l) Om) 2.0) t))
t_1)))
(if (<= t_2 0.0)
(sqrt (fma (* (* (/ n Om) l) (* l U)) -4.0 (* (* (* t n) U) 2.0)))
(if (<= t_2 2e+306)
(sqrt (* (- t (/ (* (* l l) (fma (- U U*) (/ n Om) 2.0)) Om)) t_1))
(sqrt
(*
(* (* (* -2.0 U) l) (* (/ l Om) n))
(fma (/ n Om) (- U U*) 2.0)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = (((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((((l * l) / Om) * 2.0) - t)) * t_1;
double tmp;
if (t_2 <= 0.0) {
tmp = sqrt(fma((((n / Om) * l) * (l * U)), -4.0, (((t * n) * U) * 2.0)));
} else if (t_2 <= 2e+306) {
tmp = sqrt(((t - (((l * l) * fma((U - U_42_), (n / Om), 2.0)) / Om)) * t_1));
} else {
tmp = sqrt(((((-2.0 * U) * l) * ((l / Om) * n)) * fma((n / Om), (U - U_42_), 2.0)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) t_2 = Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(Float64(Float64(l * l) / Om) * 2.0) - t)) * t_1) tmp = 0.0 if (t_2 <= 0.0) tmp = sqrt(fma(Float64(Float64(Float64(n / Om) * l) * Float64(l * U)), -4.0, Float64(Float64(Float64(t * n) * U) * 2.0))); elseif (t_2 <= 2e+306) tmp = sqrt(Float64(Float64(t - Float64(Float64(Float64(l * l) * fma(Float64(U - U_42_), Float64(n / Om), 2.0)) / Om)) * t_1)); else tmp = sqrt(Float64(Float64(Float64(Float64(-2.0 * U) * l) * Float64(Float64(l / Om) * n)) * fma(Float64(n / Om), Float64(U - U_42_), 2.0))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision] * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[Sqrt[N[(N[(N[(N[(n / Om), $MachinePrecision] * l), $MachinePrecision] * N[(l * U), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, 2e+306], N[Sqrt[N[(N[(t - N[(N[(N[(l * l), $MachinePrecision] * N[(N[(U - U$42$), $MachinePrecision] * N[(n / Om), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(-2.0 * U), $MachinePrecision] * l), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] * N[(N[(n / Om), $MachinePrecision] * N[(U - U$42$), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := \left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(\frac{\ell \cdot \ell}{Om} \cdot 2 - t\right)\right) \cdot t\_1\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\left(\frac{n}{Om} \cdot \ell\right) \cdot \left(\ell \cdot U\right), -4, \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;\sqrt{\left(t - \frac{\left(\ell \cdot \ell\right) \cdot \mathsf{fma}\left(U - U*, \frac{n}{Om}, 2\right)}{Om}\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\left(-2 \cdot U\right) \cdot \ell\right) \cdot \left(\frac{\ell}{Om} \cdot n\right)\right) \cdot \mathsf{fma}\left(\frac{n}{Om}, U - U*, 2\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 8.8%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6436.0
Applied rewrites36.0%
Applied rewrites44.2%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 2.00000000000000003e306Initial program 96.2%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
unpow2N/A
associate-/r*N/A
metadata-evalN/A
cancel-sign-sub-invN/A
associate-*r/N/A
div-subN/A
lower-/.f64N/A
Applied rewrites92.2%
if 2.00000000000000003e306 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 24.0%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites29.7%
Taylor expanded in t around 0
Applied rewrites30.1%
Applied rewrites49.5%
Final simplification65.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (* (* 2.0 n) U))
(t_3
(* (- (* (- U* U) (* (pow (/ l Om) 2.0) n)) (- (* t_1 2.0) t)) t_2)))
(if (<= t_3 0.0)
(sqrt (* (* (* t n) U) 2.0))
(if (<= t_3 INFINITY)
(sqrt (* (fma -2.0 t_1 t) t_2))
(sqrt (* (/ (* (* (* l n) (* l n)) (* U* U)) (* Om Om)) 2.0))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = (2.0 * n) * U;
double t_3 = (((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((t_1 * 2.0) - t)) * t_2;
double tmp;
if (t_3 <= 0.0) {
tmp = sqrt((((t * n) * U) * 2.0));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((fma(-2.0, t_1, t) * t_2));
} else {
tmp = sqrt((((((l * n) * (l * n)) * (U_42_ * U)) / (Om * Om)) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(Float64(2.0 * n) * U) t_3 = Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(t_1 * 2.0) - t)) * t_2) tmp = 0.0 if (t_3 <= 0.0) tmp = sqrt(Float64(Float64(Float64(t * n) * U) * 2.0)); elseif (t_3 <= Inf) tmp = sqrt(Float64(fma(-2.0, t_1, t) * t_2)); else tmp = sqrt(Float64(Float64(Float64(Float64(Float64(l * n) * Float64(l * n)) * Float64(U_42_ * U)) / Float64(Om * Om)) * 2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$1 * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[Sqrt[N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(N[(-2.0 * t$95$1 + t), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(l * n), $MachinePrecision] * N[(l * n), $MachinePrecision]), $MachinePrecision] * N[(U$42$ * U), $MachinePrecision]), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := \left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(t\_1 \cdot 2 - t\right)\right) \cdot t\_2\\
\mathbf{if}\;t\_3 \leq 0:\\
\;\;\;\;\sqrt{\left(\left(t \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(-2, t\_1, t\right) \cdot t\_2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\left(\left(\ell \cdot n\right) \cdot \left(\ell \cdot n\right)\right) \cdot \left(U* \cdot U\right)}{Om \cdot Om} \cdot 2}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 8.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 70.1%
Taylor expanded in Om around inf
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6460.1
Applied rewrites60.1%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites20.1%
Applied rewrites26.8%
Applied rewrites55.8%
Taylor expanded in U* around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
unswap-sqrN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6426.9
Applied rewrites26.9%
Final simplification51.5%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (* (* 2.0 n) U))
(t_3
(* (- (* (- U* U) (* (pow (/ l Om) 2.0) n)) (- (* t_1 2.0) t)) t_2)))
(if (<= t_3 0.0)
(sqrt (* (* (* t n) U) 2.0))
(if (<= t_3 INFINITY)
(sqrt (* (fma -2.0 t_1 t) t_2))
(sqrt (* (* (* (/ U (* Om Om)) n) (* (* (* U* n) l) l)) 2.0))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = (2.0 * n) * U;
double t_3 = (((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((t_1 * 2.0) - t)) * t_2;
double tmp;
if (t_3 <= 0.0) {
tmp = sqrt((((t * n) * U) * 2.0));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((fma(-2.0, t_1, t) * t_2));
} else {
tmp = sqrt(((((U / (Om * Om)) * n) * (((U_42_ * n) * l) * l)) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(Float64(2.0 * n) * U) t_3 = Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(t_1 * 2.0) - t)) * t_2) tmp = 0.0 if (t_3 <= 0.0) tmp = sqrt(Float64(Float64(Float64(t * n) * U) * 2.0)); elseif (t_3 <= Inf) tmp = sqrt(Float64(fma(-2.0, t_1, t) * t_2)); else tmp = sqrt(Float64(Float64(Float64(Float64(U / Float64(Om * Om)) * n) * Float64(Float64(Float64(U_42_ * n) * l) * l)) * 2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$1 * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[Sqrt[N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(N[(-2.0 * t$95$1 + t), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(U / N[(Om * Om), $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision] * N[(N[(N[(U$42$ * n), $MachinePrecision] * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := \left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(t\_1 \cdot 2 - t\right)\right) \cdot t\_2\\
\mathbf{if}\;t\_3 \leq 0:\\
\;\;\;\;\sqrt{\left(\left(t \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(-2, t\_1, t\right) \cdot t\_2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\frac{U}{Om \cdot Om} \cdot n\right) \cdot \left(\left(\left(U* \cdot n\right) \cdot \ell\right) \cdot \ell\right)\right) \cdot 2}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 8.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 70.1%
Taylor expanded in Om around inf
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6460.1
Applied rewrites60.1%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Taylor expanded in U* around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6415.4
Applied rewrites15.4%
Applied rewrites16.4%
Applied rewrites19.2%
Final simplification50.2%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U)))
(if (<=
(sqrt
(*
(-
(* (- U* U) (* (pow (/ l Om) 2.0) n))
(- (* (/ (* l l) Om) 2.0) t))
t_1))
5e-5)
(sqrt (* (* (* t U) n) 2.0))
(sqrt (* t_1 t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double tmp;
if (sqrt(((((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((((l * l) / Om) * 2.0) - t)) * t_1)) <= 5e-5) {
tmp = sqrt((((t * U) * n) * 2.0));
} else {
tmp = sqrt((t_1 * 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) :: t_1
real(8) :: tmp
t_1 = (2.0d0 * n) * u
if (sqrt(((((u_42 - u) * (((l / om) ** 2.0d0) * n)) - ((((l * l) / om) * 2.0d0) - t)) * t_1)) <= 5d-5) then
tmp = sqrt((((t * u) * n) * 2.0d0))
else
tmp = sqrt((t_1 * 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 t_1 = (2.0 * n) * U;
double tmp;
if (Math.sqrt(((((U_42_ - U) * (Math.pow((l / Om), 2.0) * n)) - ((((l * l) / Om) * 2.0) - t)) * t_1)) <= 5e-5) {
tmp = Math.sqrt((((t * U) * n) * 2.0));
} else {
tmp = Math.sqrt((t_1 * t));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = (2.0 * n) * U tmp = 0 if math.sqrt(((((U_42_ - U) * (math.pow((l / Om), 2.0) * n)) - ((((l * l) / Om) * 2.0) - t)) * t_1)) <= 5e-5: tmp = math.sqrt((((t * U) * n) * 2.0)) else: tmp = math.sqrt((t_1 * t)) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) tmp = 0.0 if (sqrt(Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(Float64(Float64(l * l) / Om) * 2.0) - t)) * t_1)) <= 5e-5) tmp = sqrt(Float64(Float64(Float64(t * U) * n) * 2.0)); else tmp = sqrt(Float64(t_1 * t)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (2.0 * n) * U; tmp = 0.0; if (sqrt(((((U_42_ - U) * (((l / Om) ^ 2.0) * n)) - ((((l * l) / Om) * 2.0) - t)) * t_1)) <= 5e-5) tmp = sqrt((((t * U) * n) * 2.0)); else tmp = sqrt((t_1 * t)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, If[LessEqual[N[Sqrt[N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision] * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], 5e-5], N[Sqrt[N[(N[(N[(t * U), $MachinePrecision] * n), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(t$95$1 * t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
\mathbf{if}\;\sqrt{\left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(\frac{\ell \cdot \ell}{Om} \cdot 2 - t\right)\right) \cdot t\_1} \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\sqrt{\left(\left(t \cdot U\right) \cdot n\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t\_1 \cdot t}\\
\end{array}
\end{array}
if (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 5.00000000000000024e-5Initial program 57.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6456.2
Applied rewrites56.2%
Applied rewrites60.5%
if 5.00000000000000024e-5 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) Initial program 46.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6431.9
Applied rewrites31.9%
Applied rewrites32.6%
Final simplification39.9%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= l 2.8e-135)
(sqrt (* (* (* t U) n) 2.0))
(if (<= l 6.8e+67)
(sqrt
(*
(fma
(* (/ (* (- 2.0 (/ (* U* n) Om)) n) Om) (* l l))
-2.0
(* (* t n) 2.0))
U))
(sqrt
(* (* (* (* -2.0 U) l) (fma (/ n Om) (- U U*) 2.0)) (* (/ l Om) n))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 2.8e-135) {
tmp = sqrt((((t * U) * n) * 2.0));
} else if (l <= 6.8e+67) {
tmp = sqrt((fma(((((2.0 - ((U_42_ * n) / Om)) * n) / Om) * (l * l)), -2.0, ((t * n) * 2.0)) * U));
} else {
tmp = sqrt(((((-2.0 * U) * l) * fma((n / Om), (U - U_42_), 2.0)) * ((l / Om) * n)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 2.8e-135) tmp = sqrt(Float64(Float64(Float64(t * U) * n) * 2.0)); elseif (l <= 6.8e+67) tmp = sqrt(Float64(fma(Float64(Float64(Float64(Float64(2.0 - Float64(Float64(U_42_ * n) / Om)) * n) / Om) * Float64(l * l)), -2.0, Float64(Float64(t * n) * 2.0)) * U)); else tmp = sqrt(Float64(Float64(Float64(Float64(-2.0 * U) * l) * fma(Float64(n / Om), Float64(U - U_42_), 2.0)) * Float64(Float64(l / Om) * n))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 2.8e-135], N[Sqrt[N[(N[(N[(t * U), $MachinePrecision] * n), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 6.8e+67], N[Sqrt[N[(N[(N[(N[(N[(N[(2.0 - N[(N[(U$42$ * n), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] * -2.0 + N[(N[(t * n), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(-2.0 * U), $MachinePrecision] * l), $MachinePrecision] * N[(N[(n / Om), $MachinePrecision] * N[(U - U$42$), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.8 \cdot 10^{-135}:\\
\;\;\;\;\sqrt{\left(\left(t \cdot U\right) \cdot n\right) \cdot 2}\\
\mathbf{elif}\;\ell \leq 6.8 \cdot 10^{+67}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\left(2 - \frac{U* \cdot n}{Om}\right) \cdot n}{Om} \cdot \left(\ell \cdot \ell\right), -2, \left(t \cdot n\right) \cdot 2\right) \cdot U}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\left(-2 \cdot U\right) \cdot \ell\right) \cdot \mathsf{fma}\left(\frac{n}{Om}, U - U*, 2\right)\right) \cdot \left(\frac{\ell}{Om} \cdot n\right)}\\
\end{array}
\end{array}
if l < 2.80000000000000023e-135Initial program 54.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6447.5
Applied rewrites47.5%
Applied rewrites46.5%
if 2.80000000000000023e-135 < l < 6.8000000000000003e67Initial program 44.0%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites61.1%
Applied rewrites61.2%
Applied rewrites58.8%
Taylor expanded in U around 0
Applied rewrites56.5%
if 6.8000000000000003e67 < l Initial program 36.5%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites40.6%
Taylor expanded in t around 0
Applied rewrites42.7%
Applied rewrites64.0%
Final simplification51.2%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 145000000.0) (sqrt (* (* (* t n) U) 2.0)) (sqrt (* (* (* (* -2.0 U) l) (* (/ l Om) n)) (fma (/ n Om) (- U U*) 2.0)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 145000000.0) {
tmp = sqrt((((t * n) * U) * 2.0));
} else {
tmp = sqrt(((((-2.0 * U) * l) * ((l / Om) * n)) * fma((n / Om), (U - U_42_), 2.0)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 145000000.0) tmp = sqrt(Float64(Float64(Float64(t * n) * U) * 2.0)); else tmp = sqrt(Float64(Float64(Float64(Float64(-2.0 * U) * l) * Float64(Float64(l / Om) * n)) * fma(Float64(n / Om), Float64(U - U_42_), 2.0))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 145000000.0], N[Sqrt[N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(-2.0 * U), $MachinePrecision] * l), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] * N[(N[(n / Om), $MachinePrecision] * N[(U - U$42$), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 145000000:\\
\;\;\;\;\sqrt{\left(\left(t \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\left(-2 \cdot U\right) \cdot \ell\right) \cdot \left(\frac{\ell}{Om} \cdot n\right)\right) \cdot \mathsf{fma}\left(\frac{n}{Om}, U - U*, 2\right)}\\
\end{array}
\end{array}
if l < 1.45e8Initial program 51.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6445.4
Applied rewrites45.4%
if 1.45e8 < l Initial program 41.8%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites50.4%
Taylor expanded in t around 0
Applied rewrites45.3%
Applied rewrites64.2%
Final simplification49.5%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 7.2e+52) (sqrt (* (* (* (fma -2.0 (/ (* l l) Om) t) n) U) 2.0)) (sqrt (* (* (* (* -2.0 U) l) (fma (/ n Om) (- U U*) 2.0)) (* (/ l Om) n)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 7.2e+52) {
tmp = sqrt((((fma(-2.0, ((l * l) / Om), t) * n) * U) * 2.0));
} else {
tmp = sqrt(((((-2.0 * U) * l) * fma((n / Om), (U - U_42_), 2.0)) * ((l / Om) * n)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 7.2e+52) tmp = sqrt(Float64(Float64(Float64(fma(-2.0, Float64(Float64(l * l) / Om), t) * n) * U) * 2.0)); else tmp = sqrt(Float64(Float64(Float64(Float64(-2.0 * U) * l) * fma(Float64(n / Om), Float64(U - U_42_), 2.0)) * Float64(Float64(l / Om) * n))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 7.2e+52], N[Sqrt[N[(N[(N[(N[(-2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(-2.0 * U), $MachinePrecision] * l), $MachinePrecision] * N[(N[(n / Om), $MachinePrecision] * N[(U - U$42$), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 7.2 \cdot 10^{+52}:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(-2, \frac{\ell \cdot \ell}{Om}, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\left(-2 \cdot U\right) \cdot \ell\right) \cdot \mathsf{fma}\left(\frac{n}{Om}, U - U*, 2\right)\right) \cdot \left(\frac{\ell}{Om} \cdot n\right)}\\
\end{array}
\end{array}
if l < 7.2e52Initial program 52.3%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6448.6
Applied rewrites48.6%
if 7.2e52 < l Initial program 37.0%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites43.0%
Taylor expanded in t around 0
Applied rewrites45.1%
Applied rewrites65.5%
Final simplification51.7%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= n -1.2e+146)
(sqrt (* (* (* t U) n) 2.0))
(if (<= n 60000000000000.0)
(sqrt (fma (/ (* (* (* l n) l) U) Om) -4.0 (* (* (* t n) U) 2.0)))
(* (sqrt (* (* (fma (* (/ l Om) l) -2.0 t) U) 2.0)) (sqrt n)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= -1.2e+146) {
tmp = sqrt((((t * U) * n) * 2.0));
} else if (n <= 60000000000000.0) {
tmp = sqrt(fma(((((l * n) * l) * U) / Om), -4.0, (((t * n) * U) * 2.0)));
} else {
tmp = sqrt(((fma(((l / Om) * l), -2.0, t) * U) * 2.0)) * sqrt(n);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= -1.2e+146) tmp = sqrt(Float64(Float64(Float64(t * U) * n) * 2.0)); elseif (n <= 60000000000000.0) tmp = sqrt(fma(Float64(Float64(Float64(Float64(l * n) * l) * U) / Om), -4.0, Float64(Float64(Float64(t * n) * U) * 2.0))); else tmp = Float64(sqrt(Float64(Float64(fma(Float64(Float64(l / Om) * l), -2.0, t) * U) * 2.0)) * sqrt(n)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, -1.2e+146], N[Sqrt[N[(N[(N[(t * U), $MachinePrecision] * n), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 60000000000000.0], N[Sqrt[N[(N[(N[(N[(N[(l * n), $MachinePrecision] * l), $MachinePrecision] * U), $MachinePrecision] / Om), $MachinePrecision] * -4.0 + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * -2.0 + t), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[n], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.2 \cdot 10^{+146}:\\
\;\;\;\;\sqrt{\left(\left(t \cdot U\right) \cdot n\right) \cdot 2}\\
\mathbf{elif}\;n \leq 60000000000000:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\left(\left(\ell \cdot n\right) \cdot \ell\right) \cdot U}{Om}, -4, \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(\frac{\ell}{Om} \cdot \ell, -2, t\right) \cdot U\right) \cdot 2} \cdot \sqrt{n}\\
\end{array}
\end{array}
if n < -1.2000000000000001e146Initial program 47.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6440.4
Applied rewrites40.4%
Applied rewrites46.5%
if -1.2000000000000001e146 < n < 6e13Initial program 48.4%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6449.1
Applied rewrites49.1%
Applied rewrites56.5%
if 6e13 < n Initial program 53.9%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
Applied rewrites44.2%
Taylor expanded in n around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f6453.7
Applied rewrites53.7%
Applied rewrites63.9%
Final simplification56.9%
(FPCore (n U t l Om U*) :precision binary64 (if (<= t 1.25e+171) (sqrt (fma (/ (* (* (* l n) l) U) Om) -4.0 (* (* (* t n) U) 2.0))) (* (* (sqrt (* U n)) (sqrt t)) (sqrt 2.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= 1.25e+171) {
tmp = sqrt(fma(((((l * n) * l) * U) / Om), -4.0, (((t * n) * U) * 2.0)));
} else {
tmp = (sqrt((U * n)) * sqrt(t)) * sqrt(2.0);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= 1.25e+171) tmp = sqrt(fma(Float64(Float64(Float64(Float64(l * n) * l) * U) / Om), -4.0, Float64(Float64(Float64(t * n) * U) * 2.0))); else tmp = Float64(Float64(sqrt(Float64(U * n)) * sqrt(t)) * sqrt(2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, 1.25e+171], N[Sqrt[N[(N[(N[(N[(N[(l * n), $MachinePrecision] * l), $MachinePrecision] * U), $MachinePrecision] / Om), $MachinePrecision] * -4.0 + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[Sqrt[N[(U * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.25 \cdot 10^{+171}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\left(\left(\ell \cdot n\right) \cdot \ell\right) \cdot U}{Om}, -4, \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{U \cdot n} \cdot \sqrt{t}\right) \cdot \sqrt{2}\\
\end{array}
\end{array}
if t < 1.2500000000000001e171Initial program 50.7%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6447.1
Applied rewrites47.1%
Applied rewrites51.9%
if 1.2500000000000001e171 < t Initial program 40.7%
Taylor expanded in U* around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate--r+N/A
lower--.f64N/A
Applied rewrites36.6%
Applied rewrites51.5%
Taylor expanded in t around inf
Applied rewrites61.9%
Final simplification53.1%
(FPCore (n U t l Om U*) :precision binary64 (if (<= t 1.25e+171) (sqrt (fma (* (* (/ n Om) l) (* l U)) -4.0 (* (* (* t n) U) 2.0))) (* (* (sqrt (* U n)) (sqrt t)) (sqrt 2.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= 1.25e+171) {
tmp = sqrt(fma((((n / Om) * l) * (l * U)), -4.0, (((t * n) * U) * 2.0)));
} else {
tmp = (sqrt((U * n)) * sqrt(t)) * sqrt(2.0);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= 1.25e+171) tmp = sqrt(fma(Float64(Float64(Float64(n / Om) * l) * Float64(l * U)), -4.0, Float64(Float64(Float64(t * n) * U) * 2.0))); else tmp = Float64(Float64(sqrt(Float64(U * n)) * sqrt(t)) * sqrt(2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, 1.25e+171], N[Sqrt[N[(N[(N[(N[(n / Om), $MachinePrecision] * l), $MachinePrecision] * N[(l * U), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[Sqrt[N[(U * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.25 \cdot 10^{+171}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\left(\frac{n}{Om} \cdot \ell\right) \cdot \left(\ell \cdot U\right), -4, \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{U \cdot n} \cdot \sqrt{t}\right) \cdot \sqrt{2}\\
\end{array}
\end{array}
if t < 1.2500000000000001e171Initial program 50.7%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6447.1
Applied rewrites47.1%
Applied rewrites51.6%
if 1.2500000000000001e171 < t Initial program 40.7%
Taylor expanded in U* around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate--r+N/A
lower--.f64N/A
Applied rewrites36.6%
Applied rewrites51.5%
Taylor expanded in t around inf
Applied rewrites61.9%
Final simplification52.8%
(FPCore (n U t l Om U*) :precision binary64 (if (<= t 1.25e+171) (sqrt (* (* (* (fma -2.0 (/ (* l l) Om) t) n) U) 2.0)) (* (* (sqrt (* U n)) (sqrt t)) (sqrt 2.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= 1.25e+171) {
tmp = sqrt((((fma(-2.0, ((l * l) / Om), t) * n) * U) * 2.0));
} else {
tmp = (sqrt((U * n)) * sqrt(t)) * sqrt(2.0);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= 1.25e+171) tmp = sqrt(Float64(Float64(Float64(fma(-2.0, Float64(Float64(l * l) / Om), t) * n) * U) * 2.0)); else tmp = Float64(Float64(sqrt(Float64(U * n)) * sqrt(t)) * sqrt(2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, 1.25e+171], N[Sqrt[N[(N[(N[(N[(-2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[(N[(N[Sqrt[N[(U * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.25 \cdot 10^{+171}:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(-2, \frac{\ell \cdot \ell}{Om}, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{U \cdot n} \cdot \sqrt{t}\right) \cdot \sqrt{2}\\
\end{array}
\end{array}
if t < 1.2500000000000001e171Initial program 50.7%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6446.7
Applied rewrites46.7%
if 1.2500000000000001e171 < t Initial program 40.7%
Taylor expanded in U* around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate--r+N/A
lower--.f64N/A
Applied rewrites36.6%
Applied rewrites51.5%
Taylor expanded in t around inf
Applied rewrites61.9%
Final simplification48.5%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 6.6e+57) (sqrt (* (* (* t n) U) 2.0)) (sqrt (* (/ (* (* (* l l) n) U) Om) -4.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 6.6e+57) {
tmp = sqrt((((t * n) * U) * 2.0));
} else {
tmp = sqrt((((((l * l) * n) * U) / Om) * -4.0));
}
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 <= 6.6d+57) then
tmp = sqrt((((t * n) * u) * 2.0d0))
else
tmp = sqrt((((((l * l) * n) * u) / om) * (-4.0d0)))
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 <= 6.6e+57) {
tmp = Math.sqrt((((t * n) * U) * 2.0));
} else {
tmp = Math.sqrt((((((l * l) * n) * U) / Om) * -4.0));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 6.6e+57: tmp = math.sqrt((((t * n) * U) * 2.0)) else: tmp = math.sqrt((((((l * l) * n) * U) / Om) * -4.0)) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 6.6e+57) tmp = sqrt(Float64(Float64(Float64(t * n) * U) * 2.0)); else tmp = sqrt(Float64(Float64(Float64(Float64(Float64(l * l) * n) * U) / Om) * -4.0)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 6.6e+57) tmp = sqrt((((t * n) * U) * 2.0)); else tmp = sqrt((((((l * l) * n) * U) / Om) * -4.0)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 6.6e+57], N[Sqrt[N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] / Om), $MachinePrecision] * -4.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 6.6 \cdot 10^{+57}:\\
\;\;\;\;\sqrt{\left(\left(t \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\left(\left(\ell \cdot \ell\right) \cdot n\right) \cdot U}{Om} \cdot -4}\\
\end{array}
\end{array}
if l < 6.6000000000000002e57Initial program 52.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6444.8
Applied rewrites44.8%
if 6.6000000000000002e57 < l Initial program 35.7%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites41.8%
Taylor expanded in t around 0
Applied rewrites43.9%
Taylor expanded in Om around inf
Applied rewrites34.9%
Final simplification43.0%
(FPCore (n U t l Om U*) :precision binary64 (if (<= n 200000000000.0) (sqrt (* (* (* t n) U) 2.0)) (* (sqrt (* (* t U) 2.0)) (sqrt n))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= 200000000000.0) {
tmp = sqrt((((t * n) * U) * 2.0));
} else {
tmp = sqrt(((t * U) * 2.0)) * sqrt(n);
}
return tmp;
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (n <= 200000000000.0d0) then
tmp = sqrt((((t * n) * u) * 2.0d0))
else
tmp = sqrt(((t * u) * 2.0d0)) * sqrt(n)
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= 200000000000.0) {
tmp = Math.sqrt((((t * n) * U) * 2.0));
} else {
tmp = Math.sqrt(((t * U) * 2.0)) * Math.sqrt(n);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if n <= 200000000000.0: tmp = math.sqrt((((t * n) * U) * 2.0)) else: tmp = math.sqrt(((t * U) * 2.0)) * math.sqrt(n) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= 200000000000.0) tmp = sqrt(Float64(Float64(Float64(t * n) * U) * 2.0)); else tmp = Float64(sqrt(Float64(Float64(t * U) * 2.0)) * sqrt(n)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (n <= 200000000000.0) tmp = sqrt((((t * n) * U) * 2.0)); else tmp = sqrt(((t * U) * 2.0)) * sqrt(n); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, 200000000000.0], N[Sqrt[N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(t * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[n], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 200000000000:\\
\;\;\;\;\sqrt{\left(\left(t \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(t \cdot U\right) \cdot 2} \cdot \sqrt{n}\\
\end{array}
\end{array}
if n < 2e11Initial program 48.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6441.7
Applied rewrites41.7%
if 2e11 < n Initial program 53.0%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
Applied rewrites43.4%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6437.8
Applied rewrites37.8%
Final simplification40.8%
(FPCore (n U t l Om U*) :precision binary64 (if (<= U* -4.2e+91) (sqrt (* (* (* 2.0 n) U) t)) (sqrt (* (* (* t n) U) 2.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U_42_ <= -4.2e+91) {
tmp = sqrt((((2.0 * n) * U) * t));
} else {
tmp = sqrt((((t * n) * U) * 2.0));
}
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_42 <= (-4.2d+91)) then
tmp = sqrt((((2.0d0 * n) * u) * t))
else
tmp = sqrt((((t * n) * u) * 2.0d0))
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_42_ <= -4.2e+91) {
tmp = Math.sqrt((((2.0 * n) * U) * t));
} else {
tmp = Math.sqrt((((t * n) * U) * 2.0));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if U_42_ <= -4.2e+91: tmp = math.sqrt((((2.0 * n) * U) * t)) else: tmp = math.sqrt((((t * n) * U) * 2.0)) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U_42_ <= -4.2e+91) tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * t)); else tmp = sqrt(Float64(Float64(Float64(t * n) * U) * 2.0)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U_42_ <= -4.2e+91) tmp = sqrt((((2.0 * n) * U) * t)); else tmp = sqrt((((t * n) * U) * 2.0)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U$42$, -4.2e+91], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;U* \leq -4.2 \cdot 10^{+91}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(t \cdot n\right) \cdot U\right) \cdot 2}\\
\end{array}
\end{array}
if U* < -4.20000000000000015e91Initial program 58.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6437.9
Applied rewrites37.9%
Applied rewrites45.8%
if -4.20000000000000015e91 < U* Initial program 47.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6438.3
Applied rewrites38.3%
Final simplification39.8%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) t)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((2.0 * n) * U) * 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 * n) * u) * 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 * n) * U) * t));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * t))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * t)) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * t)); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}
\end{array}
Initial program 49.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6438.2
Applied rewrites38.2%
Applied rewrites36.8%
Final simplification36.8%
herbie shell --seed 2024244
(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*))))))