
(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 14 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 (<= U -1450000000.0)
(sqrt
(*
(*
(* n 2.0)
(fma (- U* U) (* n (pow (/ l Om) 2.0)) (fma (* (/ l Om) l) -2.0 t)))
U))
(if (<= U 2.8e-307)
(sqrt
(* (* n 2.0) (* (fma (/ l Om) (fma (* (/ l Om) U*) n (* -2.0 l)) t) U)))
(*
(sqrt U)
(sqrt
(*
(fma (fma (* n (/ l Om)) (- U* U) (* -2.0 l)) (/ l Om) t)
(* n 2.0)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= -1450000000.0) {
tmp = sqrt((((n * 2.0) * fma((U_42_ - U), (n * pow((l / Om), 2.0)), fma(((l / Om) * l), -2.0, t))) * U));
} else if (U <= 2.8e-307) {
tmp = sqrt(((n * 2.0) * (fma((l / Om), fma(((l / Om) * U_42_), n, (-2.0 * l)), t) * U)));
} else {
tmp = sqrt(U) * sqrt((fma(fma((n * (l / Om)), (U_42_ - U), (-2.0 * l)), (l / Om), t) * (n * 2.0)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= -1450000000.0) tmp = sqrt(Float64(Float64(Float64(n * 2.0) * fma(Float64(U_42_ - U), Float64(n * (Float64(l / Om) ^ 2.0)), fma(Float64(Float64(l / Om) * l), -2.0, t))) * U)); elseif (U <= 2.8e-307) tmp = sqrt(Float64(Float64(n * 2.0) * Float64(fma(Float64(l / Om), fma(Float64(Float64(l / Om) * U_42_), n, Float64(-2.0 * l)), t) * U))); else tmp = Float64(sqrt(U) * sqrt(Float64(fma(fma(Float64(n * Float64(l / Om)), Float64(U_42_ - U), Float64(-2.0 * l)), Float64(l / Om), t) * Float64(n * 2.0)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, -1450000000.0], N[Sqrt[N[(N[(N[(n * 2.0), $MachinePrecision] * N[(N[(U$42$ - U), $MachinePrecision] * N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * -2.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision], If[LessEqual[U, 2.8e-307], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * U$42$), $MachinePrecision] * n + N[(-2.0 * l), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[U], $MachinePrecision] * N[Sqrt[N[(N[(N[(N[(n * N[(l / Om), $MachinePrecision]), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision] + N[(-2.0 * l), $MachinePrecision]), $MachinePrecision] * N[(l / Om), $MachinePrecision] + t), $MachinePrecision] * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;U \leq -1450000000:\\
\;\;\;\;\sqrt{\left(\left(n \cdot 2\right) \cdot \mathsf{fma}\left(U* - U, n \cdot {\left(\frac{\ell}{Om}\right)}^{2}, \mathsf{fma}\left(\frac{\ell}{Om} \cdot \ell, -2, t\right)\right)\right) \cdot U}\\
\mathbf{elif}\;U \leq 2.8 \cdot 10^{-307}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(\mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(\frac{\ell}{Om} \cdot U*, n, -2 \cdot \ell\right), t\right) \cdot U\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{U} \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(n \cdot \frac{\ell}{Om}, U* - U, -2 \cdot \ell\right), \frac{\ell}{Om}, t\right) \cdot \left(n \cdot 2\right)}\\
\end{array}
\end{array}
if U < -1.45e9Initial program 52.6%
lift--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--l+N/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-evalN/A
lower--.f6462.2
lift-*.f64N/A
Applied rewrites58.9%
Applied rewrites66.0%
if -1.45e9 < U < 2.8e-307Initial program 34.4%
lift--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--l+N/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-evalN/A
lower--.f6442.0
lift-*.f64N/A
Applied rewrites44.4%
Applied rewrites47.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6451.9
Applied rewrites62.0%
Taylor expanded in U around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.0
Applied rewrites62.0%
if 2.8e-307 < U Initial program 53.2%
lift--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--l+N/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-evalN/A
lower--.f6458.0
lift-*.f64N/A
Applied rewrites54.7%
Applied rewrites60.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6455.5
Applied rewrites59.8%
Applied rewrites76.6%
Final simplification70.0%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* n 2.0) U))
(t_2
(sqrt
(*
(-
(- t (* (/ (* l l) Om) 2.0))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))
t_1))))
(if (<= t_2 5e-138)
(sqrt
(* (* n 2.0) (* (fma (/ l Om) (fma (* (/ l Om) U*) n (* -2.0 l)) t) U)))
(if (<= t_2 INFINITY)
(sqrt
(*
(fma (/ l Om) (fma (* (fma -1.0 U U*) (/ l Om)) n (* -2.0 l)) t)
t_1))
(*
(* (sqrt 2.0) l)
(sqrt (* (fma (/ n Om) (/ (- U* U) Om) (/ -2.0 Om)) (* n U))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (n * 2.0) * U;
double t_2 = sqrt((((t - (((l * l) / Om) * 2.0)) - ((n * pow((l / Om), 2.0)) * (U - U_42_))) * t_1));
double tmp;
if (t_2 <= 5e-138) {
tmp = sqrt(((n * 2.0) * (fma((l / Om), fma(((l / Om) * U_42_), n, (-2.0 * l)), t) * U)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt((fma((l / Om), fma((fma(-1.0, U, U_42_) * (l / Om)), n, (-2.0 * l)), t) * t_1));
} else {
tmp = (sqrt(2.0) * l) * sqrt((fma((n / Om), ((U_42_ - U) / Om), (-2.0 / Om)) * (n * U)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(n * 2.0) * U) t_2 = sqrt(Float64(Float64(Float64(t - Float64(Float64(Float64(l * l) / Om) * 2.0)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))) * t_1)) tmp = 0.0 if (t_2 <= 5e-138) tmp = sqrt(Float64(Float64(n * 2.0) * Float64(fma(Float64(l / Om), fma(Float64(Float64(l / Om) * U_42_), n, Float64(-2.0 * l)), t) * U))); elseif (t_2 <= Inf) tmp = sqrt(Float64(fma(Float64(l / Om), fma(Float64(fma(-1.0, U, U_42_) * Float64(l / Om)), n, Float64(-2.0 * l)), t) * t_1)); else tmp = Float64(Float64(sqrt(2.0) * l) * sqrt(Float64(fma(Float64(n / Om), Float64(Float64(U_42_ - U) / Om), Float64(-2.0 / Om)) * Float64(n * U)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(n * 2.0), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(N[(t - N[(N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 5e-138], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * U$42$), $MachinePrecision] * n + N[(-2.0 * l), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(-1.0 * U + U$42$), $MachinePrecision] * N[(l / Om), $MachinePrecision]), $MachinePrecision] * n + N[(-2.0 * l), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * l), $MachinePrecision] * N[Sqrt[N[(N[(N[(n / Om), $MachinePrecision] * N[(N[(U$42$ - U), $MachinePrecision] / Om), $MachinePrecision] + N[(-2.0 / Om), $MachinePrecision]), $MachinePrecision] * N[(n * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(n \cdot 2\right) \cdot U\\
t_2 := \sqrt{\left(\left(t - \frac{\ell \cdot \ell}{Om} \cdot 2\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right) \cdot t\_1}\\
\mathbf{if}\;t\_2 \leq 5 \cdot 10^{-138}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(\mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(\frac{\ell}{Om} \cdot U*, n, -2 \cdot \ell\right), t\right) \cdot U\right)}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(\mathsf{fma}\left(-1, U, U*\right) \cdot \frac{\ell}{Om}, n, -2 \cdot \ell\right), t\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{2} \cdot \ell\right) \cdot \sqrt{\mathsf{fma}\left(\frac{n}{Om}, \frac{U* - U}{Om}, \frac{-2}{Om}\right) \cdot \left(n \cdot U\right)}\\
\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*))))) < 4.99999999999999989e-138Initial program 20.6%
lift--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--l+N/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-evalN/A
lower--.f6420.6
lift-*.f64N/A
Applied rewrites20.6%
Applied rewrites53.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6454.8
Applied rewrites52.9%
Taylor expanded in U around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f6452.9
Applied rewrites52.9%
if 4.99999999999999989e-138 < (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 67.5%
lift--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--l+N/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-evalN/A
lower--.f6474.5
lift-*.f64N/A
Applied rewrites70.3%
Applied rewrites72.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6474.5
Applied rewrites74.5%
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
*-commutativeN/A
distribute-lft-neg-inN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-*.f645.4
lift--.f64N/A
Applied rewrites5.4%
Taylor expanded in l around inf
lower-*.f64N/A
Applied rewrites27.2%
Final simplification62.5%
(FPCore (n U t l Om U*)
:precision binary64
(if (<=
(sqrt
(*
(- (- t (* (/ (* l l) Om) 2.0)) (* (* n (pow (/ l Om) 2.0)) (- U U*)))
(* (* n 2.0) U)))
INFINITY)
(sqrt (* (* (* (fma (* -2.0 l) (/ l Om) t) n) U) 2.0))
(* (/ (* (* (sqrt 2.0) n) l) Om) (sqrt (* U* U)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (sqrt((((t - (((l * l) / Om) * 2.0)) - ((n * pow((l / Om), 2.0)) * (U - U_42_))) * ((n * 2.0) * U))) <= ((double) INFINITY)) {
tmp = sqrt((((fma((-2.0 * l), (l / Om), t) * n) * U) * 2.0));
} else {
tmp = (((sqrt(2.0) * n) * l) / Om) * sqrt((U_42_ * U));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (sqrt(Float64(Float64(Float64(t - Float64(Float64(Float64(l * l) / Om) * 2.0)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))) * Float64(Float64(n * 2.0) * U))) <= Inf) tmp = sqrt(Float64(Float64(Float64(fma(Float64(-2.0 * l), Float64(l / Om), t) * n) * U) * 2.0)); else tmp = Float64(Float64(Float64(Float64(sqrt(2.0) * n) * l) / Om) * sqrt(Float64(U_42_ * U))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[N[Sqrt[N[(N[(N[(t - N[(N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(n * 2.0), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], Infinity], N[Sqrt[N[(N[(N[(N[(N[(-2.0 * l), $MachinePrecision] * N[(l / Om), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * n), $MachinePrecision] * l), $MachinePrecision] / Om), $MachinePrecision] * N[Sqrt[N[(U$42$ * U), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\sqrt{\left(\left(t - \frac{\ell \cdot \ell}{Om} \cdot 2\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right) \cdot \left(\left(n \cdot 2\right) \cdot U\right)} \leq \infty:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\sqrt{2} \cdot n\right) \cdot \ell}{Om} \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*))))) < +inf.0Initial program 56.6%
lift--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--l+N/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-evalN/A
lower--.f6461.9
lift-*.f64N/A
Applied rewrites58.7%
Applied rewrites67.8%
Taylor expanded in n around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f6455.3
Applied rewrites55.3%
Applied rewrites59.6%
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.0
Applied rewrites27.0%
Final simplification54.2%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* n 2.0) U)))
(if (<=
(*
(- (- t (* (/ (* l l) Om) 2.0)) (* (* n (pow (/ l Om) 2.0)) (- U U*)))
t_1)
1e-61)
(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 = (n * 2.0) * U;
double tmp;
if ((((t - (((l * l) / Om) * 2.0)) - ((n * pow((l / Om), 2.0)) * (U - U_42_))) * t_1) <= 1e-61) {
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 = (n * 2.0d0) * u
if ((((t - (((l * l) / om) * 2.0d0)) - ((n * ((l / om) ** 2.0d0)) * (u - u_42))) * t_1) <= 1d-61) 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 = (n * 2.0) * U;
double tmp;
if ((((t - (((l * l) / Om) * 2.0)) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_))) * t_1) <= 1e-61) {
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 = (n * 2.0) * U tmp = 0 if (((t - (((l * l) / Om) * 2.0)) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))) * t_1) <= 1e-61: 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(n * 2.0) * U) tmp = 0.0 if (Float64(Float64(Float64(t - Float64(Float64(Float64(l * l) / Om) * 2.0)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))) * t_1) <= 1e-61) tmp = sqrt(Float64(Float64(t * U) * Float64(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 = (n * 2.0) * U; tmp = 0.0; if ((((t - (((l * l) / Om) * 2.0)) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))) * t_1) <= 1e-61) 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[(n * 2.0), $MachinePrecision] * U), $MachinePrecision]}, If[LessEqual[N[(N[(N[(t - N[(N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], 1e-61], N[Sqrt[N[(N[(t * U), $MachinePrecision] * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(t$95$1 * t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(n \cdot 2\right) \cdot U\\
\mathbf{if}\;\left(\left(t - \frac{\ell \cdot \ell}{Om} \cdot 2\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right) \cdot t\_1 \leq 10^{-61}:\\
\;\;\;\;\sqrt{\left(t \cdot U\right) \cdot \left(n \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t\_1 \cdot t}\\
\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*)))) < 1e-61Initial program 45.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6453.4
Applied rewrites53.4%
Applied rewrites55.7%
if 1e-61 < (*.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 48.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
Applied rewrites33.0%
Final simplification40.5%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= U 2.25e-307)
(sqrt
(* (* n 2.0) (* (fma (/ l Om) (fma (* (/ l Om) U*) n (* -2.0 l)) t) U)))
(*
(sqrt U)
(sqrt
(*
(fma (fma (* n (/ l Om)) (- U* U) (* -2.0 l)) (/ l Om) t)
(* n 2.0))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 2.25e-307) {
tmp = sqrt(((n * 2.0) * (fma((l / Om), fma(((l / Om) * U_42_), n, (-2.0 * l)), t) * U)));
} else {
tmp = sqrt(U) * sqrt((fma(fma((n * (l / Om)), (U_42_ - U), (-2.0 * l)), (l / Om), t) * (n * 2.0)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= 2.25e-307) tmp = sqrt(Float64(Float64(n * 2.0) * Float64(fma(Float64(l / Om), fma(Float64(Float64(l / Om) * U_42_), n, Float64(-2.0 * l)), t) * U))); else tmp = Float64(sqrt(U) * sqrt(Float64(fma(fma(Float64(n * Float64(l / Om)), Float64(U_42_ - U), Float64(-2.0 * l)), Float64(l / Om), t) * Float64(n * 2.0)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, 2.25e-307], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * U$42$), $MachinePrecision] * n + N[(-2.0 * l), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[U], $MachinePrecision] * N[Sqrt[N[(N[(N[(N[(n * N[(l / Om), $MachinePrecision]), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision] + N[(-2.0 * l), $MachinePrecision]), $MachinePrecision] * N[(l / Om), $MachinePrecision] + t), $MachinePrecision] * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;U \leq 2.25 \cdot 10^{-307}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(\mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(\frac{\ell}{Om} \cdot U*, n, -2 \cdot \ell\right), t\right) \cdot U\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{U} \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(n \cdot \frac{\ell}{Om}, U* - U, -2 \cdot \ell\right), \frac{\ell}{Om}, t\right) \cdot \left(n \cdot 2\right)}\\
\end{array}
\end{array}
if U < 2.24999999999999994e-307Initial program 41.8%
lift--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--l+N/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-evalN/A
lower--.f6450.2
lift-*.f64N/A
Applied rewrites50.4%
Applied rewrites54.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6453.3
Applied rewrites60.3%
Taylor expanded in U around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f6460.3
Applied rewrites60.3%
if 2.24999999999999994e-307 < U Initial program 52.8%
lift--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--l+N/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-evalN/A
lower--.f6457.6
lift-*.f64N/A
Applied rewrites54.3%
Applied rewrites60.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6455.1
Applied rewrites59.3%
Applied rewrites76.0%
Final simplification68.2%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(sqrt
(*
(* n 2.0)
(* (fma (/ l Om) (fma (* (/ l Om) U*) n (* -2.0 l)) t) U)))))
(if (<= n -9.5e-51)
t_1
(if (<= n 6.6e-134)
(sqrt (fma (* (/ (* (* n l) U) Om) l) -4.0 (* (* (* t n) U) 2.0)))
t_1))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt(((n * 2.0) * (fma((l / Om), fma(((l / Om) * U_42_), n, (-2.0 * l)), t) * U)));
double tmp;
if (n <= -9.5e-51) {
tmp = t_1;
} else if (n <= 6.6e-134) {
tmp = sqrt(fma(((((n * l) * U) / Om) * l), -4.0, (((t * n) * U) * 2.0)));
} else {
tmp = t_1;
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = sqrt(Float64(Float64(n * 2.0) * Float64(fma(Float64(l / Om), fma(Float64(Float64(l / Om) * U_42_), n, Float64(-2.0 * l)), t) * U))) tmp = 0.0 if (n <= -9.5e-51) tmp = t_1; elseif (n <= 6.6e-134) tmp = sqrt(fma(Float64(Float64(Float64(Float64(n * l) * U) / Om) * l), -4.0, Float64(Float64(Float64(t * n) * U) * 2.0))); else tmp = t_1; end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * U$42$), $MachinePrecision] * n + N[(-2.0 * l), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[n, -9.5e-51], t$95$1, If[LessEqual[n, 6.6e-134], N[Sqrt[N[(N[(N[(N[(N[(n * l), $MachinePrecision] * U), $MachinePrecision] / Om), $MachinePrecision] * l), $MachinePrecision] * -4.0 + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\left(n \cdot 2\right) \cdot \left(\mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(\frac{\ell}{Om} \cdot U*, n, -2 \cdot \ell\right), t\right) \cdot U\right)}\\
\mathbf{if}\;n \leq -9.5 \cdot 10^{-51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;n \leq 6.6 \cdot 10^{-134}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\left(n \cdot \ell\right) \cdot U}{Om} \cdot \ell, -4, \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if n < -9.4999999999999998e-51 or 6.60000000000000038e-134 < n Initial program 52.8%
lift--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--l+N/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-evalN/A
lower--.f6459.2
lift-*.f64N/A
Applied rewrites56.4%
Applied rewrites55.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6457.1
Applied rewrites65.7%
Taylor expanded in U around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f6466.3
Applied rewrites66.3%
if -9.4999999999999998e-51 < n < 6.60000000000000038e-134Initial program 40.4%
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-*.f6454.4
Applied rewrites54.4%
Applied rewrites62.9%
Applied rewrites64.7%
Final simplification65.6%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(sqrt
(*
(* (fma (/ l Om) (* (fma n (/ (- U* U) Om) -2.0) l) t) U)
(* n 2.0)))))
(if (<= n -7.8e+43)
t_1
(if (<= n 1.02e-44)
(sqrt (fma (* (/ (* (* n l) U) Om) l) -4.0 (* (* (* t n) U) 2.0)))
t_1))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt(((fma((l / Om), (fma(n, ((U_42_ - U) / Om), -2.0) * l), t) * U) * (n * 2.0)));
double tmp;
if (n <= -7.8e+43) {
tmp = t_1;
} else if (n <= 1.02e-44) {
tmp = sqrt(fma(((((n * l) * U) / Om) * l), -4.0, (((t * n) * U) * 2.0)));
} else {
tmp = t_1;
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = sqrt(Float64(Float64(fma(Float64(l / Om), Float64(fma(n, Float64(Float64(U_42_ - U) / Om), -2.0) * l), t) * U) * Float64(n * 2.0))) tmp = 0.0 if (n <= -7.8e+43) tmp = t_1; elseif (n <= 1.02e-44) tmp = sqrt(fma(Float64(Float64(Float64(Float64(n * l) * U) / Om) * l), -4.0, Float64(Float64(Float64(t * n) * U) * 2.0))); else tmp = t_1; end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(n * N[(N[(U$42$ - U), $MachinePrecision] / Om), $MachinePrecision] + -2.0), $MachinePrecision] * l), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision] * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[n, -7.8e+43], t$95$1, If[LessEqual[n, 1.02e-44], N[Sqrt[N[(N[(N[(N[(N[(n * l), $MachinePrecision] * U), $MachinePrecision] / Om), $MachinePrecision] * l), $MachinePrecision] * -4.0 + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\left(\mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(n, \frac{U* - U}{Om}, -2\right) \cdot \ell, t\right) \cdot U\right) \cdot \left(n \cdot 2\right)}\\
\mathbf{if}\;n \leq -7.8 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;n \leq 1.02 \cdot 10^{-44}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\left(n \cdot \ell\right) \cdot U}{Om} \cdot \ell, -4, \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if n < -7.8000000000000001e43 or 1.0199999999999999e-44 < n Initial program 55.2%
lift--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--l+N/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-evalN/A
lower--.f6461.8
lift-*.f64N/A
Applied rewrites58.1%
Applied rewrites55.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6458.0
Applied rewrites69.3%
Taylor expanded in l around 0
lower-*.f64N/A
sub-negN/A
associate-/l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f6464.5
Applied rewrites64.5%
if -7.8000000000000001e43 < n < 1.0199999999999999e-44Initial program 41.7%
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-*.f6450.5
Applied rewrites50.5%
Applied rewrites58.1%
Applied rewrites60.7%
Final simplification62.3%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= Om -980000.0)
(sqrt (fma (* (/ (* (* n l) U) Om) l) -4.0 (* (* (* t n) U) 2.0)))
(if (<= Om 1.25e+79)
(sqrt (* (* (fma (/ l Om) (/ (* (* n l) U*) Om) t) U) (* n 2.0)))
(sqrt (* (* (* (fma (* -2.0 l) (/ l Om) t) n) U) 2.0)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (Om <= -980000.0) {
tmp = sqrt(fma(((((n * l) * U) / Om) * l), -4.0, (((t * n) * U) * 2.0)));
} else if (Om <= 1.25e+79) {
tmp = sqrt(((fma((l / Om), (((n * l) * U_42_) / Om), t) * U) * (n * 2.0)));
} else {
tmp = sqrt((((fma((-2.0 * l), (l / Om), t) * n) * U) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (Om <= -980000.0) tmp = sqrt(fma(Float64(Float64(Float64(Float64(n * l) * U) / Om) * l), -4.0, Float64(Float64(Float64(t * n) * U) * 2.0))); elseif (Om <= 1.25e+79) tmp = sqrt(Float64(Float64(fma(Float64(l / Om), Float64(Float64(Float64(n * l) * U_42_) / Om), t) * U) * Float64(n * 2.0))); else tmp = sqrt(Float64(Float64(Float64(fma(Float64(-2.0 * l), Float64(l / Om), t) * n) * U) * 2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[Om, -980000.0], N[Sqrt[N[(N[(N[(N[(N[(n * l), $MachinePrecision] * U), $MachinePrecision] / Om), $MachinePrecision] * l), $MachinePrecision] * -4.0 + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[Om, 1.25e+79], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(n * l), $MachinePrecision] * U$42$), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision] * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(-2.0 * l), $MachinePrecision] * N[(l / Om), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;Om \leq -980000:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\left(n \cdot \ell\right) \cdot U}{Om} \cdot \ell, -4, \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{elif}\;Om \leq 1.25 \cdot 10^{+79}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(\frac{\ell}{Om}, \frac{\left(n \cdot \ell\right) \cdot U*}{Om}, t\right) \cdot U\right) \cdot \left(n \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\end{array}
\end{array}
if Om < -9.8e5Initial program 50.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-*.f6451.7
Applied rewrites51.7%
Applied rewrites56.9%
Applied rewrites61.9%
if -9.8e5 < Om < 1.25e79Initial program 47.6%
lift--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--l+N/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-evalN/A
lower--.f6449.6
lift-*.f64N/A
Applied rewrites48.6%
Applied rewrites53.6%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6453.6
Applied rewrites61.9%
Taylor expanded in U* around inf
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6457.8
Applied rewrites57.8%
if 1.25e79 < Om Initial program 42.4%
lift--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--l+N/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-evalN/A
lower--.f6456.1
lift-*.f64N/A
Applied rewrites53.8%
Applied rewrites62.3%
Taylor expanded in n around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f6451.4
Applied rewrites51.4%
Applied rewrites62.3%
Final simplification60.2%
(FPCore (n U t l Om U*) :precision binary64 (if (<= n 2e-45) (sqrt (* (* (* (fma (* -2.0 l) (/ l Om) t) n) U) 2.0)) (sqrt (* (* (fma (/ l Om) (* -2.0 l) t) U) (* n 2.0)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= 2e-45) {
tmp = sqrt((((fma((-2.0 * l), (l / Om), t) * n) * U) * 2.0));
} else {
tmp = sqrt(((fma((l / Om), (-2.0 * l), t) * U) * (n * 2.0)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= 2e-45) tmp = sqrt(Float64(Float64(Float64(fma(Float64(-2.0 * l), Float64(l / Om), t) * n) * U) * 2.0)); else tmp = sqrt(Float64(Float64(fma(Float64(l / Om), Float64(-2.0 * l), t) * U) * Float64(n * 2.0))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, 2e-45], N[Sqrt[N[(N[(N[(N[(N[(-2.0 * l), $MachinePrecision] * N[(l / Om), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * N[(-2.0 * l), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision] * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 2 \cdot 10^{-45}:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(\frac{\ell}{Om}, -2 \cdot \ell, t\right) \cdot U\right) \cdot \left(n \cdot 2\right)}\\
\end{array}
\end{array}
if n < 1.99999999999999997e-45Initial program 43.0%
lift--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--l+N/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-evalN/A
lower--.f6449.4
lift-*.f64N/A
Applied rewrites49.1%
Applied rewrites56.9%
Taylor expanded in n around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f6446.8
Applied rewrites46.8%
Applied rewrites52.3%
if 1.99999999999999997e-45 < n Initial program 63.9%
lift--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--l+N/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-evalN/A
lower--.f6471.5
lift-*.f64N/A
Applied rewrites65.1%
Applied rewrites60.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6469.4
Applied rewrites79.0%
Taylor expanded in n around 0
lower-*.f6456.7
Applied rewrites56.7%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 1.45e+98) (sqrt (* (* (* t n) 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 <= 1.45e+98) {
tmp = sqrt((((t * n) * 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 <= 1.45d+98) then
tmp = sqrt((((t * n) * 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 <= 1.45e+98) {
tmp = Math.sqrt((((t * n) * 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 <= 1.45e+98: tmp = math.sqrt((((t * n) * 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 <= 1.45e+98) tmp = sqrt(Float64(Float64(Float64(t * n) * 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 <= 1.45e+98) tmp = sqrt((((t * n) * 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, 1.45e+98], N[Sqrt[N[(N[(N[(t * n), $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 1.45 \cdot 10^{+98}:\\
\;\;\;\;\sqrt{\left(\left(t \cdot n\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 < 1.45000000000000005e98Initial program 51.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6445.5
Applied rewrites45.5%
if 1.45000000000000005e98 < l Initial program 18.5%
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-*.f6419.3
Applied rewrites19.3%
Taylor expanded in t around 0
Applied rewrites25.8%
Final simplification43.2%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* (fma (* -2.0 l) (/ l Om) t) n) U) 2.0)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((fma((-2.0 * l), (l / Om), t) * n) * U) * 2.0));
}
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(fma(Float64(-2.0 * l), Float64(l / Om), t) * n) * U) * 2.0)) end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(N[(N[(-2.0 * l), $MachinePrecision] * N[(l / Om), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(\mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right) \cdot n\right) \cdot U\right) \cdot 2}
\end{array}
Initial program 47.3%
lift--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--l+N/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-evalN/A
lower--.f6453.9
lift-*.f64N/A
Applied rewrites52.3%
Applied rewrites57.6%
Taylor expanded in n around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sqrt.f6446.9
Applied rewrites46.9%
Applied rewrites51.3%
(FPCore (n U t l Om U*) :precision binary64 (if (<= n 2.3e-307) (sqrt (* (* (* t n) U) 2.0)) (* (sqrt (* n 2.0)) (sqrt (* t U)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= 2.3e-307) {
tmp = sqrt((((t * n) * U) * 2.0));
} else {
tmp = sqrt((n * 2.0)) * sqrt((t * U));
}
return tmp;
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (n <= 2.3d-307) then
tmp = sqrt((((t * n) * u) * 2.0d0))
else
tmp = sqrt((n * 2.0d0)) * sqrt((t * u))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= 2.3e-307) {
tmp = Math.sqrt((((t * n) * U) * 2.0));
} else {
tmp = Math.sqrt((n * 2.0)) * Math.sqrt((t * U));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if n <= 2.3e-307: tmp = math.sqrt((((t * n) * U) * 2.0)) else: tmp = math.sqrt((n * 2.0)) * math.sqrt((t * U)) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= 2.3e-307) tmp = sqrt(Float64(Float64(Float64(t * n) * U) * 2.0)); else tmp = Float64(sqrt(Float64(n * 2.0)) * sqrt(Float64(t * U))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (n <= 2.3e-307) tmp = sqrt((((t * n) * U) * 2.0)); else tmp = sqrt((n * 2.0)) * sqrt((t * U)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, 2.3e-307], N[Sqrt[N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(n * 2.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(t * U), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 2.3 \cdot 10^{-307}:\\
\;\;\;\;\sqrt{\left(\left(t \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{n \cdot 2} \cdot \sqrt{t \cdot U}\\
\end{array}
\end{array}
if n < 2.2999999999999999e-307Initial program 42.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6443.9
Applied rewrites43.9%
if 2.2999999999999999e-307 < n Initial program 52.6%
lift--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--l+N/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-evalN/A
lower--.f6460.3
lift-*.f64N/A
Applied rewrites57.5%
Applied rewrites71.9%
Taylor expanded in t around inf
lower-*.f6442.4
Applied rewrites42.4%
Final simplification43.2%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* t n) U) 2.0)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((t * n) * 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((((t * n) * 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((((t * n) * U) * 2.0));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((t * n) * U) * 2.0))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(t * n) * U) * 2.0)) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((t * n) * U) * 2.0)); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(t \cdot n\right) \cdot U\right) \cdot 2}
\end{array}
Initial program 47.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6440.8
Applied rewrites40.8%
Final simplification40.8%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* n 2.0) U) t)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((n * 2.0) * 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((((n * 2.0d0) * u) * t))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((n * 2.0) * U) * t));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((n * 2.0) * U) * t))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(n * 2.0) * U) * t)) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((n * 2.0) * U) * t)); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(n * 2.0), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot t}
\end{array}
Initial program 47.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6440.8
Applied rewrites40.8%
Applied rewrites34.9%
Final simplification34.9%
herbie shell --seed 2024288
(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*))))))