
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 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 (* (/ l Om) (/ l Om)))
(t_2 (* (- U U*) n))
(t_3 (* (* 2.0 n) U))
(t_4 (- t (* 2.0 (/ (* l l) Om))))
(t_5 (* t_3 (- t_4 (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_5 0.0)
(sqrt
(*
(* n 2.0)
(+
(/ (- (* (- U) (* (* l l) (/ t_2 Om))) (* (* (* l l) U) 2.0)) Om)
(* t U))))
(if (<= t_5 1e+289)
(sqrt (* t_3 (- t_4 (* (* n t_1) (- U U*)))))
(if (<= t_5 INFINITY)
(sqrt
(*
(* n 2.0)
(* U (- (- t (* (* l (/ l Om)) 2.0)) (* (- U U*) (* t_1 n))))))
(sqrt
(*
(* -2.0 U)
(* (* (* l l) n) (+ (/ t_2 (* Om Om)) (/ 2.0 Om))))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l / Om) * (l / Om);
double t_2 = (U - U_42_) * n;
double t_3 = (2.0 * n) * U;
double t_4 = t - (2.0 * ((l * l) / Om));
double t_5 = t_3 * (t_4 - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_5 <= 0.0) {
tmp = sqrt(((n * 2.0) * ((((-U * ((l * l) * (t_2 / Om))) - (((l * l) * U) * 2.0)) / Om) + (t * U))));
} else if (t_5 <= 1e+289) {
tmp = sqrt((t_3 * (t_4 - ((n * t_1) * (U - U_42_)))));
} else if (t_5 <= ((double) INFINITY)) {
tmp = sqrt(((n * 2.0) * (U * ((t - ((l * (l / Om)) * 2.0)) - ((U - U_42_) * (t_1 * n))))));
} else {
tmp = sqrt(((-2.0 * U) * (((l * l) * n) * ((t_2 / (Om * Om)) + (2.0 / Om)))));
}
return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l / Om) * (l / Om);
double t_2 = (U - U_42_) * n;
double t_3 = (2.0 * n) * U;
double t_4 = t - (2.0 * ((l * l) / Om));
double t_5 = t_3 * (t_4 - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_5 <= 0.0) {
tmp = Math.sqrt(((n * 2.0) * ((((-U * ((l * l) * (t_2 / Om))) - (((l * l) * U) * 2.0)) / Om) + (t * U))));
} else if (t_5 <= 1e+289) {
tmp = Math.sqrt((t_3 * (t_4 - ((n * t_1) * (U - U_42_)))));
} else if (t_5 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt(((n * 2.0) * (U * ((t - ((l * (l / Om)) * 2.0)) - ((U - U_42_) * (t_1 * n))))));
} else {
tmp = Math.sqrt(((-2.0 * U) * (((l * l) * n) * ((t_2 / (Om * Om)) + (2.0 / Om)))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = (l / Om) * (l / Om) t_2 = (U - U_42_) * n t_3 = (2.0 * n) * U t_4 = t - (2.0 * ((l * l) / Om)) t_5 = t_3 * (t_4 - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))) tmp = 0 if t_5 <= 0.0: tmp = math.sqrt(((n * 2.0) * ((((-U * ((l * l) * (t_2 / Om))) - (((l * l) * U) * 2.0)) / Om) + (t * U)))) elif t_5 <= 1e+289: tmp = math.sqrt((t_3 * (t_4 - ((n * t_1) * (U - U_42_))))) elif t_5 <= math.inf: tmp = math.sqrt(((n * 2.0) * (U * ((t - ((l * (l / Om)) * 2.0)) - ((U - U_42_) * (t_1 * n)))))) else: tmp = math.sqrt(((-2.0 * U) * (((l * l) * n) * ((t_2 / (Om * Om)) + (2.0 / Om))))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l / Om) * Float64(l / Om)) t_2 = Float64(Float64(U - U_42_) * n) t_3 = Float64(Float64(2.0 * n) * U) t_4 = Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) t_5 = Float64(t_3 * Float64(t_4 - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_5 <= 0.0) tmp = sqrt(Float64(Float64(n * 2.0) * Float64(Float64(Float64(Float64(Float64(-U) * Float64(Float64(l * l) * Float64(t_2 / Om))) - Float64(Float64(Float64(l * l) * U) * 2.0)) / Om) + Float64(t * U)))); elseif (t_5 <= 1e+289) tmp = sqrt(Float64(t_3 * Float64(t_4 - Float64(Float64(n * t_1) * Float64(U - U_42_))))); elseif (t_5 <= Inf) tmp = sqrt(Float64(Float64(n * 2.0) * Float64(U * Float64(Float64(t - Float64(Float64(l * Float64(l / Om)) * 2.0)) - Float64(Float64(U - U_42_) * Float64(t_1 * n)))))); else tmp = sqrt(Float64(Float64(-2.0 * U) * Float64(Float64(Float64(l * l) * n) * Float64(Float64(t_2 / Float64(Om * Om)) + Float64(2.0 / Om))))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (l / Om) * (l / Om); t_2 = (U - U_42_) * n; t_3 = (2.0 * n) * U; t_4 = t - (2.0 * ((l * l) / Om)); t_5 = t_3 * (t_4 - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))); tmp = 0.0; if (t_5 <= 0.0) tmp = sqrt(((n * 2.0) * ((((-U * ((l * l) * (t_2 / Om))) - (((l * l) * U) * 2.0)) / Om) + (t * U)))); elseif (t_5 <= 1e+289) tmp = sqrt((t_3 * (t_4 - ((n * t_1) * (U - U_42_))))); elseif (t_5 <= Inf) tmp = sqrt(((n * 2.0) * (U * ((t - ((l * (l / Om)) * 2.0)) - ((U - U_42_) * (t_1 * n)))))); else tmp = sqrt(((-2.0 * U) * (((l * l) * n) * ((t_2 / (Om * Om)) + (2.0 / Om))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l / Om), $MachinePrecision] * N[(l / Om), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(U - U$42$), $MachinePrecision] * n), $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$4 = N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 * N[(t$95$4 - 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$5, 0.0], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(N[(N[(N[((-U) * N[(N[(l * l), $MachinePrecision] * N[(t$95$2 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(l * l), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] + N[(t * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$5, 1e+289], N[Sqrt[N[(t$95$3 * N[(t$95$4 - N[(N[(n * t$95$1), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(U * N[(N[(t - N[(N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] - N[(N[(U - U$42$), $MachinePrecision] * N[(t$95$1 * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(-2.0 * U), $MachinePrecision] * N[(N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision] * N[(N[(t$95$2 / N[(Om * Om), $MachinePrecision]), $MachinePrecision] + N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell}{Om} \cdot \frac{\ell}{Om}\\
t_2 := \left(U - U*\right) \cdot n\\
t_3 := \left(2 \cdot n\right) \cdot U\\
t_4 := t - 2 \cdot \frac{\ell \cdot \ell}{Om}\\
t_5 := t\_3 \cdot \left(t\_4 - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_5 \leq 0:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(\frac{\left(-U\right) \cdot \left(\left(\ell \cdot \ell\right) \cdot \frac{t\_2}{Om}\right) - \left(\left(\ell \cdot \ell\right) \cdot U\right) \cdot 2}{Om} + t \cdot U\right)}\\
\mathbf{elif}\;t\_5 \leq 10^{+289}:\\
\;\;\;\;\sqrt{t\_3 \cdot \left(t\_4 - \left(n \cdot t\_1\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{elif}\;t\_5 \leq \infty:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot \left(\left(t - \left(\ell \cdot \frac{\ell}{Om}\right) \cdot 2\right) - \left(U - U*\right) \cdot \left(t\_1 \cdot n\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(-2 \cdot U\right) \cdot \left(\left(\left(\ell \cdot \ell\right) \cdot n\right) \cdot \left(\frac{t\_2}{Om \cdot Om} + \frac{2}{Om}\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 14.8%
Applied rewrites44.4%
Taylor expanded in Om around -inf
lower-+.f64N/A
Applied rewrites46.7%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1.0000000000000001e289Initial program 98.7%
lift-/.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6498.7
Applied rewrites98.7%
if 1.0000000000000001e289 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 33.3%
Applied rewrites45.5%
lift-/.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6445.5
Applied rewrites45.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 0.0%
Taylor expanded in l around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites39.4%
Final simplification68.4%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (/ l Om) (/ l Om)))
(t_2 (* (* 2.0 n) U))
(t_3
(sqrt
(*
(* n 2.0)
(* U (- (- t (* (* l (/ l Om)) 2.0)) (* (- U U*) (* t_1 n)))))))
(t_4 (- t (* 2.0 (/ (* l l) Om))))
(t_5 (* t_2 (- t_4 (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_5 0.0)
t_3
(if (<= t_5 1e+289)
(sqrt (* t_2 (- t_4 (* (* n t_1) (- U U*)))))
(if (<= t_5 INFINITY)
t_3
(sqrt
(*
(* -2.0 U)
(* (* (* l l) n) (+ (/ (* (- U U*) n) (* Om Om)) (/ 2.0 Om))))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l / Om) * (l / Om);
double t_2 = (2.0 * n) * U;
double t_3 = sqrt(((n * 2.0) * (U * ((t - ((l * (l / Om)) * 2.0)) - ((U - U_42_) * (t_1 * n))))));
double t_4 = t - (2.0 * ((l * l) / Om));
double t_5 = t_2 * (t_4 - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_5 <= 0.0) {
tmp = t_3;
} else if (t_5 <= 1e+289) {
tmp = sqrt((t_2 * (t_4 - ((n * t_1) * (U - U_42_)))));
} else if (t_5 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = sqrt(((-2.0 * U) * (((l * l) * n) * ((((U - U_42_) * n) / (Om * Om)) + (2.0 / Om)))));
}
return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l / Om) * (l / Om);
double t_2 = (2.0 * n) * U;
double t_3 = Math.sqrt(((n * 2.0) * (U * ((t - ((l * (l / Om)) * 2.0)) - ((U - U_42_) * (t_1 * n))))));
double t_4 = t - (2.0 * ((l * l) / Om));
double t_5 = t_2 * (t_4 - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_5 <= 0.0) {
tmp = t_3;
} else if (t_5 <= 1e+289) {
tmp = Math.sqrt((t_2 * (t_4 - ((n * t_1) * (U - U_42_)))));
} else if (t_5 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = Math.sqrt(((-2.0 * U) * (((l * l) * n) * ((((U - U_42_) * n) / (Om * Om)) + (2.0 / Om)))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = (l / Om) * (l / Om) t_2 = (2.0 * n) * U t_3 = math.sqrt(((n * 2.0) * (U * ((t - ((l * (l / Om)) * 2.0)) - ((U - U_42_) * (t_1 * n)))))) t_4 = t - (2.0 * ((l * l) / Om)) t_5 = t_2 * (t_4 - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))) tmp = 0 if t_5 <= 0.0: tmp = t_3 elif t_5 <= 1e+289: tmp = math.sqrt((t_2 * (t_4 - ((n * t_1) * (U - U_42_))))) elif t_5 <= math.inf: tmp = t_3 else: tmp = math.sqrt(((-2.0 * U) * (((l * l) * n) * ((((U - U_42_) * n) / (Om * Om)) + (2.0 / Om))))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l / Om) * Float64(l / Om)) t_2 = Float64(Float64(2.0 * n) * U) t_3 = sqrt(Float64(Float64(n * 2.0) * Float64(U * Float64(Float64(t - Float64(Float64(l * Float64(l / Om)) * 2.0)) - Float64(Float64(U - U_42_) * Float64(t_1 * n)))))) t_4 = Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) t_5 = Float64(t_2 * Float64(t_4 - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_5 <= 0.0) tmp = t_3; elseif (t_5 <= 1e+289) tmp = sqrt(Float64(t_2 * Float64(t_4 - Float64(Float64(n * t_1) * Float64(U - U_42_))))); elseif (t_5 <= Inf) tmp = t_3; else tmp = sqrt(Float64(Float64(-2.0 * U) * Float64(Float64(Float64(l * l) * n) * Float64(Float64(Float64(Float64(U - U_42_) * n) / Float64(Om * Om)) + Float64(2.0 / Om))))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (l / Om) * (l / Om); t_2 = (2.0 * n) * U; t_3 = sqrt(((n * 2.0) * (U * ((t - ((l * (l / Om)) * 2.0)) - ((U - U_42_) * (t_1 * n)))))); t_4 = t - (2.0 * ((l * l) / Om)); t_5 = t_2 * (t_4 - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))); tmp = 0.0; if (t_5 <= 0.0) tmp = t_3; elseif (t_5 <= 1e+289) tmp = sqrt((t_2 * (t_4 - ((n * t_1) * (U - U_42_))))); elseif (t_5 <= Inf) tmp = t_3; else tmp = sqrt(((-2.0 * U) * (((l * l) * n) * ((((U - U_42_) * n) / (Om * Om)) + (2.0 / Om))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l / Om), $MachinePrecision] * N[(l / Om), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(U * N[(N[(t - N[(N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] - N[(N[(U - U$42$), $MachinePrecision] * N[(t$95$1 * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 * N[(t$95$4 - 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$5, 0.0], t$95$3, If[LessEqual[t$95$5, 1e+289], N[Sqrt[N[(t$95$2 * N[(t$95$4 - N[(N[(n * t$95$1), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$5, Infinity], t$95$3, N[Sqrt[N[(N[(-2.0 * U), $MachinePrecision] * N[(N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision] * N[(N[(N[(N[(U - U$42$), $MachinePrecision] * n), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] + N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell}{Om} \cdot \frac{\ell}{Om}\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := \sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot \left(\left(t - \left(\ell \cdot \frac{\ell}{Om}\right) \cdot 2\right) - \left(U - U*\right) \cdot \left(t\_1 \cdot n\right)\right)\right)}\\
t_4 := t - 2 \cdot \frac{\ell \cdot \ell}{Om}\\
t_5 := t\_2 \cdot \left(t\_4 - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_5 \leq 0:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_5 \leq 10^{+289}:\\
\;\;\;\;\sqrt{t\_2 \cdot \left(t\_4 - \left(n \cdot t\_1\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{elif}\;t\_5 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(-2 \cdot U\right) \cdot \left(\left(\left(\ell \cdot \ell\right) \cdot n\right) \cdot \left(\frac{\left(U - U*\right) \cdot n}{Om \cdot Om} + \frac{2}{Om}\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.0 or 1.0000000000000001e289 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 26.7%
Applied rewrites45.1%
lift-/.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6445.1
Applied rewrites45.1%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1.0000000000000001e289Initial program 98.7%
lift-/.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6498.7
Applied rewrites98.7%
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
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites39.4%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2 (- t (* 2.0 (/ (* l l) Om))))
(t_3 (* t_1 (- t_2 (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_3 2e-303)
(sqrt (* 2.0 (* U (* n t_2))))
(if (<= t_3 INFINITY)
(sqrt (* t_1 (- t (* (* l (/ l Om)) 2.0))))
(sqrt (* (* n 2.0) (/ (* (* (* (* l l) 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 - (2.0 * ((l * l) / Om));
double t_3 = t_1 * (t_2 - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_3 <= 2e-303) {
tmp = sqrt((2.0 * (U * (n * t_2))));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((t_1 * (t - ((l * (l / Om)) * 2.0))));
} else {
tmp = sqrt(((n * 2.0) * (((((l * l) * n) * U_42_) * U) / (Om * Om))));
}
return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = t - (2.0 * ((l * l) / Om));
double t_3 = t_1 * (t_2 - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_3 <= 2e-303) {
tmp = Math.sqrt((2.0 * (U * (n * t_2))));
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_1 * (t - ((l * (l / Om)) * 2.0))));
} else {
tmp = Math.sqrt(((n * 2.0) * (((((l * l) * n) * U_42_) * U) / (Om * Om))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = (2.0 * n) * U t_2 = t - (2.0 * ((l * l) / Om)) t_3 = t_1 * (t_2 - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))) tmp = 0 if t_3 <= 2e-303: tmp = math.sqrt((2.0 * (U * (n * t_2)))) elif t_3 <= math.inf: tmp = math.sqrt((t_1 * (t - ((l * (l / Om)) * 2.0)))) else: tmp = math.sqrt(((n * 2.0) * (((((l * l) * n) * U_42_) * U) / (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 - Float64(2.0 * Float64(Float64(l * l) / Om))) t_3 = Float64(t_1 * Float64(t_2 - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_3 <= 2e-303) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t_2)))); elseif (t_3 <= Inf) tmp = sqrt(Float64(t_1 * Float64(t - Float64(Float64(l * Float64(l / Om)) * 2.0)))); else tmp = sqrt(Float64(Float64(n * 2.0) * Float64(Float64(Float64(Float64(Float64(l * l) * n) * U_42_) * U) / Float64(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 - (2.0 * ((l * l) / Om)); t_3 = t_1 * (t_2 - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))); tmp = 0.0; if (t_3 <= 2e-303) tmp = sqrt((2.0 * (U * (n * t_2)))); elseif (t_3 <= Inf) tmp = sqrt((t_1 * (t - ((l * (l / Om)) * 2.0)))); else tmp = sqrt(((n * 2.0) * (((((l * l) * n) * U_42_) * U) / (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 - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * N[(t$95$2 - 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$3, 2e-303], N[Sqrt[N[(2.0 * N[(U * N[(n * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$1 * N[(t - N[(N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision] * U$42$), $MachinePrecision] * U), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := t - 2 \cdot \frac{\ell \cdot \ell}{Om}\\
t_3 := t\_1 \cdot \left(t\_2 - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_3 \leq 2 \cdot 10^{-303}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\_2\right)\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(t - \left(\ell \cdot \frac{\ell}{Om}\right) \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \frac{\left(\left(\left(\ell \cdot \ell\right) \cdot n\right) \cdot U*\right) \cdot U}{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*)))) < 1.99999999999999986e-303Initial program 20.5%
Taylor expanded in U* around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6414.2
Applied rewrites14.2%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6414.2
Applied rewrites14.2%
Taylor expanded in n around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6445.9
Applied rewrites45.9%
if 1.99999999999999986e-303 < (*.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 73.1%
Taylor expanded in n around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6469.9
Applied rewrites69.9%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Applied rewrites6.6%
Taylor expanded in U* around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f6435.1
Applied rewrites35.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2 (- t (* 2.0 (/ (* l l) Om))))
(t_3 (* t_1 (- t_2 (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_3 2e-303)
(sqrt (* 2.0 (* U (* n t_2))))
(if (<= t_3 INFINITY)
(sqrt (* t_1 (- t (* (* l (/ l Om)) 2.0))))
(sqrt (/ (* 2.0 (* (* (* (* l n) (* l 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 - (2.0 * ((l * l) / Om));
double t_3 = t_1 * (t_2 - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_3 <= 2e-303) {
tmp = sqrt((2.0 * (U * (n * t_2))));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((t_1 * (t - ((l * (l / Om)) * 2.0))));
} else {
tmp = sqrt(((2.0 * ((((l * n) * (l * n)) * U_42_) * U)) / (Om * Om)));
}
return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = t - (2.0 * ((l * l) / Om));
double t_3 = t_1 * (t_2 - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_3 <= 2e-303) {
tmp = Math.sqrt((2.0 * (U * (n * t_2))));
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_1 * (t - ((l * (l / Om)) * 2.0))));
} else {
tmp = Math.sqrt(((2.0 * ((((l * n) * (l * n)) * U_42_) * U)) / (Om * Om)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = (2.0 * n) * U t_2 = t - (2.0 * ((l * l) / Om)) t_3 = t_1 * (t_2 - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))) tmp = 0 if t_3 <= 2e-303: tmp = math.sqrt((2.0 * (U * (n * t_2)))) elif t_3 <= math.inf: tmp = math.sqrt((t_1 * (t - ((l * (l / Om)) * 2.0)))) else: tmp = math.sqrt(((2.0 * ((((l * n) * (l * n)) * U_42_) * U)) / (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 - Float64(2.0 * Float64(Float64(l * l) / Om))) t_3 = Float64(t_1 * Float64(t_2 - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_3 <= 2e-303) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t_2)))); elseif (t_3 <= Inf) tmp = sqrt(Float64(t_1 * Float64(t - Float64(Float64(l * Float64(l / Om)) * 2.0)))); else tmp = sqrt(Float64(Float64(2.0 * Float64(Float64(Float64(Float64(l * n) * Float64(l * n)) * U_42_) * U)) / Float64(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 - (2.0 * ((l * l) / Om)); t_3 = t_1 * (t_2 - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))); tmp = 0.0; if (t_3 <= 2e-303) tmp = sqrt((2.0 * (U * (n * t_2)))); elseif (t_3 <= Inf) tmp = sqrt((t_1 * (t - ((l * (l / Om)) * 2.0)))); else tmp = sqrt(((2.0 * ((((l * n) * (l * n)) * U_42_) * U)) / (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 - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * N[(t$95$2 - 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$3, 2e-303], N[Sqrt[N[(2.0 * N[(U * N[(n * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$1 * N[(t - N[(N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * N[(N[(N[(N[(l * n), $MachinePrecision] * N[(l * n), $MachinePrecision]), $MachinePrecision] * U$42$), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := t - 2 \cdot \frac{\ell \cdot \ell}{Om}\\
t_3 := t\_1 \cdot \left(t\_2 - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_3 \leq 2 \cdot 10^{-303}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\_2\right)\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(t - \left(\ell \cdot \frac{\ell}{Om}\right) \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{2 \cdot \left(\left(\left(\left(\ell \cdot n\right) \cdot \left(\ell \cdot n\right)\right) \cdot U*\right) \cdot U\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*)))) < 1.99999999999999986e-303Initial program 20.5%
Taylor expanded in U* around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6414.2
Applied rewrites14.2%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6414.2
Applied rewrites14.2%
Taylor expanded in n around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6445.9
Applied rewrites45.9%
if 1.99999999999999986e-303 < (*.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 73.1%
Taylor expanded in n around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6469.9
Applied rewrites69.9%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Taylor expanded in U* around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6432.8
Applied rewrites32.8%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6432.8
Applied rewrites32.8%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2 (- t (* 2.0 (/ (* l l) Om))))
(t_3 (* t_1 (- t_2 (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_3 2e-303)
(sqrt (* 2.0 (* U (* n t_2))))
(if (<= t_3 INFINITY)
(sqrt (* t_1 (- t (* (* l (/ l Om)) 2.0))))
(* (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 t_1 = (2.0 * n) * U;
double t_2 = t - (2.0 * ((l * l) / Om));
double t_3 = t_1 * (t_2 - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_3 <= 2e-303) {
tmp = sqrt((2.0 * (U * (n * t_2))));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((t_1 * (t - ((l * (l / Om)) * 2.0))));
} else {
tmp = sqrt((U_42_ * U)) * (((sqrt(2.0) * n) * l) / Om);
}
return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = t - (2.0 * ((l * l) / Om));
double t_3 = t_1 * (t_2 - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_3 <= 2e-303) {
tmp = Math.sqrt((2.0 * (U * (n * t_2))));
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_1 * (t - ((l * (l / Om)) * 2.0))));
} 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_): t_1 = (2.0 * n) * U t_2 = t - (2.0 * ((l * l) / Om)) t_3 = t_1 * (t_2 - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))) tmp = 0 if t_3 <= 2e-303: tmp = math.sqrt((2.0 * (U * (n * t_2)))) elif t_3 <= math.inf: tmp = math.sqrt((t_1 * (t - ((l * (l / Om)) * 2.0)))) 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_) t_1 = Float64(Float64(2.0 * n) * U) t_2 = Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) t_3 = Float64(t_1 * Float64(t_2 - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_3 <= 2e-303) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t_2)))); elseif (t_3 <= Inf) tmp = sqrt(Float64(t_1 * Float64(t - Float64(Float64(l * Float64(l / Om)) * 2.0)))); 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_) t_1 = (2.0 * n) * U; t_2 = t - (2.0 * ((l * l) / Om)); t_3 = t_1 * (t_2 - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))); tmp = 0.0; if (t_3 <= 2e-303) tmp = sqrt((2.0 * (U * (n * t_2)))); elseif (t_3 <= Inf) tmp = sqrt((t_1 * (t - ((l * (l / Om)) * 2.0)))); 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$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * N[(t$95$2 - 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$3, 2e-303], N[Sqrt[N[(2.0 * N[(U * N[(n * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$1 * N[(t - N[(N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $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}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := t - 2 \cdot \frac{\ell \cdot \ell}{Om}\\
t_3 := t\_1 \cdot \left(t\_2 - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_3 \leq 2 \cdot 10^{-303}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\_2\right)\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(t - \left(\ell \cdot \frac{\ell}{Om}\right) \cdot 2\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*)))) < 1.99999999999999986e-303Initial program 20.5%
Taylor expanded in U* around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6414.2
Applied rewrites14.2%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6414.2
Applied rewrites14.2%
Taylor expanded in n around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6445.9
Applied rewrites45.9%
if 1.99999999999999986e-303 < (*.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 73.1%
Taylor expanded in n around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6469.9
Applied rewrites69.9%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
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.f6413.0
Applied rewrites13.0%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (* (* 2.0 n) U))
(t_3 (- t (* 2.0 t_1)))
(t_4 (* t_2 (- t_3 (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_4 2e-303)
(sqrt (* 2.0 (* U (* n t_3))))
(if (<= t_4 1e+289)
(sqrt (* t_2 (+ (* -2.0 t_1) t)))
(sqrt (* (* n 2.0) (* U (- t (* (* (/ l Om) l) 2.0)))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = (2.0 * n) * U;
double t_3 = t - (2.0 * t_1);
double t_4 = t_2 * (t_3 - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_4 <= 2e-303) {
tmp = sqrt((2.0 * (U * (n * t_3))));
} else if (t_4 <= 1e+289) {
tmp = sqrt((t_2 * ((-2.0 * t_1) + t)));
} else {
tmp = sqrt(((n * 2.0) * (U * (t - (((l / Om) * l) * 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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (l * l) / om
t_2 = (2.0d0 * n) * u
t_3 = t - (2.0d0 * t_1)
t_4 = t_2 * (t_3 - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))
if (t_4 <= 2d-303) then
tmp = sqrt((2.0d0 * (u * (n * t_3))))
else if (t_4 <= 1d+289) then
tmp = sqrt((t_2 * (((-2.0d0) * t_1) + t)))
else
tmp = sqrt(((n * 2.0d0) * (u * (t - (((l / om) * l) * 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 t_1 = (l * l) / Om;
double t_2 = (2.0 * n) * U;
double t_3 = t - (2.0 * t_1);
double t_4 = t_2 * (t_3 - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_4 <= 2e-303) {
tmp = Math.sqrt((2.0 * (U * (n * t_3))));
} else if (t_4 <= 1e+289) {
tmp = Math.sqrt((t_2 * ((-2.0 * t_1) + t)));
} else {
tmp = Math.sqrt(((n * 2.0) * (U * (t - (((l / Om) * l) * 2.0)))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = (l * l) / Om t_2 = (2.0 * n) * U t_3 = t - (2.0 * t_1) t_4 = t_2 * (t_3 - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))) tmp = 0 if t_4 <= 2e-303: tmp = math.sqrt((2.0 * (U * (n * t_3)))) elif t_4 <= 1e+289: tmp = math.sqrt((t_2 * ((-2.0 * t_1) + t))) else: tmp = math.sqrt(((n * 2.0) * (U * (t - (((l / Om) * l) * 2.0))))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(Float64(2.0 * n) * U) t_3 = Float64(t - Float64(2.0 * t_1)) t_4 = Float64(t_2 * Float64(t_3 - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_4 <= 2e-303) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t_3)))); elseif (t_4 <= 1e+289) tmp = sqrt(Float64(t_2 * Float64(Float64(-2.0 * t_1) + t))); else tmp = sqrt(Float64(Float64(n * 2.0) * Float64(U * Float64(t - Float64(Float64(Float64(l / Om) * l) * 2.0))))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (l * l) / Om; t_2 = (2.0 * n) * U; t_3 = t - (2.0 * t_1); t_4 = t_2 * (t_3 - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))); tmp = 0.0; if (t_4 <= 2e-303) tmp = sqrt((2.0 * (U * (n * t_3)))); elseif (t_4 <= 1e+289) tmp = sqrt((t_2 * ((-2.0 * t_1) + t))); else tmp = sqrt(((n * 2.0) * (U * (t - (((l / Om) * l) * 2.0))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 * N[(t$95$3 - 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$4, 2e-303], N[Sqrt[N[(2.0 * N[(U * N[(n * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 1e+289], N[Sqrt[N[(t$95$2 * N[(N[(-2.0 * t$95$1), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(U * N[(t - N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := t - 2 \cdot t\_1\\
t_4 := t\_2 \cdot \left(t\_3 - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_4 \leq 2 \cdot 10^{-303}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\_3\right)\right)}\\
\mathbf{elif}\;t\_4 \leq 10^{+289}:\\
\;\;\;\;\sqrt{t\_2 \cdot \left(-2 \cdot t\_1 + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot \left(t - \left(\frac{\ell}{Om} \cdot \ell\right) \cdot 2\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*)))) < 1.99999999999999986e-303Initial program 20.5%
Taylor expanded in U* around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6414.2
Applied rewrites14.2%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6414.2
Applied rewrites14.2%
Taylor expanded in n around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6445.9
Applied rewrites45.9%
if 1.99999999999999986e-303 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1.0000000000000001e289Initial program 98.8%
Taylor expanded in Om around -inf
+-commutativeN/A
lower-+.f64N/A
Applied rewrites88.7%
Taylor expanded in n around 0
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6490.9
Applied rewrites90.9%
if 1.0000000000000001e289 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 22.7%
Applied rewrites33.2%
Taylor expanded in n around 0
associate--l-N/A
associate-*r/N/A
*-commutativeN/A
lift-pow.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
*-commutativeN/A
associate--l-N/A
Applied rewrites27.7%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U)) (t_2 (- t (* 2.0 (/ (* l l) Om)))))
(if (<= (* t_1 (- t_2 (* (* n (pow (/ l Om) 2.0)) (- U U*)))) 2e-303)
(sqrt (* 2.0 (* U (* n t_2))))
(sqrt (* t_1 (- t (* (* l (/ l 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;
double t_2 = t - (2.0 * ((l * l) / Om));
double tmp;
if ((t_1 * (t_2 - ((n * pow((l / Om), 2.0)) * (U - U_42_)))) <= 2e-303) {
tmp = sqrt((2.0 * (U * (n * t_2))));
} else {
tmp = sqrt((t_1 * (t - ((l * (l / Om)) * 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (2.0d0 * n) * u
t_2 = t - (2.0d0 * ((l * l) / om))
if ((t_1 * (t_2 - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))) <= 2d-303) then
tmp = sqrt((2.0d0 * (u * (n * t_2))))
else
tmp = sqrt((t_1 * (t - ((l * (l / om)) * 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 t_1 = (2.0 * n) * U;
double t_2 = t - (2.0 * ((l * l) / Om));
double tmp;
if ((t_1 * (t_2 - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))) <= 2e-303) {
tmp = Math.sqrt((2.0 * (U * (n * t_2))));
} else {
tmp = Math.sqrt((t_1 * (t - ((l * (l / Om)) * 2.0))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = (2.0 * n) * U t_2 = t - (2.0 * ((l * l) / Om)) tmp = 0 if (t_1 * (t_2 - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))) <= 2e-303: tmp = math.sqrt((2.0 * (U * (n * t_2)))) else: tmp = math.sqrt((t_1 * (t - ((l * (l / Om)) * 2.0)))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) t_2 = Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) tmp = 0.0 if (Float64(t_1 * Float64(t_2 - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) <= 2e-303) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * t_2)))); else tmp = sqrt(Float64(t_1 * Float64(t - Float64(Float64(l * Float64(l / 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 = t - (2.0 * ((l * l) / Om)); tmp = 0.0; if ((t_1 * (t_2 - ((n * ((l / Om) ^ 2.0)) * (U - U_42_)))) <= 2e-303) tmp = sqrt((2.0 * (U * (n * t_2)))); else tmp = sqrt((t_1 * (t - ((l * (l / Om)) * 2.0)))); 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 - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 * N[(t$95$2 - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e-303], N[Sqrt[N[(2.0 * N[(U * N[(n * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(t$95$1 * N[(t - N[(N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := t - 2 \cdot \frac{\ell \cdot \ell}{Om}\\
\mathbf{if}\;t\_1 \cdot \left(t\_2 - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right) \leq 2 \cdot 10^{-303}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\_2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(t - \left(\ell \cdot \frac{\ell}{Om}\right) \cdot 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*)))) < 1.99999999999999986e-303Initial program 20.5%
Taylor expanded in U* around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6414.2
Applied rewrites14.2%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6414.2
Applied rewrites14.2%
Taylor expanded in n around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6445.9
Applied rewrites45.9%
if 1.99999999999999986e-303 < (*.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 61.8%
Taylor expanded in n around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6459.4
Applied rewrites59.4%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U)))
(if (<=
(*
t_1
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))
5e-272)
(sqrt (* (* (* t n) U) 2.0))
(sqrt (* t_1 t)))))
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 ((t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))) <= 5e-272) {
tmp = sqrt((((t * n) * U) * 2.0));
} else {
tmp = sqrt((t_1 * 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) :: tmp
t_1 = (2.0d0 * n) * u
if ((t_1 * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))) <= 5d-272) then
tmp = sqrt((((t * n) * u) * 2.0d0))
else
tmp = sqrt((t_1 * 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 tmp;
if ((t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))) <= 5e-272) {
tmp = Math.sqrt((((t * n) * U) * 2.0));
} else {
tmp = Math.sqrt((t_1 * t));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = (2.0 * n) * U tmp = 0 if (t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))) <= 5e-272: tmp = math.sqrt((((t * n) * U) * 2.0)) else: tmp = math.sqrt((t_1 * t)) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) tmp = 0.0 if (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-272) tmp = sqrt(Float64(Float64(Float64(t * n) * U) * 2.0)); else tmp = sqrt(Float64(t_1 * t)); 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 ((t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_)))) <= 5e-272) tmp = sqrt((((t * n) * U) * 2.0)); else tmp = sqrt((t_1 * 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]}, If[LessEqual[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], 5e-272], N[Sqrt[N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(t$95$1 * t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
\mathbf{if}\;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^{-272}:\\
\;\;\;\;\sqrt{\left(\left(t \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t\_1 \cdot t}\\
\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*)))) < 4.99999999999999982e-272Initial program 25.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6440.8
Applied rewrites40.8%
if 4.99999999999999982e-272 < (*.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 61.3%
Taylor expanded in t around inf
Applied rewrites48.8%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (- t (* (* l (/ l Om)) 2.0)))
(t_2 (* (- U U*) (* (* (/ l Om) (/ l Om)) n))))
(if (<= Om -1.36e+175)
(sqrt (* (* n 2.0) (* U (- t_1 t_2))))
(if (<= Om -1.46e-12)
(sqrt (- (* (/ (* (* l (* l n)) U) Om) -4.0) (* -2.0 (* (* t n) U))))
(if (<= Om 2.6e-26)
(sqrt (* (* n 2.0) (* U (- t t_2))))
(sqrt (* (* (* 2.0 n) U) t_1)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = t - ((l * (l / Om)) * 2.0);
double t_2 = (U - U_42_) * (((l / Om) * (l / Om)) * n);
double tmp;
if (Om <= -1.36e+175) {
tmp = sqrt(((n * 2.0) * (U * (t_1 - t_2))));
} else if (Om <= -1.46e-12) {
tmp = sqrt((((((l * (l * n)) * U) / Om) * -4.0) - (-2.0 * ((t * n) * U))));
} else if (Om <= 2.6e-26) {
tmp = sqrt(((n * 2.0) * (U * (t - t_2))));
} else {
tmp = sqrt((((2.0 * n) * 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) :: t_2
real(8) :: tmp
t_1 = t - ((l * (l / om)) * 2.0d0)
t_2 = (u - u_42) * (((l / om) * (l / om)) * n)
if (om <= (-1.36d+175)) then
tmp = sqrt(((n * 2.0d0) * (u * (t_1 - t_2))))
else if (om <= (-1.46d-12)) then
tmp = sqrt((((((l * (l * n)) * u) / om) * (-4.0d0)) - ((-2.0d0) * ((t * n) * u))))
else if (om <= 2.6d-26) then
tmp = sqrt(((n * 2.0d0) * (u * (t - t_2))))
else
tmp = sqrt((((2.0d0 * n) * 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 - ((l * (l / Om)) * 2.0);
double t_2 = (U - U_42_) * (((l / Om) * (l / Om)) * n);
double tmp;
if (Om <= -1.36e+175) {
tmp = Math.sqrt(((n * 2.0) * (U * (t_1 - t_2))));
} else if (Om <= -1.46e-12) {
tmp = Math.sqrt((((((l * (l * n)) * U) / Om) * -4.0) - (-2.0 * ((t * n) * U))));
} else if (Om <= 2.6e-26) {
tmp = Math.sqrt(((n * 2.0) * (U * (t - t_2))));
} else {
tmp = Math.sqrt((((2.0 * n) * U) * t_1));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = t - ((l * (l / Om)) * 2.0) t_2 = (U - U_42_) * (((l / Om) * (l / Om)) * n) tmp = 0 if Om <= -1.36e+175: tmp = math.sqrt(((n * 2.0) * (U * (t_1 - t_2)))) elif Om <= -1.46e-12: tmp = math.sqrt((((((l * (l * n)) * U) / Om) * -4.0) - (-2.0 * ((t * n) * U)))) elif Om <= 2.6e-26: tmp = math.sqrt(((n * 2.0) * (U * (t - t_2)))) else: tmp = math.sqrt((((2.0 * n) * U) * t_1)) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(t - Float64(Float64(l * Float64(l / Om)) * 2.0)) t_2 = Float64(Float64(U - U_42_) * Float64(Float64(Float64(l / Om) * Float64(l / Om)) * n)) tmp = 0.0 if (Om <= -1.36e+175) tmp = sqrt(Float64(Float64(n * 2.0) * Float64(U * Float64(t_1 - t_2)))); elseif (Om <= -1.46e-12) tmp = sqrt(Float64(Float64(Float64(Float64(Float64(l * Float64(l * n)) * U) / Om) * -4.0) - Float64(-2.0 * Float64(Float64(t * n) * U)))); elseif (Om <= 2.6e-26) tmp = sqrt(Float64(Float64(n * 2.0) * Float64(U * Float64(t - t_2)))); else tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * t_1)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = t - ((l * (l / Om)) * 2.0); t_2 = (U - U_42_) * (((l / Om) * (l / Om)) * n); tmp = 0.0; if (Om <= -1.36e+175) tmp = sqrt(((n * 2.0) * (U * (t_1 - t_2)))); elseif (Om <= -1.46e-12) tmp = sqrt((((((l * (l * n)) * U) / Om) * -4.0) - (-2.0 * ((t * n) * U)))); elseif (Om <= 2.6e-26) tmp = sqrt(((n * 2.0) * (U * (t - t_2)))); else tmp = sqrt((((2.0 * n) * U) * t_1)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(t - N[(N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(U - U$42$), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * N[(l / Om), $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Om, -1.36e+175], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(U * N[(t$95$1 - t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[Om, -1.46e-12], N[Sqrt[N[(N[(N[(N[(N[(l * N[(l * n), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision] / Om), $MachinePrecision] * -4.0), $MachinePrecision] - N[(-2.0 * N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[Om, 2.6e-26], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(U * N[(t - t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \left(\ell \cdot \frac{\ell}{Om}\right) \cdot 2\\
t_2 := \left(U - U*\right) \cdot \left(\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right) \cdot n\right)\\
\mathbf{if}\;Om \leq -1.36 \cdot 10^{+175}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot \left(t\_1 - t\_2\right)\right)}\\
\mathbf{elif}\;Om \leq -1.46 \cdot 10^{-12}:\\
\;\;\;\;\sqrt{\frac{\left(\ell \cdot \left(\ell \cdot n\right)\right) \cdot U}{Om} \cdot -4 - -2 \cdot \left(\left(t \cdot n\right) \cdot U\right)}\\
\mathbf{elif}\;Om \leq 2.6 \cdot 10^{-26}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot \left(t - t\_2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t\_1}\\
\end{array}
\end{array}
if Om < -1.36e175Initial program 61.8%
Applied rewrites72.9%
lift-/.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6472.9
Applied rewrites72.9%
if -1.36e175 < Om < -1.46000000000000004e-12Initial program 61.4%
Taylor expanded in Om around inf
fp-cancel-sign-sub-invN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
metadata-evalN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.9
Applied rewrites61.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f6472.4
Applied rewrites72.4%
if -1.46000000000000004e-12 < Om < 2.6000000000000001e-26Initial program 47.4%
Applied rewrites53.4%
lift-/.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6453.4
Applied rewrites53.4%
Taylor expanded in t around inf
Applied rewrites63.2%
if 2.6000000000000001e-26 < Om Initial program 57.4%
Taylor expanded in n around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6462.3
Applied rewrites62.3%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= Om -1.05e+179)
(sqrt (* (* n 2.0) (* U (- t (* (* (/ l Om) l) 2.0)))))
(if (<= Om -1.46e-12)
(sqrt (- (* (/ (* (* l (* l n)) U) Om) -4.0) (* -2.0 (* (* t n) U))))
(if (<= Om 2.6e-26)
(sqrt
(* (* n 2.0) (* U (- t (* (- U U*) (* (* (/ l Om) (/ l Om)) n))))))
(sqrt (* (* (* 2.0 n) U) (- t (* (* l (/ l Om)) 2.0))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (Om <= -1.05e+179) {
tmp = sqrt(((n * 2.0) * (U * (t - (((l / Om) * l) * 2.0)))));
} else if (Om <= -1.46e-12) {
tmp = sqrt((((((l * (l * n)) * U) / Om) * -4.0) - (-2.0 * ((t * n) * U))));
} else if (Om <= 2.6e-26) {
tmp = sqrt(((n * 2.0) * (U * (t - ((U - U_42_) * (((l / Om) * (l / Om)) * n))))));
} else {
tmp = sqrt((((2.0 * n) * U) * (t - ((l * (l / Om)) * 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 (om <= (-1.05d+179)) then
tmp = sqrt(((n * 2.0d0) * (u * (t - (((l / om) * l) * 2.0d0)))))
else if (om <= (-1.46d-12)) then
tmp = sqrt((((((l * (l * n)) * u) / om) * (-4.0d0)) - ((-2.0d0) * ((t * n) * u))))
else if (om <= 2.6d-26) then
tmp = sqrt(((n * 2.0d0) * (u * (t - ((u - u_42) * (((l / om) * (l / om)) * n))))))
else
tmp = sqrt((((2.0d0 * n) * u) * (t - ((l * (l / om)) * 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 (Om <= -1.05e+179) {
tmp = Math.sqrt(((n * 2.0) * (U * (t - (((l / Om) * l) * 2.0)))));
} else if (Om <= -1.46e-12) {
tmp = Math.sqrt((((((l * (l * n)) * U) / Om) * -4.0) - (-2.0 * ((t * n) * U))));
} else if (Om <= 2.6e-26) {
tmp = Math.sqrt(((n * 2.0) * (U * (t - ((U - U_42_) * (((l / Om) * (l / Om)) * n))))));
} else {
tmp = Math.sqrt((((2.0 * n) * U) * (t - ((l * (l / Om)) * 2.0))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if Om <= -1.05e+179: tmp = math.sqrt(((n * 2.0) * (U * (t - (((l / Om) * l) * 2.0))))) elif Om <= -1.46e-12: tmp = math.sqrt((((((l * (l * n)) * U) / Om) * -4.0) - (-2.0 * ((t * n) * U)))) elif Om <= 2.6e-26: tmp = math.sqrt(((n * 2.0) * (U * (t - ((U - U_42_) * (((l / Om) * (l / Om)) * n)))))) else: tmp = math.sqrt((((2.0 * n) * U) * (t - ((l * (l / Om)) * 2.0)))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (Om <= -1.05e+179) tmp = sqrt(Float64(Float64(n * 2.0) * Float64(U * Float64(t - Float64(Float64(Float64(l / Om) * l) * 2.0))))); elseif (Om <= -1.46e-12) tmp = sqrt(Float64(Float64(Float64(Float64(Float64(l * Float64(l * n)) * U) / Om) * -4.0) - Float64(-2.0 * Float64(Float64(t * n) * U)))); elseif (Om <= 2.6e-26) tmp = sqrt(Float64(Float64(n * 2.0) * Float64(U * Float64(t - Float64(Float64(U - U_42_) * Float64(Float64(Float64(l / Om) * Float64(l / Om)) * n)))))); else tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(t - Float64(Float64(l * Float64(l / Om)) * 2.0)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (Om <= -1.05e+179) tmp = sqrt(((n * 2.0) * (U * (t - (((l / Om) * l) * 2.0))))); elseif (Om <= -1.46e-12) tmp = sqrt((((((l * (l * n)) * U) / Om) * -4.0) - (-2.0 * ((t * n) * U)))); elseif (Om <= 2.6e-26) tmp = sqrt(((n * 2.0) * (U * (t - ((U - U_42_) * (((l / Om) * (l / Om)) * n)))))); else tmp = sqrt((((2.0 * n) * U) * (t - ((l * (l / Om)) * 2.0)))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[Om, -1.05e+179], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(U * N[(t - N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[Om, -1.46e-12], N[Sqrt[N[(N[(N[(N[(N[(l * N[(l * n), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision] / Om), $MachinePrecision] * -4.0), $MachinePrecision] - N[(-2.0 * N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[Om, 2.6e-26], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(U * N[(t - N[(N[(U - U$42$), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * N[(l / Om), $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(t - N[(N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;Om \leq -1.05 \cdot 10^{+179}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot \left(t - \left(\frac{\ell}{Om} \cdot \ell\right) \cdot 2\right)\right)}\\
\mathbf{elif}\;Om \leq -1.46 \cdot 10^{-12}:\\
\;\;\;\;\sqrt{\frac{\left(\ell \cdot \left(\ell \cdot n\right)\right) \cdot U}{Om} \cdot -4 - -2 \cdot \left(\left(t \cdot n\right) \cdot U\right)}\\
\mathbf{elif}\;Om \leq 2.6 \cdot 10^{-26}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot \left(t - \left(U - U*\right) \cdot \left(\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right) \cdot n\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t - \left(\ell \cdot \frac{\ell}{Om}\right) \cdot 2\right)}\\
\end{array}
\end{array}
if Om < -1.0499999999999999e179Initial program 61.8%
Applied rewrites72.9%
Taylor expanded in n around 0
associate--l-N/A
associate-*r/N/A
*-commutativeN/A
lift-pow.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
*-commutativeN/A
associate--l-N/A
Applied rewrites72.7%
if -1.0499999999999999e179 < Om < -1.46000000000000004e-12Initial program 61.4%
Taylor expanded in Om around inf
fp-cancel-sign-sub-invN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
metadata-evalN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.9
Applied rewrites61.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f6472.4
Applied rewrites72.4%
if -1.46000000000000004e-12 < Om < 2.6000000000000001e-26Initial program 47.4%
Applied rewrites53.4%
lift-/.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f6453.4
Applied rewrites53.4%
Taylor expanded in t around inf
Applied rewrites63.2%
if 2.6000000000000001e-26 < Om Initial program 57.4%
Taylor expanded in n around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6462.3
Applied rewrites62.3%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= l 5.3e-156)
(sqrt (* (* (* 2.0 n) U) t))
(if (<= l 3.4e+140)
(sqrt (* 2.0 (* U (* n (- t (* 2.0 (/ (* l l) Om)))))))
(sqrt (* (* n 2.0) (* U (- t (* (* (/ l Om) l) 2.0))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 5.3e-156) {
tmp = sqrt((((2.0 * n) * U) * t));
} else if (l <= 3.4e+140) {
tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
} else {
tmp = sqrt(((n * 2.0) * (U * (t - (((l / Om) * l) * 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 (l <= 5.3d-156) then
tmp = sqrt((((2.0d0 * n) * u) * t))
else if (l <= 3.4d+140) then
tmp = sqrt((2.0d0 * (u * (n * (t - (2.0d0 * ((l * l) / om)))))))
else
tmp = sqrt(((n * 2.0d0) * (u * (t - (((l / om) * l) * 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 (l <= 5.3e-156) {
tmp = Math.sqrt((((2.0 * n) * U) * t));
} else if (l <= 3.4e+140) {
tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
} else {
tmp = Math.sqrt(((n * 2.0) * (U * (t - (((l / Om) * l) * 2.0)))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 5.3e-156: tmp = math.sqrt((((2.0 * n) * U) * t)) elif l <= 3.4e+140: tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om))))))) else: tmp = math.sqrt(((n * 2.0) * (U * (t - (((l / Om) * l) * 2.0))))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 5.3e-156) tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * t)); elseif (l <= 3.4e+140) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))))))); else tmp = sqrt(Float64(Float64(n * 2.0) * Float64(U * Float64(t - Float64(Float64(Float64(l / Om) * l) * 2.0))))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 5.3e-156) tmp = sqrt((((2.0 * n) * U) * t)); elseif (l <= 3.4e+140) tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om))))))); else tmp = sqrt(((n * 2.0) * (U * (t - (((l / Om) * l) * 2.0))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 5.3e-156], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 3.4e+140], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(U * N[(t - N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 5.3 \cdot 10^{-156}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\
\mathbf{elif}\;\ell \leq 3.4 \cdot 10^{+140}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot \left(t - \left(\frac{\ell}{Om} \cdot \ell\right) \cdot 2\right)\right)}\\
\end{array}
\end{array}
if l < 5.29999999999999968e-156Initial program 60.4%
Taylor expanded in t around inf
Applied rewrites51.1%
if 5.29999999999999968e-156 < l < 3.4e140Initial program 57.0%
Taylor expanded in U* around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6422.1
Applied rewrites22.1%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6422.1
Applied rewrites22.1%
Taylor expanded in n around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6455.8
Applied rewrites55.8%
if 3.4e140 < l Initial program 19.6%
Applied rewrites48.1%
Taylor expanded in n around 0
associate--l-N/A
associate-*r/N/A
*-commutativeN/A
lift-pow.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
*-commutativeN/A
associate--l-N/A
Applied rewrites48.8%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 5.3e-156) (sqrt (* (* (* 2.0 n) U) t)) (sqrt (* (* (* (- t (* (* l (/ l Om)) 2.0)) n) U) 2.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 5.3e-156) {
tmp = sqrt((((2.0 * n) * U) * t));
} else {
tmp = sqrt(((((t - ((l * (l / Om)) * 2.0)) * 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 (l <= 5.3d-156) then
tmp = sqrt((((2.0d0 * n) * u) * t))
else
tmp = sqrt(((((t - ((l * (l / om)) * 2.0d0)) * 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 (l <= 5.3e-156) {
tmp = Math.sqrt((((2.0 * n) * U) * t));
} else {
tmp = Math.sqrt(((((t - ((l * (l / Om)) * 2.0)) * n) * U) * 2.0));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 5.3e-156: tmp = math.sqrt((((2.0 * n) * U) * t)) else: tmp = math.sqrt(((((t - ((l * (l / Om)) * 2.0)) * n) * U) * 2.0)) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 5.3e-156) tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * t)); else tmp = sqrt(Float64(Float64(Float64(Float64(t - Float64(Float64(l * Float64(l / Om)) * 2.0)) * n) * U) * 2.0)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 5.3e-156) tmp = sqrt((((2.0 * n) * U) * t)); else tmp = sqrt(((((t - ((l * (l / Om)) * 2.0)) * n) * U) * 2.0)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 5.3e-156], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(t - N[(N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 5.3 \cdot 10^{-156}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\left(t - \left(\ell \cdot \frac{\ell}{Om}\right) \cdot 2\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\end{array}
\end{array}
if l < 5.29999999999999968e-156Initial program 60.4%
Taylor expanded in t around inf
Applied rewrites51.1%
if 5.29999999999999968e-156 < l Initial program 45.7%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6448.4
Applied rewrites48.4%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 5.3e-156) (sqrt (* (* (* 2.0 n) U) t)) (sqrt (* 2.0 (* U (* n (- t (* 2.0 (/ (* l l) Om)))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 5.3e-156) {
tmp = sqrt((((2.0 * n) * U) * t));
} else {
tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l * 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 (l <= 5.3d-156) then
tmp = sqrt((((2.0d0 * n) * u) * t))
else
tmp = sqrt((2.0d0 * (u * (n * (t - (2.0d0 * ((l * 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 (l <= 5.3e-156) {
tmp = Math.sqrt((((2.0 * n) * U) * t));
} else {
tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 5.3e-156: tmp = math.sqrt((((2.0 * n) * U) * t)) else: tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om))))))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 5.3e-156) tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * t)); else tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))))))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 5.3e-156) tmp = sqrt((((2.0 * n) * U) * t)); else tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om))))))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 5.3e-156], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 5.3 \cdot 10^{-156}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)\right)}\\
\end{array}
\end{array}
if l < 5.29999999999999968e-156Initial program 60.4%
Taylor expanded in t around inf
Applied rewrites51.1%
if 5.29999999999999968e-156 < l Initial program 45.7%
Taylor expanded in U* around inf
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6421.6
Applied rewrites21.6%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6421.6
Applied rewrites21.6%
Taylor expanded in n around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6444.3
Applied rewrites44.3%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* t n) U) 2.0)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((t * n) * U) * 2.0));
}
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) * u) * 2.0d0))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((t * n) * U) * 2.0));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((t * n) * U) * 2.0))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(t * n) * U) * 2.0)) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((t * n) * U) * 2.0)); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(t \cdot n\right) \cdot U\right) \cdot 2}
\end{array}
Initial program 55.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6444.2
Applied rewrites44.2%
herbie shell --seed 2025058
(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*))))))