
(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 18 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 (fma -2.0 (* l (/ l Om)) t))
(t_2 (* n (* (* (/ l Om) (/ l Om)) (- U U*)))))
(if (<= n -8.5e+44)
(sqrt (* (- t t_2) (* (+ n n) U)))
(if (<= n 3e-289)
(sqrt (* (* (* t_1 n) U) 2.0))
(* (pow (+ n n) 0.5) (pow (* U (- t_1 t_2)) 0.5))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma(-2.0, (l * (l / Om)), t);
double t_2 = n * (((l / Om) * (l / Om)) * (U - U_42_));
double tmp;
if (n <= -8.5e+44) {
tmp = sqrt(((t - t_2) * ((n + n) * U)));
} else if (n <= 3e-289) {
tmp = sqrt((((t_1 * n) * U) * 2.0));
} else {
tmp = pow((n + n), 0.5) * pow((U * (t_1 - t_2)), 0.5);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = fma(-2.0, Float64(l * Float64(l / Om)), t) t_2 = Float64(n * Float64(Float64(Float64(l / Om) * Float64(l / Om)) * Float64(U - U_42_))) tmp = 0.0 if (n <= -8.5e+44) tmp = sqrt(Float64(Float64(t - t_2) * Float64(Float64(n + n) * U))); elseif (n <= 3e-289) tmp = sqrt(Float64(Float64(Float64(t_1 * n) * U) * 2.0)); else tmp = Float64((Float64(n + n) ^ 0.5) * (Float64(U * Float64(t_1 - t_2)) ^ 0.5)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(n * N[(N[(N[(l / Om), $MachinePrecision] * N[(l / Om), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -8.5e+44], N[Sqrt[N[(N[(t - t$95$2), $MachinePrecision] * N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 3e-289], N[Sqrt[N[(N[(N[(t$95$1 * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[(N[Power[N[(n + n), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(U * N[(t$95$1 - t$95$2), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right)\\
t_2 := n \cdot \left(\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;n \leq -8.5 \cdot 10^{+44}:\\
\;\;\;\;\sqrt{\left(t - t\_2\right) \cdot \left(\left(n + n\right) \cdot U\right)}\\
\mathbf{elif}\;n \leq 3 \cdot 10^{-289}:\\
\;\;\;\;\sqrt{\left(\left(t\_1 \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;{\left(n + n\right)}^{0.5} \cdot {\left(U \cdot \left(t\_1 - t\_2\right)\right)}^{0.5}\\
\end{array}
\end{array}
if n < -8.5e44Initial program 57.3%
Applied rewrites60.3%
Taylor expanded in t around inf
Applied rewrites63.4%
if -8.5e44 < n < 2.9999999999999998e-289Initial program 45.9%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6451.4
Applied rewrites51.4%
if 2.9999999999999998e-289 < n Initial program 49.9%
Applied rewrites63.3%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (fma -2.0 (* l (/ l Om)) t))
(t_2
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_2 0.0)
(sqrt (* (* (* t_1 n) U) 2.0))
(if (<= t_2 5e+300)
(sqrt t_2)
(if (<= t_2 INFINITY)
(sqrt
(* (+ n n) (* U (- t_1 (* n (* (* (/ l Om) (/ l Om)) (- U U*)))))))
(sqrt
(*
(fma
(/ (* (* t n) U) (* l l))
2.0
(* (* (* (/ (+ 2.0 (/ (* n (- U U*)) Om)) Om) n) U) -2.0))
(* l l))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma(-2.0, (l * (l / Om)), t);
double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 0.0) {
tmp = sqrt((((t_1 * n) * U) * 2.0));
} else if (t_2 <= 5e+300) {
tmp = sqrt(t_2);
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt(((n + n) * (U * (t_1 - (n * (((l / Om) * (l / Om)) * (U - U_42_)))))));
} else {
tmp = sqrt((fma((((t * n) * U) / (l * l)), 2.0, (((((2.0 + ((n * (U - U_42_)) / Om)) / Om) * n) * U) * -2.0)) * (l * l)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = fma(-2.0, Float64(l * Float64(l / Om)), t) t_2 = 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_2 <= 0.0) tmp = sqrt(Float64(Float64(Float64(t_1 * n) * U) * 2.0)); elseif (t_2 <= 5e+300) tmp = sqrt(t_2); elseif (t_2 <= Inf) tmp = sqrt(Float64(Float64(n + n) * Float64(U * Float64(t_1 - Float64(n * Float64(Float64(Float64(l / Om) * Float64(l / Om)) * Float64(U - U_42_))))))); else tmp = sqrt(Float64(fma(Float64(Float64(Float64(t * n) * U) / Float64(l * l)), 2.0, Float64(Float64(Float64(Float64(Float64(2.0 + Float64(Float64(n * Float64(U - U_42_)) / Om)) / Om) * n) * U) * -2.0)) * Float64(l * l))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = 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$2, 0.0], N[Sqrt[N[(N[(N[(t$95$1 * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, 5e+300], N[Sqrt[t$95$2], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(n + n), $MachinePrecision] * N[(U * N[(t$95$1 - N[(n * N[(N[(N[(l / Om), $MachinePrecision] * N[(l / Om), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * 2.0 + N[(N[(N[(N[(N[(2.0 + N[(N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right)\\
t_2 := \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\_2 \leq 0:\\
\;\;\;\;\sqrt{\left(\left(t\_1 \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;\sqrt{t\_2}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(n + n\right) \cdot \left(U \cdot \left(t\_1 - n \cdot \left(\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right) \cdot \left(U - U*\right)\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\left(t \cdot n\right) \cdot U}{\ell \cdot \ell}, 2, \left(\left(\frac{2 + \frac{n \cdot \left(U - U*\right)}{Om}}{Om} \cdot n\right) \cdot U\right) \cdot -2\right) \cdot \left(\ell \cdot \ell\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 9.9%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6438.1
Applied rewrites38.1%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 5.00000000000000026e300Initial program 97.6%
if 5.00000000000000026e300 < (*.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 32.2%
Applied rewrites43.0%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Taylor expanded in l around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites26.2%
Taylor expanded in Om around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6435.2
Applied rewrites35.2%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (fma -2.0 (* l (/ l Om)) t))
(t_2
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_2 0.0)
(sqrt (* (* (* t_1 n) U) 2.0))
(if (<= t_2 INFINITY)
(sqrt
(* (- t_1 (* n (* (* (/ l Om) (/ l Om)) (- U U*)))) (* (+ n n) U)))
(sqrt
(*
(fma
(/ (* (* t n) U) (* l l))
2.0
(* (* (* (/ (+ 2.0 (/ (* n (- U U*)) Om)) Om) n) U) -2.0))
(* l l)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma(-2.0, (l * (l / Om)), t);
double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 0.0) {
tmp = sqrt((((t_1 * n) * U) * 2.0));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt(((t_1 - (n * (((l / Om) * (l / Om)) * (U - U_42_)))) * ((n + n) * U)));
} else {
tmp = sqrt((fma((((t * n) * U) / (l * l)), 2.0, (((((2.0 + ((n * (U - U_42_)) / Om)) / Om) * n) * U) * -2.0)) * (l * l)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = fma(-2.0, Float64(l * Float64(l / Om)), t) t_2 = 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_2 <= 0.0) tmp = sqrt(Float64(Float64(Float64(t_1 * n) * U) * 2.0)); elseif (t_2 <= Inf) tmp = sqrt(Float64(Float64(t_1 - Float64(n * Float64(Float64(Float64(l / Om) * Float64(l / Om)) * Float64(U - U_42_)))) * Float64(Float64(n + n) * U))); else tmp = sqrt(Float64(fma(Float64(Float64(Float64(t * n) * U) / Float64(l * l)), 2.0, Float64(Float64(Float64(Float64(Float64(2.0 + Float64(Float64(n * Float64(U - U_42_)) / Om)) / Om) * n) * U) * -2.0)) * Float64(l * l))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = 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$2, 0.0], N[Sqrt[N[(N[(N[(t$95$1 * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(t$95$1 - N[(n * N[(N[(N[(l / Om), $MachinePrecision] * N[(l / Om), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * 2.0 + N[(N[(N[(N[(N[(2.0 + N[(N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right)\\
t_2 := \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\_2 \leq 0:\\
\;\;\;\;\sqrt{\left(\left(t\_1 \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(t\_1 - n \cdot \left(\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right) \cdot \left(U - U*\right)\right)\right) \cdot \left(\left(n + n\right) \cdot U\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\left(t \cdot n\right) \cdot U}{\ell \cdot \ell}, 2, \left(\left(\frac{2 + \frac{n \cdot \left(U - U*\right)}{Om}}{Om} \cdot n\right) \cdot U\right) \cdot -2\right) \cdot \left(\ell \cdot \ell\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 9.9%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6438.1
Applied rewrites38.1%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 68.3%
Applied rewrites71.8%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Taylor expanded in l around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites26.2%
Taylor expanded in Om around inf
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6435.2
Applied rewrites35.2%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (fma -2.0 (* l (/ l Om)) t))
(t_2 (* n (* (* (/ l Om) (/ l Om)) (- U U*)))))
(if (<= n -8.5e+44)
(sqrt (* (- t t_2) (* (+ n n) U)))
(if (<= n 1.9e-63)
(sqrt (* (* (* t_1 n) U) 2.0))
(sqrt (* (+ n n) (* U (- t_1 t_2))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma(-2.0, (l * (l / Om)), t);
double t_2 = n * (((l / Om) * (l / Om)) * (U - U_42_));
double tmp;
if (n <= -8.5e+44) {
tmp = sqrt(((t - t_2) * ((n + n) * U)));
} else if (n <= 1.9e-63) {
tmp = sqrt((((t_1 * n) * U) * 2.0));
} else {
tmp = sqrt(((n + n) * (U * (t_1 - t_2))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = fma(-2.0, Float64(l * Float64(l / Om)), t) t_2 = Float64(n * Float64(Float64(Float64(l / Om) * Float64(l / Om)) * Float64(U - U_42_))) tmp = 0.0 if (n <= -8.5e+44) tmp = sqrt(Float64(Float64(t - t_2) * Float64(Float64(n + n) * U))); elseif (n <= 1.9e-63) tmp = sqrt(Float64(Float64(Float64(t_1 * n) * U) * 2.0)); else tmp = sqrt(Float64(Float64(n + n) * Float64(U * Float64(t_1 - t_2)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(n * N[(N[(N[(l / Om), $MachinePrecision] * N[(l / Om), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -8.5e+44], N[Sqrt[N[(N[(t - t$95$2), $MachinePrecision] * N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 1.9e-63], N[Sqrt[N[(N[(N[(t$95$1 * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(n + n), $MachinePrecision] * N[(U * N[(t$95$1 - t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right)\\
t_2 := n \cdot \left(\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;n \leq -8.5 \cdot 10^{+44}:\\
\;\;\;\;\sqrt{\left(t - t\_2\right) \cdot \left(\left(n + n\right) \cdot U\right)}\\
\mathbf{elif}\;n \leq 1.9 \cdot 10^{-63}:\\
\;\;\;\;\sqrt{\left(\left(t\_1 \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(n + n\right) \cdot \left(U \cdot \left(t\_1 - t\_2\right)\right)}\\
\end{array}
\end{array}
if n < -8.5e44Initial program 57.3%
Applied rewrites60.3%
Taylor expanded in t around inf
Applied rewrites63.4%
if -8.5e44 < n < 1.90000000000000009e-63Initial program 45.1%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6452.2
Applied rewrites52.2%
if 1.90000000000000009e-63 < n Initial program 54.4%
Applied rewrites58.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (fma -2.0 (* l (/ l Om)) t))
(t_2
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_2 0.0)
(sqrt (* (* (* t_1 n) U) 2.0))
(if (<= t_2 INFINITY)
(sqrt
(* (- t_1 (* n (* (* (/ l Om) (/ l Om)) (- U U*)))) (* (+ n n) U)))
(sqrt (* 2.0 (/ (* U (* U* (pow (* l n) 2.0))) (* Om Om))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma(-2.0, (l * (l / Om)), t);
double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 0.0) {
tmp = sqrt((((t_1 * n) * U) * 2.0));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt(((t_1 - (n * (((l / Om) * (l / Om)) * (U - U_42_)))) * ((n + n) * U)));
} else {
tmp = sqrt((2.0 * ((U * (U_42_ * pow((l * n), 2.0))) / (Om * Om))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = fma(-2.0, Float64(l * Float64(l / Om)), t) t_2 = 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_2 <= 0.0) tmp = sqrt(Float64(Float64(Float64(t_1 * n) * U) * 2.0)); elseif (t_2 <= Inf) tmp = sqrt(Float64(Float64(t_1 - Float64(n * Float64(Float64(Float64(l / Om) * Float64(l / Om)) * Float64(U - U_42_)))) * Float64(Float64(n + n) * U))); else tmp = sqrt(Float64(2.0 * Float64(Float64(U * Float64(U_42_ * (Float64(l * n) ^ 2.0))) / Float64(Om * Om)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = 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$2, 0.0], N[Sqrt[N[(N[(N[(t$95$1 * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(t$95$1 - N[(n * N[(N[(N[(l / Om), $MachinePrecision] * N[(l / Om), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(N[(U * N[(U$42$ * N[Power[N[(l * n), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right)\\
t_2 := \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\_2 \leq 0:\\
\;\;\;\;\sqrt{\left(\left(t\_1 \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(t\_1 - n \cdot \left(\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right) \cdot \left(U - U*\right)\right)\right) \cdot \left(\left(n + n\right) \cdot U\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \frac{U \cdot \left(U* \cdot {\left(\ell \cdot n\right)}^{2}\right)}{Om \cdot Om}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 9.9%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6438.1
Applied rewrites38.1%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 68.3%
Applied rewrites71.8%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Applied rewrites1.9%
Taylor expanded in U* around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f6427.7
Applied rewrites27.7%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6432.2
Applied rewrites32.2%
(FPCore (n U t l Om U*) :precision binary64 (if (<= n -8.5e+44) (sqrt (* (- t (* n (* (* (/ l Om) (/ l Om)) (- U U*)))) (* (+ n n) U))) (sqrt (* (* (* (fma -2.0 (* l (/ l Om)) t) n) U) 2.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= -8.5e+44) {
tmp = sqrt(((t - (n * (((l / Om) * (l / Om)) * (U - U_42_)))) * ((n + n) * U)));
} else {
tmp = sqrt((((fma(-2.0, (l * (l / Om)), t) * n) * U) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= -8.5e+44) tmp = sqrt(Float64(Float64(t - Float64(n * Float64(Float64(Float64(l / Om) * Float64(l / Om)) * Float64(U - U_42_)))) * Float64(Float64(n + n) * U))); else tmp = sqrt(Float64(Float64(Float64(fma(-2.0, Float64(l * Float64(l / Om)), t) * n) * U) * 2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, -8.5e+44], N[Sqrt[N[(N[(t - N[(n * N[(N[(N[(l / Om), $MachinePrecision] * N[(l / Om), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -8.5 \cdot 10^{+44}:\\
\;\;\;\;\sqrt{\left(t - n \cdot \left(\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right) \cdot \left(U - U*\right)\right)\right) \cdot \left(\left(n + n\right) \cdot U\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\end{array}
\end{array}
if n < -8.5e44Initial program 57.3%
Applied rewrites60.3%
Taylor expanded in t around inf
Applied rewrites63.4%
if -8.5e44 < n Initial program 48.3%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6449.6
Applied rewrites49.6%
(FPCore (n U t l Om U*) :precision binary64 (if (<= n -4e+62) (sqrt (* (* (* 2.0 n) U) (+ (/ (* U* (* (* l l) n)) (* Om Om)) t))) (sqrt (* (* (* (fma -2.0 (* l (/ l Om)) t) n) U) 2.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= -4e+62) {
tmp = sqrt((((2.0 * n) * U) * (((U_42_ * ((l * l) * n)) / (Om * Om)) + t)));
} else {
tmp = sqrt((((fma(-2.0, (l * (l / Om)), t) * n) * U) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= -4e+62) tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(Float64(U_42_ * Float64(Float64(l * l) * n)) / Float64(Om * Om)) + t))); else tmp = sqrt(Float64(Float64(Float64(fma(-2.0, Float64(l * Float64(l / Om)), t) * n) * U) * 2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, -4e+62], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(N[(U$42$ * N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -4 \cdot 10^{+62}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\frac{U* \cdot \left(\left(\ell \cdot \ell\right) \cdot n\right)}{Om \cdot Om} + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\end{array}
\end{array}
if n < -4.00000000000000014e62Initial program 56.6%
Taylor expanded in Om around -inf
+-commutativeN/A
lower-+.f64N/A
Applied rewrites45.4%
Taylor expanded in U* around inf
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f6452.6
Applied rewrites52.6%
if -4.00000000000000014e62 < n Initial program 48.6%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6449.8
Applied rewrites49.8%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (fma -2.0 (* l (/ l Om)) t))
(t_2 (* (* 2.0 n) U))
(t_3
(sqrt
(*
t_2
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(t_4 (sqrt (* (* (* t_1 n) U) 2.0))))
(if (<= t_3 0.0) t_4 (if (<= t_3 5e+140) (sqrt (* t_2 t_1)) t_4))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma(-2.0, (l * (l / Om)), t);
double t_2 = (2.0 * n) * U;
double t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double t_4 = sqrt((((t_1 * n) * U) * 2.0));
double tmp;
if (t_3 <= 0.0) {
tmp = t_4;
} else if (t_3 <= 5e+140) {
tmp = sqrt((t_2 * t_1));
} else {
tmp = t_4;
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = fma(-2.0, Float64(l * Float64(l / Om)), t) t_2 = Float64(Float64(2.0 * n) * U) t_3 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) t_4 = sqrt(Float64(Float64(Float64(t_1 * n) * U) * 2.0)) tmp = 0.0 if (t_3 <= 0.0) tmp = t_4; elseif (t_3 <= 5e+140) tmp = sqrt(Float64(t_2 * t_1)); else tmp = t_4; end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * 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]}, Block[{t$95$4 = N[Sqrt[N[(N[(N[(t$95$1 * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], t$95$4, If[LessEqual[t$95$3, 5e+140], N[Sqrt[N[(t$95$2 * t$95$1), $MachinePrecision]], $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right)\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := \sqrt{t\_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
t_4 := \sqrt{\left(\left(t\_1 \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{if}\;t\_3 \leq 0:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+140}:\\
\;\;\;\;\sqrt{t\_2 \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\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.0 or 5.00000000000000008e140 < (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 20.2%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6430.3
Applied rewrites30.3%
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*))))) < 5.00000000000000008e140Initial program 97.6%
Taylor expanded in n around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6486.5
Applied rewrites86.5%
(FPCore (n U t l Om U*) :precision binary64 (if (<= n -5.8e+64) (sqrt (* (* (* 2.0 n) U) (* (/ (* (* l l) n) Om) (/ U* Om)))) (sqrt (* (* (* (fma -2.0 (* l (/ l Om)) t) n) U) 2.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= -5.8e+64) {
tmp = sqrt((((2.0 * n) * U) * ((((l * l) * n) / Om) * (U_42_ / Om))));
} else {
tmp = sqrt((((fma(-2.0, (l * (l / Om)), t) * n) * U) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= -5.8e+64) tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(Float64(Float64(l * l) * n) / Om) * Float64(U_42_ / Om)))); else tmp = sqrt(Float64(Float64(Float64(fma(-2.0, Float64(l * Float64(l / Om)), t) * n) * U) * 2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, -5.8e+64], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] * N[(U$42$ / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -5.8 \cdot 10^{+64}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\frac{\left(\ell \cdot \ell\right) \cdot n}{Om} \cdot \frac{U*}{Om}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\end{array}
\end{array}
if n < -5.79999999999999986e64Initial program 56.6%
Taylor expanded in U* around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow2N/A
lower-*.f6427.2
Applied rewrites27.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lower-/.f6430.3
Applied rewrites30.3%
if -5.79999999999999986e64 < n Initial program 48.6%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6449.7
Applied rewrites49.7%
(FPCore (n U t l Om U*) :precision binary64 (if (<= n -2.4e+51) (sqrt (* (* 2.0 (/ (* U (* U* (* n n))) (* Om Om))) (* l l))) (sqrt (* (* (* (fma -2.0 (* l (/ l Om)) t) n) U) 2.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= -2.4e+51) {
tmp = sqrt(((2.0 * ((U * (U_42_ * (n * n))) / (Om * Om))) * (l * l)));
} else {
tmp = sqrt((((fma(-2.0, (l * (l / Om)), t) * n) * U) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= -2.4e+51) tmp = sqrt(Float64(Float64(2.0 * Float64(Float64(U * Float64(U_42_ * Float64(n * n))) / Float64(Om * Om))) * Float64(l * l))); else tmp = sqrt(Float64(Float64(Float64(fma(-2.0, Float64(l * Float64(l / Om)), t) * n) * U) * 2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, -2.4e+51], N[Sqrt[N[(N[(2.0 * N[(N[(U * N[(U$42$ * N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.4 \cdot 10^{+51}:\\
\;\;\;\;\sqrt{\left(2 \cdot \frac{U \cdot \left(U* \cdot \left(n \cdot n\right)\right)}{Om \cdot Om}\right) \cdot \left(\ell \cdot \ell\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\end{array}
\end{array}
if n < -2.3999999999999999e51Initial program 57.0%
Taylor expanded in l around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites30.5%
Taylor expanded in U* around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f6424.5
Applied rewrites24.5%
if -2.3999999999999999e51 < n Initial program 48.4%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6449.7
Applied rewrites49.7%
(FPCore (n U t l Om U*) :precision binary64 (if (<= n -2.7e+57) (sqrt (* 2.0 (/ (* U (* U* (* (* l l) (* n n)))) (* Om Om)))) (sqrt (* (* (* (fma -2.0 (* l (/ l Om)) t) n) U) 2.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= -2.7e+57) {
tmp = sqrt((2.0 * ((U * (U_42_ * ((l * l) * (n * n)))) / (Om * Om))));
} else {
tmp = sqrt((((fma(-2.0, (l * (l / Om)), t) * n) * U) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= -2.7e+57) tmp = sqrt(Float64(2.0 * Float64(Float64(U * Float64(U_42_ * Float64(Float64(l * l) * Float64(n * n)))) / Float64(Om * Om)))); else tmp = sqrt(Float64(Float64(Float64(fma(-2.0, Float64(l * Float64(l / Om)), t) * n) * U) * 2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, -2.7e+57], N[Sqrt[N[(2.0 * N[(N[(U * N[(U$42$ * N[(N[(l * l), $MachinePrecision] * N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.7 \cdot 10^{+57}:\\
\;\;\;\;\sqrt{2 \cdot \frac{U \cdot \left(U* \cdot \left(\left(\ell \cdot \ell\right) \cdot \left(n \cdot n\right)\right)\right)}{Om \cdot Om}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\end{array}
\end{array}
if n < -2.6999999999999998e57Initial program 56.6%
Applied rewrites59.5%
Taylor expanded in U* around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f6425.0
Applied rewrites25.0%
if -2.6999999999999998e57 < n Initial program 48.5%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6449.8
Applied rewrites49.8%
(FPCore (n U t l Om U*) :precision binary64 (if (<= n -4.2e+64) (sqrt (* (/ (* U* (* (* l l) n)) (* Om Om)) (* (+ n n) U))) (sqrt (* (* (* (fma -2.0 (* l (/ l Om)) t) n) U) 2.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= -4.2e+64) {
tmp = sqrt((((U_42_ * ((l * l) * n)) / (Om * Om)) * ((n + n) * U)));
} else {
tmp = sqrt((((fma(-2.0, (l * (l / Om)), t) * n) * U) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= -4.2e+64) tmp = sqrt(Float64(Float64(Float64(U_42_ * Float64(Float64(l * l) * n)) / Float64(Om * Om)) * Float64(Float64(n + n) * U))); else tmp = sqrt(Float64(Float64(Float64(fma(-2.0, Float64(l * Float64(l / Om)), t) * n) * U) * 2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, -4.2e+64], N[Sqrt[N[(N[(N[(U$42$ * N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] * N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -4.2 \cdot 10^{+64}:\\
\;\;\;\;\sqrt{\frac{U* \cdot \left(\left(\ell \cdot \ell\right) \cdot n\right)}{Om \cdot Om} \cdot \left(\left(n + n\right) \cdot U\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\end{array}
\end{array}
if n < -4.2000000000000001e64Initial program 56.6%
Applied rewrites59.4%
Taylor expanded in U* around inf
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f6427.2
Applied rewrites27.2%
if -4.2000000000000001e64 < n Initial program 48.6%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6449.7
Applied rewrites49.7%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* (fma -2.0 (* l (/ l Om)) t) n) U) 2.0)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((fma(-2.0, (l * (l / Om)), t) * n) * U) * 2.0));
}
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(fma(-2.0, Float64(l * Float64(l / Om)), t) * n) * U) * 2.0)) end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(\mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right) \cdot n\right) \cdot U\right) \cdot 2}
\end{array}
Initial program 49.9%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6448.1
Applied rewrites48.1%
(FPCore (n U t l Om U*)
:precision binary64
(if (<=
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))
1e+292)
(sqrt (* t (* (+ n n) U)))
(* (sqrt (* U* U)) (/ (* (* (sqrt 2.0) n) l) Om))))
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_)))) <= 1e+292) {
tmp = sqrt((t * ((n + n) * U)));
} else {
tmp = sqrt((U_42_ * U)) * (((sqrt(2.0) * n) * l) / 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) :: tmp
if ((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))) <= 1d+292) then
tmp = sqrt((t * ((n + n) * u)))
else
tmp = sqrt((u_42 * u)) * (((sqrt(2.0d0) * n) * l) / 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 tmp;
if ((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))) <= 1e+292) {
tmp = Math.sqrt((t * ((n + n) * U)));
} else {
tmp = Math.sqrt((U_42_ * U)) * (((Math.sqrt(2.0) * n) * l) / Om);
}
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_)))) <= 1e+292: tmp = math.sqrt((t * ((n + n) * U))) else: tmp = math.sqrt((U_42_ * U)) * (((math.sqrt(2.0) * n) * l) / Om) 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_)))) <= 1e+292) tmp = sqrt(Float64(t * Float64(Float64(n + n) * U))); else tmp = Float64(sqrt(Float64(U_42_ * U)) * Float64(Float64(Float64(sqrt(2.0) * n) * l) / Om)); 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_)))) <= 1e+292) tmp = sqrt((t * ((n + n) * U))); else tmp = sqrt((U_42_ * U)) * (((sqrt(2.0) * n) * l) / Om); 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], 1e+292], N[Sqrt[N[(t * N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(U$42$ * U), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * n), $MachinePrecision] * l), $MachinePrecision] / Om), $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 10^{+292}:\\
\;\;\;\;\sqrt{t \cdot \left(\left(n + n\right) \cdot U\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{U* \cdot U} \cdot \frac{\left(\sqrt{2} \cdot n\right) \cdot \ell}{Om}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1e292Initial program 73.7%
Applied rewrites72.8%
Taylor expanded in t around inf
Applied rewrites59.0%
if 1e292 < (*.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 22.7%
Taylor expanded in U* around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f6421.3
Applied rewrites21.3%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 1.9e+30) (sqrt (* t (* (+ n n) U))) (sqrt (* -4.0 (/ (* U (* (* l l) n)) Om)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.9e+30) {
tmp = sqrt((t * ((n + n) * U)));
} else {
tmp = sqrt((-4.0 * ((U * ((l * l) * n)) / Om)));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (l <= 1.9d+30) then
tmp = sqrt((t * ((n + n) * u)))
else
tmp = sqrt(((-4.0d0) * ((u * ((l * l) * n)) / om)))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.9e+30) {
tmp = Math.sqrt((t * ((n + n) * U)));
} else {
tmp = Math.sqrt((-4.0 * ((U * ((l * l) * n)) / Om)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 1.9e+30: tmp = math.sqrt((t * ((n + n) * U))) else: tmp = math.sqrt((-4.0 * ((U * ((l * l) * n)) / Om))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 1.9e+30) tmp = sqrt(Float64(t * Float64(Float64(n + n) * U))); else tmp = sqrt(Float64(-4.0 * Float64(Float64(U * Float64(Float64(l * l) * n)) / Om))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 1.9e+30) tmp = sqrt((t * ((n + n) * U))); else tmp = sqrt((-4.0 * ((U * ((l * l) * n)) / Om))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 1.9e+30], N[Sqrt[N[(t * N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(-4.0 * N[(N[(U * N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.9 \cdot 10^{+30}:\\
\;\;\;\;\sqrt{t \cdot \left(\left(n + n\right) \cdot U\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{-4 \cdot \frac{U \cdot \left(\left(\ell \cdot \ell\right) \cdot n\right)}{Om}}\\
\end{array}
\end{array}
if l < 1.9000000000000001e30Initial program 54.4%
Applied rewrites56.3%
Taylor expanded in t around inf
Applied rewrites41.5%
if 1.9000000000000001e30 < l Initial program 32.5%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6439.8
Applied rewrites39.8%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6423.1
Applied rewrites23.1%
(FPCore (n U t l Om U*) :precision binary64 (if (<= t 2.8e-301) (sqrt (* (* (* t n) U) 2.0)) (* (sqrt (* (+ n n) U)) (sqrt t))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= 2.8e-301) {
tmp = sqrt((((t * n) * U) * 2.0));
} else {
tmp = sqrt(((n + n) * U)) * sqrt(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 (t <= 2.8d-301) then
tmp = sqrt((((t * n) * u) * 2.0d0))
else
tmp = sqrt(((n + n) * u)) * sqrt(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 (t <= 2.8e-301) {
tmp = Math.sqrt((((t * n) * U) * 2.0));
} else {
tmp = Math.sqrt(((n + n) * U)) * Math.sqrt(t);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if t <= 2.8e-301: tmp = math.sqrt((((t * n) * U) * 2.0)) else: tmp = math.sqrt(((n + n) * U)) * math.sqrt(t) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= 2.8e-301) tmp = sqrt(Float64(Float64(Float64(t * n) * U) * 2.0)); else tmp = Float64(sqrt(Float64(Float64(n + n) * U)) * sqrt(t)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (t <= 2.8e-301) tmp = sqrt((((t * n) * U) * 2.0)); else tmp = sqrt(((n + n) * U)) * sqrt(t); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, 2.8e-301], N[Sqrt[N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.8 \cdot 10^{-301}:\\
\;\;\;\;\sqrt{\left(\left(t \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(n + n\right) \cdot U} \cdot \sqrt{t}\\
\end{array}
\end{array}
if t < 2.8000000000000001e-301Initial program 49.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6435.4
Applied rewrites35.4%
if 2.8000000000000001e-301 < t Initial program 50.4%
Applied rewrites51.9%
Taylor expanded in t around inf
lower-sqrt.f6443.1
Applied rewrites43.1%
(FPCore (n U t l Om U*)
:precision binary64
(if (<=
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))
2e+281)
(sqrt (* t (* (+ n n) U)))
(sqrt (* (* (* t n) U) 2.0))))
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_)))) <= 2e+281) {
tmp = sqrt((t * ((n + n) * U)));
} else {
tmp = sqrt((((t * n) * U) * 2.0));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if ((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))) <= 2d+281) then
tmp = sqrt((t * ((n + n) * u)))
else
tmp = sqrt((((t * n) * u) * 2.0d0))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if ((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))) <= 2e+281) {
tmp = Math.sqrt((t * ((n + n) * U)));
} else {
tmp = Math.sqrt((((t * n) * U) * 2.0));
}
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_)))) <= 2e+281: tmp = math.sqrt((t * ((n + n) * U))) else: tmp = math.sqrt((((t * n) * U) * 2.0)) 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_)))) <= 2e+281) tmp = sqrt(Float64(t * Float64(Float64(n + n) * U))); else tmp = sqrt(Float64(Float64(Float64(t * n) * U) * 2.0)); 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_)))) <= 2e+281) tmp = sqrt((t * ((n + n) * U))); else tmp = sqrt((((t * n) * U) * 2.0)); 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], 2e+281], N[Sqrt[N[(t * N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $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 2 \cdot 10^{+281}:\\
\;\;\;\;\sqrt{t \cdot \left(\left(n + n\right) \cdot U\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(t \cdot n\right) \cdot U\right) \cdot 2}\\
\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*)))) < 2.0000000000000001e281Initial program 73.5%
Applied rewrites72.6%
Taylor expanded in t around inf
Applied rewrites58.8%
if 2.0000000000000001e281 < (*.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 23.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6412.1
Applied rewrites12.1%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* t (* (+ n n) U))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((t * ((n + n) * U)));
}
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((t * ((n + n) * u)))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((t * ((n + n) * U)));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((t * ((n + n) * U)))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(t * Float64(Float64(n + n) * U))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((t * ((n + n) * U))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(t * N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{t \cdot \left(\left(n + n\right) \cdot U\right)}
\end{array}
Initial program 49.9%
Applied rewrites53.1%
Taylor expanded in t around inf
Applied rewrites36.0%
herbie shell --seed 2025122
(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*))))))