
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}
\end{array}
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}
\end{array}
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))))
(if (<= t_1 0.0)
(* U (* (sqrt (/ (* n t) U)) (sqrt 2.0)))
(if (<= t_1 INFINITY)
t_1
(sqrt
(*
-2.0
(*
U
(*
(pow l 2.0)
(* n (fma 2.0 (/ 1.0 Om) (/ (* n (- U U*)) (pow Om 2.0))))))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_1 <= 0.0) {
tmp = U * (sqrt(((n * t) / U)) * sqrt(2.0));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = sqrt((-2.0 * (U * (pow(l, 2.0) * (n * fma(2.0, (1.0 / Om), ((n * (U - U_42_)) / pow(Om, 2.0))))))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(U * Float64(sqrt(Float64(Float64(n * t) / U)) * sqrt(2.0))); elseif (t_1 <= Inf) tmp = t_1; else tmp = sqrt(Float64(-2.0 * Float64(U * Float64((l ^ 2.0) * Float64(n * fma(2.0, Float64(1.0 / Om), Float64(Float64(n * Float64(U - U_42_)) / (Om ^ 2.0)))))))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(U * N[(N[Sqrt[N[(N[(n * t), $MachinePrecision] / U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[Sqrt[N[(-2.0 * N[(U * N[(N[Power[l, 2.0], $MachinePrecision] * N[(n * N[(2.0 * N[(1.0 / Om), $MachinePrecision] + N[(N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;U \cdot \left(\sqrt{\frac{n \cdot t}{U}} \cdot \sqrt{2}\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(n \cdot \mathsf{fma}\left(2, \frac{1}{Om}, \frac{n \cdot \left(U - U*\right)}{{Om}^{2}}\right)\right)\right)\right)}\\
\end{array}
\end{array}
if (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 0.0Initial program 50.5%
Taylor expanded in Om around inf
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites32.2%
Taylor expanded in U around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites16.5%
Taylor expanded in n around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites15.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift-sqrt.f6418.6
Applied rewrites18.6%
if 0.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < +inf.0Initial program 50.5%
if +inf.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) Initial program 50.5%
Taylor expanded in l around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f64N/A
lower-pow.f6420.0
Applied rewrites20.0%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))))
(if (<= t_1 0.0)
(* U (* (sqrt (/ (* n t) U)) (sqrt 2.0)))
(if (<= t_1 INFINITY)
t_1
(sqrt
(*
(pow l 2.0)
(*
n
(fma
-4.0
(/ U Om)
(* -2.0 (/ (* U (* n (- U U*))) (pow Om 2.0)))))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_1 <= 0.0) {
tmp = U * (sqrt(((n * t) / U)) * sqrt(2.0));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = sqrt((pow(l, 2.0) * (n * fma(-4.0, (U / Om), (-2.0 * ((U * (n * (U - U_42_))) / pow(Om, 2.0)))))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(U * Float64(sqrt(Float64(Float64(n * t) / U)) * sqrt(2.0))); elseif (t_1 <= Inf) tmp = t_1; else tmp = sqrt(Float64((l ^ 2.0) * Float64(n * fma(-4.0, Float64(U / Om), Float64(-2.0 * Float64(Float64(U * Float64(n * Float64(U - U_42_))) / (Om ^ 2.0))))))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(U * N[(N[Sqrt[N[(N[(n * t), $MachinePrecision] / U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[Sqrt[N[(N[Power[l, 2.0], $MachinePrecision] * N[(n * N[(-4.0 * N[(U / Om), $MachinePrecision] + N[(-2.0 * N[(N[(U * N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;U \cdot \left(\sqrt{\frac{n \cdot t}{U}} \cdot \sqrt{2}\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{{\ell}^{2} \cdot \left(n \cdot \mathsf{fma}\left(-4, \frac{U}{Om}, -2 \cdot \frac{U \cdot \left(n \cdot \left(U - U*\right)\right)}{{Om}^{2}}\right)\right)}\\
\end{array}
\end{array}
if (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 0.0Initial program 50.5%
Taylor expanded in Om around inf
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites32.2%
Taylor expanded in U around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites16.5%
Taylor expanded in n around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites15.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift-sqrt.f6418.6
Applied rewrites18.6%
if 0.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < +inf.0Initial program 50.5%
if +inf.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) Initial program 50.5%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift--.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
Applied rewrites38.6%
Taylor expanded in l around inf
lower-*.f64N/A
lift-pow.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-pow.f6419.1
Applied rewrites19.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_1 0.0)
(* U (* (sqrt (/ (* n t) U)) (sqrt 2.0)))
(if (<= t_1 INFINITY)
(sqrt t_1)
(sqrt (* n (* 2.0 (/ (* U (* U* (* (pow l 2.0) n))) (pow Om 2.0)))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_1 <= 0.0) {
tmp = U * (sqrt(((n * t) / U)) * sqrt(2.0));
} else if (t_1 <= ((double) INFINITY)) {
tmp = sqrt(t_1);
} else {
tmp = sqrt((n * (2.0 * ((U * (U_42_ * (pow(l, 2.0) * n))) / 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 = ((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 = U * (Math.sqrt(((n * t) / U)) * Math.sqrt(2.0));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt(t_1);
} else {
tmp = Math.sqrt((n * (2.0 * ((U * (U_42_ * (Math.pow(l, 2.0) * n))) / Math.pow(Om, 2.0)))));
}
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 = U * (math.sqrt(((n * t) / U)) * math.sqrt(2.0)) elif t_1 <= math.inf: tmp = math.sqrt(t_1) else: tmp = math.sqrt((n * (2.0 * ((U * (U_42_ * (math.pow(l, 2.0) * n))) / math.pow(Om, 2.0))))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(U * Float64(sqrt(Float64(Float64(n * t) / U)) * sqrt(2.0))); elseif (t_1 <= Inf) tmp = sqrt(t_1); else tmp = sqrt(Float64(n * Float64(2.0 * Float64(Float64(U * Float64(U_42_ * Float64((l ^ 2.0) * n))) / (Om ^ 2.0))))); 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 = U * (sqrt(((n * t) / U)) * sqrt(2.0)); elseif (t_1 <= Inf) tmp = sqrt(t_1); else tmp = sqrt((n * (2.0 * ((U * (U_42_ * ((l ^ 2.0) * n))) / (Om ^ 2.0))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(U * N[(N[Sqrt[N[(N[(n * t), $MachinePrecision] / U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[Sqrt[t$95$1], $MachinePrecision], N[Sqrt[N[(n * N[(2.0 * N[(N[(U * N[(U$42$ * N[(N[Power[l, 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;U \cdot \left(\sqrt{\frac{n \cdot t}{U}} \cdot \sqrt{2}\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\sqrt{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{n \cdot \left(2 \cdot \frac{U \cdot \left(U* \cdot \left({\ell}^{2} \cdot n\right)\right)}{{Om}^{2}}\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 50.5%
Taylor expanded in Om around inf
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites32.2%
Taylor expanded in U around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites16.5%
Taylor expanded in n around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites15.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift-sqrt.f6418.6
Applied rewrites18.6%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 50.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.5%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift--.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
Applied rewrites38.6%
Taylor expanded in U* around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
lift-pow.f6416.6
Applied rewrites16.6%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U)))
(if (<=
(sqrt
(*
t_1
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))
5e-154)
(* U (* (sqrt (/ (* n t) U)) (sqrt 2.0)))
(sqrt
(*
t_1
(+ t (* -1.0 (/ (* (pow l 2.0) (+ 2.0 (/ (* n (- U U*)) Om))) Om))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double tmp;
if (sqrt((t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_))))) <= 5e-154) {
tmp = U * (sqrt(((n * t) / U)) * sqrt(2.0));
} else {
tmp = sqrt((t_1 * (t + (-1.0 * ((pow(l, 2.0) * (2.0 + ((n * (U - U_42_)) / Om))) / 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
if (sqrt((t_1 * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42))))) <= 5d-154) then
tmp = u * (sqrt(((n * t) / u)) * sqrt(2.0d0))
else
tmp = sqrt((t_1 * (t + ((-1.0d0) * (((l ** 2.0d0) * (2.0d0 + ((n * (u - u_42)) / om))) / 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;
double tmp;
if (Math.sqrt((t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_))))) <= 5e-154) {
tmp = U * (Math.sqrt(((n * t) / U)) * Math.sqrt(2.0));
} else {
tmp = Math.sqrt((t_1 * (t + (-1.0 * ((Math.pow(l, 2.0) * (2.0 + ((n * (U - U_42_)) / Om))) / Om)))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = (2.0 * n) * U tmp = 0 if math.sqrt((t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))))) <= 5e-154: tmp = U * (math.sqrt(((n * t) / U)) * math.sqrt(2.0)) else: tmp = math.sqrt((t_1 * (t + (-1.0 * ((math.pow(l, 2.0) * (2.0 + ((n * (U - U_42_)) / Om))) / Om))))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) tmp = 0.0 if (sqrt(Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) <= 5e-154) tmp = Float64(U * Float64(sqrt(Float64(Float64(n * t) / U)) * sqrt(2.0))); else tmp = sqrt(Float64(t_1 * Float64(t + Float64(-1.0 * Float64(Float64((l ^ 2.0) * Float64(2.0 + Float64(Float64(n * Float64(U - U_42_)) / Om))) / Om))))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (2.0 * n) * U; tmp = 0.0; if (sqrt((t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))) <= 5e-154) tmp = U * (sqrt(((n * t) / U)) * sqrt(2.0)); else tmp = sqrt((t_1 * (t + (-1.0 * (((l ^ 2.0) * (2.0 + ((n * (U - U_42_)) / Om))) / Om))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, If[LessEqual[N[Sqrt[N[(t$95$1 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 5e-154], N[(U * N[(N[Sqrt[N[(N[(n * t), $MachinePrecision] / U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(t$95$1 * N[(t + N[(-1.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] * N[(2.0 + N[(N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
\mathbf{if}\;\sqrt{t\_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \leq 5 \cdot 10^{-154}:\\
\;\;\;\;U \cdot \left(\sqrt{\frac{n \cdot t}{U}} \cdot \sqrt{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(t + -1 \cdot \frac{{\ell}^{2} \cdot \left(2 + \frac{n \cdot \left(U - U*\right)}{Om}\right)}{Om}\right)}\\
\end{array}
\end{array}
if (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 5.0000000000000002e-154Initial program 50.5%
Taylor expanded in Om around inf
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites32.2%
Taylor expanded in U around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites16.5%
Taylor expanded in n around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites15.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift-sqrt.f6418.6
Applied rewrites18.6%
if 5.0000000000000002e-154 < (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.5%
Taylor expanded in Om around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift--.f64N/A
lower-*.f64N/A
lower-pow.f6445.7
Applied rewrites45.7%
Taylor expanded in l around 0
lower-*.f64N/A
lift-pow.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lift-*.f6450.5
Applied rewrites50.5%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2
(*
t_1
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_2 0.0)
(* U (* (sqrt (/ (* n t) U)) (sqrt 2.0)))
(if (<= t_2 5e+229)
(sqrt
(* t_1 (+ t (* -1.0 (/ (* (pow l 2.0) (+ 2.0 (/ (* U n) Om))) Om)))))
(sqrt
(*
t_1
(+ t (* -1.0 (/ (/ (* (pow l 2.0) (* n (- U U*))) Om) Om)))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 0.0) {
tmp = U * (sqrt(((n * t) / U)) * sqrt(2.0));
} else if (t_2 <= 5e+229) {
tmp = sqrt((t_1 * (t + (-1.0 * ((pow(l, 2.0) * (2.0 + ((U * n) / Om))) / Om)))));
} else {
tmp = sqrt((t_1 * (t + (-1.0 * (((pow(l, 2.0) * (n * (U - U_42_))) / Om) / 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) :: t_2
real(8) :: tmp
t_1 = (2.0d0 * n) * u
t_2 = t_1 * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))
if (t_2 <= 0.0d0) then
tmp = u * (sqrt(((n * t) / u)) * sqrt(2.0d0))
else if (t_2 <= 5d+229) then
tmp = sqrt((t_1 * (t + ((-1.0d0) * (((l ** 2.0d0) * (2.0d0 + ((u * n) / om))) / om)))))
else
tmp = sqrt((t_1 * (t + ((-1.0d0) * ((((l ** 2.0d0) * (n * (u - u_42))) / om) / 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;
double t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 0.0) {
tmp = U * (Math.sqrt(((n * t) / U)) * Math.sqrt(2.0));
} else if (t_2 <= 5e+229) {
tmp = Math.sqrt((t_1 * (t + (-1.0 * ((Math.pow(l, 2.0) * (2.0 + ((U * n) / Om))) / Om)))));
} else {
tmp = Math.sqrt((t_1 * (t + (-1.0 * (((Math.pow(l, 2.0) * (n * (U - U_42_))) / Om) / Om)))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = (2.0 * n) * U t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))) tmp = 0 if t_2 <= 0.0: tmp = U * (math.sqrt(((n * t) / U)) * math.sqrt(2.0)) elif t_2 <= 5e+229: tmp = math.sqrt((t_1 * (t + (-1.0 * ((math.pow(l, 2.0) * (2.0 + ((U * n) / Om))) / Om))))) else: tmp = math.sqrt((t_1 * (t + (-1.0 * (((math.pow(l, 2.0) * (n * (U - U_42_))) / Om) / Om))))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) t_2 = Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_2 <= 0.0) tmp = Float64(U * Float64(sqrt(Float64(Float64(n * t) / U)) * sqrt(2.0))); elseif (t_2 <= 5e+229) tmp = sqrt(Float64(t_1 * Float64(t + Float64(-1.0 * Float64(Float64((l ^ 2.0) * Float64(2.0 + Float64(Float64(U * n) / Om))) / Om))))); else tmp = sqrt(Float64(t_1 * Float64(t + Float64(-1.0 * Float64(Float64(Float64((l ^ 2.0) * Float64(n * Float64(U - U_42_))) / Om) / Om))))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (2.0 * n) * U; t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))); tmp = 0.0; if (t_2 <= 0.0) tmp = U * (sqrt(((n * t) / U)) * sqrt(2.0)); elseif (t_2 <= 5e+229) tmp = sqrt((t_1 * (t + (-1.0 * (((l ^ 2.0) * (2.0 + ((U * n) / Om))) / Om))))); else tmp = sqrt((t_1 * (t + (-1.0 * ((((l ^ 2.0) * (n * (U - U_42_))) / Om) / Om))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[(U * N[(N[Sqrt[N[(N[(n * t), $MachinePrecision] / U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+229], N[Sqrt[N[(t$95$1 * N[(t + N[(-1.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] * N[(2.0 + N[(N[(U * n), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(t$95$1 * N[(t + N[(-1.0 * N[(N[(N[(N[Power[l, 2.0], $MachinePrecision] * N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := t\_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;U \cdot \left(\sqrt{\frac{n \cdot t}{U}} \cdot \sqrt{2}\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+229}:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(t + -1 \cdot \frac{{\ell}^{2} \cdot \left(2 + \frac{U \cdot n}{Om}\right)}{Om}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(t + -1 \cdot \frac{\frac{{\ell}^{2} \cdot \left(n \cdot \left(U - U*\right)\right)}{Om}}{Om}\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 50.5%
Taylor expanded in Om around inf
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites32.2%
Taylor expanded in U around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites16.5%
Taylor expanded in n around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites15.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift-sqrt.f6418.6
Applied rewrites18.6%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 5.0000000000000005e229Initial program 50.5%
Taylor expanded in Om around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift--.f64N/A
lower-*.f64N/A
lower-pow.f6445.7
Applied rewrites45.7%
Taylor expanded in l around 0
lower-*.f64N/A
lift-pow.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lift-*.f6450.5
Applied rewrites50.5%
Taylor expanded in U around inf
lower-*.f6438.1
Applied rewrites38.1%
if 5.0000000000000005e229 < (*.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.5%
Taylor expanded in Om around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift--.f64N/A
lower-*.f64N/A
lower-pow.f6445.7
Applied rewrites45.7%
Taylor expanded in l around 0
lower-*.f64N/A
lift-pow.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lift-*.f6450.5
Applied rewrites50.5%
Taylor expanded in n around inf
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
lift--.f64N/A
lift-*.f6445.1
Applied rewrites45.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (- t (* 2.0 (/ (pow l 2.0) Om)))))
(if (<= Om -37000000.0)
(sqrt (* 2.0 (* U (* n t_1))))
(if (<= Om 1.85e-121)
(sqrt
(*
(* (* 2.0 n) U)
(+ t (* -1.0 (/ (/ (* (pow l 2.0) (* n (- U U*))) Om) Om)))))
(sqrt (* n (* 2.0 (* U t_1))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = t - (2.0 * (pow(l, 2.0) / Om));
double tmp;
if (Om <= -37000000.0) {
tmp = sqrt((2.0 * (U * (n * t_1))));
} else if (Om <= 1.85e-121) {
tmp = sqrt((((2.0 * n) * U) * (t + (-1.0 * (((pow(l, 2.0) * (n * (U - U_42_))) / Om) / Om)))));
} else {
tmp = sqrt((n * (2.0 * (U * t_1))));
}
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 - (2.0d0 * ((l ** 2.0d0) / om))
if (om <= (-37000000.0d0)) then
tmp = sqrt((2.0d0 * (u * (n * t_1))))
else if (om <= 1.85d-121) then
tmp = sqrt((((2.0d0 * n) * u) * (t + ((-1.0d0) * ((((l ** 2.0d0) * (n * (u - u_42))) / om) / om)))))
else
tmp = sqrt((n * (2.0d0 * (u * t_1))))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = t - (2.0 * (Math.pow(l, 2.0) / Om));
double tmp;
if (Om <= -37000000.0) {
tmp = Math.sqrt((2.0 * (U * (n * t_1))));
} else if (Om <= 1.85e-121) {
tmp = Math.sqrt((((2.0 * n) * U) * (t + (-1.0 * (((Math.pow(l, 2.0) * (n * (U - U_42_))) / Om) / Om)))));
} else {
tmp = Math.sqrt((n * (2.0 * (U * t_1))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = t - (2.0 * (math.pow(l, 2.0) / Om)) tmp = 0 if Om <= -37000000.0: tmp = math.sqrt((2.0 * (U * (n * t_1)))) elif Om <= 1.85e-121: tmp = math.sqrt((((2.0 * n) * U) * (t + (-1.0 * (((math.pow(l, 2.0) * (n * (U - U_42_))) / Om) / Om))))) else: tmp = math.sqrt((n * (2.0 * (U * t_1)))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(t - Float64(2.0 * Float64((l ^ 2.0) / Om))) tmp = 0.0 if (Om <= -37000000.0) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t_1)))); elseif (Om <= 1.85e-121) tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(t + Float64(-1.0 * Float64(Float64(Float64((l ^ 2.0) * Float64(n * Float64(U - U_42_))) / Om) / Om))))); else tmp = sqrt(Float64(n * Float64(2.0 * Float64(U * t_1)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = t - (2.0 * ((l ^ 2.0) / Om)); tmp = 0.0; if (Om <= -37000000.0) tmp = sqrt((2.0 * (U * (n * t_1)))); elseif (Om <= 1.85e-121) tmp = sqrt((((2.0 * n) * U) * (t + (-1.0 * ((((l ^ 2.0) * (n * (U - U_42_))) / Om) / Om))))); else tmp = sqrt((n * (2.0 * (U * t_1)))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(t - N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Om, -37000000.0], N[Sqrt[N[(2.0 * N[(U * N[(n * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[Om, 1.85e-121], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(t + N[(-1.0 * N[(N[(N[(N[Power[l, 2.0], $MachinePrecision] * N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(n * N[(2.0 * N[(U * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - 2 \cdot \frac{{\ell}^{2}}{Om}\\
\mathbf{if}\;Om \leq -37000000:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\_1\right)\right)}\\
\mathbf{elif}\;Om \leq 1.85 \cdot 10^{-121}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + -1 \cdot \frac{\frac{{\ell}^{2} \cdot \left(n \cdot \left(U - U*\right)\right)}{Om}}{Om}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{n \cdot \left(2 \cdot \left(U \cdot t\_1\right)\right)}\\
\end{array}
\end{array}
if Om < -3.7e7Initial program 50.5%
Taylor expanded in n around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
if -3.7e7 < Om < 1.8500000000000001e-121Initial program 50.5%
Taylor expanded in Om around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift--.f64N/A
lower-*.f64N/A
lower-pow.f6445.7
Applied rewrites45.7%
Taylor expanded in l around 0
lower-*.f64N/A
lift-pow.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift--.f64N/A
lift-*.f6450.5
Applied rewrites50.5%
Taylor expanded in n around inf
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
lift--.f64N/A
lift-*.f6445.1
Applied rewrites45.1%
if 1.8500000000000001e-121 < Om Initial program 50.5%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift--.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
Applied rewrites38.6%
Taylor expanded in n around 0
lift-pow.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6443.6
Applied rewrites43.6%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2
(*
t_1
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_2 0.0)
(* U (* (sqrt (/ (* n t) U)) (sqrt 2.0)))
(if (<= t_2 2e+302)
(sqrt (* t_1 (- t (* 2.0 (/ (pow l 2.0) Om)))))
(* (/ (* l (* n (sqrt 2.0))) Om) (sqrt (* U U*)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 0.0) {
tmp = U * (sqrt(((n * t) / U)) * sqrt(2.0));
} else if (t_2 <= 2e+302) {
tmp = sqrt((t_1 * (t - (2.0 * (pow(l, 2.0) / Om)))));
} else {
tmp = ((l * (n * sqrt(2.0))) / Om) * sqrt((U * U_42_));
}
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 = (2.0d0 * n) * u
t_2 = t_1 * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))
if (t_2 <= 0.0d0) then
tmp = u * (sqrt(((n * t) / u)) * sqrt(2.0d0))
else if (t_2 <= 2d+302) then
tmp = sqrt((t_1 * (t - (2.0d0 * ((l ** 2.0d0) / om)))))
else
tmp = ((l * (n * sqrt(2.0d0))) / om) * sqrt((u * u_42))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 0.0) {
tmp = U * (Math.sqrt(((n * t) / U)) * Math.sqrt(2.0));
} else if (t_2 <= 2e+302) {
tmp = Math.sqrt((t_1 * (t - (2.0 * (Math.pow(l, 2.0) / Om)))));
} else {
tmp = ((l * (n * Math.sqrt(2.0))) / Om) * Math.sqrt((U * U_42_));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = (2.0 * n) * U t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))) tmp = 0 if t_2 <= 0.0: tmp = U * (math.sqrt(((n * t) / U)) * math.sqrt(2.0)) elif t_2 <= 2e+302: tmp = math.sqrt((t_1 * (t - (2.0 * (math.pow(l, 2.0) / Om))))) else: tmp = ((l * (n * math.sqrt(2.0))) / Om) * math.sqrt((U * U_42_)) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) t_2 = Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_2 <= 0.0) tmp = Float64(U * Float64(sqrt(Float64(Float64(n * t) / U)) * sqrt(2.0))); elseif (t_2 <= 2e+302) tmp = sqrt(Float64(t_1 * Float64(t - Float64(2.0 * Float64((l ^ 2.0) / Om))))); else tmp = Float64(Float64(Float64(l * Float64(n * sqrt(2.0))) / Om) * sqrt(Float64(U * U_42_))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (2.0 * n) * U; t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))); tmp = 0.0; if (t_2 <= 0.0) tmp = U * (sqrt(((n * t) / U)) * sqrt(2.0)); elseif (t_2 <= 2e+302) tmp = sqrt((t_1 * (t - (2.0 * ((l ^ 2.0) / Om))))); else tmp = ((l * (n * sqrt(2.0))) / Om) * sqrt((U * U_42_)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[(U * N[(N[Sqrt[N[(N[(n * t), $MachinePrecision] / U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+302], N[Sqrt[N[(t$95$1 * N[(t - N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(l * N[(n * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] * N[Sqrt[N[(U * U$42$), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := t\_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;U \cdot \left(\sqrt{\frac{n \cdot t}{U}} \cdot \sqrt{2}\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+302}:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \left(n \cdot \sqrt{2}\right)}{Om} \cdot \sqrt{U \cdot U*}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 50.5%
Taylor expanded in Om around inf
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites32.2%
Taylor expanded in U around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites16.5%
Taylor expanded in n around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites15.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift-sqrt.f6418.6
Applied rewrites18.6%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 2.0000000000000002e302Initial program 50.5%
Taylor expanded in n around 0
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6443.8
Applied rewrites43.8%
if 2.0000000000000002e302 < (*.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.5%
Taylor expanded in U* around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f6414.3
Applied rewrites14.3%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (- t (* 2.0 (/ (pow l 2.0) Om)))))
(if (<= Om -1.7e-305)
(sqrt (* 2.0 (* U (* n t_1))))
(if (<= Om 6.8e-127)
(* (/ (* l (* n (sqrt 2.0))) Om) (sqrt (* U U*)))
(sqrt (* n (* 2.0 (* U t_1))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = t - (2.0 * (pow(l, 2.0) / Om));
double tmp;
if (Om <= -1.7e-305) {
tmp = sqrt((2.0 * (U * (n * t_1))));
} else if (Om <= 6.8e-127) {
tmp = ((l * (n * sqrt(2.0))) / Om) * sqrt((U * U_42_));
} else {
tmp = sqrt((n * (2.0 * (U * t_1))));
}
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 - (2.0d0 * ((l ** 2.0d0) / om))
if (om <= (-1.7d-305)) then
tmp = sqrt((2.0d0 * (u * (n * t_1))))
else if (om <= 6.8d-127) then
tmp = ((l * (n * sqrt(2.0d0))) / om) * sqrt((u * u_42))
else
tmp = sqrt((n * (2.0d0 * (u * t_1))))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = t - (2.0 * (Math.pow(l, 2.0) / Om));
double tmp;
if (Om <= -1.7e-305) {
tmp = Math.sqrt((2.0 * (U * (n * t_1))));
} else if (Om <= 6.8e-127) {
tmp = ((l * (n * Math.sqrt(2.0))) / Om) * Math.sqrt((U * U_42_));
} else {
tmp = Math.sqrt((n * (2.0 * (U * t_1))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = t - (2.0 * (math.pow(l, 2.0) / Om)) tmp = 0 if Om <= -1.7e-305: tmp = math.sqrt((2.0 * (U * (n * t_1)))) elif Om <= 6.8e-127: tmp = ((l * (n * math.sqrt(2.0))) / Om) * math.sqrt((U * U_42_)) else: tmp = math.sqrt((n * (2.0 * (U * t_1)))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(t - Float64(2.0 * Float64((l ^ 2.0) / Om))) tmp = 0.0 if (Om <= -1.7e-305) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t_1)))); elseif (Om <= 6.8e-127) tmp = Float64(Float64(Float64(l * Float64(n * sqrt(2.0))) / Om) * sqrt(Float64(U * U_42_))); else tmp = sqrt(Float64(n * Float64(2.0 * Float64(U * t_1)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = t - (2.0 * ((l ^ 2.0) / Om)); tmp = 0.0; if (Om <= -1.7e-305) tmp = sqrt((2.0 * (U * (n * t_1)))); elseif (Om <= 6.8e-127) tmp = ((l * (n * sqrt(2.0))) / Om) * sqrt((U * U_42_)); else tmp = sqrt((n * (2.0 * (U * t_1)))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(t - N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Om, -1.7e-305], N[Sqrt[N[(2.0 * N[(U * N[(n * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[Om, 6.8e-127], N[(N[(N[(l * N[(n * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] * N[Sqrt[N[(U * U$42$), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(n * N[(2.0 * N[(U * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - 2 \cdot \frac{{\ell}^{2}}{Om}\\
\mathbf{if}\;Om \leq -1.7 \cdot 10^{-305}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\_1\right)\right)}\\
\mathbf{elif}\;Om \leq 6.8 \cdot 10^{-127}:\\
\;\;\;\;\frac{\ell \cdot \left(n \cdot \sqrt{2}\right)}{Om} \cdot \sqrt{U \cdot U*}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{n \cdot \left(2 \cdot \left(U \cdot t\_1\right)\right)}\\
\end{array}
\end{array}
if Om < -1.7e-305Initial program 50.5%
Taylor expanded in n around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
if -1.7e-305 < Om < 6.7999999999999997e-127Initial program 50.5%
Taylor expanded in U* around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f6414.3
Applied rewrites14.3%
if 6.7999999999999997e-127 < Om Initial program 50.5%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift--.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
Applied rewrites38.6%
Taylor expanded in n around 0
lift-pow.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6443.6
Applied rewrites43.6%
(FPCore (n U t l Om U*)
:precision binary64
(if (<=
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))
INFINITY)
(sqrt (* 2.0 (* U (* n (- t (* 2.0 (/ (pow l 2.0) Om)))))))
(* (/ (* l (* n (sqrt 2.0))) Om) (sqrt (* U U*)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if ((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))) <= ((double) INFINITY)) {
tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (pow(l, 2.0) / Om)))))));
} else {
tmp = ((l * (n * sqrt(2.0))) / Om) * sqrt((U * U_42_));
}
return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if ((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))) <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * (Math.pow(l, 2.0) / Om)))))));
} else {
tmp = ((l * (n * Math.sqrt(2.0))) / Om) * Math.sqrt((U * U_42_));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if (((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))) <= math.inf: tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * (math.pow(l, 2.0) / Om))))))) else: tmp = ((l * (n * math.sqrt(2.0))) / Om) * math.sqrt((U * U_42_)) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) <= Inf) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64((l ^ 2.0) / Om))))))); else tmp = Float64(Float64(Float64(l * Float64(n * sqrt(2.0))) / Om) * sqrt(Float64(U * U_42_))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if ((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_)))) <= Inf) tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l ^ 2.0) / Om))))))); else tmp = ((l * (n * sqrt(2.0))) / Om) * sqrt((U * U_42_)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(l * N[(n * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] * N[Sqrt[N[(U * U$42$), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right) \leq \infty:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \left(n \cdot \sqrt{2}\right)}{Om} \cdot \sqrt{U \cdot U*}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 50.5%
Taylor expanded in n around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
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.5%
Taylor expanded in U* around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f6414.3
Applied rewrites14.3%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2
(*
t_1
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_2 0.0)
(* U (* (sqrt (/ (* n t) U)) (sqrt 2.0)))
(if (<= t_2 2e+302)
(sqrt (* t_1 (* t 1.0)))
(* (/ (* l (* n (sqrt 2.0))) Om) (sqrt (* U U*)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 0.0) {
tmp = U * (sqrt(((n * t) / U)) * sqrt(2.0));
} else if (t_2 <= 2e+302) {
tmp = sqrt((t_1 * (t * 1.0)));
} else {
tmp = ((l * (n * sqrt(2.0))) / Om) * sqrt((U * U_42_));
}
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 = (2.0d0 * n) * u
t_2 = t_1 * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))
if (t_2 <= 0.0d0) then
tmp = u * (sqrt(((n * t) / u)) * sqrt(2.0d0))
else if (t_2 <= 2d+302) then
tmp = sqrt((t_1 * (t * 1.0d0)))
else
tmp = ((l * (n * sqrt(2.0d0))) / om) * sqrt((u * u_42))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 0.0) {
tmp = U * (Math.sqrt(((n * t) / U)) * Math.sqrt(2.0));
} else if (t_2 <= 2e+302) {
tmp = Math.sqrt((t_1 * (t * 1.0)));
} else {
tmp = ((l * (n * Math.sqrt(2.0))) / Om) * Math.sqrt((U * U_42_));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = (2.0 * n) * U t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))) tmp = 0 if t_2 <= 0.0: tmp = U * (math.sqrt(((n * t) / U)) * math.sqrt(2.0)) elif t_2 <= 2e+302: tmp = math.sqrt((t_1 * (t * 1.0))) else: tmp = ((l * (n * math.sqrt(2.0))) / Om) * math.sqrt((U * U_42_)) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) t_2 = Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_2 <= 0.0) tmp = Float64(U * Float64(sqrt(Float64(Float64(n * t) / U)) * sqrt(2.0))); elseif (t_2 <= 2e+302) tmp = sqrt(Float64(t_1 * Float64(t * 1.0))); else tmp = Float64(Float64(Float64(l * Float64(n * sqrt(2.0))) / Om) * sqrt(Float64(U * U_42_))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (2.0 * n) * U; t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))); tmp = 0.0; if (t_2 <= 0.0) tmp = U * (sqrt(((n * t) / U)) * sqrt(2.0)); elseif (t_2 <= 2e+302) tmp = sqrt((t_1 * (t * 1.0))); else tmp = ((l * (n * sqrt(2.0))) / Om) * sqrt((U * U_42_)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[(U * N[(N[Sqrt[N[(N[(n * t), $MachinePrecision] / U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+302], N[Sqrt[N[(t$95$1 * N[(t * 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(l * N[(n * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] * N[Sqrt[N[(U * U$42$), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := t\_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;U \cdot \left(\sqrt{\frac{n \cdot t}{U}} \cdot \sqrt{2}\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+302}:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(t \cdot 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \left(n \cdot \sqrt{2}\right)}{Om} \cdot \sqrt{U \cdot U*}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 50.5%
Taylor expanded in Om around inf
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites32.2%
Taylor expanded in U around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites16.5%
Taylor expanded in n around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites15.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift-sqrt.f6418.6
Applied rewrites18.6%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 2.0000000000000002e302Initial program 50.5%
Taylor expanded in n around 0
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6443.8
Applied rewrites43.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-pow.f64N/A
lower-*.f6442.4
Applied rewrites42.4%
Taylor expanded in t around inf
Applied rewrites36.5%
if 2.0000000000000002e302 < (*.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.5%
Taylor expanded in U* around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f6414.3
Applied rewrites14.3%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2
(*
t_1
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_2 0.0)
(* U (* (sqrt (/ (* n t) U)) (sqrt 2.0)))
(if (<= t_2 1e+266)
(sqrt (* t_1 (* t 1.0)))
(sqrt (* 2.0 (* U (* n t))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 0.0) {
tmp = U * (sqrt(((n * t) / U)) * sqrt(2.0));
} else if (t_2 <= 1e+266) {
tmp = sqrt((t_1 * (t * 1.0)));
} else {
tmp = sqrt((2.0 * (U * (n * t))));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (2.0d0 * n) * u
t_2 = t_1 * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))
if (t_2 <= 0.0d0) then
tmp = u * (sqrt(((n * t) / u)) * sqrt(2.0d0))
else if (t_2 <= 1d+266) then
tmp = sqrt((t_1 * (t * 1.0d0)))
else
tmp = sqrt((2.0d0 * (u * (n * t))))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 0.0) {
tmp = U * (Math.sqrt(((n * t) / U)) * Math.sqrt(2.0));
} else if (t_2 <= 1e+266) {
tmp = Math.sqrt((t_1 * (t * 1.0)));
} else {
tmp = Math.sqrt((2.0 * (U * (n * t))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = (2.0 * n) * U t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))) tmp = 0 if t_2 <= 0.0: tmp = U * (math.sqrt(((n * t) / U)) * math.sqrt(2.0)) elif t_2 <= 1e+266: tmp = math.sqrt((t_1 * (t * 1.0))) else: tmp = math.sqrt((2.0 * (U * (n * t)))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) t_2 = Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_2 <= 0.0) tmp = Float64(U * Float64(sqrt(Float64(Float64(n * t) / U)) * sqrt(2.0))); elseif (t_2 <= 1e+266) tmp = sqrt(Float64(t_1 * Float64(t * 1.0))); else tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (2.0 * n) * U; t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))); tmp = 0.0; if (t_2 <= 0.0) tmp = U * (sqrt(((n * t) / U)) * sqrt(2.0)); elseif (t_2 <= 1e+266) tmp = sqrt((t_1 * (t * 1.0))); else tmp = sqrt((2.0 * (U * (n * t)))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[(U * N[(N[Sqrt[N[(N[(n * t), $MachinePrecision] / U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+266], N[Sqrt[N[(t$95$1 * N[(t * 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := t\_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;U \cdot \left(\sqrt{\frac{n \cdot t}{U}} \cdot \sqrt{2}\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+266}:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(t \cdot 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 50.5%
Taylor expanded in Om around inf
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites32.2%
Taylor expanded in U around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites16.5%
Taylor expanded in n around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites15.0%
Taylor expanded in t around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lift-sqrt.f6418.6
Applied rewrites18.6%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1e266Initial program 50.5%
Taylor expanded in n around 0
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6443.8
Applied rewrites43.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-pow.f64N/A
lower-*.f6442.4
Applied rewrites42.4%
Taylor expanded in t around inf
Applied rewrites36.5%
if 1e266 < (*.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.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.1
Applied rewrites36.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2
(*
t_1
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_2 0.0)
(sqrt (* n (* 2.0 (* U t))))
(if (<= t_2 1e+266)
(sqrt (* t_1 (* t 1.0)))
(sqrt (* 2.0 (* U (* n t))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 0.0) {
tmp = sqrt((n * (2.0 * (U * t))));
} else if (t_2 <= 1e+266) {
tmp = sqrt((t_1 * (t * 1.0)));
} else {
tmp = sqrt((2.0 * (U * (n * t))));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (2.0d0 * n) * u
t_2 = t_1 * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))
if (t_2 <= 0.0d0) then
tmp = sqrt((n * (2.0d0 * (u * t))))
else if (t_2 <= 1d+266) then
tmp = sqrt((t_1 * (t * 1.0d0)))
else
tmp = sqrt((2.0d0 * (u * (n * t))))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 0.0) {
tmp = Math.sqrt((n * (2.0 * (U * t))));
} else if (t_2 <= 1e+266) {
tmp = Math.sqrt((t_1 * (t * 1.0)));
} else {
tmp = Math.sqrt((2.0 * (U * (n * t))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = (2.0 * n) * U t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))) tmp = 0 if t_2 <= 0.0: tmp = math.sqrt((n * (2.0 * (U * t)))) elif t_2 <= 1e+266: tmp = math.sqrt((t_1 * (t * 1.0))) else: tmp = math.sqrt((2.0 * (U * (n * t)))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) t_2 = Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_2 <= 0.0) tmp = sqrt(Float64(n * Float64(2.0 * Float64(U * t)))); elseif (t_2 <= 1e+266) tmp = sqrt(Float64(t_1 * Float64(t * 1.0))); else tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (2.0 * n) * U; t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))); tmp = 0.0; if (t_2 <= 0.0) tmp = sqrt((n * (2.0 * (U * t)))); elseif (t_2 <= 1e+266) tmp = sqrt((t_1 * (t * 1.0))); else tmp = sqrt((2.0 * (U * (n * t)))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[Sqrt[N[(n * N[(2.0 * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, 1e+266], N[Sqrt[N[(t$95$1 * N[(t * 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := t\_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;\sqrt{n \cdot \left(2 \cdot \left(U \cdot t\right)\right)}\\
\mathbf{elif}\;t\_2 \leq 10^{+266}:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(t \cdot 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 50.5%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift--.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
Applied rewrites38.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1e266Initial program 50.5%
Taylor expanded in n around 0
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f6443.8
Applied rewrites43.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-pow.f64N/A
lower-*.f6442.4
Applied rewrites42.4%
Taylor expanded in t around inf
Applied rewrites36.5%
if 1e266 < (*.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.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.1
Applied rewrites36.1%
(FPCore (n U t l Om U*) :precision binary64 (if (<= Om 8.2e+24) (sqrt (* 2.0 (* U (* n t)))) (sqrt (* n (* 2.0 (* U t))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (Om <= 8.2e+24) {
tmp = sqrt((2.0 * (U * (n * t))));
} else {
tmp = sqrt((n * (2.0 * (U * t))));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (om <= 8.2d+24) then
tmp = sqrt((2.0d0 * (u * (n * t))))
else
tmp = sqrt((n * (2.0d0 * (u * t))))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (Om <= 8.2e+24) {
tmp = Math.sqrt((2.0 * (U * (n * t))));
} else {
tmp = Math.sqrt((n * (2.0 * (U * t))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if Om <= 8.2e+24: tmp = math.sqrt((2.0 * (U * (n * t)))) else: tmp = math.sqrt((n * (2.0 * (U * t)))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (Om <= 8.2e+24) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t)))); else tmp = sqrt(Float64(n * Float64(2.0 * Float64(U * t)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (Om <= 8.2e+24) tmp = sqrt((2.0 * (U * (n * t)))); else tmp = sqrt((n * (2.0 * (U * t)))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[Om, 8.2e+24], N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(n * N[(2.0 * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;Om \leq 8.2 \cdot 10^{+24}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{n \cdot \left(2 \cdot \left(U \cdot t\right)\right)}\\
\end{array}
\end{array}
if Om < 8.2000000000000002e24Initial program 50.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.1
Applied rewrites36.1%
if 8.2000000000000002e24 < Om Initial program 50.5%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift--.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
Applied rewrites38.6%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6435.6
Applied rewrites35.6%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2.0 (* 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.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}
\end{array}
Initial program 50.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.1
Applied rewrites36.1%
herbie shell --seed 2025134
(FPCore (n U t l Om U*)
:name "Toniolo and Linder, Equation (13)"
:precision binary64
(sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))