
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}
\end{array}
Herbie found 15 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 (- t (* (/ l Om) (fma (* (/ l Om) n) (- U U*) (* l 2.0))))))
(if (<= U 1.75e-294)
(pow (* t_1 (* (* U 2.0) n)) 0.5)
(* (sqrt (* (* n 2.0) t_1)) (sqrt U)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = t - ((l / Om) * fma(((l / Om) * n), (U - U_42_), (l * 2.0)));
double tmp;
if (U <= 1.75e-294) {
tmp = pow((t_1 * ((U * 2.0) * n)), 0.5);
} else {
tmp = sqrt(((n * 2.0) * t_1)) * sqrt(U);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(t - Float64(Float64(l / Om) * fma(Float64(Float64(l / Om) * n), Float64(U - U_42_), Float64(l * 2.0)))) tmp = 0.0 if (U <= 1.75e-294) tmp = Float64(t_1 * Float64(Float64(U * 2.0) * n)) ^ 0.5; else tmp = Float64(sqrt(Float64(Float64(n * 2.0) * t_1)) * sqrt(U)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(t - N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision] * N[(U - U$42$), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[U, 1.75e-294], N[Power[N[(t$95$1 * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[(N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sqrt[U], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{\ell}{Om} \cdot \mathsf{fma}\left(\frac{\ell}{Om} \cdot n, U - U*, \ell \cdot 2\right)\\
\mathbf{if}\;U \leq 1.75 \cdot 10^{-294}:\\
\;\;\;\;{\left(t\_1 \cdot \left(\left(U \cdot 2\right) \cdot n\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot t\_1} \cdot \sqrt{U}\\
\end{array}
\end{array}
if U < 1.75000000000000016e-294Initial program 48.8%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6454.2
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.0
Applied rewrites51.0%
Applied rewrites59.5%
if 1.75000000000000016e-294 < U Initial program 52.4%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6457.6
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6454.5
Applied rewrites54.5%
Applied rewrites71.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (/ l Om) n))
(t_2
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))))
(if (<= t_2 1e+58)
(sqrt (* (* (- t (* (/ l Om) (fma t_1 (- U U*) (* l 2.0)))) (* n 2.0)) U))
(if (<= t_2 2e+154)
(sqrt (* (* (+ n n) U) (- t (* (* n (/ (* l l) (* Om Om))) (- U U*)))))
(if (<= t_2 INFINITY)
(sqrt (* (* (- t (* (/ l Om) (fma t_1 (- U U*) (+ l l)))) U) (+ n n)))
(sqrt
(*
-2.0
(/
(* U (* l (* n (fma 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 = (l / Om) * n;
double t_2 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_2 <= 1e+58) {
tmp = sqrt((((t - ((l / Om) * fma(t_1, (U - U_42_), (l * 2.0)))) * (n * 2.0)) * U));
} else if (t_2 <= 2e+154) {
tmp = sqrt((((n + n) * U) * (t - ((n * ((l * l) / (Om * Om))) * (U - U_42_)))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt((((t - ((l / Om) * fma(t_1, (U - U_42_), (l + l)))) * U) * (n + n)));
} else {
tmp = sqrt((-2.0 * ((U * (l * (n * fma(2.0, l, ((l * (n * (U - U_42_))) / Om))))) / Om)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l / Om) * n) t_2 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_2 <= 1e+58) tmp = sqrt(Float64(Float64(Float64(t - Float64(Float64(l / Om) * fma(t_1, Float64(U - U_42_), Float64(l * 2.0)))) * Float64(n * 2.0)) * U)); elseif (t_2 <= 2e+154) tmp = sqrt(Float64(Float64(Float64(n + n) * U) * Float64(t - Float64(Float64(n * Float64(Float64(l * l) / Float64(Om * Om))) * Float64(U - U_42_))))); elseif (t_2 <= Inf) tmp = sqrt(Float64(Float64(Float64(t - Float64(Float64(l / Om) * fma(t_1, Float64(U - U_42_), Float64(l + l)))) * U) * Float64(n + n))); else tmp = sqrt(Float64(-2.0 * Float64(Float64(U * Float64(l * Float64(n * fma(2.0, l, Float64(Float64(l * Float64(n * Float64(U - U_42_))) / Om))))) / Om))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 1e+58], N[Sqrt[N[(N[(N[(t - N[(N[(l / Om), $MachinePrecision] * N[(t$95$1 * N[(U - U$42$), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(n * 2.0), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, 2e+154], N[Sqrt[N[(N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision] * N[(t - N[(N[(n * N[(N[(l * l), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(N[(t - N[(N[(l / Om), $MachinePrecision] * N[(t$95$1 * N[(U - U$42$), $MachinePrecision] + N[(l + l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision] * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(-2.0 * N[(N[(U * N[(l * N[(n * N[(2.0 * l + N[(N[(l * N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell}{Om} \cdot n\\
t_2 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_2 \leq 10^{+58}:\\
\;\;\;\;\sqrt{\left(\left(t - \frac{\ell}{Om} \cdot \mathsf{fma}\left(t\_1, U - U*, \ell \cdot 2\right)\right) \cdot \left(n \cdot 2\right)\right) \cdot U}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+154}:\\
\;\;\;\;\sqrt{\left(\left(n + n\right) \cdot U\right) \cdot \left(t - \left(n \cdot \frac{\ell \cdot \ell}{Om \cdot Om}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(\left(t - \frac{\ell}{Om} \cdot \mathsf{fma}\left(t\_1, U - U*, \ell + \ell\right)\right) \cdot U\right) \cdot \left(n + n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{-2 \cdot \frac{U \cdot \left(\ell \cdot \left(n \cdot \mathsf{fma}\left(2, \ell, \frac{\ell \cdot \left(n \cdot \left(U - U*\right)\right)}{Om}\right)\right)\right)}{Om}}\\
\end{array}
\end{array}
if (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 9.99999999999999944e57Initial program 70.6%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites74.1%
Applied rewrites75.0%
if 9.99999999999999944e57 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 2.00000000000000007e154Initial program 99.1%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f6487.0
Applied rewrites87.0%
lift-*.f64N/A
count-2-revN/A
lower-+.f6487.0
Applied rewrites87.0%
Taylor expanded in t around inf
Applied rewrites81.8%
if 2.00000000000000007e154 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < +inf.0Initial program 32.6%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6442.3
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
Applied rewrites43.6%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6443.6
Applied rewrites43.6%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lift-+.f6443.6
Applied rewrites43.6%
if +inf.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) Initial program 0.0%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6414.0
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6414.6
Applied rewrites14.6%
Applied rewrites36.4%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites54.5%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(t_2
(sqrt
(*
(* (- t (* (/ l Om) (fma (* (/ l Om) n) (- U U*) (+ l l)))) U)
(+ n n)))))
(if (<= t_1 7e-16)
t_2
(if (<= t_1 4e+148)
(sqrt
(* (- t (* (/ l Om) (* -1.0 (/ (* U* (* l n)) Om)))) (* (* U 2.0) n)))
(if (<= t_1 INFINITY)
t_2
(sqrt
(*
-2.0
(/
(* U (* l (* n (fma 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 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double t_2 = sqrt((((t - ((l / Om) * fma(((l / Om) * n), (U - U_42_), (l + l)))) * U) * (n + n)));
double tmp;
if (t_1 <= 7e-16) {
tmp = t_2;
} else if (t_1 <= 4e+148) {
tmp = sqrt(((t - ((l / Om) * (-1.0 * ((U_42_ * (l * n)) / Om)))) * ((U * 2.0) * n)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = sqrt((-2.0 * ((U * (l * (n * fma(2.0, l, ((l * (n * (U - U_42_))) / Om))))) / Om)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) t_2 = sqrt(Float64(Float64(Float64(t - Float64(Float64(l / Om) * fma(Float64(Float64(l / Om) * n), Float64(U - U_42_), Float64(l + l)))) * U) * Float64(n + n))) tmp = 0.0 if (t_1 <= 7e-16) tmp = t_2; elseif (t_1 <= 4e+148) tmp = sqrt(Float64(Float64(t - Float64(Float64(l / Om) * Float64(-1.0 * Float64(Float64(U_42_ * Float64(l * n)) / Om)))) * Float64(Float64(U * 2.0) * n))); elseif (t_1 <= Inf) tmp = t_2; else tmp = sqrt(Float64(-2.0 * Float64(Float64(U * Float64(l * Float64(n * fma(2.0, l, Float64(Float64(l * Float64(n * Float64(U - U_42_))) / Om))))) / Om))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[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]}, Block[{t$95$2 = N[Sqrt[N[(N[(N[(t - N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision] * N[(U - U$42$), $MachinePrecision] + N[(l + l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision] * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 7e-16], t$95$2, If[LessEqual[t$95$1, 4e+148], N[Sqrt[N[(N[(t - N[(N[(l / Om), $MachinePrecision] * N[(-1.0 * N[(N[(U$42$ * N[(l * n), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$2, N[Sqrt[N[(-2.0 * N[(N[(U * N[(l * N[(n * N[(2.0 * l + N[(N[(l * N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
t_2 := \sqrt{\left(\left(t - \frac{\ell}{Om} \cdot \mathsf{fma}\left(\frac{\ell}{Om} \cdot n, U - U*, \ell + \ell\right)\right) \cdot U\right) \cdot \left(n + n\right)}\\
\mathbf{if}\;t\_1 \leq 7 \cdot 10^{-16}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+148}:\\
\;\;\;\;\sqrt{\left(t - \frac{\ell}{Om} \cdot \left(-1 \cdot \frac{U* \cdot \left(\ell \cdot n\right)}{Om}\right)\right) \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\sqrt{-2 \cdot \frac{U \cdot \left(\ell \cdot \left(n \cdot \mathsf{fma}\left(2, \ell, \frac{\ell \cdot \left(n \cdot \left(U - U*\right)\right)}{Om}\right)\right)\right)}{Om}}\\
\end{array}
\end{array}
if (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 7.00000000000000035e-16 or 4.0000000000000002e148 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < +inf.0Initial program 46.0%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6451.0
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6448.6
Applied rewrites48.6%
Applied rewrites55.6%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6455.6
Applied rewrites55.6%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lift-+.f6455.6
Applied rewrites55.6%
if 7.00000000000000035e-16 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 4.0000000000000002e148Initial program 98.9%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6498.9
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6491.1
Applied rewrites91.1%
Applied rewrites98.7%
Taylor expanded in U* around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6484.7
Applied rewrites84.7%
if +inf.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) Initial program 0.0%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6414.0
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6414.6
Applied rewrites14.6%
Applied rewrites36.4%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites54.5%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (- t (* (/ l Om) (fma (* (/ l Om) n) (- U U*) (* l 2.0)))))
(t_2
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))))
(if (<= t_2 4e-109)
(sqrt (* (* t_1 (* n 2.0)) U))
(if (<= t_2 INFINITY)
(sqrt (* t_1 (* (* U 2.0) n)))
(sqrt
(*
-2.0
(/ (* U (* l (* n (fma 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 = t - ((l / Om) * fma(((l / Om) * n), (U - U_42_), (l * 2.0)));
double t_2 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_2 <= 4e-109) {
tmp = sqrt(((t_1 * (n * 2.0)) * U));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt((t_1 * ((U * 2.0) * n)));
} else {
tmp = sqrt((-2.0 * ((U * (l * (n * fma(2.0, l, ((l * (n * (U - U_42_))) / Om))))) / Om)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(t - Float64(Float64(l / Om) * fma(Float64(Float64(l / Om) * n), Float64(U - U_42_), Float64(l * 2.0)))) t_2 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_2 <= 4e-109) tmp = sqrt(Float64(Float64(t_1 * Float64(n * 2.0)) * U)); elseif (t_2 <= Inf) tmp = sqrt(Float64(t_1 * Float64(Float64(U * 2.0) * n))); else tmp = sqrt(Float64(-2.0 * Float64(Float64(U * Float64(l * Float64(n * fma(2.0, l, Float64(Float64(l * Float64(n * Float64(U - U_42_))) / Om))))) / Om))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(t - N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision] * N[(U - U$42$), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 4e-109], N[Sqrt[N[(N[(t$95$1 * N[(n * 2.0), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(t$95$1 * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(-2.0 * N[(N[(U * N[(l * N[(n * N[(2.0 * l + N[(N[(l * N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{\ell}{Om} \cdot \mathsf{fma}\left(\frac{\ell}{Om} \cdot n, U - U*, \ell \cdot 2\right)\\
t_2 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_2 \leq 4 \cdot 10^{-109}:\\
\;\;\;\;\sqrt{\left(t\_1 \cdot \left(n \cdot 2\right)\right) \cdot U}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{-2 \cdot \frac{U \cdot \left(\ell \cdot \left(n \cdot \mathsf{fma}\left(2, \ell, \frac{\ell \cdot \left(n \cdot \left(U - U*\right)\right)}{Om}\right)\right)\right)}{Om}}\\
\end{array}
\end{array}
if (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 4e-109Initial program 31.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites47.8%
Applied rewrites48.4%
if 4e-109 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < +inf.0Initial program 68.3%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6472.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6468.0
Applied rewrites68.0%
Applied rewrites73.7%
if +inf.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) Initial program 0.0%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6414.0
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6414.6
Applied rewrites14.6%
Applied rewrites36.4%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites54.5%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* n (- U U*)))
(t_2
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))))
(if (<= t_2 4e-109)
(sqrt
(* 2.0 (* U (* n (- t (/ (* l (fma 2.0 l (/ (* U (* l n)) Om))) Om))))))
(if (<= t_2 INFINITY)
(sqrt (* (- t (* (/ l Om) (* l (+ 2.0 (/ t_1 Om))))) (* (* U 2.0) n)))
(sqrt
(* -2.0 (/ (* U (* l (* n (fma 2.0 l (/ (* l t_1) Om))))) Om)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = n * (U - U_42_);
double t_2 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_2 <= 4e-109) {
tmp = sqrt((2.0 * (U * (n * (t - ((l * fma(2.0, l, ((U * (l * n)) / Om))) / Om))))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt(((t - ((l / Om) * (l * (2.0 + (t_1 / Om))))) * ((U * 2.0) * n)));
} else {
tmp = sqrt((-2.0 * ((U * (l * (n * fma(2.0, l, ((l * t_1) / Om))))) / Om)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(n * Float64(U - U_42_)) t_2 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_2 <= 4e-109) tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(Float64(l * fma(2.0, l, Float64(Float64(U * Float64(l * n)) / Om))) / Om)))))); elseif (t_2 <= Inf) tmp = sqrt(Float64(Float64(t - Float64(Float64(l / Om) * Float64(l * Float64(2.0 + Float64(t_1 / Om))))) * Float64(Float64(U * 2.0) * n))); else tmp = sqrt(Float64(-2.0 * Float64(Float64(U * Float64(l * Float64(n * fma(2.0, l, Float64(Float64(l * t_1) / Om))))) / Om))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 4e-109], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(N[(l * N[(2.0 * l + N[(N[(U * N[(l * n), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(t - N[(N[(l / Om), $MachinePrecision] * N[(l * N[(2.0 + N[(t$95$1 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(-2.0 * N[(N[(U * N[(l * N[(n * N[(2.0 * l + N[(N[(l * t$95$1), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := n \cdot \left(U - U*\right)\\
t_2 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_2 \leq 4 \cdot 10^{-109}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - \frac{\ell \cdot \mathsf{fma}\left(2, \ell, \frac{U \cdot \left(\ell \cdot n\right)}{Om}\right)}{Om}\right)\right)\right)}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(t - \frac{\ell}{Om} \cdot \left(\ell \cdot \left(2 + \frac{t\_1}{Om}\right)\right)\right) \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{-2 \cdot \frac{U \cdot \left(\ell \cdot \left(n \cdot \mathsf{fma}\left(2, \ell, \frac{\ell \cdot t\_1}{Om}\right)\right)\right)}{Om}}\\
\end{array}
\end{array}
if (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 4e-109Initial program 31.7%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6431.7
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6431.3
Applied rewrites31.3%
Applied rewrites32.3%
Taylor expanded in U* around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6445.3
Applied rewrites45.3%
if 4e-109 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < +inf.0Initial program 68.3%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6472.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6468.0
Applied rewrites68.0%
Applied rewrites73.7%
Taylor expanded in l around 0
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6466.5
Applied rewrites66.5%
if +inf.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) Initial program 0.0%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6414.0
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6414.6
Applied rewrites14.6%
Applied rewrites36.4%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites54.5%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (- t (* (/ l Om) (* 2.0 l))))
(t_2
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_2 2e-310)
(sqrt (* (* t_1 U) (* n 2.0)))
(if (<= t_2 INFINITY)
(sqrt (* t_1 (* (* U 2.0) n)))
(* (/ (* l (* n (sqrt 2.0))) Om) (sqrt (* U U*)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = t - ((l / Om) * (2.0 * l));
double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 2e-310) {
tmp = sqrt(((t_1 * U) * (n * 2.0)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt((t_1 * ((U * 2.0) * n)));
} else {
tmp = ((l * (n * sqrt(2.0))) / Om) * sqrt((U * U_42_));
}
return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = t - ((l / Om) * (2.0 * l));
double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 2e-310) {
tmp = Math.sqrt(((t_1 * U) * (n * 2.0)));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((t_1 * ((U * 2.0) * n)));
} else {
tmp = ((l * (n * Math.sqrt(2.0))) / Om) * Math.sqrt((U * U_42_));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = t - ((l / Om) * (2.0 * l)) t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))) tmp = 0 if t_2 <= 2e-310: tmp = math.sqrt(((t_1 * U) * (n * 2.0))) elif t_2 <= math.inf: tmp = math.sqrt((t_1 * ((U * 2.0) * n))) else: tmp = ((l * (n * math.sqrt(2.0))) / Om) * math.sqrt((U * U_42_)) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(t - Float64(Float64(l / Om) * Float64(2.0 * l))) t_2 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_2 <= 2e-310) tmp = sqrt(Float64(Float64(t_1 * U) * Float64(n * 2.0))); elseif (t_2 <= Inf) tmp = sqrt(Float64(t_1 * Float64(Float64(U * 2.0) * n))); else tmp = Float64(Float64(Float64(l * Float64(n * sqrt(2.0))) / Om) * sqrt(Float64(U * U_42_))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = t - ((l / Om) * (2.0 * l)); t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))); tmp = 0.0; if (t_2 <= 2e-310) tmp = sqrt(((t_1 * U) * (n * 2.0))); elseif (t_2 <= Inf) tmp = sqrt((t_1 * ((U * 2.0) * n))); else tmp = ((l * (n * sqrt(2.0))) / Om) * sqrt((U * U_42_)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(t - N[(N[(l / Om), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 2e-310], N[Sqrt[N[(N[(t$95$1 * U), $MachinePrecision] * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(t$95$1 * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(l * N[(n * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] * N[Sqrt[N[(U * U$42$), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{\ell}{Om} \cdot \left(2 \cdot \ell\right)\\
t_2 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_2 \leq 2 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\left(t\_1 \cdot U\right) \cdot \left(n \cdot 2\right)}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \left(n \cdot \sqrt{2}\right)}{Om} \cdot \sqrt{U \cdot U*}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1.999999999999994e-310Initial program 12.0%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6414.5
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6415.1
Applied rewrites15.1%
Applied rewrites41.8%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6441.8
Applied rewrites41.8%
Taylor expanded in n around 0
lower-*.f6437.4
Applied rewrites37.4%
if 1.999999999999994e-310 < (*.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 69.8%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6474.0
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6469.4
Applied rewrites69.4%
Applied rewrites75.0%
Taylor expanded in n around 0
lower-*.f6463.9
Applied rewrites63.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%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6413.1
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6413.2
Applied rewrites13.2%
Applied rewrites32.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites42.7%
Taylor expanded in U* around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-*.f6423.3
Applied rewrites23.3%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(t_2 (sqrt (* 2.0 (* U (* n t))))))
(if (<= t_1 5e-142)
t_2
(if (<= t_1 2e+145) (sqrt (* (* (+ n n) U) t)) t_2))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double t_2 = sqrt((2.0 * (U * (n * t))));
double tmp;
if (t_1 <= 5e-142) {
tmp = t_2;
} else if (t_1 <= 2e+145) {
tmp = sqrt((((n + n) * U) * t));
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
t_2 = sqrt((2.0d0 * (u * (n * t))))
if (t_1 <= 5d-142) then
tmp = t_2
else if (t_1 <= 2d+145) then
tmp = sqrt((((n + n) * u) * t))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
double t_2 = Math.sqrt((2.0 * (U * (n * t))));
double tmp;
if (t_1 <= 5e-142) {
tmp = t_2;
} else if (t_1 <= 2e+145) {
tmp = Math.sqrt((((n + n) * U) * t));
} else {
tmp = t_2;
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))))) t_2 = math.sqrt((2.0 * (U * (n * t)))) tmp = 0 if t_1 <= 5e-142: tmp = t_2 elif t_1 <= 2e+145: tmp = math.sqrt((((n + n) * U) * t)) else: tmp = t_2 return tmp
function code(n, U, t, l, Om, U_42_) t_1 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) t_2 = sqrt(Float64(2.0 * Float64(U * Float64(n * t)))) tmp = 0.0 if (t_1 <= 5e-142) tmp = t_2; elseif (t_1 <= 2e+145) tmp = sqrt(Float64(Float64(Float64(n + n) * U) * t)); else tmp = t_2; end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); t_2 = sqrt((2.0 * (U * (n * t)))); tmp = 0.0; if (t_1 <= 5e-142) tmp = t_2; elseif (t_1 <= 2e+145) tmp = sqrt((((n + n) * U) * t)); else tmp = t_2; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[(N[(N[(2.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]}, Block[{t$95$2 = N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 5e-142], t$95$2, If[LessEqual[t$95$1, 2e+145], N[Sqrt[N[(N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
t_2 := \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-142}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+145}:\\
\;\;\;\;\sqrt{\left(\left(n + n\right) \cdot U\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 5.0000000000000002e-142 or 2e145 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) Initial program 21.3%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6429.9
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6428.5
Applied rewrites28.5%
Applied rewrites36.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6417.6
Applied rewrites17.6%
if 5.0000000000000002e-142 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 2e145Initial program 98.0%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f6486.6
Applied rewrites86.6%
lift-*.f64N/A
count-2-revN/A
lower-+.f6486.6
Applied rewrites86.6%
Taylor expanded in t around inf
Applied rewrites75.5%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (- t (* (/ l Om) (fma (* (/ l Om) n) (- U U*) (* l 2.0))))))
(if (<= U -5e-311)
(sqrt (* t_1 (* (* U 2.0) n)))
(* (sqrt (* (* n 2.0) t_1)) (sqrt U)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = t - ((l / Om) * fma(((l / Om) * n), (U - U_42_), (l * 2.0)));
double tmp;
if (U <= -5e-311) {
tmp = sqrt((t_1 * ((U * 2.0) * n)));
} else {
tmp = sqrt(((n * 2.0) * t_1)) * sqrt(U);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(t - Float64(Float64(l / Om) * fma(Float64(Float64(l / Om) * n), Float64(U - U_42_), Float64(l * 2.0)))) tmp = 0.0 if (U <= -5e-311) tmp = sqrt(Float64(t_1 * Float64(Float64(U * 2.0) * n))); else tmp = Float64(sqrt(Float64(Float64(n * 2.0) * t_1)) * sqrt(U)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(t - N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision] * N[(U - U$42$), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[U, -5e-311], N[Sqrt[N[(t$95$1 * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sqrt[U], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{\ell}{Om} \cdot \mathsf{fma}\left(\frac{\ell}{Om} \cdot n, U - U*, \ell \cdot 2\right)\\
\mathbf{if}\;U \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot t\_1} \cdot \sqrt{U}\\
\end{array}
\end{array}
if U < -5.00000000000023e-311Initial program 49.5%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6454.9
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.7
Applied rewrites51.7%
Applied rewrites60.1%
if -5.00000000000023e-311 < U Initial program 51.6%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6456.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6453.8
Applied rewrites53.8%
Applied rewrites70.7%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (sqrt (* (- t (* (/ l Om) (* 2.0 l))) (* (* U 2.0) n)))))
(if (<= Om -2.2e-63)
t_1
(if (<= Om 1.6e+64)
(sqrt
(* (* (- t (* (/ l Om) (/ (* l (* n (- U U*))) Om))) U) (* n 2.0)))
t_1))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt(((t - ((l / Om) * (2.0 * l))) * ((U * 2.0) * n)));
double tmp;
if (Om <= -2.2e-63) {
tmp = t_1;
} else if (Om <= 1.6e+64) {
tmp = sqrt((((t - ((l / Om) * ((l * (n * (U - U_42_))) / Om))) * U) * (n * 2.0)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(((t - ((l / om) * (2.0d0 * l))) * ((u * 2.0d0) * n)))
if (om <= (-2.2d-63)) then
tmp = t_1
else if (om <= 1.6d+64) then
tmp = sqrt((((t - ((l / om) * ((l * (n * (u - u_42))) / om))) * u) * (n * 2.0d0)))
else
tmp = 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 = Math.sqrt(((t - ((l / Om) * (2.0 * l))) * ((U * 2.0) * n)));
double tmp;
if (Om <= -2.2e-63) {
tmp = t_1;
} else if (Om <= 1.6e+64) {
tmp = Math.sqrt((((t - ((l / Om) * ((l * (n * (U - U_42_))) / Om))) * U) * (n * 2.0)));
} else {
tmp = t_1;
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = math.sqrt(((t - ((l / Om) * (2.0 * l))) * ((U * 2.0) * n))) tmp = 0 if Om <= -2.2e-63: tmp = t_1 elif Om <= 1.6e+64: tmp = math.sqrt((((t - ((l / Om) * ((l * (n * (U - U_42_))) / Om))) * U) * (n * 2.0))) else: tmp = t_1 return tmp
function code(n, U, t, l, Om, U_42_) t_1 = sqrt(Float64(Float64(t - Float64(Float64(l / Om) * Float64(2.0 * l))) * Float64(Float64(U * 2.0) * n))) tmp = 0.0 if (Om <= -2.2e-63) tmp = t_1; elseif (Om <= 1.6e+64) tmp = sqrt(Float64(Float64(Float64(t - Float64(Float64(l / Om) * Float64(Float64(l * Float64(n * Float64(U - U_42_))) / Om))) * U) * Float64(n * 2.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = sqrt(((t - ((l / Om) * (2.0 * l))) * ((U * 2.0) * n))); tmp = 0.0; if (Om <= -2.2e-63) tmp = t_1; elseif (Om <= 1.6e+64) tmp = sqrt((((t - ((l / Om) * ((l * (n * (U - U_42_))) / Om))) * U) * (n * 2.0))); else tmp = t_1; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[(N[(t - N[(N[(l / Om), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[Om, -2.2e-63], t$95$1, If[LessEqual[Om, 1.6e+64], N[Sqrt[N[(N[(N[(t - N[(N[(l / Om), $MachinePrecision] * N[(N[(l * N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision] * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\left(t - \frac{\ell}{Om} \cdot \left(2 \cdot \ell\right)\right) \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{if}\;Om \leq -2.2 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;Om \leq 1.6 \cdot 10^{+64}:\\
\;\;\;\;\sqrt{\left(\left(t - \frac{\ell}{Om} \cdot \frac{\ell \cdot \left(n \cdot \left(U - U*\right)\right)}{Om}\right) \cdot U\right) \cdot \left(n \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if Om < -2.2e-63 or 1.60000000000000009e64 < Om Initial program 53.7%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6460.9
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6455.8
Applied rewrites55.8%
Applied rewrites62.1%
Taylor expanded in n around 0
lower-*.f6455.7
Applied rewrites55.7%
if -2.2e-63 < Om < 1.60000000000000009e64Initial program 46.3%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6448.9
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6448.5
Applied rewrites48.5%
Applied rewrites59.7%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6459.7
Applied rewrites59.7%
Taylor expanded in n around inf
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f6453.9
Applied rewrites53.9%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= t 2.5e+179)
(sqrt
(* (* (- t (* (/ l Om) (fma (* (/ l Om) n) (- U U*) (+ l l)))) U) (+ n n)))
(* (sqrt t) (sqrt (* U (+ n n))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= 2.5e+179) {
tmp = sqrt((((t - ((l / Om) * fma(((l / Om) * n), (U - U_42_), (l + l)))) * U) * (n + n)));
} else {
tmp = sqrt(t) * sqrt((U * (n + n)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= 2.5e+179) tmp = sqrt(Float64(Float64(Float64(t - Float64(Float64(l / Om) * fma(Float64(Float64(l / Om) * n), Float64(U - U_42_), Float64(l + l)))) * U) * Float64(n + n))); else tmp = Float64(sqrt(t) * sqrt(Float64(U * Float64(n + n)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, 2.5e+179], N[Sqrt[N[(N[(N[(t - N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision] * N[(U - U$42$), $MachinePrecision] + N[(l + l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision] * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[t], $MachinePrecision] * N[Sqrt[N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.5 \cdot 10^{+179}:\\
\;\;\;\;\sqrt{\left(\left(t - \frac{\ell}{Om} \cdot \mathsf{fma}\left(\frac{\ell}{Om} \cdot n, U - U*, \ell + \ell\right)\right) \cdot U\right) \cdot \left(n + n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t} \cdot \sqrt{U \cdot \left(n + n\right)}\\
\end{array}
\end{array}
if t < 2.5e179Initial program 50.7%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6456.0
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6453.2
Applied rewrites53.2%
Applied rewrites61.1%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6461.1
Applied rewrites61.1%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lift-+.f6461.1
Applied rewrites61.1%
if 2.5e179 < t Initial program 49.6%
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
*-commutativeN/A
unpow-prod-downN/A
lower-*.f64N/A
Applied rewrites59.9%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
lift-/.f64N/A
times-fracN/A
sqr-neg-revN/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-neg.f6454.0
Applied rewrites54.0%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6454.0
Applied rewrites54.0%
Taylor expanded in t around inf
Applied rewrites61.3%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (sqrt (* (- t (* (/ l Om) (* 2.0 l))) (* (* U 2.0) n)))))
(if (<= Om -1.52e+54)
t_1
(if (<= Om 3.3e+65)
(sqrt (* (* (+ n n) U) (- t (* (* n (/ (* l l) (* Om Om))) (- U U*)))))
t_1))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt(((t - ((l / Om) * (2.0 * l))) * ((U * 2.0) * n)));
double tmp;
if (Om <= -1.52e+54) {
tmp = t_1;
} else if (Om <= 3.3e+65) {
tmp = sqrt((((n + n) * U) * (t - ((n * ((l * l) / (Om * Om))) * (U - U_42_)))));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(((t - ((l / om) * (2.0d0 * l))) * ((u * 2.0d0) * n)))
if (om <= (-1.52d+54)) then
tmp = t_1
else if (om <= 3.3d+65) then
tmp = sqrt((((n + n) * u) * (t - ((n * ((l * l) / (om * om))) * (u - u_42)))))
else
tmp = 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 = Math.sqrt(((t - ((l / Om) * (2.0 * l))) * ((U * 2.0) * n)));
double tmp;
if (Om <= -1.52e+54) {
tmp = t_1;
} else if (Om <= 3.3e+65) {
tmp = Math.sqrt((((n + n) * U) * (t - ((n * ((l * l) / (Om * Om))) * (U - U_42_)))));
} else {
tmp = t_1;
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = math.sqrt(((t - ((l / Om) * (2.0 * l))) * ((U * 2.0) * n))) tmp = 0 if Om <= -1.52e+54: tmp = t_1 elif Om <= 3.3e+65: tmp = math.sqrt((((n + n) * U) * (t - ((n * ((l * l) / (Om * Om))) * (U - U_42_))))) else: tmp = t_1 return tmp
function code(n, U, t, l, Om, U_42_) t_1 = sqrt(Float64(Float64(t - Float64(Float64(l / Om) * Float64(2.0 * l))) * Float64(Float64(U * 2.0) * n))) tmp = 0.0 if (Om <= -1.52e+54) tmp = t_1; elseif (Om <= 3.3e+65) tmp = sqrt(Float64(Float64(Float64(n + n) * U) * Float64(t - Float64(Float64(n * Float64(Float64(l * l) / Float64(Om * Om))) * Float64(U - U_42_))))); else tmp = t_1; end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = sqrt(((t - ((l / Om) * (2.0 * l))) * ((U * 2.0) * n))); tmp = 0.0; if (Om <= -1.52e+54) tmp = t_1; elseif (Om <= 3.3e+65) tmp = sqrt((((n + n) * U) * (t - ((n * ((l * l) / (Om * Om))) * (U - U_42_))))); else tmp = t_1; end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[(N[(t - N[(N[(l / Om), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[Om, -1.52e+54], t$95$1, If[LessEqual[Om, 3.3e+65], N[Sqrt[N[(N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision] * N[(t - N[(N[(n * N[(N[(l * l), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\left(t - \frac{\ell}{Om} \cdot \left(2 \cdot \ell\right)\right) \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{if}\;Om \leq -1.52 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;Om \leq 3.3 \cdot 10^{+65}:\\
\;\;\;\;\sqrt{\left(\left(n + n\right) \cdot U\right) \cdot \left(t - \left(n \cdot \frac{\ell \cdot \ell}{Om \cdot Om}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if Om < -1.51999999999999999e54 or 3.30000000000000023e65 < Om Initial program 53.7%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6461.6
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6455.8
Applied rewrites55.8%
Applied rewrites62.5%
Taylor expanded in n around 0
lower-*.f6457.9
Applied rewrites57.9%
if -1.51999999999999999e54 < Om < 3.30000000000000023e65Initial program 47.7%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
lift-*.f64N/A
count-2-revN/A
lower-+.f6438.8
Applied rewrites38.8%
Taylor expanded in t around inf
Applied rewrites43.8%
(FPCore (n U t l Om U*) :precision binary64 (if (<= t 1.08e+42) (sqrt (* (- t (* (/ l Om) (* 2.0 l))) (* (* U 2.0) n))) (* (sqrt t) (sqrt (* U (+ n n))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= 1.08e+42) {
tmp = sqrt(((t - ((l / Om) * (2.0 * l))) * ((U * 2.0) * n)));
} else {
tmp = sqrt(t) * sqrt((U * (n + n)));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (t <= 1.08d+42) then
tmp = sqrt(((t - ((l / om) * (2.0d0 * l))) * ((u * 2.0d0) * n)))
else
tmp = sqrt(t) * sqrt((u * (n + n)))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= 1.08e+42) {
tmp = Math.sqrt(((t - ((l / Om) * (2.0 * l))) * ((U * 2.0) * n)));
} else {
tmp = Math.sqrt(t) * Math.sqrt((U * (n + n)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if t <= 1.08e+42: tmp = math.sqrt(((t - ((l / Om) * (2.0 * l))) * ((U * 2.0) * n))) else: tmp = math.sqrt(t) * math.sqrt((U * (n + n))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= 1.08e+42) tmp = sqrt(Float64(Float64(t - Float64(Float64(l / Om) * Float64(2.0 * l))) * Float64(Float64(U * 2.0) * n))); else tmp = Float64(sqrt(t) * sqrt(Float64(U * Float64(n + n)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (t <= 1.08e+42) tmp = sqrt(((t - ((l / Om) * (2.0 * l))) * ((U * 2.0) * n))); else tmp = sqrt(t) * sqrt((U * (n + n))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, 1.08e+42], N[Sqrt[N[(N[(t - N[(N[(l / Om), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(U * 2.0), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[t], $MachinePrecision] * N[Sqrt[N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.08 \cdot 10^{+42}:\\
\;\;\;\;\sqrt{\left(t - \frac{\ell}{Om} \cdot \left(2 \cdot \ell\right)\right) \cdot \left(\left(U \cdot 2\right) \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t} \cdot \sqrt{U \cdot \left(n + n\right)}\\
\end{array}
\end{array}
if t < 1.08e42Initial program 50.2%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6455.6
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6452.8
Applied rewrites52.8%
Applied rewrites60.3%
Taylor expanded in n around 0
lower-*.f6446.2
Applied rewrites46.2%
if 1.08e42 < t Initial program 51.8%
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
*-commutativeN/A
unpow-prod-downN/A
lower-*.f64N/A
Applied rewrites56.0%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
lift-/.f64N/A
times-fracN/A
sqr-neg-revN/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-neg.f6450.6
Applied rewrites50.6%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6450.6
Applied rewrites50.6%
Taylor expanded in t around inf
Applied rewrites53.9%
(FPCore (n U t l Om U*) :precision binary64 (if (<= t 7e+159) (sqrt (* (* (- t (* (/ l Om) (* 2.0 l))) U) (* n 2.0))) (* (sqrt t) (sqrt (* U (+ n n))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= 7e+159) {
tmp = sqrt((((t - ((l / Om) * (2.0 * l))) * U) * (n * 2.0)));
} else {
tmp = sqrt(t) * sqrt((U * (n + n)));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (t <= 7d+159) then
tmp = sqrt((((t - ((l / om) * (2.0d0 * l))) * u) * (n * 2.0d0)))
else
tmp = sqrt(t) * sqrt((u * (n + n)))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= 7e+159) {
tmp = Math.sqrt((((t - ((l / Om) * (2.0 * l))) * U) * (n * 2.0)));
} else {
tmp = Math.sqrt(t) * Math.sqrt((U * (n + n)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if t <= 7e+159: tmp = math.sqrt((((t - ((l / Om) * (2.0 * l))) * U) * (n * 2.0))) else: tmp = math.sqrt(t) * math.sqrt((U * (n + n))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= 7e+159) tmp = sqrt(Float64(Float64(Float64(t - Float64(Float64(l / Om) * Float64(2.0 * l))) * U) * Float64(n * 2.0))); else tmp = Float64(sqrt(t) * sqrt(Float64(U * Float64(n + n)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (t <= 7e+159) tmp = sqrt((((t - ((l / Om) * (2.0 * l))) * U) * (n * 2.0))); else tmp = sqrt(t) * sqrt((U * (n + n))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, 7e+159], N[Sqrt[N[(N[(N[(t - N[(N[(l / Om), $MachinePrecision] * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision] * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[t], $MachinePrecision] * N[Sqrt[N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7 \cdot 10^{+159}:\\
\;\;\;\;\sqrt{\left(\left(t - \frac{\ell}{Om} \cdot \left(2 \cdot \ell\right)\right) \cdot U\right) \cdot \left(n \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t} \cdot \sqrt{U \cdot \left(n + n\right)}\\
\end{array}
\end{array}
if t < 6.9999999999999999e159Initial program 50.6%
lift--.f64N/A
lift--.f64N/A
associate--l-N/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6456.0
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6453.2
Applied rewrites53.2%
Applied rewrites61.0%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6461.0
Applied rewrites61.0%
Taylor expanded in n around 0
lower-*.f6447.2
Applied rewrites47.2%
if 6.9999999999999999e159 < t Initial program 50.0%
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
*-commutativeN/A
unpow-prod-downN/A
lower-*.f64N/A
Applied rewrites59.1%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
lift-/.f64N/A
times-fracN/A
sqr-neg-revN/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-neg.f6453.4
Applied rewrites53.4%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6453.4
Applied rewrites53.4%
Taylor expanded in t around inf
Applied rewrites60.0%
(FPCore (n U t l Om U*) :precision binary64 (if (<= t -8e-298) (sqrt (* (* (+ n n) U) t)) (* (sqrt t) (sqrt (* U (+ n n))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= -8e-298) {
tmp = sqrt((((n + n) * U) * t));
} else {
tmp = sqrt(t) * sqrt((U * (n + n)));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (t <= (-8d-298)) then
tmp = sqrt((((n + n) * u) * t))
else
tmp = sqrt(t) * sqrt((u * (n + n)))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= -8e-298) {
tmp = Math.sqrt((((n + n) * U) * t));
} else {
tmp = Math.sqrt(t) * Math.sqrt((U * (n + n)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if t <= -8e-298: tmp = math.sqrt((((n + n) * U) * t)) else: tmp = math.sqrt(t) * math.sqrt((U * (n + n))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= -8e-298) tmp = sqrt(Float64(Float64(Float64(n + n) * U) * t)); else tmp = Float64(sqrt(t) * sqrt(Float64(U * Float64(n + n)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (t <= -8e-298) tmp = sqrt((((n + n) * U) * t)); else tmp = sqrt(t) * sqrt((U * (n + n))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, -8e-298], N[Sqrt[N[(N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[t], $MachinePrecision] * N[Sqrt[N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{-298}:\\
\;\;\;\;\sqrt{\left(\left(n + n\right) \cdot U\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t} \cdot \sqrt{U \cdot \left(n + n\right)}\\
\end{array}
\end{array}
if t < -7.9999999999999993e-298Initial program 50.4%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f6444.8
Applied rewrites44.8%
lift-*.f64N/A
count-2-revN/A
lower-+.f6444.8
Applied rewrites44.8%
Taylor expanded in t around inf
Applied rewrites35.9%
if -7.9999999999999993e-298 < t Initial program 50.7%
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
*-commutativeN/A
unpow-prod-downN/A
lower-*.f64N/A
Applied rewrites49.8%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
lift-/.f64N/A
times-fracN/A
sqr-neg-revN/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-neg.f6446.1
Applied rewrites46.1%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6446.1
Applied rewrites46.1%
Taylor expanded in t around inf
Applied rewrites43.0%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (+ n n) U) t)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((n + n) * U) * t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((n + n) * u) * t))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((n + n) * U) * t));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((n + n) * U) * t))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(n + n) * U) * t)) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((n + n) * U) * t)); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(n + n\right) \cdot U\right) \cdot t}
\end{array}
Initial program 50.5%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f6445.1
Applied rewrites45.1%
lift-*.f64N/A
count-2-revN/A
lower-+.f6445.1
Applied rewrites45.1%
Taylor expanded in t around inf
Applied rewrites36.5%
herbie shell --seed 2025108
(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*))))))