
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}
\end{array}
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (fma (/ l Om) (fma (* (/ l Om) (- U U*)) (- n) (* -2.0 l)) t)))
(if (<= n -1e-288)
(sqrt (* (* t_1 (* U 2.0)) n))
(if (<= n 2.1e-263)
(sqrt (fma (* (* U l) (/ (* n l) Om)) -4.0 (* (* (* n t) U) 2.0)))
(* (sqrt (* t_1 U)) (sqrt (* n 2.0)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma((l / Om), fma(((l / Om) * (U - U_42_)), -n, (-2.0 * l)), t);
double tmp;
if (n <= -1e-288) {
tmp = sqrt(((t_1 * (U * 2.0)) * n));
} else if (n <= 2.1e-263) {
tmp = sqrt(fma(((U * l) * ((n * l) / Om)), -4.0, (((n * t) * U) * 2.0)));
} else {
tmp = sqrt((t_1 * U)) * sqrt((n * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = fma(Float64(l / Om), fma(Float64(Float64(l / Om) * Float64(U - U_42_)), Float64(-n), Float64(-2.0 * l)), t) tmp = 0.0 if (n <= -1e-288) tmp = sqrt(Float64(Float64(t_1 * Float64(U * 2.0)) * n)); elseif (n <= 2.1e-263) tmp = sqrt(fma(Float64(Float64(U * l) * Float64(Float64(n * l) / Om)), -4.0, Float64(Float64(Float64(n * t) * U) * 2.0))); else tmp = Float64(sqrt(Float64(t_1 * U)) * sqrt(Float64(n * 2.0))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] * (-n) + N[(-2.0 * l), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[n, -1e-288], N[Sqrt[N[(N[(t$95$1 * N[(U * 2.0), $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 2.1e-263], N[Sqrt[N[(N[(N[(U * l), $MachinePrecision] * N[(N[(n * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(N[(N[(n * t), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(t$95$1 * U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(n * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(\frac{\ell}{Om} \cdot \left(U - U*\right), -n, -2 \cdot \ell\right), t\right)\\
\mathbf{if}\;n \leq -1 \cdot 10^{-288}:\\
\;\;\;\;\sqrt{\left(t\_1 \cdot \left(U \cdot 2\right)\right) \cdot n}\\
\mathbf{elif}\;n \leq 2.1 \cdot 10^{-263}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\left(U \cdot \ell\right) \cdot \frac{n \cdot \ell}{Om}, -4, \left(\left(n \cdot t\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t\_1 \cdot U} \cdot \sqrt{n \cdot 2}\\
\end{array}
\end{array}
if n < -1.00000000000000006e-288Initial program 51.7%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval53.7
Applied rewrites53.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites49.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6450.8
Applied rewrites50.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites61.6%
if -1.00000000000000006e-288 < n < 2.10000000000000003e-263Initial program 22.6%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6453.2
Applied rewrites53.2%
Applied rewrites73.6%
if 2.10000000000000003e-263 < n Initial program 55.2%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval59.7
Applied rewrites59.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites53.0%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6454.2
Applied rewrites54.2%
lift-sqrt.f64N/A
lift-*.f64N/A
sqrt-prodN/A
pow1/2N/A
lower-*.f64N/A
Applied rewrites75.3%
Final simplification68.3%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2
(sqrt
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*)))))))
(if (<= t_2 5e-111)
(sqrt (* (* (fma t_1 -2.0 t) U) (* 2.0 n)))
(if (<= t_2 INFINITY)
(sqrt (* (fma (* (/ l Om) l) -2.0 t) (* U (* n 2.0))))
(sqrt (* (/ (* (* U* U) (* (* n l) (* n l))) (* 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 = sqrt((((2.0 * n) * U) * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_2 <= 5e-111) {
tmp = sqrt(((fma(t_1, -2.0, t) * U) * (2.0 * n)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt((fma(((l / Om) * l), -2.0, t) * (U * (n * 2.0))));
} else {
tmp = sqrt(((((U_42_ * U) * ((n * l) * (n * l))) / (Om * Om)) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_2 <= 5e-111) tmp = sqrt(Float64(Float64(fma(t_1, -2.0, t) * U) * Float64(2.0 * n))); elseif (t_2 <= Inf) tmp = sqrt(Float64(fma(Float64(Float64(l / Om) * l), -2.0, t) * Float64(U * Float64(n * 2.0)))); else tmp = sqrt(Float64(Float64(Float64(Float64(U_42_ * U) * Float64(Float64(n * l) * Float64(n * l))) / 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[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 5e-111], N[Sqrt[N[(N[(N[(t$95$1 * -2.0 + t), $MachinePrecision] * U), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * -2.0 + t), $MachinePrecision] * N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(U$42$ * U), $MachinePrecision] * N[(N[(n * l), $MachinePrecision] * N[(n * l), $MachinePrecision]), $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 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_2 \leq 5 \cdot 10^{-111}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(t\_1, -2, t\right) \cdot U\right) \cdot \left(2 \cdot n\right)}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\ell}{Om} \cdot \ell, -2, t\right) \cdot \left(U \cdot \left(n \cdot 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\left(U* \cdot U\right) \cdot \left(\left(n \cdot \ell\right) \cdot \left(n \cdot \ell\right)\right)}{Om \cdot Om} \cdot 2}\\
\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.0000000000000003e-111Initial program 30.9%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval30.9
Applied rewrites30.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites52.1%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6448.0
Applied rewrites48.0%
if 5.0000000000000003e-111 < (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*))))) < +inf.0Initial program 68.7%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval71.9
Applied rewrites71.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.3%
Taylor expanded in n around 0
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f6452.9
Applied rewrites52.9%
Applied rewrites59.2%
if +inf.0 < (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 0.0%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval5.2
Applied rewrites5.2%
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-*.f6430.1
Applied rewrites30.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2
(sqrt
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*)))))))
(if (<= t_2 5e-111)
(sqrt (* (* (fma t_1 -2.0 t) U) (* 2.0 n)))
(if (<= t_2 INFINITY)
(sqrt (* (fma (* (/ l Om) l) -2.0 t) (* U (* n 2.0))))
(* (* (* n (sqrt 2.0)) (/ l Om)) (sqrt (* U* U)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = sqrt((((2.0 * n) * U) * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_2 <= 5e-111) {
tmp = sqrt(((fma(t_1, -2.0, t) * U) * (2.0 * n)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt((fma(((l / Om) * l), -2.0, t) * (U * (n * 2.0))));
} else {
tmp = ((n * sqrt(2.0)) * (l / Om)) * sqrt((U_42_ * U));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_2 <= 5e-111) tmp = sqrt(Float64(Float64(fma(t_1, -2.0, t) * U) * Float64(2.0 * n))); elseif (t_2 <= Inf) tmp = sqrt(Float64(fma(Float64(Float64(l / Om) * l), -2.0, t) * Float64(U * Float64(n * 2.0)))); else tmp = Float64(Float64(Float64(n * sqrt(2.0)) * Float64(l / Om)) * sqrt(Float64(U_42_ * U))); 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[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 5e-111], N[Sqrt[N[(N[(N[(t$95$1 * -2.0 + t), $MachinePrecision] * U), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * -2.0 + t), $MachinePrecision] * N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(n * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(l / Om), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(U$42$ * U), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_2 \leq 5 \cdot 10^{-111}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(t\_1, -2, t\right) \cdot U\right) \cdot \left(2 \cdot n\right)}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\ell}{Om} \cdot \ell, -2, t\right) \cdot \left(U \cdot \left(n \cdot 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(n \cdot \sqrt{2}\right) \cdot \frac{\ell}{Om}\right) \cdot \sqrt{U* \cdot U}\\
\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.0000000000000003e-111Initial program 30.9%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval30.9
Applied rewrites30.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites52.1%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6448.0
Applied rewrites48.0%
if 5.0000000000000003e-111 < (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*))))) < +inf.0Initial program 68.7%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval71.9
Applied rewrites71.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.3%
Taylor expanded in n around 0
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f6452.9
Applied rewrites52.9%
Applied rewrites59.2%
if +inf.0 < (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 0.0%
Taylor expanded in U* around -inf
associate-*r*N/A
lower-*.f64N/A
Applied rewrites27.9%
Final simplification52.2%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2
(sqrt
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*)))))))
(if (<= t_2 5e-111)
(sqrt (* (* (fma t_1 -2.0 t) U) (* 2.0 n)))
(if (<= t_2 INFINITY)
(sqrt (* (fma (* (/ l Om) l) -2.0 t) (* U (* n 2.0))))
(* (sqrt (* U* U)) (/ (* (* (sqrt 2.0) n) l) Om))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = sqrt((((2.0 * n) * U) * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_2 <= 5e-111) {
tmp = sqrt(((fma(t_1, -2.0, t) * U) * (2.0 * n)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt((fma(((l / Om) * l), -2.0, t) * (U * (n * 2.0))));
} else {
tmp = sqrt((U_42_ * U)) * (((sqrt(2.0) * n) * l) / Om);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_2 <= 5e-111) tmp = sqrt(Float64(Float64(fma(t_1, -2.0, t) * U) * Float64(2.0 * n))); elseif (t_2 <= Inf) tmp = sqrt(Float64(fma(Float64(Float64(l / Om) * l), -2.0, t) * Float64(U * Float64(n * 2.0)))); else tmp = Float64(sqrt(Float64(U_42_ * U)) * Float64(Float64(Float64(sqrt(2.0) * n) * l) / Om)); 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[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 5e-111], N[Sqrt[N[(N[(N[(t$95$1 * -2.0 + t), $MachinePrecision] * U), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * -2.0 + t), $MachinePrecision] * N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(U$42$ * U), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * n), $MachinePrecision] * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_2 \leq 5 \cdot 10^{-111}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(t\_1, -2, t\right) \cdot U\right) \cdot \left(2 \cdot n\right)}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\ell}{Om} \cdot \ell, -2, t\right) \cdot \left(U \cdot \left(n \cdot 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{U* \cdot U} \cdot \frac{\left(\sqrt{2} \cdot n\right) \cdot \ell}{Om}\\
\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.0000000000000003e-111Initial program 30.9%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval30.9
Applied rewrites30.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites52.1%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6448.0
Applied rewrites48.0%
if 5.0000000000000003e-111 < (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*))))) < +inf.0Initial program 68.7%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval71.9
Applied rewrites71.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.3%
Taylor expanded in n around 0
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f6452.9
Applied rewrites52.9%
Applied rewrites59.2%
if +inf.0 < (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 0.0%
Taylor expanded in U* around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f6427.9
Applied rewrites27.9%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_2 0.0)
(sqrt (* (* (* (fma -2.0 t_1 t) n) U) 2.0))
(if (<= t_2 INFINITY)
(sqrt (* (fma (* (/ l Om) l) -2.0 t) (* U (* n 2.0))))
(sqrt (* (/ (* (* (* l l) U) n) Om) -4.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) * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 0.0) {
tmp = sqrt((((fma(-2.0, t_1, t) * n) * U) * 2.0));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt((fma(((l / Om) * l), -2.0, t) * (U * (n * 2.0))));
} else {
tmp = sqrt((((((l * l) * U) * n) / Om) * -4.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_2 <= 0.0) tmp = sqrt(Float64(Float64(Float64(fma(-2.0, t_1, t) * n) * U) * 2.0)); elseif (t_2 <= Inf) tmp = sqrt(Float64(fma(Float64(Float64(l / Om) * l), -2.0, t) * Float64(U * Float64(n * 2.0)))); else tmp = sqrt(Float64(Float64(Float64(Float64(Float64(l * l) * U) * n) / Om) * -4.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[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[Sqrt[N[(N[(N[(N[(-2.0 * t$95$1 + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * -2.0 + t), $MachinePrecision] * N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(l * l), $MachinePrecision] * U), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] * -4.0), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(-2, t\_1, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\ell}{Om} \cdot \ell, -2, t\right) \cdot \left(U \cdot \left(n \cdot 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\left(\left(\ell \cdot \ell\right) \cdot U\right) \cdot n}{Om} \cdot -4}\\
\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 13.5%
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-*.f6435.3
Applied rewrites35.3%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 69.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval72.8
Applied rewrites72.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.3%
Taylor expanded in n around 0
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f6453.4
Applied rewrites53.4%
Applied rewrites60.4%
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 Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6414.8
Applied rewrites14.8%
Applied rewrites15.6%
Taylor expanded in t around 0
Applied rewrites17.7%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_1 0.0)
(sqrt (* (* (* n t) U) 2.0))
(if (<= t_1 INFINITY)
(sqrt (* (fma (* (/ l Om) l) -2.0 t) (* U (* n 2.0))))
(sqrt (* (/ (* (* (* l l) U) n) Om) -4.0))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_1 <= 0.0) {
tmp = sqrt((((n * t) * U) * 2.0));
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt((fma(((l / Om) * l), -2.0, t) * (U * (n * 2.0))));
} else {
tmp = sqrt((((((l * l) * U) * n) / Om) * -4.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = 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_)))) tmp = 0.0 if (t_1 <= 0.0) tmp = sqrt(Float64(Float64(Float64(n * t) * U) * 2.0)); elseif (t_1 <= Inf) tmp = sqrt(Float64(fma(Float64(Float64(l / Om) * l), -2.0, t) * Float64(U * Float64(n * 2.0)))); else tmp = sqrt(Float64(Float64(Float64(Float64(Float64(l * l) * U) * n) / Om) * -4.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, 0.0], N[Sqrt[N[(N[(N[(n * t), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * -2.0 + t), $MachinePrecision] * N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(l * l), $MachinePrecision] * U), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] * -4.0), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\sqrt{\left(\left(n \cdot t\right) \cdot U\right) \cdot 2}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\ell}{Om} \cdot \ell, -2, t\right) \cdot \left(U \cdot \left(n \cdot 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\left(\left(\ell \cdot \ell\right) \cdot U\right) \cdot n}{Om} \cdot -4}\\
\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 13.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6433.1
Applied rewrites33.1%
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 69.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval72.8
Applied rewrites72.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.3%
Taylor expanded in n around 0
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f6453.4
Applied rewrites53.4%
Applied rewrites60.4%
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 Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6414.8
Applied rewrites14.8%
Applied rewrites15.6%
Taylor expanded in t around 0
Applied rewrites17.7%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U)))
(if (<=
(sqrt
(*
t_1
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))
0.0)
(sqrt (* n (* t (* U 2.0))))
(sqrt (* t t_1)))))
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((t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_))))) <= 0.0) {
tmp = sqrt((n * (t * (U * 2.0))));
} else {
tmp = sqrt((t * t_1));
}
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((t_1 * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42))))) <= 0.0d0) then
tmp = sqrt((n * (t * (u * 2.0d0))))
else
tmp = sqrt((t * t_1))
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((t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_))))) <= 0.0) {
tmp = Math.sqrt((n * (t * (U * 2.0))));
} else {
tmp = Math.sqrt((t * t_1));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = (2.0 * n) * U tmp = 0 if math.sqrt((t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))))) <= 0.0: tmp = math.sqrt((n * (t * (U * 2.0)))) else: tmp = math.sqrt((t * t_1)) 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(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) <= 0.0) tmp = sqrt(Float64(n * Float64(t * Float64(U * 2.0)))); else tmp = sqrt(Float64(t * t_1)); 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((t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))) <= 0.0) tmp = sqrt((n * (t * (U * 2.0)))); else tmp = sqrt((t * t_1)); 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[(t$95$1 * 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], 0.0], N[Sqrt[N[(n * N[(t * N[(U * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(t * t$95$1), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
\mathbf{if}\;\sqrt{t\_1 \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)} \leq 0:\\
\;\;\;\;\sqrt{n \cdot \left(t \cdot \left(U \cdot 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t \cdot t\_1}\\
\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*))))) < 0.0Initial program 15.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6434.8
Applied rewrites34.8%
Applied rewrites35.0%
if 0.0 < (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 57.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6437.2
Applied rewrites37.2%
Applied rewrites41.1%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= l 1.9e+135)
(sqrt
(*
(*
(fma (/ l Om) (fma (* (/ l Om) (- U U*)) (- n) (* -2.0 l)) t)
(* U 2.0))
n))
(*
(sqrt (* (* U (- n)) (+ (/ (* n (- U U*)) (* Om Om)) (/ 2.0 Om))))
(* l (sqrt 2.0)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.9e+135) {
tmp = sqrt(((fma((l / Om), fma(((l / Om) * (U - U_42_)), -n, (-2.0 * l)), t) * (U * 2.0)) * n));
} else {
tmp = sqrt(((U * -n) * (((n * (U - U_42_)) / (Om * Om)) + (2.0 / Om)))) * (l * sqrt(2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 1.9e+135) tmp = sqrt(Float64(Float64(fma(Float64(l / Om), fma(Float64(Float64(l / Om) * Float64(U - U_42_)), Float64(-n), Float64(-2.0 * l)), t) * Float64(U * 2.0)) * n)); else tmp = Float64(sqrt(Float64(Float64(U * Float64(-n)) * Float64(Float64(Float64(n * Float64(U - U_42_)) / Float64(Om * Om)) + Float64(2.0 / Om)))) * Float64(l * sqrt(2.0))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 1.9e+135], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] * (-n) + N[(-2.0 * l), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * N[(U * 2.0), $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(U * (-n)), $MachinePrecision] * N[(N[(N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] + N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.9 \cdot 10^{+135}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(\frac{\ell}{Om} \cdot \left(U - U*\right), -n, -2 \cdot \ell\right), t\right) \cdot \left(U \cdot 2\right)\right) \cdot n}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(U \cdot \left(-n\right)\right) \cdot \left(\frac{n \cdot \left(U - U*\right)}{Om \cdot Om} + \frac{2}{Om}\right)} \cdot \left(\ell \cdot \sqrt{2}\right)\\
\end{array}
\end{array}
if l < 1.9000000000000001e135Initial program 55.3%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval56.9
Applied rewrites56.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites52.7%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6454.6
Applied rewrites54.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites64.1%
if 1.9000000000000001e135 < l Initial program 5.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval22.2
Applied rewrites22.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites24.0%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6424.8
Applied rewrites24.8%
Taylor expanded in l around inf
lower-*.f64N/A
Applied rewrites69.7%
Final simplification64.6%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= U 4.1e-153)
(sqrt
(*
(*
(fma (/ l Om) (fma (* (/ l Om) (- U U*)) (- n) (* -2.0 l)) t)
(* U 2.0))
n))
(*
(sqrt (* (fma (* (/ (fma U* (/ n Om) -2.0) Om) l) l t) (* 2.0 n)))
(sqrt U))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 4.1e-153) {
tmp = sqrt(((fma((l / Om), fma(((l / Om) * (U - U_42_)), -n, (-2.0 * l)), t) * (U * 2.0)) * n));
} else {
tmp = sqrt((fma(((fma(U_42_, (n / Om), -2.0) / Om) * l), l, t) * (2.0 * n))) * sqrt(U);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= 4.1e-153) tmp = sqrt(Float64(Float64(fma(Float64(l / Om), fma(Float64(Float64(l / Om) * Float64(U - U_42_)), Float64(-n), Float64(-2.0 * l)), t) * Float64(U * 2.0)) * n)); else tmp = Float64(sqrt(Float64(fma(Float64(Float64(fma(U_42_, Float64(n / Om), -2.0) / Om) * l), l, t) * Float64(2.0 * n))) * sqrt(U)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, 4.1e-153], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] * (-n) + N[(-2.0 * l), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * N[(U * 2.0), $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(N[(N[(N[(U$42$ * N[(n / Om), $MachinePrecision] + -2.0), $MachinePrecision] / Om), $MachinePrecision] * l), $MachinePrecision] * l + t), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[U], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;U \leq 4.1 \cdot 10^{-153}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(\frac{\ell}{Om} \cdot \left(U - U*\right), -n, -2 \cdot \ell\right), t\right) \cdot \left(U \cdot 2\right)\right) \cdot n}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\mathsf{fma}\left(U*, \frac{n}{Om}, -2\right)}{Om} \cdot \ell, \ell, t\right) \cdot \left(2 \cdot n\right)} \cdot \sqrt{U}\\
\end{array}
\end{array}
if U < 4.1e-153Initial program 47.4%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval50.6
Applied rewrites50.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.0%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6449.0
Applied rewrites49.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites58.9%
if 4.1e-153 < U Initial program 58.8%
Taylor expanded in U around 0
+-commutativeN/A
associate--r+N/A
lower--.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
unpow2N/A
Applied rewrites57.7%
Applied rewrites60.4%
lift-sqrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
Applied rewrites77.6%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= t 9e+237)
(sqrt
(*
(*
(fma (/ l Om) (fma (* (/ l Om) (- U U*)) (- n) (* -2.0 l)) t)
(* U 2.0))
n))
(* (sqrt (fma (* (/ l Om) l) -2.0 t)) (sqrt (* U (* n 2.0))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= 9e+237) {
tmp = sqrt(((fma((l / Om), fma(((l / Om) * (U - U_42_)), -n, (-2.0 * l)), t) * (U * 2.0)) * n));
} else {
tmp = sqrt(fma(((l / Om) * l), -2.0, t)) * sqrt((U * (n * 2.0)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= 9e+237) tmp = sqrt(Float64(Float64(fma(Float64(l / Om), fma(Float64(Float64(l / Om) * Float64(U - U_42_)), Float64(-n), Float64(-2.0 * l)), t) * Float64(U * 2.0)) * n)); else tmp = Float64(sqrt(fma(Float64(Float64(l / Om) * l), -2.0, t)) * sqrt(Float64(U * Float64(n * 2.0)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, 9e+237], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] * (-n) + N[(-2.0 * l), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * N[(U * 2.0), $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * -2.0 + t), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 9 \cdot 10^{+237}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(\frac{\ell}{Om} \cdot \left(U - U*\right), -n, -2 \cdot \ell\right), t\right) \cdot \left(U \cdot 2\right)\right) \cdot n}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\ell}{Om} \cdot \ell, -2, t\right)} \cdot \sqrt{U \cdot \left(n \cdot 2\right)}\\
\end{array}
\end{array}
if t < 8.99999999999999928e237Initial program 51.3%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval54.4
Applied rewrites54.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites50.9%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6452.8
Applied rewrites52.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites63.0%
if 8.99999999999999928e237 < t Initial program 47.0%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval47.0
Applied rewrites47.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites40.3%
Taylor expanded in n around 0
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f6452.8
Applied rewrites52.8%
Applied rewrites87.2%
(FPCore (n U t l Om U*) :precision binary64 (if (or (<= n -5.6e+38) (not (<= n 3.8e-246))) (sqrt (* (* (* 2.0 n) U) (fma (fma U* (/ n Om) -2.0) (* (/ l Om) l) t))) (sqrt (fma (* (* U l) (/ (* n l) Om)) -4.0 (* (* (* n t) U) 2.0)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if ((n <= -5.6e+38) || !(n <= 3.8e-246)) {
tmp = sqrt((((2.0 * n) * U) * fma(fma(U_42_, (n / Om), -2.0), ((l / Om) * l), t)));
} else {
tmp = sqrt(fma(((U * l) * ((n * l) / Om)), -4.0, (((n * t) * U) * 2.0)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if ((n <= -5.6e+38) || !(n <= 3.8e-246)) tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * fma(fma(U_42_, Float64(n / Om), -2.0), Float64(Float64(l / Om) * l), t))); else tmp = sqrt(fma(Float64(Float64(U * l) * Float64(Float64(n * l) / Om)), -4.0, Float64(Float64(Float64(n * t) * U) * 2.0))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[Or[LessEqual[n, -5.6e+38], N[Not[LessEqual[n, 3.8e-246]], $MachinePrecision]], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(U$42$ * N[(n / Om), $MachinePrecision] + -2.0), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(U * l), $MachinePrecision] * N[(N[(n * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(N[(N[(n * t), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -5.6 \cdot 10^{+38} \lor \neg \left(n \leq 3.8 \cdot 10^{-246}\right):\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(U*, \frac{n}{Om}, -2\right), \frac{\ell}{Om} \cdot \ell, t\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\left(U \cdot \ell\right) \cdot \frac{n \cdot \ell}{Om}, -4, \left(\left(n \cdot t\right) \cdot U\right) \cdot 2\right)}\\
\end{array}
\end{array}
if n < -5.6e38 or 3.79999999999999976e-246 < n Initial program 54.3%
Taylor expanded in U around 0
+-commutativeN/A
associate--r+N/A
lower--.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
unpow2N/A
Applied rewrites50.2%
Applied rewrites55.1%
Applied rewrites59.1%
if -5.6e38 < n < 3.79999999999999976e-246Initial program 46.1%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6451.4
Applied rewrites51.4%
Applied rewrites63.0%
Final simplification60.6%
(FPCore (n U t l Om U*) :precision binary64 (if (or (<= n -5.6e+38) (not (<= n 6e-245))) (sqrt (* (* (* 2.0 n) U) (fma (fma U* (/ n Om) -2.0) (* (/ l Om) l) t))) (sqrt (fma (/ (* (* U l) (* n l)) Om) -4.0 (* (* (* n t) U) 2.0)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if ((n <= -5.6e+38) || !(n <= 6e-245)) {
tmp = sqrt((((2.0 * n) * U) * fma(fma(U_42_, (n / Om), -2.0), ((l / Om) * l), t)));
} else {
tmp = sqrt(fma((((U * l) * (n * l)) / Om), -4.0, (((n * t) * U) * 2.0)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if ((n <= -5.6e+38) || !(n <= 6e-245)) tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * fma(fma(U_42_, Float64(n / Om), -2.0), Float64(Float64(l / Om) * l), t))); else tmp = sqrt(fma(Float64(Float64(Float64(U * l) * Float64(n * l)) / Om), -4.0, Float64(Float64(Float64(n * t) * U) * 2.0))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[Or[LessEqual[n, -5.6e+38], N[Not[LessEqual[n, 6e-245]], $MachinePrecision]], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(U$42$ * N[(n / Om), $MachinePrecision] + -2.0), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(U * l), $MachinePrecision] * N[(n * l), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] * -4.0 + N[(N[(N[(n * t), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -5.6 \cdot 10^{+38} \lor \neg \left(n \leq 6 \cdot 10^{-245}\right):\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(U*, \frac{n}{Om}, -2\right), \frac{\ell}{Om} \cdot \ell, t\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\left(U \cdot \ell\right) \cdot \left(n \cdot \ell\right)}{Om}, -4, \left(\left(n \cdot t\right) \cdot U\right) \cdot 2\right)}\\
\end{array}
\end{array}
if n < -5.6e38 or 6.0000000000000004e-245 < n Initial program 54.3%
Taylor expanded in U around 0
+-commutativeN/A
associate--r+N/A
lower--.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
*-commutativeN/A
unpow2N/A
Applied rewrites50.2%
Applied rewrites55.1%
Applied rewrites59.1%
if -5.6e38 < n < 6.0000000000000004e-245Initial program 46.1%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6451.4
Applied rewrites51.4%
Applied rewrites61.1%
Final simplification59.9%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (fma (* (/ l Om) l) -2.0 t)))
(if (<= U -2e-310)
(sqrt (* t_1 (* U (* n 2.0))))
(* (sqrt (* 2.0 (* t_1 n))) (sqrt U)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma(((l / Om) * l), -2.0, t);
double tmp;
if (U <= -2e-310) {
tmp = sqrt((t_1 * (U * (n * 2.0))));
} else {
tmp = sqrt((2.0 * (t_1 * n))) * sqrt(U);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = fma(Float64(Float64(l / Om) * l), -2.0, t) tmp = 0.0 if (U <= -2e-310) tmp = sqrt(Float64(t_1 * Float64(U * Float64(n * 2.0)))); else tmp = Float64(sqrt(Float64(2.0 * Float64(t_1 * n))) * sqrt(U)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * -2.0 + t), $MachinePrecision]}, If[LessEqual[U, -2e-310], N[Sqrt[N[(t$95$1 * N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(t$95$1 * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[U], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{\ell}{Om} \cdot \ell, -2, t\right)\\
\mathbf{if}\;U \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(U \cdot \left(n \cdot 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(t\_1 \cdot n\right)} \cdot \sqrt{U}\\
\end{array}
\end{array}
if U < -1.999999999999994e-310Initial program 49.5%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval53.6
Applied rewrites53.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.2%
Taylor expanded in n around 0
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f6438.5
Applied rewrites38.5%
Applied rewrites43.5%
if -1.999999999999994e-310 < U Initial program 52.7%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval54.4
Applied rewrites54.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites53.6%
Taylor expanded in n around 0
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f6451.7
Applied rewrites51.7%
Applied rewrites62.7%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 3.8e+95) (sqrt (* (* (* n t) U) 2.0)) (sqrt (* (/ (* (* (* l l) U) n) Om) -4.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 3.8e+95) {
tmp = sqrt((((n * t) * U) * 2.0));
} else {
tmp = sqrt((((((l * l) * U) * n) / 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 <= 3.8d+95) then
tmp = sqrt((((n * t) * u) * 2.0d0))
else
tmp = sqrt((((((l * l) * u) * n) / 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 <= 3.8e+95) {
tmp = Math.sqrt((((n * t) * U) * 2.0));
} else {
tmp = Math.sqrt((((((l * l) * U) * n) / Om) * -4.0));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 3.8e+95: tmp = math.sqrt((((n * t) * U) * 2.0)) else: tmp = math.sqrt((((((l * l) * U) * n) / Om) * -4.0)) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 3.8e+95) tmp = sqrt(Float64(Float64(Float64(n * t) * U) * 2.0)); else tmp = sqrt(Float64(Float64(Float64(Float64(Float64(l * l) * U) * n) / Om) * -4.0)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 3.8e+95) tmp = sqrt((((n * t) * U) * 2.0)); else tmp = sqrt((((((l * l) * U) * n) / Om) * -4.0)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 3.8e+95], N[Sqrt[N[(N[(N[(n * t), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(l * l), $MachinePrecision] * U), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] * -4.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.8 \cdot 10^{+95}:\\
\;\;\;\;\sqrt{\left(\left(n \cdot t\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\left(\left(\ell \cdot \ell\right) \cdot U\right) \cdot n}{Om} \cdot -4}\\
\end{array}
\end{array}
if l < 3.7999999999999999e95Initial program 55.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6440.8
Applied rewrites40.8%
if 3.7999999999999999e95 < l Initial program 12.9%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6417.2
Applied rewrites17.2%
Applied rewrites21.3%
Taylor expanded in t around 0
Applied rewrites17.2%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* n (* t (* U 2.0)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((n * (t * (U * 2.0))));
}
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((n * (t * (u * 2.0d0))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((n * (t * (U * 2.0))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((n * (t * (U * 2.0))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(n * Float64(t * Float64(U * 2.0)))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((n * (t * (U * 2.0)))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(n * N[(t * N[(U * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{n \cdot \left(t \cdot \left(U \cdot 2\right)\right)}
\end{array}
Initial program 51.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6436.9
Applied rewrites36.9%
Applied rewrites36.7%
herbie shell --seed 2024298
(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*))))))