
(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]
\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)}
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]
\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)}
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2 (/ (fabs l) Om))
(t_3
(*
t_1
(-
(- t (* 2.0 (/ (* (fabs l) (fabs l)) Om)))
(* (* n (pow t_2 2.0)) (- U U*))))))
(if (<= t_3 1e-286)
(sqrt (* (+ n n) (* (fma t_2 (fma (* U* n) t_2 (* -2.0 (fabs l))) t) U)))
(if (<= t_3 INFINITY)
(sqrt
(* t_1 (fma t_2 (* (* t_2 n) (- U* U)) (fma (* t_2 (fabs l)) -2.0 t))))
(*
(fabs l)
(sqrt (* -2.0 (* U (* n (/ (+ 2.0 (/ (* n (- U U*)) Om)) Om))))))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = fabs(l) / Om;
double t_3 = t_1 * ((t - (2.0 * ((fabs(l) * fabs(l)) / Om))) - ((n * pow(t_2, 2.0)) * (U - U_42_)));
double tmp;
if (t_3 <= 1e-286) {
tmp = sqrt(((n + n) * (fma(t_2, fma((U_42_ * n), t_2, (-2.0 * fabs(l))), t) * U)));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((t_1 * fma(t_2, ((t_2 * n) * (U_42_ - U)), fma((t_2 * fabs(l)), -2.0, t))));
} else {
tmp = fabs(l) * sqrt((-2.0 * (U * (n * ((2.0 + ((n * (U - U_42_)) / Om)) / Om)))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) t_2 = Float64(abs(l) / Om) t_3 = Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(abs(l) * abs(l)) / Om))) - Float64(Float64(n * (t_2 ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_3 <= 1e-286) tmp = sqrt(Float64(Float64(n + n) * Float64(fma(t_2, fma(Float64(U_42_ * n), t_2, Float64(-2.0 * abs(l))), t) * U))); elseif (t_3 <= Inf) tmp = sqrt(Float64(t_1 * fma(t_2, Float64(Float64(t_2 * n) * Float64(U_42_ - U)), fma(Float64(t_2 * abs(l)), -2.0, t)))); else tmp = Float64(abs(l) * sqrt(Float64(-2.0 * Float64(U * Float64(n * Float64(Float64(2.0 + Float64(Float64(n * Float64(U - U_42_)) / Om)) / Om)))))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[(N[Abs[l], $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * N[(N[(t - N[(2.0 * N[(N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[t$95$2, 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 1e-286], N[Sqrt[N[(N[(n + n), $MachinePrecision] * N[(N[(t$95$2 * N[(N[(U$42$ * n), $MachinePrecision] * t$95$2 + N[(-2.0 * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$1 * N[(t$95$2 * N[(N[(t$95$2 * n), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 * N[Abs[l], $MachinePrecision]), $MachinePrecision] * -2.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Abs[l], $MachinePrecision] * N[Sqrt[N[(-2.0 * N[(U * N[(n * N[(N[(2.0 + N[(N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := \frac{\left|\ell\right|}{Om}\\
t_3 := t\_1 \cdot \left(\left(t - 2 \cdot \frac{\left|\ell\right| \cdot \left|\ell\right|}{Om}\right) - \left(n \cdot {t\_2}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_3 \leq 10^{-286}:\\
\;\;\;\;\sqrt{\left(n + n\right) \cdot \left(\mathsf{fma}\left(t\_2, \mathsf{fma}\left(U* \cdot n, t\_2, -2 \cdot \left|\ell\right|\right), t\right) \cdot U\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{t\_1 \cdot \mathsf{fma}\left(t\_2, \left(t\_2 \cdot n\right) \cdot \left(U* - U\right), \mathsf{fma}\left(t\_2 \cdot \left|\ell\right|, -2, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\left|\ell\right| \cdot \sqrt{-2 \cdot \left(U \cdot \left(n \cdot \frac{2 + \frac{n \cdot \left(U - U*\right)}{Om}}{Om}\right)\right)}\\
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1.00000000000000005e-286Initial program 50.6%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites52.2%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6452.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites56.2%
Taylor expanded in U around 0
Applied rewrites57.3%
if 1.00000000000000005e-286 < (*.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 50.6%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites52.2%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6452.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites55.9%
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 50.6%
Taylor expanded in l around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-pow.f6415.2%
Applied rewrites15.2%
Taylor expanded in Om around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6416.9%
Applied rewrites16.9%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* -2.0 (fabs l)))
(t_2 (/ (fabs l) Om))
(t_3
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* (fabs l) (fabs l)) Om)))
(* (* n (pow t_2 2.0)) (- U U*))))))
(if (<= t_3 1e-286)
(sqrt (* (+ n n) (* (fma t_2 (fma (* U* n) t_2 t_1) t) U)))
(if (<= t_3 INFINITY)
(sqrt (* (fma (fma (* t_2 n) (- U* U) t_1) t_2 t) (* U (+ n n))))
(*
(fabs l)
(sqrt (* -2.0 (* U (* n (/ (+ 2.0 (/ (* n (- U U*)) Om)) Om))))))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = -2.0 * fabs(l);
double t_2 = fabs(l) / Om;
double t_3 = ((2.0 * n) * U) * ((t - (2.0 * ((fabs(l) * fabs(l)) / Om))) - ((n * pow(t_2, 2.0)) * (U - U_42_)));
double tmp;
if (t_3 <= 1e-286) {
tmp = sqrt(((n + n) * (fma(t_2, fma((U_42_ * n), t_2, t_1), t) * U)));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((fma(fma((t_2 * n), (U_42_ - U), t_1), t_2, t) * (U * (n + n))));
} else {
tmp = fabs(l) * sqrt((-2.0 * (U * (n * ((2.0 + ((n * (U - U_42_)) / Om)) / Om)))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(-2.0 * abs(l)) t_2 = Float64(abs(l) / Om) t_3 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(abs(l) * abs(l)) / Om))) - Float64(Float64(n * (t_2 ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_3 <= 1e-286) tmp = sqrt(Float64(Float64(n + n) * Float64(fma(t_2, fma(Float64(U_42_ * n), t_2, t_1), t) * U))); elseif (t_3 <= Inf) tmp = sqrt(Float64(fma(fma(Float64(t_2 * n), Float64(U_42_ - U), t_1), t_2, t) * Float64(U * Float64(n + n)))); else tmp = Float64(abs(l) * sqrt(Float64(-2.0 * Float64(U * Float64(n * Float64(Float64(2.0 + Float64(Float64(n * Float64(U - U_42_)) / Om)) / Om)))))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(-2.0 * N[Abs[l], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Abs[l], $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[t$95$2, 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 1e-286], N[Sqrt[N[(N[(n + n), $MachinePrecision] * N[(N[(t$95$2 * N[(N[(U$42$ * n), $MachinePrecision] * t$95$2 + t$95$1), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(N[(N[(N[(t$95$2 * n), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision] + t$95$1), $MachinePrecision] * t$95$2 + t), $MachinePrecision] * N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Abs[l], $MachinePrecision] * N[Sqrt[N[(-2.0 * N[(U * N[(n * N[(N[(2.0 + N[(N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := -2 \cdot \left|\ell\right|\\
t_2 := \frac{\left|\ell\right|}{Om}\\
t_3 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\left|\ell\right| \cdot \left|\ell\right|}{Om}\right) - \left(n \cdot {t\_2}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_3 \leq 10^{-286}:\\
\;\;\;\;\sqrt{\left(n + n\right) \cdot \left(\mathsf{fma}\left(t\_2, \mathsf{fma}\left(U* \cdot n, t\_2, t\_1\right), t\right) \cdot U\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(t\_2 \cdot n, U* - U, t\_1\right), t\_2, t\right) \cdot \left(U \cdot \left(n + n\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\left|\ell\right| \cdot \sqrt{-2 \cdot \left(U \cdot \left(n \cdot \frac{2 + \frac{n \cdot \left(U - U*\right)}{Om}}{Om}\right)\right)}\\
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1.00000000000000005e-286Initial program 50.6%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites52.2%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6452.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites56.2%
Taylor expanded in U around 0
Applied rewrites57.3%
if 1.00000000000000005e-286 < (*.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 50.6%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites52.2%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6452.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites56.2%
Applied rewrites60.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 50.6%
Taylor expanded in l around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-pow.f6415.2%
Applied rewrites15.2%
Taylor expanded in Om around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6416.9%
Applied rewrites16.9%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (fabs l) Om)))
(if (<=
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* (fabs l) (fabs l)) Om)))
(* (* n (pow t_1 2.0)) (- U U*))))
INFINITY)
(sqrt (* (+ n n) (* (fma t_1 (fma (* U* n) t_1 (* -2.0 (fabs l))) t) U)))
(*
(fabs l)
(sqrt (* -2.0 (* U (* n (/ (+ 2.0 (/ (* n (- U U*)) Om)) Om)))))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fabs(l) / Om;
double tmp;
if ((((2.0 * n) * U) * ((t - (2.0 * ((fabs(l) * fabs(l)) / Om))) - ((n * pow(t_1, 2.0)) * (U - U_42_)))) <= ((double) INFINITY)) {
tmp = sqrt(((n + n) * (fma(t_1, fma((U_42_ * n), t_1, (-2.0 * fabs(l))), t) * U)));
} else {
tmp = fabs(l) * sqrt((-2.0 * (U * (n * ((2.0 + ((n * (U - U_42_)) / Om)) / Om)))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(abs(l) / Om) tmp = 0.0 if (Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(abs(l) * abs(l)) / Om))) - Float64(Float64(n * (t_1 ^ 2.0)) * Float64(U - U_42_)))) <= Inf) tmp = sqrt(Float64(Float64(n + n) * Float64(fma(t_1, fma(Float64(U_42_ * n), t_1, Float64(-2.0 * abs(l))), t) * U))); else tmp = Float64(abs(l) * sqrt(Float64(-2.0 * Float64(U * Float64(n * Float64(Float64(2.0 + Float64(Float64(n * Float64(U - U_42_)) / Om)) / Om)))))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[Abs[l], $MachinePrecision] / Om), $MachinePrecision]}, If[LessEqual[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[Sqrt[N[(N[(n + n), $MachinePrecision] * N[(N[(t$95$1 * N[(N[(U$42$ * n), $MachinePrecision] * t$95$1 + N[(-2.0 * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Abs[l], $MachinePrecision] * N[Sqrt[N[(-2.0 * N[(U * N[(n * N[(N[(2.0 + N[(N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \frac{\left|\ell\right|}{Om}\\
\mathbf{if}\;\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\left|\ell\right| \cdot \left|\ell\right|}{Om}\right) - \left(n \cdot {t\_1}^{2}\right) \cdot \left(U - U*\right)\right) \leq \infty:\\
\;\;\;\;\sqrt{\left(n + n\right) \cdot \left(\mathsf{fma}\left(t\_1, \mathsf{fma}\left(U* \cdot n, t\_1, -2 \cdot \left|\ell\right|\right), t\right) \cdot U\right)}\\
\mathbf{else}:\\
\;\;\;\;\left|\ell\right| \cdot \sqrt{-2 \cdot \left(U \cdot \left(n \cdot \frac{2 + \frac{n \cdot \left(U - U*\right)}{Om}}{Om}\right)\right)}\\
\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*)))) < +inf.0Initial program 50.6%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites52.2%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6452.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites56.2%
Taylor expanded in U around 0
Applied rewrites57.3%
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 50.6%
Taylor expanded in l around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-pow.f6415.2%
Applied rewrites15.2%
Taylor expanded in Om around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6416.9%
Applied rewrites16.9%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (fabs l) Om))
(t_2
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* (fabs l) (fabs l)) Om)))
(* (* n (pow t_1 2.0)) (- U U*)))))))
(if (<= t_2 1e+20)
(sqrt (* (+ n n) (* (fma t_1 (* -2.0 (fabs l)) t) U)))
(if (<= t_2 2e+148)
(sqrt (* (* U (+ n n)) t))
(*
(fabs l)
(sqrt
(* -2.0 (* U (* n (fma (/ (- U U*) Om) (/ n Om) (/ 2.0 Om)))))))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fabs(l) / Om;
double t_2 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((fabs(l) * fabs(l)) / Om))) - ((n * pow(t_1, 2.0)) * (U - U_42_)))));
double tmp;
if (t_2 <= 1e+20) {
tmp = sqrt(((n + n) * (fma(t_1, (-2.0 * fabs(l)), t) * U)));
} else if (t_2 <= 2e+148) {
tmp = sqrt(((U * (n + n)) * t));
} else {
tmp = fabs(l) * sqrt((-2.0 * (U * (n * fma(((U - U_42_) / Om), (n / Om), (2.0 / Om))))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(abs(l) / Om) t_2 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(abs(l) * abs(l)) / Om))) - Float64(Float64(n * (t_1 ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_2 <= 1e+20) tmp = sqrt(Float64(Float64(n + n) * Float64(fma(t_1, Float64(-2.0 * abs(l)), t) * U))); elseif (t_2 <= 2e+148) tmp = sqrt(Float64(Float64(U * Float64(n + n)) * t)); else tmp = Float64(abs(l) * sqrt(Float64(-2.0 * Float64(U * Float64(n * fma(Float64(Float64(U - U_42_) / Om), Float64(n / Om), Float64(2.0 / Om))))))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[Abs[l], $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 1e+20], N[Sqrt[N[(N[(n + n), $MachinePrecision] * N[(N[(t$95$1 * N[(-2.0 * N[Abs[l], $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, 2e+148], N[Sqrt[N[(N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], N[(N[Abs[l], $MachinePrecision] * N[Sqrt[N[(-2.0 * N[(U * N[(n * N[(N[(N[(U - U$42$), $MachinePrecision] / Om), $MachinePrecision] * N[(n / Om), $MachinePrecision] + N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \frac{\left|\ell\right|}{Om}\\
t_2 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\left|\ell\right| \cdot \left|\ell\right|}{Om}\right) - \left(n \cdot {t\_1}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_2 \leq 10^{+20}:\\
\;\;\;\;\sqrt{\left(n + n\right) \cdot \left(\mathsf{fma}\left(t\_1, -2 \cdot \left|\ell\right|, t\right) \cdot U\right)}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+148}:\\
\;\;\;\;\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\left|\ell\right| \cdot \sqrt{-2 \cdot \left(U \cdot \left(n \cdot \mathsf{fma}\left(\frac{U - U*}{Om}, \frac{n}{Om}, \frac{2}{Om}\right)\right)\right)}\\
\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*))))) < 1e20Initial program 50.6%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites52.2%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6452.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites56.2%
Taylor expanded in n around 0
lower-*.f6447.1%
Applied rewrites47.1%
if 1e20 < (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*))))) < 2.0000000000000001e148Initial program 50.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.3%
Applied rewrites36.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
count-2N/A
lift-+.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
count-2N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6436.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.1%
lift-*.f64N/A
count-2-revN/A
lift-+.f6436.1%
Applied rewrites36.1%
if 2.0000000000000001e148 < (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 50.6%
Taylor expanded in l around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-pow.f6415.2%
Applied rewrites15.2%
lift-fma.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
pow2N/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6417.0%
Applied rewrites17.0%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (fma (/ l Om) (/ (* U* (* l n)) Om) t) U)))
(if (<= n -1.75e-231)
(sqrt (* (+ n n) t_1))
(if (<= n 1.1e+20)
(sqrt (fma -4.0 (/ (* (* l n) (* l U)) Om) (* 2.0 (* U (* n t)))))
(* (sqrt (+ n n)) (sqrt t_1))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma((l / Om), ((U_42_ * (l * n)) / Om), t) * U;
double tmp;
if (n <= -1.75e-231) {
tmp = sqrt(((n + n) * t_1));
} else if (n <= 1.1e+20) {
tmp = sqrt(fma(-4.0, (((l * n) * (l * U)) / Om), (2.0 * (U * (n * t)))));
} else {
tmp = sqrt((n + n)) * sqrt(t_1);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(fma(Float64(l / Om), Float64(Float64(U_42_ * Float64(l * n)) / Om), t) * U) tmp = 0.0 if (n <= -1.75e-231) tmp = sqrt(Float64(Float64(n + n) * t_1)); elseif (n <= 1.1e+20) tmp = sqrt(fma(-4.0, Float64(Float64(Float64(l * n) * Float64(l * U)) / Om), Float64(2.0 * Float64(U * Float64(n * t))))); else tmp = Float64(sqrt(Float64(n + n)) * sqrt(t_1)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(U$42$ * N[(l * n), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision]}, If[LessEqual[n, -1.75e-231], N[Sqrt[N[(N[(n + n), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 1.1e+20], N[Sqrt[N[(-4.0 * N[(N[(N[(l * n), $MachinePrecision] * N[(l * U), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] + N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(n + n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{\ell}{Om}, \frac{U* \cdot \left(\ell \cdot n\right)}{Om}, t\right) \cdot U\\
\mathbf{if}\;n \leq -1.75 \cdot 10^{-231}:\\
\;\;\;\;\sqrt{\left(n + n\right) \cdot t\_1}\\
\mathbf{elif}\;n \leq 1.1 \cdot 10^{+20}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(-4, \frac{\left(\ell \cdot n\right) \cdot \left(\ell \cdot U\right)}{Om}, 2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{n + n} \cdot \sqrt{t\_1}\\
\end{array}
if n < -1.7500000000000001e-231Initial program 50.6%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites52.2%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6452.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites56.2%
Taylor expanded in U* around inf
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6450.3%
Applied rewrites50.3%
if -1.7500000000000001e-231 < n < 1.1e20Initial program 50.6%
Taylor expanded in Om around inf
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6443.3%
Applied rewrites43.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6447.0%
Applied rewrites47.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6448.5%
Applied rewrites48.5%
if 1.1e20 < n Initial program 50.6%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites52.2%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6452.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites55.9%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
sqrt-prodN/A
lower-unsound-*.f64N/A
lower-unsound-sqrt.f64N/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
lower-unsound-sqrt.f64N/A
*-commutativeN/A
lower-*.f6433.6%
Applied rewrites32.7%
Taylor expanded in U* around inf
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6429.0%
Applied rewrites29.0%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (fabs l) Om))
(t_2
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* (fabs l) (fabs l)) Om)))
(* (* n (pow t_1 2.0)) (- U U*)))))))
(if (<= t_2 1e+20)
(sqrt (* (+ n n) (* (fma t_1 (* -2.0 (fabs l)) t) U)))
(if (<= t_2 2e+148)
(sqrt (* (* U (+ n n)) t))
(*
(fabs l)
(sqrt (* -2.0 (* U (* n (/ (+ 2.0 (/ (* n (- U U*)) Om)) Om))))))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fabs(l) / Om;
double t_2 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((fabs(l) * fabs(l)) / Om))) - ((n * pow(t_1, 2.0)) * (U - U_42_)))));
double tmp;
if (t_2 <= 1e+20) {
tmp = sqrt(((n + n) * (fma(t_1, (-2.0 * fabs(l)), t) * U)));
} else if (t_2 <= 2e+148) {
tmp = sqrt(((U * (n + n)) * t));
} else {
tmp = fabs(l) * sqrt((-2.0 * (U * (n * ((2.0 + ((n * (U - U_42_)) / Om)) / Om)))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(abs(l) / Om) t_2 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(abs(l) * abs(l)) / Om))) - Float64(Float64(n * (t_1 ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_2 <= 1e+20) tmp = sqrt(Float64(Float64(n + n) * Float64(fma(t_1, Float64(-2.0 * abs(l)), t) * U))); elseif (t_2 <= 2e+148) tmp = sqrt(Float64(Float64(U * Float64(n + n)) * t)); else tmp = Float64(abs(l) * sqrt(Float64(-2.0 * Float64(U * Float64(n * Float64(Float64(2.0 + Float64(Float64(n * Float64(U - U_42_)) / Om)) / Om)))))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[Abs[l], $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 1e+20], N[Sqrt[N[(N[(n + n), $MachinePrecision] * N[(N[(t$95$1 * N[(-2.0 * N[Abs[l], $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, 2e+148], N[Sqrt[N[(N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], N[(N[Abs[l], $MachinePrecision] * N[Sqrt[N[(-2.0 * N[(U * N[(n * N[(N[(2.0 + N[(N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \frac{\left|\ell\right|}{Om}\\
t_2 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\left|\ell\right| \cdot \left|\ell\right|}{Om}\right) - \left(n \cdot {t\_1}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_2 \leq 10^{+20}:\\
\;\;\;\;\sqrt{\left(n + n\right) \cdot \left(\mathsf{fma}\left(t\_1, -2 \cdot \left|\ell\right|, t\right) \cdot U\right)}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+148}:\\
\;\;\;\;\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\left|\ell\right| \cdot \sqrt{-2 \cdot \left(U \cdot \left(n \cdot \frac{2 + \frac{n \cdot \left(U - U*\right)}{Om}}{Om}\right)\right)}\\
\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*))))) < 1e20Initial program 50.6%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites52.2%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6452.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites56.2%
Taylor expanded in n around 0
lower-*.f6447.1%
Applied rewrites47.1%
if 1e20 < (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*))))) < 2.0000000000000001e148Initial program 50.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.3%
Applied rewrites36.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
count-2N/A
lift-+.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
count-2N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6436.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.1%
lift-*.f64N/A
count-2-revN/A
lift-+.f6436.1%
Applied rewrites36.1%
if 2.0000000000000001e148 < (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 50.6%
Taylor expanded in l around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-pow.f6415.2%
Applied rewrites15.2%
Taylor expanded in Om around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6416.9%
Applied rewrites16.9%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (sqrt (* (+ n n) (* (fma (/ l Om) (/ (* U* (* l n)) Om) t) U)))))
(if (<= n -1.75e-231)
t_1
(if (<= n 1.1e+20)
(sqrt (fma -4.0 (/ (* (* l n) (* l U)) Om) (* 2.0 (* U (* n t)))))
t_1))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt(((n + n) * (fma((l / Om), ((U_42_ * (l * n)) / Om), t) * U)));
double tmp;
if (n <= -1.75e-231) {
tmp = t_1;
} else if (n <= 1.1e+20) {
tmp = sqrt(fma(-4.0, (((l * n) * (l * U)) / Om), (2.0 * (U * (n * t)))));
} else {
tmp = t_1;
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = sqrt(Float64(Float64(n + n) * Float64(fma(Float64(l / Om), Float64(Float64(U_42_ * Float64(l * n)) / Om), t) * U))) tmp = 0.0 if (n <= -1.75e-231) tmp = t_1; elseif (n <= 1.1e+20) tmp = sqrt(fma(-4.0, Float64(Float64(Float64(l * n) * Float64(l * U)) / Om), Float64(2.0 * Float64(U * Float64(n * t))))); 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), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(U$42$ * N[(l * n), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[n, -1.75e-231], t$95$1, If[LessEqual[n, 1.1e+20], N[Sqrt[N[(-4.0 * N[(N[(N[(l * n), $MachinePrecision] * N[(l * U), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] + N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \sqrt{\left(n + n\right) \cdot \left(\mathsf{fma}\left(\frac{\ell}{Om}, \frac{U* \cdot \left(\ell \cdot n\right)}{Om}, t\right) \cdot U\right)}\\
\mathbf{if}\;n \leq -1.75 \cdot 10^{-231}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;n \leq 1.1 \cdot 10^{+20}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(-4, \frac{\left(\ell \cdot n\right) \cdot \left(\ell \cdot U\right)}{Om}, 2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if n < -1.7500000000000001e-231 or 1.1e20 < n Initial program 50.6%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites52.2%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6452.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites56.2%
Taylor expanded in U* around inf
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6450.3%
Applied rewrites50.3%
if -1.7500000000000001e-231 < n < 1.1e20Initial program 50.6%
Taylor expanded in Om around inf
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6443.3%
Applied rewrites43.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6447.0%
Applied rewrites47.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6448.5%
Applied rewrites48.5%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (fabs l) Om))
(t_2
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* (fabs l) (fabs l)) Om)))
(* (* n (pow t_1 2.0)) (- U U*))))))
(t_3 (sqrt (* (+ n n) (* (fma t_1 (* -2.0 (fabs l)) t) U)))))
(if (<= t_2 1e+20)
t_3
(if (<= t_2 5e+144)
(sqrt (* (* U (+ n n)) t))
(if (<= t_2 INFINITY)
t_3
(* (fabs l) (sqrt (* -2.0 (* U (* n (/ 2.0 Om)))))))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fabs(l) / Om;
double t_2 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((fabs(l) * fabs(l)) / Om))) - ((n * pow(t_1, 2.0)) * (U - U_42_)))));
double t_3 = sqrt(((n + n) * (fma(t_1, (-2.0 * fabs(l)), t) * U)));
double tmp;
if (t_2 <= 1e+20) {
tmp = t_3;
} else if (t_2 <= 5e+144) {
tmp = sqrt(((U * (n + n)) * t));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = fabs(l) * sqrt((-2.0 * (U * (n * (2.0 / Om)))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(abs(l) / Om) t_2 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(abs(l) * abs(l)) / Om))) - Float64(Float64(n * (t_1 ^ 2.0)) * Float64(U - U_42_))))) t_3 = sqrt(Float64(Float64(n + n) * Float64(fma(t_1, Float64(-2.0 * abs(l)), t) * U))) tmp = 0.0 if (t_2 <= 1e+20) tmp = t_3; elseif (t_2 <= 5e+144) tmp = sqrt(Float64(Float64(U * Float64(n + n)) * t)); elseif (t_2 <= Inf) tmp = t_3; else tmp = Float64(abs(l) * sqrt(Float64(-2.0 * Float64(U * Float64(n * Float64(2.0 / Om)))))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[Abs[l], $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(n + n), $MachinePrecision] * N[(N[(t$95$1 * N[(-2.0 * N[Abs[l], $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 1e+20], t$95$3, If[LessEqual[t$95$2, 5e+144], N[Sqrt[N[(N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$3, N[(N[Abs[l], $MachinePrecision] * N[Sqrt[N[(-2.0 * N[(U * N[(n * N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := \frac{\left|\ell\right|}{Om}\\
t_2 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\left|\ell\right| \cdot \left|\ell\right|}{Om}\right) - \left(n \cdot {t\_1}^{2}\right) \cdot \left(U - U*\right)\right)}\\
t_3 := \sqrt{\left(n + n\right) \cdot \left(\mathsf{fma}\left(t\_1, -2 \cdot \left|\ell\right|, t\right) \cdot U\right)}\\
\mathbf{if}\;t\_2 \leq 10^{+20}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+144}:\\
\;\;\;\;\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\left|\ell\right| \cdot \sqrt{-2 \cdot \left(U \cdot \left(n \cdot \frac{2}{Om}\right)\right)}\\
\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*))))) < 1e20 or 4.9999999999999999e144 < (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 50.6%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites52.2%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6452.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites56.2%
Taylor expanded in n around 0
lower-*.f6447.1%
Applied rewrites47.1%
if 1e20 < (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.9999999999999999e144Initial program 50.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.3%
Applied rewrites36.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
count-2N/A
lift-+.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
count-2N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6436.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.1%
lift-*.f64N/A
count-2-revN/A
lift-+.f6436.1%
Applied rewrites36.1%
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 50.6%
Taylor expanded in l around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-pow.f6415.2%
Applied rewrites15.2%
Taylor expanded in n around 0
lower-/.f6410.1%
Applied rewrites10.1%
(FPCore (n U t l Om U*) :precision binary64 (let* ((t_1 (* (fma (/ l Om) (* -2.0 l) t) U))) (if (<= n -3.8e-303) (sqrt (* (+ n n) t_1)) (* (sqrt (+ n n)) (sqrt t_1)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma((l / Om), (-2.0 * l), t) * U;
double tmp;
if (n <= -3.8e-303) {
tmp = sqrt(((n + n) * t_1));
} else {
tmp = sqrt((n + n)) * sqrt(t_1);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(fma(Float64(l / Om), Float64(-2.0 * l), t) * U) tmp = 0.0 if (n <= -3.8e-303) tmp = sqrt(Float64(Float64(n + n) * t_1)); else tmp = Float64(sqrt(Float64(n + n)) * sqrt(t_1)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(N[(l / Om), $MachinePrecision] * N[(-2.0 * l), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision]}, If[LessEqual[n, -3.8e-303], N[Sqrt[N[(N[(n + n), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(n + n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{\ell}{Om}, -2 \cdot \ell, t\right) \cdot U\\
\mathbf{if}\;n \leq -3.8 \cdot 10^{-303}:\\
\;\;\;\;\sqrt{\left(n + n\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{n + n} \cdot \sqrt{t\_1}\\
\end{array}
if n < -3.80000000000000009e-303Initial program 50.6%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites52.2%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6452.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites56.2%
Taylor expanded in n around 0
lower-*.f6447.1%
Applied rewrites47.1%
if -3.80000000000000009e-303 < n Initial program 50.6%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites52.2%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6452.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites55.9%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
sqrt-prodN/A
lower-unsound-*.f64N/A
lower-unsound-sqrt.f64N/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
lower-unsound-sqrt.f64N/A
*-commutativeN/A
lower-*.f6433.6%
Applied rewrites32.7%
Taylor expanded in n around 0
lower-*.f6428.0%
Applied rewrites28.0%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* (fabs l) (fabs l)) Om)))
(* (* n (pow (/ (fabs l) Om) 2.0)) (- U U*)))))))
(if (<= t_1 0.0)
(* (sqrt n) (sqrt (* 2.0 (* U t))))
(if (<= t_1 2e+148)
(sqrt (* (* U (+ n n)) t))
(* (fabs l) (sqrt (* -2.0 (* U (* n (/ 2.0 Om))))))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((fabs(l) * fabs(l)) / Om))) - ((n * pow((fabs(l) / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_1 <= 0.0) {
tmp = sqrt(n) * sqrt((2.0 * (U * t)));
} else if (t_1 <= 2e+148) {
tmp = sqrt(((U * (n + n)) * t));
} else {
tmp = fabs(l) * sqrt((-2.0 * (U * (n * (2.0 / Om)))));
}
return tmp;
}
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
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((abs(l) * abs(l)) / om))) - ((n * ((abs(l) / om) ** 2.0d0)) * (u - u_42)))))
if (t_1 <= 0.0d0) then
tmp = sqrt(n) * sqrt((2.0d0 * (u * t)))
else if (t_1 <= 2d+148) then
tmp = sqrt(((u * (n + n)) * t))
else
tmp = abs(l) * sqrt(((-2.0d0) * (u * (n * (2.0d0 / om)))))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((Math.abs(l) * Math.abs(l)) / Om))) - ((n * Math.pow((Math.abs(l) / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_1 <= 0.0) {
tmp = Math.sqrt(n) * Math.sqrt((2.0 * (U * t)));
} else if (t_1 <= 2e+148) {
tmp = Math.sqrt(((U * (n + n)) * t));
} else {
tmp = Math.abs(l) * Math.sqrt((-2.0 * (U * (n * (2.0 / Om)))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((math.fabs(l) * math.fabs(l)) / Om))) - ((n * math.pow((math.fabs(l) / Om), 2.0)) * (U - U_42_))))) tmp = 0 if t_1 <= 0.0: tmp = math.sqrt(n) * math.sqrt((2.0 * (U * t))) elif t_1 <= 2e+148: tmp = math.sqrt(((U * (n + n)) * t)) else: tmp = math.fabs(l) * math.sqrt((-2.0 * (U * (n * (2.0 / Om))))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(abs(l) * abs(l)) / Om))) - Float64(Float64(n * (Float64(abs(l) / Om) ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(sqrt(n) * sqrt(Float64(2.0 * Float64(U * t)))); elseif (t_1 <= 2e+148) tmp = sqrt(Float64(Float64(U * Float64(n + n)) * t)); else tmp = Float64(abs(l) * sqrt(Float64(-2.0 * Float64(U * Float64(n * Float64(2.0 / Om)))))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((abs(l) * abs(l)) / Om))) - ((n * ((abs(l) / Om) ^ 2.0)) * (U - U_42_))))); tmp = 0.0; if (t_1 <= 0.0) tmp = sqrt(n) * sqrt((2.0 * (U * t))); elseif (t_1 <= 2e+148) tmp = sqrt(((U * (n + n)) * t)); else tmp = abs(l) * sqrt((-2.0 * (U * (n * (2.0 / Om))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, 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[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(N[Abs[l], $MachinePrecision] / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(N[Sqrt[n], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+148], N[Sqrt[N[(N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], N[(N[Abs[l], $MachinePrecision] * N[Sqrt[N[(-2.0 * N[(U * N[(n * N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\left|\ell\right| \cdot \left|\ell\right|}{Om}\right) - \left(n \cdot {\left(\frac{\left|\ell\right|}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\sqrt{n} \cdot \sqrt{2 \cdot \left(U \cdot t\right)}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+148}:\\
\;\;\;\;\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\left|\ell\right| \cdot \sqrt{-2 \cdot \left(U \cdot \left(n \cdot \frac{2}{Om}\right)\right)}\\
\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 50.6%
Applied rewrites24.9%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6420.8%
Applied rewrites20.8%
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*))))) < 2.0000000000000001e148Initial program 50.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.3%
Applied rewrites36.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
count-2N/A
lift-+.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
count-2N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6436.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.1%
lift-*.f64N/A
count-2-revN/A
lift-+.f6436.1%
Applied rewrites36.1%
if 2.0000000000000001e148 < (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 50.6%
Taylor expanded in l around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-pow.f6415.2%
Applied rewrites15.2%
Taylor expanded in n around 0
lower-/.f6410.1%
Applied rewrites10.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* (fabs l) (fabs l)) Om)))
(* (* n (pow (/ (fabs l) Om) 2.0)) (- U U*)))))))
(if (<= t_1 0.0)
(* (sqrt n) (sqrt (* 2.0 (* U t))))
(if (<= t_1 2e+148)
(sqrt (* (* U (+ n n)) t))
(* (fabs l) (sqrt (* -4.0 (/ (* U n) Om))))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((fabs(l) * fabs(l)) / Om))) - ((n * pow((fabs(l) / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_1 <= 0.0) {
tmp = sqrt(n) * sqrt((2.0 * (U * t)));
} else if (t_1 <= 2e+148) {
tmp = sqrt(((U * (n + n)) * t));
} else {
tmp = fabs(l) * sqrt((-4.0 * ((U * n) / Om)));
}
return tmp;
}
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
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((abs(l) * abs(l)) / om))) - ((n * ((abs(l) / om) ** 2.0d0)) * (u - u_42)))))
if (t_1 <= 0.0d0) then
tmp = sqrt(n) * sqrt((2.0d0 * (u * t)))
else if (t_1 <= 2d+148) then
tmp = sqrt(((u * (n + n)) * t))
else
tmp = abs(l) * sqrt(((-4.0d0) * ((u * n) / om)))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((Math.abs(l) * Math.abs(l)) / Om))) - ((n * Math.pow((Math.abs(l) / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_1 <= 0.0) {
tmp = Math.sqrt(n) * Math.sqrt((2.0 * (U * t)));
} else if (t_1 <= 2e+148) {
tmp = Math.sqrt(((U * (n + n)) * t));
} else {
tmp = Math.abs(l) * Math.sqrt((-4.0 * ((U * n) / Om)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((math.fabs(l) * math.fabs(l)) / Om))) - ((n * math.pow((math.fabs(l) / Om), 2.0)) * (U - U_42_))))) tmp = 0 if t_1 <= 0.0: tmp = math.sqrt(n) * math.sqrt((2.0 * (U * t))) elif t_1 <= 2e+148: tmp = math.sqrt(((U * (n + n)) * t)) else: tmp = math.fabs(l) * math.sqrt((-4.0 * ((U * n) / Om))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(abs(l) * abs(l)) / Om))) - Float64(Float64(n * (Float64(abs(l) / Om) ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(sqrt(n) * sqrt(Float64(2.0 * Float64(U * t)))); elseif (t_1 <= 2e+148) tmp = sqrt(Float64(Float64(U * Float64(n + n)) * t)); else tmp = Float64(abs(l) * sqrt(Float64(-4.0 * Float64(Float64(U * n) / Om)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((abs(l) * abs(l)) / Om))) - ((n * ((abs(l) / Om) ^ 2.0)) * (U - U_42_))))); tmp = 0.0; if (t_1 <= 0.0) tmp = sqrt(n) * sqrt((2.0 * (U * t))); elseif (t_1 <= 2e+148) tmp = sqrt(((U * (n + n)) * t)); else tmp = abs(l) * sqrt((-4.0 * ((U * n) / Om))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, 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[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(N[Abs[l], $MachinePrecision] / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(N[Sqrt[n], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+148], N[Sqrt[N[(N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], N[(N[Abs[l], $MachinePrecision] * N[Sqrt[N[(-4.0 * N[(N[(U * n), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\left|\ell\right| \cdot \left|\ell\right|}{Om}\right) - \left(n \cdot {\left(\frac{\left|\ell\right|}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\sqrt{n} \cdot \sqrt{2 \cdot \left(U \cdot t\right)}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+148}:\\
\;\;\;\;\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\left|\ell\right| \cdot \sqrt{-4 \cdot \frac{U \cdot n}{Om}}\\
\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 50.6%
Applied rewrites24.9%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6420.8%
Applied rewrites20.8%
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*))))) < 2.0000000000000001e148Initial program 50.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.3%
Applied rewrites36.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
count-2N/A
lift-+.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
count-2N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6436.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.1%
lift-*.f64N/A
count-2-revN/A
lift-+.f6436.1%
Applied rewrites36.1%
if 2.0000000000000001e148 < (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 50.6%
Taylor expanded in l around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-pow.f6415.2%
Applied rewrites15.2%
Taylor expanded in n around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6410.1%
Applied rewrites10.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))))
(if (<= t_1 0.0)
(* (sqrt n) (sqrt (* 2.0 (* U t))))
(if (<= t_1 5e+144)
(sqrt (* (* U (+ n n)) t))
(sqrt (fabs (* (* (+ U U) t) n)))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_1 <= 0.0) {
tmp = sqrt(n) * sqrt((2.0 * (U * t)));
} else if (t_1 <= 5e+144) {
tmp = sqrt(((U * (n + n)) * t));
} else {
tmp = sqrt(fabs((((U + U) * t) * n)));
}
return tmp;
}
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
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
if (t_1 <= 0.0d0) then
tmp = sqrt(n) * sqrt((2.0d0 * (u * t)))
else if (t_1 <= 5d+144) then
tmp = sqrt(((u * (n + n)) * t))
else
tmp = sqrt(abs((((u + u) * t) * n)))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_1 <= 0.0) {
tmp = Math.sqrt(n) * Math.sqrt((2.0 * (U * t)));
} else if (t_1 <= 5e+144) {
tmp = Math.sqrt(((U * (n + n)) * t));
} else {
tmp = Math.sqrt(Math.abs((((U + U) * t) * n)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))))) tmp = 0 if t_1 <= 0.0: tmp = math.sqrt(n) * math.sqrt((2.0 * (U * t))) elif t_1 <= 5e+144: tmp = math.sqrt(((U * (n + n)) * t)) else: tmp = math.sqrt(math.fabs((((U + U) * t) * n))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = 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_))))) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(sqrt(n) * sqrt(Float64(2.0 * Float64(U * t)))); elseif (t_1 <= 5e+144) tmp = sqrt(Float64(Float64(U * Float64(n + n)) * t)); else tmp = sqrt(abs(Float64(Float64(Float64(U + U) * t) * n))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); tmp = 0.0; if (t_1 <= 0.0) tmp = sqrt(n) * sqrt((2.0 * (U * t))); elseif (t_1 <= 5e+144) tmp = sqrt(((U * (n + n)) * t)); else tmp = sqrt(abs((((U + U) * t) * n))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, 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 * 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]}, If[LessEqual[t$95$1, 0.0], N[(N[Sqrt[n], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+144], N[Sqrt[N[(N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[Abs[N[(N[(N[(U + U), $MachinePrecision] * t), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_1 := \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)}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\sqrt{n} \cdot \sqrt{2 \cdot \left(U \cdot t\right)}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+144}:\\
\;\;\;\;\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left|\left(\left(U + U\right) \cdot t\right) \cdot n\right|}\\
\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 50.6%
Applied rewrites24.9%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6420.8%
Applied rewrites20.8%
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*))))) < 4.9999999999999999e144Initial program 50.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.3%
Applied rewrites36.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
count-2N/A
lift-+.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
count-2N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6436.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.1%
lift-*.f64N/A
count-2-revN/A
lift-+.f6436.1%
Applied rewrites36.1%
if 4.9999999999999999e144 < (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 50.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.3%
Applied rewrites36.3%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites37.5%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))))
(if (<= t_1 0.0)
(* (sqrt (+ n n)) (sqrt (* U t)))
(if (<= t_1 5e+144)
(sqrt (* (* U (+ n n)) t))
(sqrt (fabs (* (* (+ U U) t) n)))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_1 <= 0.0) {
tmp = sqrt((n + n)) * sqrt((U * t));
} else if (t_1 <= 5e+144) {
tmp = sqrt(((U * (n + n)) * t));
} else {
tmp = sqrt(fabs((((U + U) * t) * n)));
}
return tmp;
}
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
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
if (t_1 <= 0.0d0) then
tmp = sqrt((n + n)) * sqrt((u * t))
else if (t_1 <= 5d+144) then
tmp = sqrt(((u * (n + n)) * t))
else
tmp = sqrt(abs((((u + u) * t) * n)))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_1 <= 0.0) {
tmp = Math.sqrt((n + n)) * Math.sqrt((U * t));
} else if (t_1 <= 5e+144) {
tmp = Math.sqrt(((U * (n + n)) * t));
} else {
tmp = Math.sqrt(Math.abs((((U + U) * t) * n)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))))) tmp = 0 if t_1 <= 0.0: tmp = math.sqrt((n + n)) * math.sqrt((U * t)) elif t_1 <= 5e+144: tmp = math.sqrt(((U * (n + n)) * t)) else: tmp = math.sqrt(math.fabs((((U + U) * t) * n))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = 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_))))) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(sqrt(Float64(n + n)) * sqrt(Float64(U * t))); elseif (t_1 <= 5e+144) tmp = sqrt(Float64(Float64(U * Float64(n + n)) * t)); else tmp = sqrt(abs(Float64(Float64(Float64(U + U) * t) * n))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); tmp = 0.0; if (t_1 <= 0.0) tmp = sqrt((n + n)) * sqrt((U * t)); elseif (t_1 <= 5e+144) tmp = sqrt(((U * (n + n)) * t)); else tmp = sqrt(abs((((U + U) * t) * n))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, 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 * 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]}, If[LessEqual[t$95$1, 0.0], N[(N[Sqrt[N[(n + n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+144], N[Sqrt[N[(N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[Abs[N[(N[(N[(U + U), $MachinePrecision] * t), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_1 := \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)}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\sqrt{n + n} \cdot \sqrt{U \cdot t}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+144}:\\
\;\;\;\;\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left|\left(\left(U + U\right) \cdot t\right) \cdot n\right|}\\
\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 50.6%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites52.2%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6452.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6455.9%
Applied rewrites55.9%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
sqrt-prodN/A
lower-unsound-*.f64N/A
lower-unsound-sqrt.f64N/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
lower-unsound-sqrt.f64N/A
*-commutativeN/A
lower-*.f6433.6%
Applied rewrites32.7%
Taylor expanded in t around inf
lower-*.f6420.8%
Applied rewrites20.8%
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*))))) < 4.9999999999999999e144Initial program 50.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.3%
Applied rewrites36.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
count-2N/A
lift-+.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
count-2N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6436.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.1%
lift-*.f64N/A
count-2-revN/A
lift-+.f6436.1%
Applied rewrites36.1%
if 4.9999999999999999e144 < (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 50.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.3%
Applied rewrites36.3%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites37.5%
(FPCore (n U t l Om U*) :precision binary64 (if (<= U 6.2e+97) (sqrt (fabs (* (* (+ U U) t) n))) (sqrt (* (* U (+ n n)) t))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 6.2e+97) {
tmp = sqrt(fabs((((U + U) * t) * n)));
} else {
tmp = sqrt(((U * (n + n)) * t));
}
return tmp;
}
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
real(8) :: tmp
if (u <= 6.2d+97) then
tmp = sqrt(abs((((u + u) * t) * n)))
else
tmp = sqrt(((u * (n + n)) * t))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 6.2e+97) {
tmp = Math.sqrt(Math.abs((((U + U) * t) * n)));
} else {
tmp = Math.sqrt(((U * (n + n)) * t));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if U <= 6.2e+97: tmp = math.sqrt(math.fabs((((U + U) * t) * n))) else: tmp = math.sqrt(((U * (n + n)) * t)) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= 6.2e+97) tmp = sqrt(abs(Float64(Float64(Float64(U + U) * t) * n))); else tmp = sqrt(Float64(Float64(U * Float64(n + n)) * t)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U <= 6.2e+97) tmp = sqrt(abs((((U + U) * t) * n))); else tmp = sqrt(((U * (n + n)) * t)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, 6.2e+97], N[Sqrt[N[Abs[N[(N[(N[(U + U), $MachinePrecision] * t), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;U \leq 6.2 \cdot 10^{+97}:\\
\;\;\;\;\sqrt{\left|\left(\left(U + U\right) \cdot t\right) \cdot n\right|}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}\\
\end{array}
if U < 6.19999999999999962e97Initial program 50.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.3%
Applied rewrites36.3%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites37.5%
if 6.19999999999999962e97 < U Initial program 50.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.3%
Applied rewrites36.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
count-2N/A
lift-+.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
count-2N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6436.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.1%
lift-*.f64N/A
count-2-revN/A
lift-+.f6436.1%
Applied rewrites36.1%
(FPCore (n U t l Om U*)
:precision binary64
(if (<=
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))
0.0)
(sqrt (* (* (+ U U) t) n))
(sqrt (* (* U (+ n n)) t))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if ((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))) <= 0.0) {
tmp = sqrt((((U + U) * t) * n));
} else {
tmp = sqrt(((U * (n + n)) * t));
}
return tmp;
}
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
real(8) :: tmp
if ((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))) <= 0.0d0) then
tmp = sqrt((((u + u) * t) * n))
else
tmp = sqrt(((u * (n + n)) * t))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if ((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))) <= 0.0) {
tmp = Math.sqrt((((U + U) * t) * n));
} else {
tmp = Math.sqrt(((U * (n + n)) * t));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if (((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))) <= 0.0: tmp = math.sqrt((((U + U) * t) * n)) else: tmp = math.sqrt(((U * (n + n)) * t)) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (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_)))) <= 0.0) tmp = sqrt(Float64(Float64(Float64(U + U) * t) * n)); else tmp = sqrt(Float64(Float64(U * Float64(n + n)) * t)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if ((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_)))) <= 0.0) tmp = sqrt((((U + U) * t) * n)); else tmp = sqrt(((U * (n + n)) * t)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[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], 0.0], N[Sqrt[N[(N[(N[(U + U), $MachinePrecision] * t), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\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) \leq 0:\\
\;\;\;\;\sqrt{\left(\left(U + U\right) \cdot t\right) \cdot n}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}\\
\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 50.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.3%
Applied rewrites36.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
count-2N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6435.2%
Applied rewrites35.2%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 50.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.3%
Applied rewrites36.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
count-2N/A
lift-+.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
count-2N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6436.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.1%
lift-*.f64N/A
count-2-revN/A
lift-+.f6436.1%
Applied rewrites36.1%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* U (+ n n)) t)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt(((U * (n + n)) * t));
}
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(((u * (n + n)) * t))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt(((U * (n + n)) * t));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt(((U * (n + n)) * t))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(U * Float64(n + n)) * t)) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt(((U * (n + n)) * t)); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]
\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}
Initial program 50.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.3%
Applied rewrites36.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
count-2N/A
lift-+.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
count-2N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6436.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.1%
lift-*.f64N/A
count-2-revN/A
lift-+.f6436.1%
Applied rewrites36.1%
herbie shell --seed 2025188
(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*))))))