
(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_)))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
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 16 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_)))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
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}
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(if (<= l_m 5.5e-39)
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l_m l_m) Om)))
(* (* n (pow (/ l_m Om) 2.0)) (- U U*)))))
(if (<= l_m 1.02e+191)
(sqrt
(* (* (fma (* l_m (/ (fma U* (/ n Om) -2.0) Om)) l_m t) (* 2.0 n)) U))
(*
(* (sqrt (* (* U n) (- (/ (* U* n) (* Om Om)) (/ 2.0 Om)))) l_m)
(sqrt 2.0)))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if (l_m <= 5.5e-39) {
tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) - ((n * pow((l_m / Om), 2.0)) * (U - U_42_)))));
} else if (l_m <= 1.02e+191) {
tmp = sqrt(((fma((l_m * (fma(U_42_, (n / Om), -2.0) / Om)), l_m, t) * (2.0 * n)) * U));
} else {
tmp = (sqrt(((U * n) * (((U_42_ * n) / (Om * Om)) - (2.0 / Om)))) * l_m) * sqrt(2.0);
}
return tmp;
}
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) tmp = 0.0 if (l_m <= 5.5e-39) tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) - Float64(Float64(n * (Float64(l_m / Om) ^ 2.0)) * Float64(U - U_42_))))); elseif (l_m <= 1.02e+191) tmp = sqrt(Float64(Float64(fma(Float64(l_m * Float64(fma(U_42_, Float64(n / Om), -2.0) / Om)), l_m, t) * Float64(2.0 * n)) * U)); else tmp = Float64(Float64(sqrt(Float64(Float64(U * n) * Float64(Float64(Float64(U_42_ * n) / Float64(Om * Om)) - Float64(2.0 / Om)))) * l_m) * sqrt(2.0)); end return tmp end
l_m = N[Abs[l], $MachinePrecision] code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[l$95$m, 5.5e-39], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l$95$m, 1.02e+191], N[Sqrt[N[(N[(N[(N[(l$95$m * N[(N[(U$42$ * N[(n / Om), $MachinePrecision] + -2.0), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * l$95$m + t), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision], N[(N[(N[Sqrt[N[(N[(U * n), $MachinePrecision] * N[(N[(N[(U$42$ * n), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] - N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * l$95$m), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 5.5 \cdot 10^{-39}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) - \left(n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{elif}\;l\_m \leq 1.02 \cdot 10^{+191}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(l\_m \cdot \frac{\mathsf{fma}\left(U*, \frac{n}{Om}, -2\right)}{Om}, l\_m, t\right) \cdot \left(2 \cdot n\right)\right) \cdot U}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{\left(U \cdot n\right) \cdot \left(\frac{U* \cdot n}{Om \cdot Om} - \frac{2}{Om}\right)} \cdot l\_m\right) \cdot \sqrt{2}\\
\end{array}
\end{array}
if l < 5.50000000000000018e-39Initial program 56.1%
if 5.50000000000000018e-39 < l < 1.02000000000000006e191Initial program 56.3%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites48.4%
Applied rewrites32.5%
Applied rewrites60.4%
Applied rewrites70.9%
if 1.02000000000000006e191 < l Initial program 10.9%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites10.6%
Taylor expanded in l around inf
Applied rewrites80.2%
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(let* ((t_1
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l_m l_m) Om)))
(* (* n (pow (/ l_m Om) 2.0)) (- U U*)))))))
(if (<= t_1 1e-121)
(sqrt (* (fma -4.0 (/ (* (* l_m l_m) n) Om) (* (* 2.0 n) t)) U))
(if (<= t_1 INFINITY)
(sqrt (* (fma l_m (/ (* -2.0 l_m) Om) t) (* (* U 2.0) n)))
(sqrt (* 2.0 (/ (* (* U U*) (* (* (* l_m n) n) l_m)) (* Om Om))))))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) - ((n * pow((l_m / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_1 <= 1e-121) {
tmp = sqrt((fma(-4.0, (((l_m * l_m) * n) / Om), ((2.0 * n) * t)) * U));
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt((fma(l_m, ((-2.0 * l_m) / Om), t) * ((U * 2.0) * n)));
} else {
tmp = sqrt((2.0 * (((U * U_42_) * (((l_m * n) * n) * l_m)) / (Om * Om))));
}
return tmp;
}
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) t_1 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) - Float64(Float64(n * (Float64(l_m / Om) ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_1 <= 1e-121) tmp = sqrt(Float64(fma(-4.0, Float64(Float64(Float64(l_m * l_m) * n) / Om), Float64(Float64(2.0 * n) * t)) * U)); elseif (t_1 <= Inf) tmp = sqrt(Float64(fma(l_m, Float64(Float64(-2.0 * l_m) / Om), t) * Float64(Float64(U * 2.0) * n))); else tmp = sqrt(Float64(2.0 * Float64(Float64(Float64(U * U_42_) * Float64(Float64(Float64(l_m * n) * n) * l_m)) / Float64(Om * Om)))); end return tmp end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 1e-121], N[Sqrt[N[(N[(-4.0 * N[(N[(N[(l$95$m * l$95$m), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] + N[(N[(2.0 * n), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[Sqrt[N[(N[(l$95$m * N[(N[(-2.0 * l$95$m), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(N[(N[(U * U$42$), $MachinePrecision] * N[(N[(N[(l$95$m * n), $MachinePrecision] * n), $MachinePrecision] * l$95$m), $MachinePrecision]), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) - \left(n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_1 \leq 10^{-121}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(-4, \frac{\left(l\_m \cdot l\_m\right) \cdot n}{Om}, \left(2 \cdot n\right) \cdot t\right) \cdot U}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(l\_m, \frac{-2 \cdot l\_m}{Om}, t\right) \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \frac{\left(U \cdot U*\right) \cdot \left(\left(\left(l\_m \cdot n\right) \cdot n\right) \cdot l\_m\right)}{Om \cdot 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*))))) < 9.9999999999999998e-122Initial program 29.4%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/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--.f6429.4
lift-*.f64N/A
Applied rewrites29.4%
Applied rewrites54.8%
Taylor expanded in Om around inf
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6452.1
Applied rewrites52.1%
if 9.9999999999999998e-122 < (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 69.0%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites62.1%
Applied rewrites33.7%
Applied rewrites68.0%
Taylor expanded in n around 0
Applied rewrites65.7%
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
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/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--.f6415.2
lift-*.f64N/A
Applied rewrites15.4%
Applied rewrites10.3%
Taylor expanded in U* around inf
lower-*.f64N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6429.7
Applied rewrites29.7%
Applied rewrites37.7%
Final simplification59.4%
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(let* ((t_1
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l_m l_m) Om)))
(* (* n (pow (/ l_m Om) 2.0)) (- U U*)))))))
(if (<= t_1 1e-121)
(sqrt (* (fma -4.0 (/ (* (* l_m l_m) n) Om) (* (* 2.0 n) t)) U))
(if (<= t_1 INFINITY)
(sqrt (* (fma l_m (/ (* -2.0 l_m) Om) t) (* (* U 2.0) n)))
(sqrt (* 2.0 (/ (* (* U U*) (* (* l_m l_m) (* n n))) (* Om Om))))))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) - ((n * pow((l_m / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_1 <= 1e-121) {
tmp = sqrt((fma(-4.0, (((l_m * l_m) * n) / Om), ((2.0 * n) * t)) * U));
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt((fma(l_m, ((-2.0 * l_m) / Om), t) * ((U * 2.0) * n)));
} else {
tmp = sqrt((2.0 * (((U * U_42_) * ((l_m * l_m) * (n * n))) / (Om * Om))));
}
return tmp;
}
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) t_1 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) - Float64(Float64(n * (Float64(l_m / Om) ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_1 <= 1e-121) tmp = sqrt(Float64(fma(-4.0, Float64(Float64(Float64(l_m * l_m) * n) / Om), Float64(Float64(2.0 * n) * t)) * U)); elseif (t_1 <= Inf) tmp = sqrt(Float64(fma(l_m, Float64(Float64(-2.0 * l_m) / Om), t) * Float64(Float64(U * 2.0) * n))); else tmp = sqrt(Float64(2.0 * Float64(Float64(Float64(U * U_42_) * Float64(Float64(l_m * l_m) * Float64(n * n))) / Float64(Om * Om)))); end return tmp end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 1e-121], N[Sqrt[N[(N[(-4.0 * N[(N[(N[(l$95$m * l$95$m), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] + N[(N[(2.0 * n), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[Sqrt[N[(N[(l$95$m * N[(N[(-2.0 * l$95$m), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(N[(N[(U * U$42$), $MachinePrecision] * N[(N[(l$95$m * l$95$m), $MachinePrecision] * N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) - \left(n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_1 \leq 10^{-121}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(-4, \frac{\left(l\_m \cdot l\_m\right) \cdot n}{Om}, \left(2 \cdot n\right) \cdot t\right) \cdot U}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(l\_m, \frac{-2 \cdot l\_m}{Om}, t\right) \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \frac{\left(U \cdot U*\right) \cdot \left(\left(l\_m \cdot l\_m\right) \cdot \left(n \cdot n\right)\right)}{Om \cdot 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*))))) < 9.9999999999999998e-122Initial program 29.4%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/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--.f6429.4
lift-*.f64N/A
Applied rewrites29.4%
Applied rewrites54.8%
Taylor expanded in Om around inf
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6452.1
Applied rewrites52.1%
if 9.9999999999999998e-122 < (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 69.0%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites62.1%
Applied rewrites33.7%
Applied rewrites68.0%
Taylor expanded in n around 0
Applied rewrites65.7%
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
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/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--.f6415.2
lift-*.f64N/A
Applied rewrites15.4%
Taylor expanded in U* around inf
lower-*.f64N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6429.7
Applied rewrites29.7%
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(let* ((t_1
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l_m l_m) Om)))
(* (* n (pow (/ l_m Om) 2.0)) (- U U*)))))))
(if (<= t_1 1e-121)
(sqrt (* (fma -4.0 (/ (* (* l_m l_m) n) Om) (* (* 2.0 n) t)) U))
(if (<= t_1 INFINITY)
(sqrt (* (fma l_m (/ (* -2.0 l_m) Om) t) (* (* U 2.0) n)))
(* (* (/ (* l_m n) Om) (sqrt (* U U*))) (sqrt 2.0))))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) - ((n * pow((l_m / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_1 <= 1e-121) {
tmp = sqrt((fma(-4.0, (((l_m * l_m) * n) / Om), ((2.0 * n) * t)) * U));
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt((fma(l_m, ((-2.0 * l_m) / Om), t) * ((U * 2.0) * n)));
} else {
tmp = (((l_m * n) / Om) * sqrt((U * U_42_))) * sqrt(2.0);
}
return tmp;
}
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) t_1 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) - Float64(Float64(n * (Float64(l_m / Om) ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_1 <= 1e-121) tmp = sqrt(Float64(fma(-4.0, Float64(Float64(Float64(l_m * l_m) * n) / Om), Float64(Float64(2.0 * n) * t)) * U)); elseif (t_1 <= Inf) tmp = sqrt(Float64(fma(l_m, Float64(Float64(-2.0 * l_m) / Om), t) * Float64(Float64(U * 2.0) * n))); else tmp = Float64(Float64(Float64(Float64(l_m * n) / Om) * sqrt(Float64(U * U_42_))) * sqrt(2.0)); end return tmp end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 1e-121], N[Sqrt[N[(N[(-4.0 * N[(N[(N[(l$95$m * l$95$m), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] + N[(N[(2.0 * n), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[Sqrt[N[(N[(l$95$m * N[(N[(-2.0 * l$95$m), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[(l$95$m * n), $MachinePrecision] / Om), $MachinePrecision] * N[Sqrt[N[(U * U$42$), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) - \left(n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_1 \leq 10^{-121}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(-4, \frac{\left(l\_m \cdot l\_m\right) \cdot n}{Om}, \left(2 \cdot n\right) \cdot t\right) \cdot U}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(l\_m, \frac{-2 \cdot l\_m}{Om}, t\right) \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{l\_m \cdot n}{Om} \cdot \sqrt{U \cdot U*}\right) \cdot \sqrt{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*))))) < 9.9999999999999998e-122Initial program 29.4%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/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--.f6429.4
lift-*.f64N/A
Applied rewrites29.4%
Applied rewrites54.8%
Taylor expanded in Om around inf
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6452.1
Applied rewrites52.1%
if 9.9999999999999998e-122 < (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 69.0%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites62.1%
Applied rewrites33.7%
Applied rewrites68.0%
Taylor expanded in n around 0
Applied rewrites65.7%
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 0
lower-*.f64N/A
Applied rewrites0.7%
Taylor expanded in n around inf
Applied rewrites22.7%
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(let* ((t_1 (/ (* l_m l_m) Om))
(t_2
(sqrt
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 t_1)) (* (* n (pow (/ l_m 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_m (/ (* -2.0 l_m) Om) t) (* (* U 2.0) n)))
(* (* (/ (* l_m n) Om) (sqrt (* U U*))) (sqrt 2.0))))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double t_1 = (l_m * l_m) / Om;
double t_2 = sqrt((((2.0 * n) * U) * ((t - (2.0 * t_1)) - ((n * pow((l_m / 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_m, ((-2.0 * l_m) / Om), t) * ((U * 2.0) * n)));
} else {
tmp = (((l_m * n) / Om) * sqrt((U * U_42_))) * sqrt(2.0);
}
return tmp;
}
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) t_1 = Float64(Float64(l_m * l_m) / Om) t_2 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l_m / 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(l_m, Float64(Float64(-2.0 * l_m) / Om), t) * Float64(Float64(U * 2.0) * n))); else tmp = Float64(Float64(Float64(Float64(l_m * n) / Om) * sqrt(Float64(U * U_42_))) * sqrt(2.0)); end return tmp end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l$95$m * l$95$m), $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$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $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[(l$95$m * N[(N[(-2.0 * l$95$m), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[(l$95$m * n), $MachinePrecision] / Om), $MachinePrecision] * N[Sqrt[N[(U * U$42$), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := \frac{l\_m \cdot l\_m}{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{l\_m}{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(l\_m, \frac{-2 \cdot l\_m}{Om}, t\right) \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{l\_m \cdot n}{Om} \cdot \sqrt{U \cdot U*}\right) \cdot \sqrt{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*))))) < 0.0Initial program 9.9%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6439.7
Applied rewrites39.7%
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*))))) < +inf.0Initial program 69.9%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites63.2%
Applied rewrites34.4%
Applied rewrites69.0%
Taylor expanded in n around 0
Applied rewrites66.8%
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 0
lower-*.f64N/A
Applied rewrites0.7%
Taylor expanded in n around inf
Applied rewrites22.7%
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(let* ((t_1
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l_m l_m) Om)))
(* (* n (pow (/ l_m Om) 2.0)) (- U U*))))))
(if (<= t_1 0.0)
(sqrt
(* (* (fma (* l_m (/ (fma U* (/ n Om) -2.0) Om)) l_m t) U) (* 2.0 n)))
(if (<= t_1 INFINITY)
(sqrt
(*
(fma l_m (/ (fma (* (/ n Om) U*) l_m (* -2.0 l_m)) Om) t)
(* (* U 2.0) n)))
(sqrt
(*
2.0
(/
(* U (* l_m (* n (fma -2.0 l_m (/ (* U* (* l_m n)) Om)))))
Om)))))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) - ((n * pow((l_m / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_1 <= 0.0) {
tmp = sqrt(((fma((l_m * (fma(U_42_, (n / Om), -2.0) / Om)), l_m, t) * U) * (2.0 * n)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt((fma(l_m, (fma(((n / Om) * U_42_), l_m, (-2.0 * l_m)) / Om), t) * ((U * 2.0) * n)));
} else {
tmp = sqrt((2.0 * ((U * (l_m * (n * fma(-2.0, l_m, ((U_42_ * (l_m * n)) / Om))))) / Om)));
}
return tmp;
}
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) t_1 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) - Float64(Float64(n * (Float64(l_m / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_1 <= 0.0) tmp = sqrt(Float64(Float64(fma(Float64(l_m * Float64(fma(U_42_, Float64(n / Om), -2.0) / Om)), l_m, t) * U) * Float64(2.0 * n))); elseif (t_1 <= Inf) tmp = sqrt(Float64(fma(l_m, Float64(fma(Float64(Float64(n / Om) * U_42_), l_m, Float64(-2.0 * l_m)) / Om), t) * Float64(Float64(U * 2.0) * n))); else tmp = sqrt(Float64(2.0 * Float64(Float64(U * Float64(l_m * Float64(n * fma(-2.0, l_m, Float64(Float64(U_42_ * Float64(l_m * n)) / Om))))) / Om))); end return tmp end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, 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$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l$95$m / 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[(l$95$m * N[(N[(U$42$ * N[(n / Om), $MachinePrecision] + -2.0), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * l$95$m + t), $MachinePrecision] * U), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[Sqrt[N[(N[(l$95$m * N[(N[(N[(N[(n / Om), $MachinePrecision] * U$42$), $MachinePrecision] * l$95$m + N[(-2.0 * l$95$m), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(N[(U * N[(l$95$m * N[(n * N[(-2.0 * l$95$m + N[(N[(U$42$ * N[(l$95$m * n), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) - \left(n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(l\_m \cdot \frac{\mathsf{fma}\left(U*, \frac{n}{Om}, -2\right)}{Om}, l\_m, t\right) \cdot U\right) \cdot \left(2 \cdot n\right)}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(l\_m, \frac{\mathsf{fma}\left(\frac{n}{Om} \cdot U*, l\_m, -2 \cdot l\_m\right)}{Om}, t\right) \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \frac{U \cdot \left(l\_m \cdot \left(n \cdot \mathsf{fma}\left(-2, l\_m, \frac{U* \cdot \left(l\_m \cdot n\right)}{Om}\right)\right)\right)}{Om}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 8.9%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites8.7%
Applied rewrites29.1%
Applied rewrites12.7%
Applied rewrites42.6%
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.9%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites63.2%
Applied rewrites34.4%
Applied rewrites69.0%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites0.7%
Applied rewrites5.9%
Applied rewrites33.4%
Taylor expanded in t around 0
Applied rewrites58.9%
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(let* ((t_1
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l_m l_m) Om)))
(* (* n (pow (/ l_m Om) 2.0)) (- U U*)))))))
(if (<= t_1 0.0)
(sqrt (* (* 2.0 n) (* U t)))
(if (<= t_1 5e+152)
(sqrt (* t (* (+ U U) n)))
(* (sqrt (* U (* n (+ t (* 2.0 n))))) (sqrt 2.0))))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) - ((n * pow((l_m / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_1 <= 0.0) {
tmp = sqrt(((2.0 * n) * (U * t)));
} else if (t_1 <= 5e+152) {
tmp = sqrt((t * ((U + U) * n)));
} else {
tmp = sqrt((U * (n * (t + (2.0 * n))))) * sqrt(2.0);
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l_m, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l_m * l_m) / om))) - ((n * ((l_m / om) ** 2.0d0)) * (u - u_42)))))
if (t_1 <= 0.0d0) then
tmp = sqrt(((2.0d0 * n) * (u * t)))
else if (t_1 <= 5d+152) then
tmp = sqrt((t * ((u + u) * n)))
else
tmp = sqrt((u * (n * (t + (2.0d0 * n))))) * sqrt(2.0d0)
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double t_1 = Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) - ((n * Math.pow((l_m / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_1 <= 0.0) {
tmp = Math.sqrt(((2.0 * n) * (U * t)));
} else if (t_1 <= 5e+152) {
tmp = Math.sqrt((t * ((U + U) * n)));
} else {
tmp = Math.sqrt((U * (n * (t + (2.0 * n))))) * Math.sqrt(2.0);
}
return tmp;
}
l_m = math.fabs(l) def code(n, U, t, l_m, Om, U_42_): t_1 = math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) - ((n * math.pow((l_m / Om), 2.0)) * (U - U_42_))))) tmp = 0 if t_1 <= 0.0: tmp = math.sqrt(((2.0 * n) * (U * t))) elif t_1 <= 5e+152: tmp = math.sqrt((t * ((U + U) * n))) else: tmp = math.sqrt((U * (n * (t + (2.0 * n))))) * math.sqrt(2.0) return tmp
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) t_1 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) - Float64(Float64(n * (Float64(l_m / Om) ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_1 <= 0.0) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * t))); elseif (t_1 <= 5e+152) tmp = sqrt(Float64(t * Float64(Float64(U + U) * n))); else tmp = Float64(sqrt(Float64(U * Float64(n * Float64(t + Float64(2.0 * n))))) * sqrt(2.0)); end return tmp end
l_m = abs(l); function tmp_2 = code(n, U, t, l_m, Om, U_42_) t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) - ((n * ((l_m / Om) ^ 2.0)) * (U - U_42_))))); tmp = 0.0; if (t_1 <= 0.0) tmp = sqrt(((2.0 * n) * (U * t))); elseif (t_1 <= 5e+152) tmp = sqrt((t * ((U + U) * n))); else tmp = sqrt((U * (n * (t + (2.0 * n))))) * sqrt(2.0); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 5e+152], N[Sqrt[N[(t * N[(N[(U + U), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(U * N[(n * N[(t + N[(2.0 * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) - \left(n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+152}:\\
\;\;\;\;\sqrt{t \cdot \left(\left(U + U\right) \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{U \cdot \left(n \cdot \left(t + 2 \cdot n\right)\right)} \cdot \sqrt{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*))))) < 0.0Initial program 9.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6431.8
Applied rewrites31.8%
Applied rewrites31.9%
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*))))) < 5e152Initial program 97.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6467.8
Applied rewrites67.8%
Applied rewrites79.2%
Applied rewrites79.2%
if 5e152 < (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 18.4%
Applied rewrites17.1%
Taylor expanded in l around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-sqrt.f6415.5
Applied rewrites15.5%
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(if (<=
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l_m l_m) Om)))
(* (* n (pow (/ l_m Om) 2.0)) (- U U*)))))
0.0)
(sqrt (* (* 2.0 n) (* U t)))
(sqrt (* t (* (+ U U) n)))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if (sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) - ((n * pow((l_m / Om), 2.0)) * (U - U_42_))))) <= 0.0) {
tmp = sqrt(((2.0 * n) * (U * t)));
} else {
tmp = sqrt((t * ((U + U) * n)));
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l_m, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l_m * l_m) / om))) - ((n * ((l_m / om) ** 2.0d0)) * (u - u_42))))) <= 0.0d0) then
tmp = sqrt(((2.0d0 * n) * (u * t)))
else
tmp = sqrt((t * ((u + u) * n)))
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if (Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) - ((n * Math.pow((l_m / Om), 2.0)) * (U - U_42_))))) <= 0.0) {
tmp = Math.sqrt(((2.0 * n) * (U * t)));
} else {
tmp = Math.sqrt((t * ((U + U) * n)));
}
return tmp;
}
l_m = math.fabs(l) def code(n, U, t, l_m, Om, U_42_): tmp = 0 if math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) - ((n * math.pow((l_m / Om), 2.0)) * (U - U_42_))))) <= 0.0: tmp = math.sqrt(((2.0 * n) * (U * t))) else: tmp = math.sqrt((t * ((U + U) * n))) return tmp
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) tmp = 0.0 if (sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) - Float64(Float64(n * (Float64(l_m / Om) ^ 2.0)) * Float64(U - U_42_))))) <= 0.0) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * t))); else tmp = sqrt(Float64(t * Float64(Float64(U + U) * n))); end return tmp end
l_m = abs(l); function tmp_2 = code(n, U, t, l_m, Om, U_42_) tmp = 0.0; if (sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) - ((n * ((l_m / Om) ^ 2.0)) * (U - U_42_))))) <= 0.0) tmp = sqrt(((2.0 * n) * (U * t))); else tmp = sqrt((t * ((U + U) * n))); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 0.0], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(t * N[(N[(U + U), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) - \left(n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \leq 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t \cdot \left(\left(U + U\right) \cdot n\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*))))) < 0.0Initial program 9.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6431.8
Applied rewrites31.8%
Applied rewrites31.9%
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.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
Applied rewrites43.2%
Applied rewrites43.2%
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(if (<= l_m 9.5e-68)
(sqrt
(*
t
(*
2.0
(fma
U
n
(*
(/ U Om)
(/ (* l_m (* n (fma -2.0 l_m (/ (* U* (* l_m n)) Om)))) t))))))
(if (<= l_m 1.02e+191)
(sqrt
(* (* (fma (* l_m (/ (fma U* (/ n Om) -2.0) Om)) l_m t) (* 2.0 n)) U))
(*
(* (sqrt (* (* U n) (- (/ (* U* n) (* Om Om)) (/ 2.0 Om)))) l_m)
(sqrt 2.0)))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if (l_m <= 9.5e-68) {
tmp = sqrt((t * (2.0 * fma(U, n, ((U / Om) * ((l_m * (n * fma(-2.0, l_m, ((U_42_ * (l_m * n)) / Om)))) / t))))));
} else if (l_m <= 1.02e+191) {
tmp = sqrt(((fma((l_m * (fma(U_42_, (n / Om), -2.0) / Om)), l_m, t) * (2.0 * n)) * U));
} else {
tmp = (sqrt(((U * n) * (((U_42_ * n) / (Om * Om)) - (2.0 / Om)))) * l_m) * sqrt(2.0);
}
return tmp;
}
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) tmp = 0.0 if (l_m <= 9.5e-68) tmp = sqrt(Float64(t * Float64(2.0 * fma(U, n, Float64(Float64(U / Om) * Float64(Float64(l_m * Float64(n * fma(-2.0, l_m, Float64(Float64(U_42_ * Float64(l_m * n)) / Om)))) / t)))))); elseif (l_m <= 1.02e+191) tmp = sqrt(Float64(Float64(fma(Float64(l_m * Float64(fma(U_42_, Float64(n / Om), -2.0) / Om)), l_m, t) * Float64(2.0 * n)) * U)); else tmp = Float64(Float64(sqrt(Float64(Float64(U * n) * Float64(Float64(Float64(U_42_ * n) / Float64(Om * Om)) - Float64(2.0 / Om)))) * l_m) * sqrt(2.0)); end return tmp end
l_m = N[Abs[l], $MachinePrecision] code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[l$95$m, 9.5e-68], N[Sqrt[N[(t * N[(2.0 * N[(U * n + N[(N[(U / Om), $MachinePrecision] * N[(N[(l$95$m * N[(n * N[(-2.0 * l$95$m + N[(N[(U$42$ * N[(l$95$m * n), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l$95$m, 1.02e+191], N[Sqrt[N[(N[(N[(N[(l$95$m * N[(N[(U$42$ * N[(n / Om), $MachinePrecision] + -2.0), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * l$95$m + t), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision], N[(N[(N[Sqrt[N[(N[(U * n), $MachinePrecision] * N[(N[(N[(U$42$ * n), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] - N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * l$95$m), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 9.5 \cdot 10^{-68}:\\
\;\;\;\;\sqrt{t \cdot \left(2 \cdot \mathsf{fma}\left(U, n, \frac{U}{Om} \cdot \frac{l\_m \cdot \left(n \cdot \mathsf{fma}\left(-2, l\_m, \frac{U* \cdot \left(l\_m \cdot n\right)}{Om}\right)\right)}{t}\right)\right)}\\
\mathbf{elif}\;l\_m \leq 1.02 \cdot 10^{+191}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(l\_m \cdot \frac{\mathsf{fma}\left(U*, \frac{n}{Om}, -2\right)}{Om}, l\_m, t\right) \cdot \left(2 \cdot n\right)\right) \cdot U}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{\left(U \cdot n\right) \cdot \left(\frac{U* \cdot n}{Om \cdot Om} - \frac{2}{Om}\right)} \cdot l\_m\right) \cdot \sqrt{2}\\
\end{array}
\end{array}
if l < 9.4999999999999997e-68Initial program 54.6%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites50.0%
Applied rewrites30.0%
Applied rewrites55.6%
Taylor expanded in t around inf
Applied rewrites59.2%
if 9.4999999999999997e-68 < l < 1.02000000000000006e191Initial program 60.7%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites53.5%
Applied rewrites31.0%
Applied rewrites62.7%
Applied rewrites72.2%
if 1.02000000000000006e191 < l Initial program 10.9%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites10.6%
Taylor expanded in l around inf
Applied rewrites80.2%
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(if (<= l_m 1.45e-88)
(sqrt (* (fma l_m (/ (* -2.0 l_m) Om) t) (* (* U 2.0) n)))
(if (<= l_m 1.02e+191)
(sqrt
(* (* (fma (* l_m (/ (fma U* (/ n Om) -2.0) Om)) l_m t) (* 2.0 n)) U))
(*
(* (sqrt (* (* U n) (- (/ (* U* n) (* Om Om)) (/ 2.0 Om)))) l_m)
(sqrt 2.0)))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if (l_m <= 1.45e-88) {
tmp = sqrt((fma(l_m, ((-2.0 * l_m) / Om), t) * ((U * 2.0) * n)));
} else if (l_m <= 1.02e+191) {
tmp = sqrt(((fma((l_m * (fma(U_42_, (n / Om), -2.0) / Om)), l_m, t) * (2.0 * n)) * U));
} else {
tmp = (sqrt(((U * n) * (((U_42_ * n) / (Om * Om)) - (2.0 / Om)))) * l_m) * sqrt(2.0);
}
return tmp;
}
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) tmp = 0.0 if (l_m <= 1.45e-88) tmp = sqrt(Float64(fma(l_m, Float64(Float64(-2.0 * l_m) / Om), t) * Float64(Float64(U * 2.0) * n))); elseif (l_m <= 1.02e+191) tmp = sqrt(Float64(Float64(fma(Float64(l_m * Float64(fma(U_42_, Float64(n / Om), -2.0) / Om)), l_m, t) * Float64(2.0 * n)) * U)); else tmp = Float64(Float64(sqrt(Float64(Float64(U * n) * Float64(Float64(Float64(U_42_ * n) / Float64(Om * Om)) - Float64(2.0 / Om)))) * l_m) * sqrt(2.0)); end return tmp end
l_m = N[Abs[l], $MachinePrecision] code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[l$95$m, 1.45e-88], N[Sqrt[N[(N[(l$95$m * N[(N[(-2.0 * l$95$m), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l$95$m, 1.02e+191], N[Sqrt[N[(N[(N[(N[(l$95$m * N[(N[(U$42$ * N[(n / Om), $MachinePrecision] + -2.0), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * l$95$m + t), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision], N[(N[(N[Sqrt[N[(N[(U * n), $MachinePrecision] * N[(N[(N[(U$42$ * n), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] - N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * l$95$m), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 1.45 \cdot 10^{-88}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(l\_m, \frac{-2 \cdot l\_m}{Om}, t\right) \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{elif}\;l\_m \leq 1.02 \cdot 10^{+191}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(l\_m \cdot \frac{\mathsf{fma}\left(U*, \frac{n}{Om}, -2\right)}{Om}, l\_m, t\right) \cdot \left(2 \cdot n\right)\right) \cdot U}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{\left(U \cdot n\right) \cdot \left(\frac{U* \cdot n}{Om \cdot Om} - \frac{2}{Om}\right)} \cdot l\_m\right) \cdot \sqrt{2}\\
\end{array}
\end{array}
if l < 1.4500000000000001e-88Initial program 54.1%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites49.5%
Applied rewrites29.7%
Applied rewrites55.1%
Taylor expanded in n around 0
Applied rewrites53.5%
if 1.4500000000000001e-88 < l < 1.02000000000000006e191Initial program 61.9%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites55.0%
Applied rewrites31.6%
Applied rewrites64.0%
Applied rewrites73.1%
if 1.02000000000000006e191 < l Initial program 10.9%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites10.6%
Taylor expanded in l around inf
Applied rewrites80.2%
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(if (<= l_m 1.45e-88)
(sqrt (* (fma l_m (/ (* -2.0 l_m) Om) t) (* (* U 2.0) n)))
(if (<= l_m 1.02e+191)
(sqrt
(* (* (fma (* l_m (/ (fma U* (/ n Om) -2.0) Om)) l_m t) (* 2.0 n)) U))
(*
(sqrt (* (* U n) (- (/ (* U* n) (* Om Om)) (/ 2.0 Om))))
(* l_m (sqrt 2.0))))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if (l_m <= 1.45e-88) {
tmp = sqrt((fma(l_m, ((-2.0 * l_m) / Om), t) * ((U * 2.0) * n)));
} else if (l_m <= 1.02e+191) {
tmp = sqrt(((fma((l_m * (fma(U_42_, (n / Om), -2.0) / Om)), l_m, t) * (2.0 * n)) * U));
} else {
tmp = sqrt(((U * n) * (((U_42_ * n) / (Om * Om)) - (2.0 / Om)))) * (l_m * sqrt(2.0));
}
return tmp;
}
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) tmp = 0.0 if (l_m <= 1.45e-88) tmp = sqrt(Float64(fma(l_m, Float64(Float64(-2.0 * l_m) / Om), t) * Float64(Float64(U * 2.0) * n))); elseif (l_m <= 1.02e+191) tmp = sqrt(Float64(Float64(fma(Float64(l_m * Float64(fma(U_42_, Float64(n / Om), -2.0) / Om)), l_m, t) * Float64(2.0 * n)) * U)); else tmp = Float64(sqrt(Float64(Float64(U * n) * Float64(Float64(Float64(U_42_ * n) / Float64(Om * Om)) - Float64(2.0 / Om)))) * Float64(l_m * sqrt(2.0))); end return tmp end
l_m = N[Abs[l], $MachinePrecision] code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[l$95$m, 1.45e-88], N[Sqrt[N[(N[(l$95$m * N[(N[(-2.0 * l$95$m), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l$95$m, 1.02e+191], N[Sqrt[N[(N[(N[(N[(l$95$m * N[(N[(U$42$ * N[(n / Om), $MachinePrecision] + -2.0), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * l$95$m + t), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(U * n), $MachinePrecision] * N[(N[(N[(U$42$ * n), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] - N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 1.45 \cdot 10^{-88}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(l\_m, \frac{-2 \cdot l\_m}{Om}, t\right) \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{elif}\;l\_m \leq 1.02 \cdot 10^{+191}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(l\_m \cdot \frac{\mathsf{fma}\left(U*, \frac{n}{Om}, -2\right)}{Om}, l\_m, t\right) \cdot \left(2 \cdot n\right)\right) \cdot U}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(U \cdot n\right) \cdot \left(\frac{U* \cdot n}{Om \cdot Om} - \frac{2}{Om}\right)} \cdot \left(l\_m \cdot \sqrt{2}\right)\\
\end{array}
\end{array}
if l < 1.4500000000000001e-88Initial program 54.1%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites49.5%
Applied rewrites29.7%
Applied rewrites55.1%
Taylor expanded in n around 0
Applied rewrites53.5%
if 1.4500000000000001e-88 < l < 1.02000000000000006e191Initial program 61.9%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites55.0%
Applied rewrites31.6%
Applied rewrites64.0%
Applied rewrites73.1%
if 1.02000000000000006e191 < l Initial program 10.9%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites10.6%
Taylor expanded in l around inf
Applied rewrites80.1%
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(if (<= l_m 1.45e-88)
(sqrt (* (fma l_m (/ (* -2.0 l_m) Om) t) (* (* U 2.0) n)))
(sqrt
(* (* (fma (* l_m (/ (fma U* (/ n Om) -2.0) Om)) l_m t) (* 2.0 n)) U))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if (l_m <= 1.45e-88) {
tmp = sqrt((fma(l_m, ((-2.0 * l_m) / Om), t) * ((U * 2.0) * n)));
} else {
tmp = sqrt(((fma((l_m * (fma(U_42_, (n / Om), -2.0) / Om)), l_m, t) * (2.0 * n)) * U));
}
return tmp;
}
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) tmp = 0.0 if (l_m <= 1.45e-88) tmp = sqrt(Float64(fma(l_m, Float64(Float64(-2.0 * l_m) / Om), t) * Float64(Float64(U * 2.0) * n))); else tmp = sqrt(Float64(Float64(fma(Float64(l_m * Float64(fma(U_42_, Float64(n / Om), -2.0) / Om)), l_m, t) * Float64(2.0 * n)) * U)); end return tmp end
l_m = N[Abs[l], $MachinePrecision] code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[l$95$m, 1.45e-88], N[Sqrt[N[(N[(l$95$m * N[(N[(-2.0 * l$95$m), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(l$95$m * N[(N[(U$42$ * N[(n / Om), $MachinePrecision] + -2.0), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * l$95$m + t), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 1.45 \cdot 10^{-88}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(l\_m, \frac{-2 \cdot l\_m}{Om}, t\right) \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(l\_m \cdot \frac{\mathsf{fma}\left(U*, \frac{n}{Om}, -2\right)}{Om}, l\_m, t\right) \cdot \left(2 \cdot n\right)\right) \cdot U}\\
\end{array}
\end{array}
if l < 1.4500000000000001e-88Initial program 54.1%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites49.5%
Applied rewrites29.7%
Applied rewrites55.1%
Taylor expanded in n around 0
Applied rewrites53.5%
if 1.4500000000000001e-88 < l Initial program 49.3%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites44.0%
Applied rewrites28.8%
Applied rewrites62.3%
Applied rewrites67.0%
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
:precision binary64
(if (<= l_m 3.8e-35)
(sqrt (* (fma l_m (/ (* -2.0 l_m) Om) t) (* (* U 2.0) n)))
(sqrt
(* (* (fma (* l_m (/ (fma U* (/ n Om) -2.0) Om)) l_m t) U) (* 2.0 n)))))l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if (l_m <= 3.8e-35) {
tmp = sqrt((fma(l_m, ((-2.0 * l_m) / Om), t) * ((U * 2.0) * n)));
} else {
tmp = sqrt(((fma((l_m * (fma(U_42_, (n / Om), -2.0) / Om)), l_m, t) * U) * (2.0 * n)));
}
return tmp;
}
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) tmp = 0.0 if (l_m <= 3.8e-35) tmp = sqrt(Float64(fma(l_m, Float64(Float64(-2.0 * l_m) / Om), t) * Float64(Float64(U * 2.0) * n))); else tmp = sqrt(Float64(Float64(fma(Float64(l_m * Float64(fma(U_42_, Float64(n / Om), -2.0) / Om)), l_m, t) * U) * Float64(2.0 * n))); end return tmp end
l_m = N[Abs[l], $MachinePrecision] code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[l$95$m, 3.8e-35], N[Sqrt[N[(N[(l$95$m * N[(N[(-2.0 * l$95$m), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(l$95$m * N[(N[(U$42$ * N[(n / Om), $MachinePrecision] + -2.0), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * l$95$m + t), $MachinePrecision] * U), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 3.8 \cdot 10^{-35}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(l\_m, \frac{-2 \cdot l\_m}{Om}, t\right) \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(l\_m \cdot \frac{\mathsf{fma}\left(U*, \frac{n}{Om}, -2\right)}{Om}, l\_m, t\right) \cdot U\right) \cdot \left(2 \cdot n\right)}\\
\end{array}
\end{array}
if l < 3.8000000000000001e-35Initial program 56.3%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites51.9%
Applied rewrites29.4%
Applied rewrites56.8%
Taylor expanded in n around 0
Applied rewrites54.7%
if 3.8000000000000001e-35 < l Initial program 43.1%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites37.2%
Applied rewrites29.5%
Applied rewrites58.9%
Applied rewrites62.8%
l_m = (fabs.f64 l) (FPCore (n U t l_m Om U*) :precision binary64 (if (<= t 1.95e+170) (sqrt (* (fma l_m (/ (* -2.0 l_m) Om) t) (* (* U 2.0) n))) (* (sqrt (* U n)) (* (sqrt t) (sqrt 2.0)))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if (t <= 1.95e+170) {
tmp = sqrt((fma(l_m, ((-2.0 * l_m) / Om), t) * ((U * 2.0) * n)));
} else {
tmp = sqrt((U * n)) * (sqrt(t) * sqrt(2.0));
}
return tmp;
}
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) tmp = 0.0 if (t <= 1.95e+170) tmp = sqrt(Float64(fma(l_m, Float64(Float64(-2.0 * l_m) / Om), t) * Float64(Float64(U * 2.0) * n))); else tmp = Float64(sqrt(Float64(U * n)) * Float64(sqrt(t) * sqrt(2.0))); end return tmp end
l_m = N[Abs[l], $MachinePrecision] code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[t, 1.95e+170], N[Sqrt[N[(N[(l$95$m * N[(N[(-2.0 * l$95$m), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(U * n), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[t], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.95 \cdot 10^{+170}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(l\_m, \frac{-2 \cdot l\_m}{Om}, t\right) \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{U \cdot n} \cdot \left(\sqrt{t} \cdot \sqrt{2}\right)\\
\end{array}
\end{array}
if t < 1.9500000000000001e170Initial program 53.7%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites48.1%
Applied rewrites29.2%
Applied rewrites59.3%
Taylor expanded in n around 0
Applied rewrites51.3%
if 1.9500000000000001e170 < t Initial program 45.9%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites45.8%
Applied rewrites65.5%
Taylor expanded in t around inf
Applied rewrites68.1%
l_m = (fabs.f64 l) (FPCore (n U t l_m Om U*) :precision binary64 (if (<= n 7.2e-166) (sqrt (* (* (* n t) U) 2.0)) (* (sqrt n) (sqrt (* 2.0 (* U t))))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if (n <= 7.2e-166) {
tmp = sqrt((((n * t) * U) * 2.0));
} else {
tmp = sqrt(n) * sqrt((2.0 * (U * t)));
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l_m, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (n <= 7.2d-166) then
tmp = sqrt((((n * t) * u) * 2.0d0))
else
tmp = sqrt(n) * sqrt((2.0d0 * (u * t)))
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
double tmp;
if (n <= 7.2e-166) {
tmp = Math.sqrt((((n * t) * U) * 2.0));
} else {
tmp = Math.sqrt(n) * Math.sqrt((2.0 * (U * t)));
}
return tmp;
}
l_m = math.fabs(l) def code(n, U, t, l_m, Om, U_42_): tmp = 0 if n <= 7.2e-166: tmp = math.sqrt((((n * t) * U) * 2.0)) else: tmp = math.sqrt(n) * math.sqrt((2.0 * (U * t))) return tmp
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) tmp = 0.0 if (n <= 7.2e-166) tmp = sqrt(Float64(Float64(Float64(n * t) * U) * 2.0)); else tmp = Float64(sqrt(n) * sqrt(Float64(2.0 * Float64(U * t)))); end return tmp end
l_m = abs(l); function tmp_2 = code(n, U, t, l_m, Om, U_42_) tmp = 0.0; if (n <= 7.2e-166) tmp = sqrt((((n * t) * U) * 2.0)); else tmp = sqrt(n) * sqrt((2.0 * (U * t))); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[n, 7.2e-166], N[Sqrt[N[(N[(N[(n * t), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[n], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;n \leq 7.2 \cdot 10^{-166}:\\
\;\;\;\;\sqrt{\left(\left(n \cdot t\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{n} \cdot \sqrt{2 \cdot \left(U \cdot t\right)}\\
\end{array}
\end{array}
if n < 7.2000000000000002e-166Initial program 50.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
if 7.2000000000000002e-166 < n Initial program 56.5%
Taylor expanded in U* around inf
associate-*r*N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6419.5
Applied rewrites19.5%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
Applied rewrites20.7%
Taylor expanded in t around inf
lower-*.f6446.3
Applied rewrites46.3%
l_m = (fabs.f64 l) (FPCore (n U t l_m Om U*) :precision binary64 (sqrt (* t (* (+ U U) n))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
return sqrt((t * ((U + U) * n)));
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l_m, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((t * ((u + u) * n)))
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
return Math.sqrt((t * ((U + U) * n)));
}
l_m = math.fabs(l) def code(n, U, t, l_m, Om, U_42_): return math.sqrt((t * ((U + U) * n)))
l_m = abs(l) function code(n, U, t, l_m, Om, U_42_) return sqrt(Float64(t * Float64(Float64(U + U) * n))) end
l_m = abs(l); function tmp = code(n, U, t, l_m, Om, U_42_) tmp = sqrt((t * ((U + U) * n))); end
l_m = N[Abs[l], $MachinePrecision] code[n_, U_, t_, l$95$m_, Om_, U$42$_] := N[Sqrt[N[(t * N[(N[(U + U), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\sqrt{t \cdot \left(\left(U + U\right) \cdot n\right)}
\end{array}
Initial program 52.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6438.1
Applied rewrites38.1%
Applied rewrites40.0%
Applied rewrites40.0%
herbie shell --seed 2024359
(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*))))))