
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2 n) U) (- (- t (* 2 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2)) (- 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 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2], $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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2 n) U) (- (- t (* 2 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2)) (- 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 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2], $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 (/ (fabs l) Om))
(t_2
(*
(* (* 2 n) U)
(-
(- t (* 2 (/ (* (fabs l) (fabs l)) Om)))
(* (* n (pow t_1 2)) (- U U*))))))
(if (<= t_2 0)
(sqrt (fabs (* (* t U) (+ n n))))
(if (<= t_2 INFINITY)
(sqrt
(*
(* (+ n n) U)
(-
(- t (* (/ (+ (fabs l) (fabs l)) Om) (fabs l)))
(* (* t_1 (* t_1 n)) (- U U*)))))
(*
(fabs l)
(sqrt
(*
-2
(*
U
(*
n
(+ (* 2 (/ 1 Om)) (/ (* n (- U U*)) (pow Om 2))))))))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fabs(l) / Om;
double t_2 = ((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 <= 0.0) {
tmp = sqrt(fabs(((t * U) * (n + n))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt((((n + n) * U) * ((t - (((fabs(l) + fabs(l)) / Om) * fabs(l))) - ((t_1 * (t_1 * n)) * (U - U_42_)))));
} else {
tmp = fabs(l) * sqrt((-2.0 * (U * (n * ((2.0 * (1.0 / Om)) + ((n * (U - U_42_)) / pow(Om, 2.0)))))));
}
return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = Math.abs(l) / Om;
double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((Math.abs(l) * Math.abs(l)) / Om))) - ((n * Math.pow(t_1, 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 0.0) {
tmp = Math.sqrt(Math.abs(((t * U) * (n + n))));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((((n + n) * U) * ((t - (((Math.abs(l) + Math.abs(l)) / Om) * Math.abs(l))) - ((t_1 * (t_1 * n)) * (U - U_42_)))));
} else {
tmp = Math.abs(l) * Math.sqrt((-2.0 * (U * (n * ((2.0 * (1.0 / Om)) + ((n * (U - U_42_)) / Math.pow(Om, 2.0)))))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = math.fabs(l) / Om t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((math.fabs(l) * math.fabs(l)) / Om))) - ((n * math.pow(t_1, 2.0)) * (U - U_42_))) tmp = 0 if t_2 <= 0.0: tmp = math.sqrt(math.fabs(((t * U) * (n + n)))) elif t_2 <= math.inf: tmp = math.sqrt((((n + n) * U) * ((t - (((math.fabs(l) + math.fabs(l)) / Om) * math.fabs(l))) - ((t_1 * (t_1 * n)) * (U - U_42_))))) else: tmp = math.fabs(l) * math.sqrt((-2.0 * (U * (n * ((2.0 * (1.0 / Om)) + ((n * (U - U_42_)) / math.pow(Om, 2.0))))))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(abs(l) / Om) t_2 = 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 <= 0.0) tmp = sqrt(abs(Float64(Float64(t * U) * Float64(n + n)))); elseif (t_2 <= Inf) tmp = sqrt(Float64(Float64(Float64(n + n) * U) * Float64(Float64(t - Float64(Float64(Float64(abs(l) + abs(l)) / Om) * abs(l))) - Float64(Float64(t_1 * Float64(t_1 * n)) * Float64(U - U_42_))))); else tmp = Float64(abs(l) * sqrt(Float64(-2.0 * Float64(U * Float64(n * Float64(Float64(2.0 * Float64(1.0 / Om)) + Float64(Float64(n * Float64(U - U_42_)) / (Om ^ 2.0)))))))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = abs(l) / Om; t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((abs(l) * abs(l)) / Om))) - ((n * (t_1 ^ 2.0)) * (U - U_42_))); tmp = 0.0; if (t_2 <= 0.0) tmp = sqrt(abs(((t * U) * (n + n)))); elseif (t_2 <= Inf) tmp = sqrt((((n + n) * U) * ((t - (((abs(l) + abs(l)) / Om) * abs(l))) - ((t_1 * (t_1 * n)) * (U - U_42_))))); else tmp = abs(l) * sqrt((-2.0 * (U * (n * ((2.0 * (1.0 / Om)) + ((n * (U - U_42_)) / (Om ^ 2.0))))))); end tmp_2 = 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[(N[(N[(2 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2 * N[(N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[t$95$1, 2], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0], N[Sqrt[N[Abs[N[(N[(t * U), $MachinePrecision] * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(N[(N[(N[Abs[l], $MachinePrecision] + N[Abs[l], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$1 * N[(t$95$1 * n), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Abs[l], $MachinePrecision] * N[Sqrt[N[(-2 * N[(U * N[(n * N[(N[(2 * N[(1 / Om), $MachinePrecision]), $MachinePrecision] + N[(N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \frac{\left|\ell\right|}{Om}\\
t_2 := \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 0:\\
\;\;\;\;\sqrt{\left|\left(t \cdot U\right) \cdot \left(n + n\right)\right|}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(\left(n + n\right) \cdot U\right) \cdot \left(\left(t - \frac{\left|\ell\right| + \left|\ell\right|}{Om} \cdot \left|\ell\right|\right) - \left(t\_1 \cdot \left(t\_1 \cdot n\right)\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\left|\ell\right| \cdot \sqrt{-2 \cdot \left(U \cdot \left(n \cdot \left(2 \cdot \frac{1}{Om} + \frac{n \cdot \left(U - U*\right)}{{Om}^{2}}\right)\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*)))) < 0.0Initial program 50.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
count-2N/A
distribute-rgt-outN/A
count-2-revN/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6436.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
lift-*.f6436.5%
Applied rewrites36.5%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites38.1%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 50.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lift-/.f64N/A
associate-*r*N/A
count-2N/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
mult-flipN/A
distribute-lft-outN/A
mult-flipN/A
mult-flipN/A
distribute-rgt-outN/A
metadata-evalN/A
associate-*l*N/A
mult-flipN/A
lift-/.f64N/A
lower-*.f64N/A
Applied rewrites53.6%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6454.9%
Applied rewrites54.9%
lift-*.f64N/A
count-2-revN/A
lift-+.f6454.9%
Applied rewrites54.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.1%
Taylor expanded in n around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-pow.f649.8%
Applied rewrites9.8%
Taylor expanded in l around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
Applied rewrites15.0%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(*
(* (* 2 n) U)
(-
(- t (* 2 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2)) (- U U*))))))
(if (<= t_1 0)
(sqrt (fabs (* (* t U) (+ n n))))
(if (<= t_1 INFINITY)
(sqrt
(*
(* (+ n n) U)
(-
(- t (* (/ (+ l l) Om) l))
(* (* (/ l Om) (* (/ l Om) n)) (- U U*)))))
(/
(* (* (sqrt (fabs (* (* (- U U*) -2) U))) (fabs l)) n)
(- Om))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_1 <= 0.0) {
tmp = sqrt(fabs(((t * U) * (n + n))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt((((n + n) * U) * ((t - (((l + l) / Om) * l)) - (((l / Om) * ((l / Om) * n)) * (U - U_42_)))));
} else {
tmp = ((sqrt(fabs((((U - U_42_) * -2.0) * U))) * fabs(l)) * n) / -Om;
}
return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_1 <= 0.0) {
tmp = Math.sqrt(Math.abs(((t * U) * (n + n))));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((((n + n) * U) * ((t - (((l + l) / Om) * l)) - (((l / Om) * ((l / Om) * n)) * (U - U_42_)))));
} else {
tmp = ((Math.sqrt(Math.abs((((U - U_42_) * -2.0) * U))) * Math.abs(l)) * n) / -Om;
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = ((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(math.fabs(((t * U) * (n + n)))) elif t_1 <= math.inf: tmp = math.sqrt((((n + n) * U) * ((t - (((l + l) / Om) * l)) - (((l / Om) * ((l / Om) * n)) * (U - U_42_))))) else: tmp = ((math.sqrt(math.fabs((((U - U_42_) * -2.0) * U))) * math.fabs(l)) * n) / -Om return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_1 <= 0.0) tmp = sqrt(abs(Float64(Float64(t * U) * Float64(n + n)))); elseif (t_1 <= Inf) tmp = sqrt(Float64(Float64(Float64(n + n) * U) * Float64(Float64(t - Float64(Float64(Float64(l + l) / Om) * l)) - Float64(Float64(Float64(l / Om) * Float64(Float64(l / Om) * n)) * Float64(U - U_42_))))); else tmp = Float64(Float64(Float64(sqrt(abs(Float64(Float64(Float64(U - U_42_) * -2.0) * U))) * abs(l)) * n) / Float64(-Om)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = ((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(abs(((t * U) * (n + n)))); elseif (t_1 <= Inf) tmp = sqrt((((n + n) * U) * ((t - (((l + l) / Om) * l)) - (((l / Om) * ((l / Om) * n)) * (U - U_42_))))); else tmp = ((sqrt(abs((((U - U_42_) * -2.0) * U))) * abs(l)) * n) / -Om; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(N[(2 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0], N[Sqrt[N[Abs[N[(N[(t * U), $MachinePrecision] * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[Sqrt[N[(N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(N[(N[(l + l), $MachinePrecision] / Om), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[Sqrt[N[Abs[N[(N[(N[(U - U$42$), $MachinePrecision] * -2), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision] / (-Om)), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\sqrt{\left|\left(t \cdot U\right) \cdot \left(n + n\right)\right|}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\sqrt{\left(\left(n + n\right) \cdot U\right) \cdot \left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om}\\
\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.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
count-2N/A
distribute-rgt-outN/A
count-2-revN/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6436.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
lift-*.f6436.5%
Applied rewrites36.5%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites38.1%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 50.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lift-/.f64N/A
associate-*r*N/A
count-2N/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
mult-flipN/A
distribute-lft-outN/A
mult-flipN/A
mult-flipN/A
distribute-rgt-outN/A
metadata-evalN/A
associate-*l*N/A
mult-flipN/A
lift-/.f64N/A
lower-*.f64N/A
Applied rewrites53.6%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6454.9%
Applied rewrites54.9%
lift-*.f64N/A
count-2-revN/A
lift-+.f6454.9%
Applied rewrites54.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.1%
Taylor expanded in n around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-pow.f649.8%
Applied rewrites9.8%
Taylor expanded in Om around -inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f6411.3%
Applied rewrites11.3%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites13.5%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
mul-fabsN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
lower-fabs.f6415.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6415.7%
Applied rewrites15.7%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (- t (* (/ (+ l l) Om) l))))
(if (<=
U
4051998235156121/98829225247710262867429368515096341332791332892647518728955741224331220492185227974590031104217345944915565363435943316108305047551656971126471386689813725547615929822542168634993607295943953291620980311754270053008792716515963231747120779125566189619536160406425180445475300105093018814544105228831057745755716670455808)
(sqrt
(*
(* (+ n n) U)
(- t_1 (* (* (/ l Om) (* (/ l Om) n)) (- U U*)))))
(*
(sqrt
(* (- t_1 (/ (* (- U U*) (* (* (/ l Om) l) n)) Om)) (+ n n)))
(sqrt U)))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = t - (((l + l) / Om) * l);
double tmp;
if (U <= 4.1e-305) {
tmp = sqrt((((n + n) * U) * (t_1 - (((l / Om) * ((l / Om) * n)) * (U - U_42_)))));
} else {
tmp = sqrt(((t_1 - (((U - U_42_) * (((l / Om) * l) * n)) / Om)) * (n + n))) * sqrt(U);
}
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 = t - (((l + l) / om) * l)
if (u <= 4.1d-305) then
tmp = sqrt((((n + n) * u) * (t_1 - (((l / om) * ((l / om) * n)) * (u - u_42)))))
else
tmp = sqrt(((t_1 - (((u - u_42) * (((l / om) * l) * n)) / om)) * (n + n))) * sqrt(u)
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = t - (((l + l) / Om) * l);
double tmp;
if (U <= 4.1e-305) {
tmp = Math.sqrt((((n + n) * U) * (t_1 - (((l / Om) * ((l / Om) * n)) * (U - U_42_)))));
} else {
tmp = Math.sqrt(((t_1 - (((U - U_42_) * (((l / Om) * l) * n)) / Om)) * (n + n))) * Math.sqrt(U);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = t - (((l + l) / Om) * l) tmp = 0 if U <= 4.1e-305: tmp = math.sqrt((((n + n) * U) * (t_1 - (((l / Om) * ((l / Om) * n)) * (U - U_42_))))) else: tmp = math.sqrt(((t_1 - (((U - U_42_) * (((l / Om) * l) * n)) / Om)) * (n + n))) * math.sqrt(U) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(t - Float64(Float64(Float64(l + l) / Om) * l)) tmp = 0.0 if (U <= 4.1e-305) tmp = sqrt(Float64(Float64(Float64(n + n) * U) * Float64(t_1 - Float64(Float64(Float64(l / Om) * Float64(Float64(l / Om) * n)) * Float64(U - U_42_))))); else tmp = Float64(sqrt(Float64(Float64(t_1 - Float64(Float64(Float64(U - U_42_) * Float64(Float64(Float64(l / Om) * l) * n)) / Om)) * Float64(n + n))) * sqrt(U)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = t - (((l + l) / Om) * l); tmp = 0.0; if (U <= 4.1e-305) tmp = sqrt((((n + n) * U) * (t_1 - (((l / Om) * ((l / Om) * n)) * (U - U_42_))))); else tmp = sqrt(((t_1 - (((U - U_42_) * (((l / Om) * l) * n)) / Om)) * (n + n))) * sqrt(U); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(t - N[(N[(N[(l + l), $MachinePrecision] / Om), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[U, 4051998235156121/98829225247710262867429368515096341332791332892647518728955741224331220492185227974590031104217345944915565363435943316108305047551656971126471386689813725547615929822542168634993607295943953291620980311754270053008792716515963231747120779125566189619536160406425180445475300105093018814544105228831057745755716670455808], N[Sqrt[N[(N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision] * N[(t$95$1 - N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(t$95$1 - N[(N[(N[(U - U$42$), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[U], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := t - \frac{\ell + \ell}{Om} \cdot \ell\\
\mathbf{if}\;U \leq \frac{4051998235156121}{98829225247710262867429368515096341332791332892647518728955741224331220492185227974590031104217345944915565363435943316108305047551656971126471386689813725547615929822542168634993607295943953291620980311754270053008792716515963231747120779125566189619536160406425180445475300105093018814544105228831057745755716670455808}:\\
\;\;\;\;\sqrt{\left(\left(n + n\right) \cdot U\right) \cdot \left(t\_1 - \left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(t\_1 - \frac{\left(U - U*\right) \cdot \left(\left(\frac{\ell}{Om} \cdot \ell\right) \cdot n\right)}{Om}\right) \cdot \left(n + n\right)} \cdot \sqrt{U}\\
\end{array}
if U < 4.1000000000000002e-305Initial program 50.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lift-/.f64N/A
associate-*r*N/A
count-2N/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
mult-flipN/A
distribute-lft-outN/A
mult-flipN/A
mult-flipN/A
distribute-rgt-outN/A
metadata-evalN/A
associate-*l*N/A
mult-flipN/A
lift-/.f64N/A
lower-*.f64N/A
Applied rewrites53.6%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6454.9%
Applied rewrites54.9%
lift-*.f64N/A
count-2-revN/A
lift-+.f6454.9%
Applied rewrites54.9%
if 4.1000000000000002e-305 < U Initial program 50.1%
Applied rewrites26.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites30.8%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(*
(* (* 2 n) U)
(-
(- t (* 2 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2)) (- U U*))))))
(if (<= t_1 0)
(sqrt (fabs (* (* t U) (+ n n))))
(if (<= t_1 INFINITY)
(sqrt
(fabs
(*
(-
(- t (* (/ (+ l l) Om) l))
(* (* (- U U*) n) (* l (/ l (* Om Om)))))
(* U (+ n n)))))
(/
(* (* (sqrt (fabs (* (* (- U U*) -2) U))) (fabs l)) n)
(- Om))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_1 <= 0.0) {
tmp = sqrt(fabs(((t * U) * (n + n))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt(fabs((((t - (((l + l) / Om) * l)) - (((U - U_42_) * n) * (l * (l / (Om * Om))))) * (U * (n + n)))));
} else {
tmp = ((sqrt(fabs((((U - U_42_) * -2.0) * U))) * fabs(l)) * n) / -Om;
}
return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_1 <= 0.0) {
tmp = Math.sqrt(Math.abs(((t * U) * (n + n))));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt(Math.abs((((t - (((l + l) / Om) * l)) - (((U - U_42_) * n) * (l * (l / (Om * Om))))) * (U * (n + n)))));
} else {
tmp = ((Math.sqrt(Math.abs((((U - U_42_) * -2.0) * U))) * Math.abs(l)) * n) / -Om;
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = ((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(math.fabs(((t * U) * (n + n)))) elif t_1 <= math.inf: tmp = math.sqrt(math.fabs((((t - (((l + l) / Om) * l)) - (((U - U_42_) * n) * (l * (l / (Om * Om))))) * (U * (n + n))))) else: tmp = ((math.sqrt(math.fabs((((U - U_42_) * -2.0) * U))) * math.fabs(l)) * n) / -Om return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_1 <= 0.0) tmp = sqrt(abs(Float64(Float64(t * U) * Float64(n + n)))); elseif (t_1 <= Inf) tmp = sqrt(abs(Float64(Float64(Float64(t - Float64(Float64(Float64(l + l) / Om) * l)) - Float64(Float64(Float64(U - U_42_) * n) * Float64(l * Float64(l / Float64(Om * Om))))) * Float64(U * Float64(n + n))))); else tmp = Float64(Float64(Float64(sqrt(abs(Float64(Float64(Float64(U - U_42_) * -2.0) * U))) * abs(l)) * n) / Float64(-Om)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = ((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(abs(((t * U) * (n + n)))); elseif (t_1 <= Inf) tmp = sqrt(abs((((t - (((l + l) / Om) * l)) - (((U - U_42_) * n) * (l * (l / (Om * Om))))) * (U * (n + n))))); else tmp = ((sqrt(abs((((U - U_42_) * -2.0) * U))) * abs(l)) * n) / -Om; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(N[(2 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0], N[Sqrt[N[Abs[N[(N[(t * U), $MachinePrecision] * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[Sqrt[N[Abs[N[(N[(N[(t - N[(N[(N[(l + l), $MachinePrecision] / Om), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(U - U$42$), $MachinePrecision] * n), $MachinePrecision] * N[(l * N[(l / N[(Om * Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[Sqrt[N[Abs[N[(N[(N[(U - U$42$), $MachinePrecision] * -2), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision] / (-Om)), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\sqrt{\left|\left(t \cdot U\right) \cdot \left(n + n\right)\right|}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\sqrt{\left|\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(\left(U - U*\right) \cdot n\right) \cdot \left(\ell \cdot \frac{\ell}{Om \cdot Om}\right)\right) \cdot \left(U \cdot \left(n + n\right)\right)\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om}\\
\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.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
count-2N/A
distribute-rgt-outN/A
count-2-revN/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6436.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
lift-*.f6436.5%
Applied rewrites36.5%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites38.1%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 50.1%
Applied rewrites46.5%
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.1%
Taylor expanded in n around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-pow.f649.8%
Applied rewrites9.8%
Taylor expanded in Om around -inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f6411.3%
Applied rewrites11.3%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites13.5%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
mul-fabsN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
lower-fabs.f6415.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6415.7%
Applied rewrites15.7%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(*
(* (* 2 n) U)
(-
(- t (* 2 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2)) (- U U*))))))
(if (<= t_1 0)
(sqrt (fabs (* (* t U) (+ n n))))
(if (<= t_1 INFINITY)
(sqrt
(*
(-
(- t (* (/ (+ l l) Om) l))
(* (* (- U U*) n) (* l (/ l (* Om Om)))))
(* U (+ n n))))
(/
(* (* (sqrt (fabs (* (* (- U U*) -2) U))) (fabs l)) n)
(- Om))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_1 <= 0.0) {
tmp = sqrt(fabs(((t * U) * (n + n))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt((((t - (((l + l) / Om) * l)) - (((U - U_42_) * n) * (l * (l / (Om * Om))))) * (U * (n + n))));
} else {
tmp = ((sqrt(fabs((((U - U_42_) * -2.0) * U))) * fabs(l)) * n) / -Om;
}
return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_1 <= 0.0) {
tmp = Math.sqrt(Math.abs(((t * U) * (n + n))));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((((t - (((l + l) / Om) * l)) - (((U - U_42_) * n) * (l * (l / (Om * Om))))) * (U * (n + n))));
} else {
tmp = ((Math.sqrt(Math.abs((((U - U_42_) * -2.0) * U))) * Math.abs(l)) * n) / -Om;
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = ((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(math.fabs(((t * U) * (n + n)))) elif t_1 <= math.inf: tmp = math.sqrt((((t - (((l + l) / Om) * l)) - (((U - U_42_) * n) * (l * (l / (Om * Om))))) * (U * (n + n)))) else: tmp = ((math.sqrt(math.fabs((((U - U_42_) * -2.0) * U))) * math.fabs(l)) * n) / -Om return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_1 <= 0.0) tmp = sqrt(abs(Float64(Float64(t * U) * Float64(n + n)))); elseif (t_1 <= Inf) tmp = sqrt(Float64(Float64(Float64(t - Float64(Float64(Float64(l + l) / Om) * l)) - Float64(Float64(Float64(U - U_42_) * n) * Float64(l * Float64(l / Float64(Om * Om))))) * Float64(U * Float64(n + n)))); else tmp = Float64(Float64(Float64(sqrt(abs(Float64(Float64(Float64(U - U_42_) * -2.0) * U))) * abs(l)) * n) / Float64(-Om)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = ((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(abs(((t * U) * (n + n)))); elseif (t_1 <= Inf) tmp = sqrt((((t - (((l + l) / Om) * l)) - (((U - U_42_) * n) * (l * (l / (Om * Om))))) * (U * (n + n)))); else tmp = ((sqrt(abs((((U - U_42_) * -2.0) * U))) * abs(l)) * n) / -Om; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(N[(2 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0], N[Sqrt[N[Abs[N[(N[(t * U), $MachinePrecision] * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[Sqrt[N[(N[(N[(t - N[(N[(N[(l + l), $MachinePrecision] / Om), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(U - U$42$), $MachinePrecision] * n), $MachinePrecision] * N[(l * N[(l / N[(Om * Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[Sqrt[N[Abs[N[(N[(N[(U - U$42$), $MachinePrecision] * -2), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision] / (-Om)), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\sqrt{\left|\left(t \cdot U\right) \cdot \left(n + n\right)\right|}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(\left(U - U*\right) \cdot n\right) \cdot \left(\ell \cdot \frac{\ell}{Om \cdot Om}\right)\right) \cdot \left(U \cdot \left(n + n\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om}\\
\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.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
count-2N/A
distribute-rgt-outN/A
count-2-revN/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6436.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
lift-*.f6436.5%
Applied rewrites36.5%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites38.1%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 50.1%
Applied rewrites46.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.1%
Taylor expanded in n around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-pow.f649.8%
Applied rewrites9.8%
Taylor expanded in Om around -inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f6411.3%
Applied rewrites11.3%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites13.5%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
mul-fabsN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
lower-fabs.f6415.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6415.7%
Applied rewrites15.7%
(FPCore (n U t l Om U*)
:precision binary64
(if (<=
(fabs l)
3256237484844319/23258839177459420497578361852416145099316523541994177929007686373780457219628733546438113622840434097944400691400517693873107252115668992)
(sqrt (* 2 (* U (* n t))))
(sqrt
(*
(+ n n)
(*
(-
(- t (* (/ (+ (fabs l) (fabs l)) Om) (fabs l)))
(* (* (- U U*) n) (* (fabs l) (/ (fabs l) (* Om Om)))))
U)))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (fabs(l) <= 1.4e-121) {
tmp = sqrt((2.0 * (U * (n * t))));
} else {
tmp = sqrt(((n + n) * (((t - (((fabs(l) + fabs(l)) / Om) * fabs(l))) - (((U - U_42_) * n) * (fabs(l) * (fabs(l) / (Om * Om))))) * U)));
}
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 (abs(l) <= 1.4d-121) then
tmp = sqrt((2.0d0 * (u * (n * t))))
else
tmp = sqrt(((n + n) * (((t - (((abs(l) + abs(l)) / om) * abs(l))) - (((u - u_42) * n) * (abs(l) * (abs(l) / (om * om))))) * u)))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (Math.abs(l) <= 1.4e-121) {
tmp = Math.sqrt((2.0 * (U * (n * t))));
} else {
tmp = Math.sqrt(((n + n) * (((t - (((Math.abs(l) + Math.abs(l)) / Om) * Math.abs(l))) - (((U - U_42_) * n) * (Math.abs(l) * (Math.abs(l) / (Om * Om))))) * U)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if math.fabs(l) <= 1.4e-121: tmp = math.sqrt((2.0 * (U * (n * t)))) else: tmp = math.sqrt(((n + n) * (((t - (((math.fabs(l) + math.fabs(l)) / Om) * math.fabs(l))) - (((U - U_42_) * n) * (math.fabs(l) * (math.fabs(l) / (Om * Om))))) * U))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (abs(l) <= 1.4e-121) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t)))); else tmp = sqrt(Float64(Float64(n + n) * Float64(Float64(Float64(t - Float64(Float64(Float64(abs(l) + abs(l)) / Om) * abs(l))) - Float64(Float64(Float64(U - U_42_) * n) * Float64(abs(l) * Float64(abs(l) / Float64(Om * Om))))) * U))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (abs(l) <= 1.4e-121) tmp = sqrt((2.0 * (U * (n * t)))); else tmp = sqrt(((n + n) * (((t - (((abs(l) + abs(l)) / Om) * abs(l))) - (((U - U_42_) * n) * (abs(l) * (abs(l) / (Om * Om))))) * U))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[N[Abs[l], $MachinePrecision], 3256237484844319/23258839177459420497578361852416145099316523541994177929007686373780457219628733546438113622840434097944400691400517693873107252115668992], N[Sqrt[N[(2 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(n + n), $MachinePrecision] * N[(N[(N[(t - N[(N[(N[(N[Abs[l], $MachinePrecision] + N[Abs[l], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(U - U$42$), $MachinePrecision] * n), $MachinePrecision] * N[(N[Abs[l], $MachinePrecision] * N[(N[Abs[l], $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|\ell\right| \leq \frac{3256237484844319}{23258839177459420497578361852416145099316523541994177929007686373780457219628733546438113622840434097944400691400517693873107252115668992}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(n + n\right) \cdot \left(\left(\left(t - \frac{\left|\ell\right| + \left|\ell\right|}{Om} \cdot \left|\ell\right|\right) - \left(\left(U - U*\right) \cdot n\right) \cdot \left(\left|\ell\right| \cdot \frac{\left|\ell\right|}{Om \cdot Om}\right)\right) \cdot U\right)}\\
\end{array}
if l < 1.4000000000000001e-121Initial program 50.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
if 1.4000000000000001e-121 < l Initial program 50.1%
Applied rewrites46.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(*
(* (* 2 n) U)
(-
(- t (* 2 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2)) (- U U*))))))
(if (<= t_1 0)
(sqrt (fabs (* (* t U) (+ n n))))
(if (<=
t_1
10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784)
(sqrt
(*
(-
(- t (* (/ (+ l l) Om) l))
(* (* U n) (* (/ l (* Om Om)) l)))
(* (+ U U) n)))
(/
(* (* (sqrt (fabs (* (* (- U U*) -2) U))) (fabs l)) n)
(- Om))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_1 <= 0.0) {
tmp = sqrt(fabs(((t * U) * (n + n))));
} else if (t_1 <= 1e+289) {
tmp = sqrt((((t - (((l + l) / Om) * l)) - ((U * n) * ((l / (Om * Om)) * l))) * ((U + U) * n)));
} else {
tmp = ((sqrt(fabs((((U - U_42_) * -2.0) * U))) * fabs(l)) * 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 = ((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(abs(((t * u) * (n + n))))
else if (t_1 <= 1d+289) then
tmp = sqrt((((t - (((l + l) / om) * l)) - ((u * n) * ((l / (om * om)) * l))) * ((u + u) * n)))
else
tmp = ((sqrt(abs((((u - u_42) * (-2.0d0)) * u))) * abs(l)) * 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 = ((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(Math.abs(((t * U) * (n + n))));
} else if (t_1 <= 1e+289) {
tmp = Math.sqrt((((t - (((l + l) / Om) * l)) - ((U * n) * ((l / (Om * Om)) * l))) * ((U + U) * n)));
} else {
tmp = ((Math.sqrt(Math.abs((((U - U_42_) * -2.0) * U))) * Math.abs(l)) * n) / -Om;
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = ((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(math.fabs(((t * U) * (n + n)))) elif t_1 <= 1e+289: tmp = math.sqrt((((t - (((l + l) / Om) * l)) - ((U * n) * ((l / (Om * Om)) * l))) * ((U + U) * n))) else: tmp = ((math.sqrt(math.fabs((((U - U_42_) * -2.0) * U))) * math.fabs(l)) * n) / -Om return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_1 <= 0.0) tmp = sqrt(abs(Float64(Float64(t * U) * Float64(n + n)))); elseif (t_1 <= 1e+289) tmp = sqrt(Float64(Float64(Float64(t - Float64(Float64(Float64(l + l) / Om) * l)) - Float64(Float64(U * n) * Float64(Float64(l / Float64(Om * Om)) * l))) * Float64(Float64(U + U) * n))); else tmp = Float64(Float64(Float64(sqrt(abs(Float64(Float64(Float64(U - U_42_) * -2.0) * U))) * abs(l)) * n) / Float64(-Om)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = ((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(abs(((t * U) * (n + n)))); elseif (t_1 <= 1e+289) tmp = sqrt((((t - (((l + l) / Om) * l)) - ((U * n) * ((l / (Om * Om)) * l))) * ((U + U) * n))); else tmp = ((sqrt(abs((((U - U_42_) * -2.0) * U))) * abs(l)) * n) / -Om; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(N[(2 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0], N[Sqrt[N[Abs[N[(N[(t * U), $MachinePrecision] * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784], N[Sqrt[N[(N[(N[(t - N[(N[(N[(l + l), $MachinePrecision] / Om), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] - N[(N[(U * n), $MachinePrecision] * N[(N[(l / N[(Om * Om), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(U + U), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[Sqrt[N[Abs[N[(N[(N[(U - U$42$), $MachinePrecision] * -2), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision] / (-Om)), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\sqrt{\left|\left(t \cdot U\right) \cdot \left(n + n\right)\right|}\\
\mathbf{elif}\;t\_1 \leq 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784:\\
\;\;\;\;\sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U \cdot n\right) \cdot \left(\frac{\ell}{Om \cdot Om} \cdot \ell\right)\right) \cdot \left(\left(U + U\right) \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om}\\
\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.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
count-2N/A
distribute-rgt-outN/A
count-2-revN/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6436.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
lift-*.f6436.5%
Applied rewrites36.5%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites38.1%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1.0000000000000001e289Initial program 50.1%
Applied rewrites26.7%
Taylor expanded in U around inf
lower-*.f6422.7%
Applied rewrites22.7%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6438.1%
Applied rewrites38.1%
if 1.0000000000000001e289 < (*.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.1%
Taylor expanded in n around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-pow.f649.8%
Applied rewrites9.8%
Taylor expanded in Om around -inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f6411.3%
Applied rewrites11.3%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites13.5%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
mul-fabsN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
lower-fabs.f6415.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6415.7%
Applied rewrites15.7%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(*
(* (* 2 n) U)
(-
(- t (* 2 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2)) (- U U*))))))
(if (<= t_1 0)
(sqrt (fabs (* (* t U) (+ n n))))
(if (<=
t_1
10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784)
(sqrt (fabs (* t (* U (+ n n)))))
(/
(* (* (sqrt (fabs (* (* (- U U*) -2) U))) (fabs l)) n)
(- Om))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_1 <= 0.0) {
tmp = sqrt(fabs(((t * U) * (n + n))));
} else if (t_1 <= 1e+289) {
tmp = sqrt(fabs((t * (U * (n + n)))));
} else {
tmp = ((sqrt(fabs((((U - U_42_) * -2.0) * U))) * fabs(l)) * 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 = ((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(abs(((t * u) * (n + n))))
else if (t_1 <= 1d+289) then
tmp = sqrt(abs((t * (u * (n + n)))))
else
tmp = ((sqrt(abs((((u - u_42) * (-2.0d0)) * u))) * abs(l)) * 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 = ((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(Math.abs(((t * U) * (n + n))));
} else if (t_1 <= 1e+289) {
tmp = Math.sqrt(Math.abs((t * (U * (n + n)))));
} else {
tmp = ((Math.sqrt(Math.abs((((U - U_42_) * -2.0) * U))) * Math.abs(l)) * n) / -Om;
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = ((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(math.fabs(((t * U) * (n + n)))) elif t_1 <= 1e+289: tmp = math.sqrt(math.fabs((t * (U * (n + n))))) else: tmp = ((math.sqrt(math.fabs((((U - U_42_) * -2.0) * U))) * math.fabs(l)) * n) / -Om return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_1 <= 0.0) tmp = sqrt(abs(Float64(Float64(t * U) * Float64(n + n)))); elseif (t_1 <= 1e+289) tmp = sqrt(abs(Float64(t * Float64(U * Float64(n + n))))); else tmp = Float64(Float64(Float64(sqrt(abs(Float64(Float64(Float64(U - U_42_) * -2.0) * U))) * abs(l)) * n) / Float64(-Om)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = ((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(abs(((t * U) * (n + n)))); elseif (t_1 <= 1e+289) tmp = sqrt(abs((t * (U * (n + n))))); else tmp = ((sqrt(abs((((U - U_42_) * -2.0) * U))) * abs(l)) * n) / -Om; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(N[(2 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0], N[Sqrt[N[Abs[N[(N[(t * U), $MachinePrecision] * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784], N[Sqrt[N[Abs[N[(t * N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[Sqrt[N[Abs[N[(N[(N[(U - U$42$), $MachinePrecision] * -2), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision] / (-Om)), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\sqrt{\left|\left(t \cdot U\right) \cdot \left(n + n\right)\right|}\\
\mathbf{elif}\;t\_1 \leq 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784:\\
\;\;\;\;\sqrt{\left|t \cdot \left(U \cdot \left(n + n\right)\right)\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om}\\
\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.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
count-2N/A
distribute-rgt-outN/A
count-2-revN/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6436.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
lift-*.f6436.5%
Applied rewrites36.5%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites38.1%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1.0000000000000001e289Initial program 50.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites38.7%
if 1.0000000000000001e289 < (*.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.1%
Taylor expanded in n around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-pow.f649.8%
Applied rewrites9.8%
Taylor expanded in Om around -inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f6411.3%
Applied rewrites11.3%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites13.5%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
mul-fabsN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
lower-fabs.f6415.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6415.7%
Applied rewrites15.7%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(*
(* (* 2 n) U)
(-
(- t (* 2 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2)) (- U U*))))))
(if (<= t_1 0)
(sqrt (fabs (* (* t U) (+ n n))))
(if (<=
t_1
10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784)
(sqrt (fabs (* t (* U (+ n n)))))
(* (fabs l) (* (sqrt (* (* (- U U*) -2) U)) (/ (- n) Om)))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_1 <= 0.0) {
tmp = sqrt(fabs(((t * U) * (n + n))));
} else if (t_1 <= 1e+289) {
tmp = sqrt(fabs((t * (U * (n + n)))));
} else {
tmp = fabs(l) * (sqrt((((U - U_42_) * -2.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 = ((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(abs(((t * u) * (n + n))))
else if (t_1 <= 1d+289) then
tmp = sqrt(abs((t * (u * (n + n)))))
else
tmp = abs(l) * (sqrt((((u - u_42) * (-2.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 = ((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(Math.abs(((t * U) * (n + n))));
} else if (t_1 <= 1e+289) {
tmp = Math.sqrt(Math.abs((t * (U * (n + n)))));
} else {
tmp = Math.abs(l) * (Math.sqrt((((U - U_42_) * -2.0) * U)) * (-n / Om));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = ((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(math.fabs(((t * U) * (n + n)))) elif t_1 <= 1e+289: tmp = math.sqrt(math.fabs((t * (U * (n + n))))) else: tmp = math.fabs(l) * (math.sqrt((((U - U_42_) * -2.0) * U)) * (-n / Om)) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_1 <= 0.0) tmp = sqrt(abs(Float64(Float64(t * U) * Float64(n + n)))); elseif (t_1 <= 1e+289) tmp = sqrt(abs(Float64(t * Float64(U * Float64(n + n))))); else tmp = Float64(abs(l) * Float64(sqrt(Float64(Float64(Float64(U - U_42_) * -2.0) * U)) * Float64(Float64(-n) / Om))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = ((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(abs(((t * U) * (n + n)))); elseif (t_1 <= 1e+289) tmp = sqrt(abs((t * (U * (n + n))))); else tmp = abs(l) * (sqrt((((U - U_42_) * -2.0) * U)) * (-n / Om)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(N[(2 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0], N[Sqrt[N[Abs[N[(N[(t * U), $MachinePrecision] * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784], N[Sqrt[N[Abs[N[(t * N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[(N[Abs[l], $MachinePrecision] * N[(N[Sqrt[N[(N[(N[(U - U$42$), $MachinePrecision] * -2), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision] * N[((-n) / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\sqrt{\left|\left(t \cdot U\right) \cdot \left(n + n\right)\right|}\\
\mathbf{elif}\;t\_1 \leq 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784:\\
\;\;\;\;\sqrt{\left|t \cdot \left(U \cdot \left(n + n\right)\right)\right|}\\
\mathbf{else}:\\
\;\;\;\;\left|\ell\right| \cdot \left(\sqrt{\left(\left(U - U*\right) \cdot -2\right) \cdot U} \cdot \frac{-n}{Om}\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*)))) < 0.0Initial program 50.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
count-2N/A
distribute-rgt-outN/A
count-2-revN/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6436.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
lift-*.f6436.5%
Applied rewrites36.5%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites38.1%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1.0000000000000001e289Initial program 50.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites38.7%
if 1.0000000000000001e289 < (*.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.1%
Taylor expanded in n around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-pow.f649.8%
Applied rewrites9.8%
Taylor expanded in Om around -inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f6411.3%
Applied rewrites11.3%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites13.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
frac-2negN/A
lift-neg.f64N/A
remove-double-negN/A
lower-/.f64N/A
Applied rewrites13.4%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(*
(* (* 2 n) U)
(-
(- t (* 2 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2)) (- U U*))))))
(if (<= t_1 0)
(sqrt (fabs (* (* t U) (+ n n))))
(if (<=
t_1
10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784)
(sqrt (fabs (* t (* U (+ n n)))))
(- (* (* (sqrt (* (* -2 U) (- U U*))) (fabs l)) (/ n Om)))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_1 <= 0.0) {
tmp = sqrt(fabs(((t * U) * (n + n))));
} else if (t_1 <= 1e+289) {
tmp = sqrt(fabs((t * (U * (n + n)))));
} else {
tmp = -((sqrt(((-2.0 * U) * (U - U_42_))) * fabs(l)) * (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 = ((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(abs(((t * u) * (n + n))))
else if (t_1 <= 1d+289) then
tmp = sqrt(abs((t * (u * (n + n)))))
else
tmp = -((sqrt((((-2.0d0) * u) * (u - u_42))) * abs(l)) * (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 = ((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(Math.abs(((t * U) * (n + n))));
} else if (t_1 <= 1e+289) {
tmp = Math.sqrt(Math.abs((t * (U * (n + n)))));
} else {
tmp = -((Math.sqrt(((-2.0 * U) * (U - U_42_))) * Math.abs(l)) * (n / Om));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = ((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(math.fabs(((t * U) * (n + n)))) elif t_1 <= 1e+289: tmp = math.sqrt(math.fabs((t * (U * (n + n))))) else: tmp = -((math.sqrt(((-2.0 * U) * (U - U_42_))) * math.fabs(l)) * (n / Om)) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_1 <= 0.0) tmp = sqrt(abs(Float64(Float64(t * U) * Float64(n + n)))); elseif (t_1 <= 1e+289) tmp = sqrt(abs(Float64(t * Float64(U * Float64(n + n))))); else tmp = Float64(-Float64(Float64(sqrt(Float64(Float64(-2.0 * U) * Float64(U - U_42_))) * abs(l)) * Float64(n / Om))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = ((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(abs(((t * U) * (n + n)))); elseif (t_1 <= 1e+289) tmp = sqrt(abs((t * (U * (n + n))))); else tmp = -((sqrt(((-2.0 * U) * (U - U_42_))) * abs(l)) * (n / Om)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(N[(2 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0], N[Sqrt[N[Abs[N[(N[(t * U), $MachinePrecision] * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784], N[Sqrt[N[Abs[N[(t * N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], (-N[(N[(N[Sqrt[N[(N[(-2 * U), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] * N[(n / Om), $MachinePrecision]), $MachinePrecision])]]]
\begin{array}{l}
t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\sqrt{\left|\left(t \cdot U\right) \cdot \left(n + n\right)\right|}\\
\mathbf{elif}\;t\_1 \leq 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784:\\
\;\;\;\;\sqrt{\left|t \cdot \left(U \cdot \left(n + n\right)\right)\right|}\\
\mathbf{else}:\\
\;\;\;\;-\left(\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \left|\ell\right|\right) \cdot \frac{n}{Om}\\
\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.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
count-2N/A
distribute-rgt-outN/A
count-2-revN/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6436.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
lift-*.f6436.5%
Applied rewrites36.5%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites38.1%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1.0000000000000001e289Initial program 50.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites38.7%
if 1.0000000000000001e289 < (*.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.1%
Taylor expanded in n around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-pow.f649.8%
Applied rewrites9.8%
Taylor expanded in Om around -inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f6411.3%
Applied rewrites11.3%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6411.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites13.5%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(*
(* (* 2 n) U)
(-
(- t (* 2 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2)) (- U U*))))))
(if (<= t_1 0)
(sqrt (fabs (* (* t U) (+ n n))))
(if (<=
t_1
10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784)
(sqrt (fabs (* t (* U (+ n n)))))
(/ (* (* (sqrt (* 2 (* U U*))) (fabs l)) n) (- Om))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_1 <= 0.0) {
tmp = sqrt(fabs(((t * U) * (n + n))));
} else if (t_1 <= 1e+289) {
tmp = sqrt(fabs((t * (U * (n + n)))));
} else {
tmp = ((sqrt((2.0 * (U * U_42_))) * fabs(l)) * 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 = ((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(abs(((t * u) * (n + n))))
else if (t_1 <= 1d+289) then
tmp = sqrt(abs((t * (u * (n + n)))))
else
tmp = ((sqrt((2.0d0 * (u * u_42))) * abs(l)) * 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 = ((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(Math.abs(((t * U) * (n + n))));
} else if (t_1 <= 1e+289) {
tmp = Math.sqrt(Math.abs((t * (U * (n + n)))));
} else {
tmp = ((Math.sqrt((2.0 * (U * U_42_))) * Math.abs(l)) * n) / -Om;
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = ((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(math.fabs(((t * U) * (n + n)))) elif t_1 <= 1e+289: tmp = math.sqrt(math.fabs((t * (U * (n + n))))) else: tmp = ((math.sqrt((2.0 * (U * U_42_))) * math.fabs(l)) * n) / -Om return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_1 <= 0.0) tmp = sqrt(abs(Float64(Float64(t * U) * Float64(n + n)))); elseif (t_1 <= 1e+289) tmp = sqrt(abs(Float64(t * Float64(U * Float64(n + n))))); else tmp = Float64(Float64(Float64(sqrt(Float64(2.0 * Float64(U * U_42_))) * abs(l)) * n) / Float64(-Om)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = ((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(abs(((t * U) * (n + n)))); elseif (t_1 <= 1e+289) tmp = sqrt(abs((t * (U * (n + n))))); else tmp = ((sqrt((2.0 * (U * U_42_))) * abs(l)) * n) / -Om; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(N[(2 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0], N[Sqrt[N[Abs[N[(N[(t * U), $MachinePrecision] * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784], N[Sqrt[N[Abs[N[(t * N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[Sqrt[N[(2 * N[(U * U$42$), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision] / (-Om)), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\sqrt{\left|\left(t \cdot U\right) \cdot \left(n + n\right)\right|}\\
\mathbf{elif}\;t\_1 \leq 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784:\\
\;\;\;\;\sqrt{\left|t \cdot \left(U \cdot \left(n + n\right)\right)\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\sqrt{2 \cdot \left(U \cdot U*\right)} \cdot \left|\ell\right|\right) \cdot n}{-Om}\\
\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.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
count-2N/A
distribute-rgt-outN/A
count-2-revN/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6436.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
lift-*.f6436.5%
Applied rewrites36.5%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites38.1%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1.0000000000000001e289Initial program 50.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites38.7%
if 1.0000000000000001e289 < (*.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.1%
Taylor expanded in n around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-pow.f649.8%
Applied rewrites9.8%
Taylor expanded in Om around -inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f6411.3%
Applied rewrites11.3%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites13.5%
Taylor expanded in U around 0
lower-*.f64N/A
lower-*.f6414.0%
Applied rewrites14.0%
(FPCore (n U t l Om U*)
:precision binary64
(if (<=
U
8696971821798503/395316900990841051469717474060385365331165331570590074915822964897324881968740911898360124416869383779662261453743773264433220190206627884505885546759254902190463719290168674539974429183775813166483921247017080212035170866063852926988483116502264758478144641625700721781901200420372075258176420915324230983022866681823232)
(sqrt (fabs (* (* t U) (+ n n))))
(* (sqrt (* 2 (* n t))) (sqrt U))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 2.2e-305) {
tmp = sqrt(fabs(((t * U) * (n + n))));
} else {
tmp = sqrt((2.0 * (n * t))) * sqrt(U);
}
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 <= 2.2d-305) then
tmp = sqrt(abs(((t * u) * (n + n))))
else
tmp = sqrt((2.0d0 * (n * t))) * sqrt(u)
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 2.2e-305) {
tmp = Math.sqrt(Math.abs(((t * U) * (n + n))));
} else {
tmp = Math.sqrt((2.0 * (n * t))) * Math.sqrt(U);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if U <= 2.2e-305: tmp = math.sqrt(math.fabs(((t * U) * (n + n)))) else: tmp = math.sqrt((2.0 * (n * t))) * math.sqrt(U) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= 2.2e-305) tmp = sqrt(abs(Float64(Float64(t * U) * Float64(n + n)))); else tmp = Float64(sqrt(Float64(2.0 * Float64(n * t))) * sqrt(U)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U <= 2.2e-305) tmp = sqrt(abs(((t * U) * (n + n)))); else tmp = sqrt((2.0 * (n * t))) * sqrt(U); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, 8696971821798503/395316900990841051469717474060385365331165331570590074915822964897324881968740911898360124416869383779662261453743773264433220190206627884505885546759254902190463719290168674539974429183775813166483921247017080212035170866063852926988483116502264758478144641625700721781901200420372075258176420915324230983022866681823232], N[Sqrt[N[Abs[N[(N[(t * U), $MachinePrecision] * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(2 * N[(n * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[U], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;U \leq \frac{8696971821798503}{395316900990841051469717474060385365331165331570590074915822964897324881968740911898360124416869383779662261453743773264433220190206627884505885546759254902190463719290168674539974429183775813166483921247017080212035170866063852926988483116502264758478144641625700721781901200420372075258176420915324230983022866681823232}:\\
\;\;\;\;\sqrt{\left|\left(t \cdot U\right) \cdot \left(n + n\right)\right|}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot t\right)} \cdot \sqrt{U}\\
\end{array}
if U < 2.2e-305Initial program 50.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
count-2N/A
distribute-rgt-outN/A
count-2-revN/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6436.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
lift-*.f6436.5%
Applied rewrites36.5%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites38.1%
if 2.2e-305 < U Initial program 50.1%
Applied rewrites26.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6421.4%
Applied rewrites21.4%
(FPCore (n U t l Om U*)
:precision binary64
(if (<=
(fabs l)
6313673899733619/121416805764108066932466369176469931665150427440758720078238275608681517825325531136)
(sqrt (* 2 (* U (* n t))))
(sqrt (fabs (* t (* U (+ n n)))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (fabs(l) <= 5.2e-68) {
tmp = sqrt((2.0 * (U * (n * t))));
} else {
tmp = sqrt(fabs((t * (U * (n + 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) :: tmp
if (abs(l) <= 5.2d-68) then
tmp = sqrt((2.0d0 * (u * (n * t))))
else
tmp = sqrt(abs((t * (u * (n + n)))))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (Math.abs(l) <= 5.2e-68) {
tmp = Math.sqrt((2.0 * (U * (n * t))));
} else {
tmp = Math.sqrt(Math.abs((t * (U * (n + n)))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if math.fabs(l) <= 5.2e-68: tmp = math.sqrt((2.0 * (U * (n * t)))) else: tmp = math.sqrt(math.fabs((t * (U * (n + n))))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (abs(l) <= 5.2e-68) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t)))); else tmp = sqrt(abs(Float64(t * Float64(U * Float64(n + n))))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (abs(l) <= 5.2e-68) tmp = sqrt((2.0 * (U * (n * t)))); else tmp = sqrt(abs((t * (U * (n + n))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[N[Abs[l], $MachinePrecision], 6313673899733619/121416805764108066932466369176469931665150427440758720078238275608681517825325531136], N[Sqrt[N[(2 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[Abs[N[(t * N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|\ell\right| \leq \frac{6313673899733619}{121416805764108066932466369176469931665150427440758720078238275608681517825325531136}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left|t \cdot \left(U \cdot \left(n + n\right)\right)\right|}\\
\end{array}
if l < 5.1999999999999996e-68Initial program 50.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
if 5.1999999999999996e-68 < l Initial program 50.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqr-abs-revN/A
Applied rewrites38.7%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(sqrt
(*
(* (* 2 n) U)
(-
(- t (* 2 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2)) (- U U*))))))
(t_2 (sqrt (* (* (+ U U) t) n))))
(if (<= t_1 0)
t_2
(if (<=
t_1
4999999999999999945435305910704598063392403130200679472590007732362651199555129074427056403228815030648329464160476949292016380761727168556302336)
(sqrt (* (* U (+ n n)) t))
t_2))))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 t_2 = sqrt((((U + U) * t) * n));
double tmp;
if (t_1 <= 0.0) {
tmp = t_2;
} else if (t_1 <= 5e+144) {
tmp = sqrt(((U * (n + n)) * t));
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
t_2 = sqrt((((u + u) * t) * n))
if (t_1 <= 0.0d0) then
tmp = t_2
else if (t_1 <= 5d+144) then
tmp = sqrt(((u * (n + n)) * t))
else
tmp = t_2
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 t_2 = Math.sqrt((((U + U) * t) * n));
double tmp;
if (t_1 <= 0.0) {
tmp = t_2;
} else if (t_1 <= 5e+144) {
tmp = Math.sqrt(((U * (n + n)) * t));
} else {
tmp = t_2;
}
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_))))) t_2 = math.sqrt((((U + U) * t) * n)) tmp = 0 if t_1 <= 0.0: tmp = t_2 elif t_1 <= 5e+144: tmp = math.sqrt(((U * (n + n)) * t)) else: tmp = t_2 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_))))) t_2 = sqrt(Float64(Float64(Float64(U + U) * t) * n)) tmp = 0.0 if (t_1 <= 0.0) tmp = t_2; elseif (t_1 <= 5e+144) tmp = sqrt(Float64(Float64(U * Float64(n + n)) * t)); else tmp = t_2; 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_))))); t_2 = sqrt((((U + U) * t) * n)); tmp = 0.0; if (t_1 <= 0.0) tmp = t_2; elseif (t_1 <= 5e+144) tmp = sqrt(((U * (n + n)) * t)); else tmp = t_2; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[(N[(N[(2 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(N[(U + U), $MachinePrecision] * t), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 0], t$95$2, If[LessEqual[t$95$1, 4999999999999999945435305910704598063392403130200679472590007732362651199555129074427056403228815030648329464160476949292016380761727168556302336], N[Sqrt[N[(N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], t$95$2]]]]
\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)}\\
t_2 := \sqrt{\left(\left(U + U\right) \cdot t\right) \cdot n}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4999999999999999945435305910704598063392403130200679472590007732362651199555129074427056403228815030648329464160476949292016380761727168556302336:\\
\;\;\;\;\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\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.0 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*))))) Initial program 50.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
count-2-revN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f6436.1%
Applied rewrites36.1%
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.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
count-2N/A
distribute-rgt-outN/A
count-2-revN/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6436.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
lift-*.f6436.5%
Applied rewrites36.5%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2 (* U (* n t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((2.0 * (U * (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((2.0d0 * (u * (n * t))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((2.0 * (U * (n * t))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((2.0 * (U * (n * t))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(2.0 * Float64(U * Float64(n * t)))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((2.0 * (U * (n * t)))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(2 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}
Initial program 50.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (+ U U) (* t n))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt(((U + U) * (t * n)));
}
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 + u) * (t * n)))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt(((U + U) * (t * n)));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt(((U + U) * (t * n)))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(U + U) * Float64(t * n))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt(((U + U) * (t * n))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(U + U), $MachinePrecision] * N[(t * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\sqrt{\left(U + U\right) \cdot \left(t \cdot n\right)}
Initial program 50.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
count-2-revN/A
lower-*.f64N/A
lower-+.f6436.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.4%
Applied rewrites36.4%
(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.1%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.4%
Applied rewrites36.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
count-2N/A
distribute-rgt-outN/A
count-2-revN/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6436.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
lift-*.f6436.5%
Applied rewrites36.5%
herbie shell --seed 2025285 -o generate:evaluate
(FPCore (n U t l Om U*)
:name "Toniolo and Linder, Equation (13)"
:precision binary64
(sqrt (* (* (* 2 n) U) (- (- t (* 2 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2)) (- U U*))))))