
(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 16 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 (* (* 2.0 n) U))
(t_2
(*
t_1
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_2 1e-322)
(*
(sqrt n)
(sqrt (* 2.0 (* (fma (/ l Om) (fma -2.0 l (/ (* U* (* l n)) Om)) t) U))))
(if (<= t_2 INFINITY)
(sqrt
(* (fma (/ l Om) (fma (* (- U U*) (/ l Om)) (- n) (* -2.0 l)) t) t_1))
(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 = (2.0 * n) * U;
double t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 1e-322) {
tmp = sqrt(n) * sqrt((2.0 * (fma((l / Om), fma(-2.0, l, ((U_42_ * (l * n)) / Om)), t) * U)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = sqrt((fma((l / Om), fma(((U - U_42_) * (l / Om)), -n, (-2.0 * l)), t) * t_1));
} 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(2.0 * n) * U) t_2 = Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_2 <= 1e-322) tmp = Float64(sqrt(n) * sqrt(Float64(2.0 * Float64(fma(Float64(l / Om), fma(-2.0, l, Float64(Float64(U_42_ * Float64(l * n)) / Om)), t) * U)))); elseif (t_2 <= Inf) tmp = sqrt(Float64(fma(Float64(l / Om), fma(Float64(Float64(U - U_42_) * Float64(l / Om)), Float64(-n), Float64(-2.0 * l)), t) * t_1)); else tmp = sqrt(Float64(2.0 * Float64(Float64(Float64(U * l) * Float64(n * fma(-2.0, l, Float64(Float64(l * Float64(n * Float64(U - U_42_))) / Float64(-Om))))) / Om))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 1e-322], N[(N[Sqrt[n], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(N[(N[(l / Om), $MachinePrecision] * N[(-2.0 * l + N[(N[(U$42$ * N[(l * n), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(U - U$42$), $MachinePrecision] * N[(l / Om), $MachinePrecision]), $MachinePrecision] * (-n) + N[(-2.0 * l), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(N[(N[(U * l), $MachinePrecision] * N[(n * N[(-2.0 * l + N[(N[(l * N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-Om)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := t\_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_2 \leq 10^{-322}:\\
\;\;\;\;\sqrt{n} \cdot \sqrt{2 \cdot \left(\mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(-2, \ell, \frac{U* \cdot \left(\ell \cdot n\right)}{Om}\right), t\right) \cdot U\right)}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(\left(U - U*\right) \cdot \frac{\ell}{Om}, -n, -2 \cdot \ell\right), t\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \frac{\left(U \cdot \ell\right) \cdot \left(n \cdot \mathsf{fma}\left(-2, \ell, \frac{\ell \cdot \left(n \cdot \left(U - U*\right)\right)}{-Om}\right)\right)}{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*)))) < 9.88131e-323Initial program 10.3%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower--.f6410.3
lift-*.f64N/A
Applied rewrites12.9%
Applied rewrites18.2%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
sqrt-prodN/A
pow1/2N/A
lower-*.f64N/A
Applied rewrites44.1%
Taylor expanded in U around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6446.5
Applied rewrites46.5%
if 9.88131e-323 < (*.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 66.2%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower--.f6471.8
lift-*.f64N/A
Applied rewrites65.9%
Applied rewrites66.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.9
Applied rewrites71.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%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower--.f6417.9
lift-*.f64N/A
Applied rewrites17.9%
Applied rewrites1.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites30.1%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites76.8%
Final simplification68.5%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (* (* 2.0 n) U))
(t_3
(sqrt
(*
t_2
(- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*)))))))
(if (<= t_3 2e-121)
(sqrt (* (* (fma (/ l Om) (* -2.0 l) t) U) (* 2.0 n)))
(if (<= t_3 1e+149)
(sqrt (* t_2 (fma -2.0 t_1 t)))
(sqrt (fma (* l (* (* n l) (/ U Om))) -4.0 (* (* (* n t) U) 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 = sqrt((t_2 * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_3 <= 2e-121) {
tmp = sqrt(((fma((l / Om), (-2.0 * l), t) * U) * (2.0 * n)));
} else if (t_3 <= 1e+149) {
tmp = sqrt((t_2 * fma(-2.0, t_1, t)));
} else {
tmp = sqrt(fma((l * ((n * l) * (U / Om))), -4.0, (((n * t) * U) * 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 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_3 <= 2e-121) tmp = sqrt(Float64(Float64(fma(Float64(l / Om), Float64(-2.0 * l), t) * U) * Float64(2.0 * n))); elseif (t_3 <= 1e+149) tmp = sqrt(Float64(t_2 * fma(-2.0, t_1, t))); else tmp = sqrt(fma(Float64(l * Float64(Float64(n * l) * Float64(U / Om))), -4.0, Float64(Float64(Float64(n * t) * U) * 2.0))); end return 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[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * t$95$1), $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$3, 2e-121], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * N[(-2.0 * l), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, 1e+149], N[Sqrt[N[(t$95$2 * N[(-2.0 * t$95$1 + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(l * N[(N[(n * l), $MachinePrecision] * N[(U / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(N[(N[(n * t), $MachinePrecision] * U), $MachinePrecision] * 2.0), $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 := \sqrt{t\_2 \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_3 \leq 2 \cdot 10^{-121}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(\frac{\ell}{Om}, -2 \cdot \ell, t\right) \cdot U\right) \cdot \left(2 \cdot n\right)}\\
\mathbf{elif}\;t\_3 \leq 10^{+149}:\\
\;\;\;\;\sqrt{t\_2 \cdot \mathsf{fma}\left(-2, t\_1, t\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\ell \cdot \left(\left(n \cdot \ell\right) \cdot \frac{U}{Om}\right), -4, \left(\left(n \cdot t\right) \cdot U\right) \cdot 2\right)}\\
\end{array}
\end{array}
if (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 2e-121Initial program 26.1%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower--.f6426.2
lift-*.f64N/A
Applied rewrites26.2%
Applied rewrites26.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.7%
Taylor expanded in n around 0
lower-*.f6447.9
Applied rewrites47.9%
if 2e-121 < (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*))))) < 1.00000000000000005e149Initial program 99.7%
Taylor expanded in n around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6487.0
Applied rewrites87.0%
if 1.00000000000000005e149 < (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 23.0%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6421.9
Applied rewrites21.9%
Applied rewrites35.5%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* n (- U U*)))
(t_2 (* (* 2.0 n) U))
(t_3
(*
t_2
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_3 2e-242)
(sqrt (* (* (fma (/ l Om) (* (- l) (+ (/ t_1 Om) 2.0)) t) U) (* 2.0 n)))
(if (<= t_3 INFINITY)
(sqrt
(* (fma (/ l Om) (fma (* (- U U*) (/ l Om)) (- n) (* -2.0 l)) t) t_2))
(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 = (2.0 * n) * U;
double t_3 = t_2 * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_3 <= 2e-242) {
tmp = sqrt(((fma((l / Om), (-l * ((t_1 / Om) + 2.0)), t) * U) * (2.0 * n)));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((fma((l / Om), fma(((U - U_42_) * (l / Om)), -n, (-2.0 * l)), t) * t_2));
} 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 = Float64(Float64(2.0 * n) * U) t_3 = Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_3 <= 2e-242) tmp = sqrt(Float64(Float64(fma(Float64(l / Om), Float64(Float64(-l) * Float64(Float64(t_1 / Om) + 2.0)), t) * U) * Float64(2.0 * n))); elseif (t_3 <= Inf) tmp = sqrt(Float64(fma(Float64(l / Om), fma(Float64(Float64(U - U_42_) * Float64(l / Om)), Float64(-n), Float64(-2.0 * l)), t) * t_2)); else tmp = sqrt(Float64(2.0 * Float64(Float64(Float64(U * l) * Float64(n * fma(-2.0, l, Float64(Float64(l * t_1) / Float64(-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[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 2e-242], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * N[((-l) * N[(N[(t$95$1 / Om), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(U - U$42$), $MachinePrecision] * N[(l / Om), $MachinePrecision]), $MachinePrecision] * (-n) + N[(-2.0 * l), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(N[(N[(U * l), $MachinePrecision] * N[(n * N[(-2.0 * l + N[(N[(l * t$95$1), $MachinePrecision] / (-Om)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := n \cdot \left(U - U*\right)\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := t\_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_3 \leq 2 \cdot 10^{-242}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(\frac{\ell}{Om}, \left(-\ell\right) \cdot \left(\frac{t\_1}{Om} + 2\right), t\right) \cdot U\right) \cdot \left(2 \cdot n\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(\left(U - U*\right) \cdot \frac{\ell}{Om}, -n, -2 \cdot \ell\right), t\right) \cdot t\_2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \frac{\left(U \cdot \ell\right) \cdot \left(n \cdot \mathsf{fma}\left(-2, \ell, \frac{\ell \cdot t\_1}{-Om}\right)\right)}{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*)))) < 2e-242Initial program 23.3%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower--.f6423.3
lift-*.f64N/A
Applied rewrites25.5%
Applied rewrites30.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites49.2%
Taylor expanded in l around 0
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6449.3
Applied rewrites49.3%
if 2e-242 < (*.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 65.0%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower--.f6470.8
lift-*.f64N/A
Applied rewrites64.7%
Applied rewrites65.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6465.8
Applied rewrites70.8%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower--.f6417.9
lift-*.f64N/A
Applied rewrites17.9%
Applied rewrites1.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites30.1%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites76.8%
Final simplification67.6%
(FPCore (n U t l Om U*)
:precision binary64
(if (<=
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))
INFINITY)
(sqrt
(*
(* (fma (/ l Om) (fma (* (- U U*) (/ l Om)) (- n) (* -2.0 l)) t) 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 tmp;
if ((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))) <= ((double) INFINITY)) {
tmp = sqrt(((fma((l / Om), fma(((U - U_42_) * (l / Om)), -n, (-2.0 * l)), t) * 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_) tmp = 0.0 if (Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) <= Inf) tmp = sqrt(Float64(Float64(fma(Float64(l / Om), fma(Float64(Float64(U - U_42_) * Float64(l / Om)), Float64(-n), Float64(-2.0 * l)), t) * U) * Float64(2.0 * n))); else tmp = sqrt(Float64(2.0 * Float64(Float64(Float64(U * l) * Float64(n * fma(-2.0, l, Float64(Float64(l * Float64(n * Float64(U - U_42_))) / Float64(-Om))))) / Om))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(U - U$42$), $MachinePrecision] * N[(l / Om), $MachinePrecision]), $MachinePrecision] * (-n) + N[(-2.0 * l), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(N[(N[(U * l), $MachinePrecision] * N[(n * N[(-2.0 * l + N[(N[(l * N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-Om)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right) \leq \infty:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(\left(U - U*\right) \cdot \frac{\ell}{Om}, -n, -2 \cdot \ell\right), t\right) \cdot U\right) \cdot \left(2 \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \frac{\left(U \cdot \ell\right) \cdot \left(n \cdot \mathsf{fma}\left(-2, \ell, \frac{\ell \cdot \left(n \cdot \left(U - U*\right)\right)}{-Om}\right)\right)}{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*)))) < +inf.0Initial program 56.6%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower--.f6461.2
lift-*.f64N/A
Applied rewrites56.8%
Applied rewrites58.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.0%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower--.f6417.9
lift-*.f64N/A
Applied rewrites17.9%
Applied rewrites1.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites30.1%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites76.8%
Final simplification64.6%
(FPCore (n U t l Om U*)
:precision binary64
(if (<=
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))
5e-128)
(sqrt (* (* 2.0 n) (* U t)))
(sqrt (* t (* (+ U U) n)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_))))) <= 5e-128) {
tmp = sqrt(((2.0 * n) * (U * t)));
} else {
tmp = sqrt((t * ((U + U) * 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 (sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42))))) <= 5d-128) then
tmp = sqrt(((2.0d0 * n) * (u * t)))
else
tmp = sqrt((t * ((u + u) * n)))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_))))) <= 5e-128) {
tmp = Math.sqrt(((2.0 * n) * (U * t)));
} else {
tmp = Math.sqrt((t * ((U + U) * n)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))))) <= 5e-128: tmp = math.sqrt(((2.0 * n) * (U * t))) else: tmp = math.sqrt((t * ((U + U) * n))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (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_))))) <= 5e-128) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * t))); else tmp = sqrt(Float64(t * Float64(Float64(U + U) * n))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))) <= 5e-128) tmp = sqrt(((2.0 * n) * (U * t))); else tmp = sqrt((t * ((U + U) * n))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[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], 5e-128], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(t * N[(N[(U + U), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\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)} \leq 5 \cdot 10^{-128}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t \cdot \left(\left(U + U\right) \cdot n\right)}\\
\end{array}
\end{array}
if (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 5.0000000000000001e-128Initial program 22.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6439.7
Applied rewrites39.7%
Applied rewrites42.7%
if 5.0000000000000001e-128 < (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 55.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6438.0
Applied rewrites38.0%
Applied rewrites39.4%
Applied rewrites39.4%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= l 4.3e+67)
(sqrt (* (* (fma (/ l Om) (/ (* U* (* l n)) Om) t) 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 tmp;
if (l <= 4.3e+67) {
tmp = sqrt(((fma((l / Om), ((U_42_ * (l * n)) / Om), t) * 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_) tmp = 0.0 if (l <= 4.3e+67) tmp = sqrt(Float64(Float64(fma(Float64(l / Om), Float64(Float64(U_42_ * Float64(l * n)) / Om), t) * U) * Float64(2.0 * n))); else tmp = sqrt(Float64(2.0 * Float64(Float64(Float64(U * l) * Float64(n * fma(-2.0, l, Float64(Float64(l * Float64(n * Float64(U - U_42_))) / Float64(-Om))))) / Om))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 4.3e+67], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(U$42$ * N[(l * n), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(N[(N[(U * l), $MachinePrecision] * N[(n * N[(-2.0 * l + N[(N[(l * N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-Om)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4.3 \cdot 10^{+67}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(\frac{\ell}{Om}, \frac{U* \cdot \left(\ell \cdot n\right)}{Om}, t\right) \cdot U\right) \cdot \left(2 \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \frac{\left(U \cdot \ell\right) \cdot \left(n \cdot \mathsf{fma}\left(-2, \ell, \frac{\ell \cdot \left(n \cdot \left(U - U*\right)\right)}{-Om}\right)\right)}{Om}}\\
\end{array}
\end{array}
if l < 4.3000000000000001e67Initial program 53.3%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower--.f6456.5
lift-*.f64N/A
Applied rewrites52.3%
Applied rewrites52.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.4%
Taylor expanded in U* around inf
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6456.7
Applied rewrites56.7%
if 4.3000000000000001e67 < l Initial program 33.6%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower--.f6455.3
lift-*.f64N/A
Applied rewrites52.8%
Applied rewrites47.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites53.4%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites62.7%
Final simplification57.7%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= n -1.8e+202)
(sqrt (* (* (* 2.0 n) U) (* (/ (* U* (* l l)) Om) (/ n Om))))
(if (<= n 7e-288)
(sqrt (fma (/ (* l (* (* n l) U)) Om) -4.0 (* (* (* n t) U) 2.0)))
(* (sqrt n) (sqrt (* 2.0 (* (fma (/ l Om) (* -2.0 l) t) U)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= -1.8e+202) {
tmp = sqrt((((2.0 * n) * U) * (((U_42_ * (l * l)) / Om) * (n / Om))));
} else if (n <= 7e-288) {
tmp = sqrt(fma(((l * ((n * l) * U)) / Om), -4.0, (((n * t) * U) * 2.0)));
} else {
tmp = sqrt(n) * sqrt((2.0 * (fma((l / Om), (-2.0 * l), t) * U)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= -1.8e+202) tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(Float64(U_42_ * Float64(l * l)) / Om) * Float64(n / Om)))); elseif (n <= 7e-288) tmp = sqrt(fma(Float64(Float64(l * Float64(Float64(n * l) * U)) / Om), -4.0, Float64(Float64(Float64(n * t) * U) * 2.0))); else tmp = Float64(sqrt(n) * sqrt(Float64(2.0 * Float64(fma(Float64(l / Om), Float64(-2.0 * l), t) * U)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, -1.8e+202], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(N[(U$42$ * N[(l * l), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] * N[(n / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 7e-288], N[Sqrt[N[(N[(N[(l * N[(N[(n * l), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] * -4.0 + N[(N[(N[(n * t), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[n], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(N[(N[(l / Om), $MachinePrecision] * N[(-2.0 * l), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.8 \cdot 10^{+202}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\frac{U* \cdot \left(\ell \cdot \ell\right)}{Om} \cdot \frac{n}{Om}\right)}\\
\mathbf{elif}\;n \leq 7 \cdot 10^{-288}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\ell \cdot \left(\left(n \cdot \ell\right) \cdot U\right)}{Om}, -4, \left(\left(n \cdot t\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{n} \cdot \sqrt{2 \cdot \left(\mathsf{fma}\left(\frac{\ell}{Om}, -2 \cdot \ell, t\right) \cdot U\right)}\\
\end{array}
\end{array}
if n < -1.80000000000000004e202Initial program 49.5%
Taylor expanded in U* around inf
associate-*r*N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6447.5
Applied rewrites47.5%
if -1.80000000000000004e202 < n < 7.0000000000000006e-288Initial program 49.8%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6448.1
Applied rewrites48.1%
Applied rewrites54.5%
if 7.0000000000000006e-288 < n Initial program 50.6%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower--.f6455.4
lift-*.f64N/A
Applied rewrites51.0%
Applied rewrites51.9%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
sqrt-prodN/A
pow1/2N/A
lower-*.f64N/A
Applied rewrites74.8%
Taylor expanded in n around 0
lower-*.f6460.0
Applied rewrites60.0%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (fma (/ l Om) (* -2.0 l) t) U)))
(if (<= n -3.2e+198)
(sqrt (* t_1 (* 2.0 n)))
(if (<= n 7e-288)
(sqrt (fma (/ (* l (* (* n l) U)) Om) -4.0 (* (* (* n t) U) 2.0)))
(* (sqrt n) (sqrt (* 2.0 t_1)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma((l / Om), (-2.0 * l), t) * U;
double tmp;
if (n <= -3.2e+198) {
tmp = sqrt((t_1 * (2.0 * n)));
} else if (n <= 7e-288) {
tmp = sqrt(fma(((l * ((n * l) * U)) / Om), -4.0, (((n * t) * U) * 2.0)));
} else {
tmp = sqrt(n) * sqrt((2.0 * t_1));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(fma(Float64(l / Om), Float64(-2.0 * l), t) * U) tmp = 0.0 if (n <= -3.2e+198) tmp = sqrt(Float64(t_1 * Float64(2.0 * n))); elseif (n <= 7e-288) tmp = sqrt(fma(Float64(Float64(l * Float64(Float64(n * l) * U)) / Om), -4.0, Float64(Float64(Float64(n * t) * U) * 2.0))); else tmp = Float64(sqrt(n) * sqrt(Float64(2.0 * t_1))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(N[(l / Om), $MachinePrecision] * N[(-2.0 * l), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision]}, If[LessEqual[n, -3.2e+198], N[Sqrt[N[(t$95$1 * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 7e-288], N[Sqrt[N[(N[(N[(l * N[(N[(n * l), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] * -4.0 + N[(N[(N[(n * t), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[n], $MachinePrecision] * N[Sqrt[N[(2.0 * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{\ell}{Om}, -2 \cdot \ell, t\right) \cdot U\\
\mathbf{if}\;n \leq -3.2 \cdot 10^{+198}:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(2 \cdot n\right)}\\
\mathbf{elif}\;n \leq 7 \cdot 10^{-288}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\ell \cdot \left(\left(n \cdot \ell\right) \cdot U\right)}{Om}, -4, \left(\left(n \cdot t\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{n} \cdot \sqrt{2 \cdot t\_1}\\
\end{array}
\end{array}
if n < -3.1999999999999998e198Initial program 49.7%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower--.f6460.1
lift-*.f64N/A
Applied rewrites51.7%
Applied rewrites51.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.2%
Taylor expanded in n around 0
lower-*.f6441.8
Applied rewrites41.8%
if -3.1999999999999998e198 < n < 7.0000000000000006e-288Initial program 49.8%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6449.0
Applied rewrites49.0%
Applied rewrites55.5%
if 7.0000000000000006e-288 < n Initial program 50.6%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower--.f6455.4
lift-*.f64N/A
Applied rewrites51.0%
Applied rewrites51.9%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
sqrt-prodN/A
pow1/2N/A
lower-*.f64N/A
Applied rewrites74.8%
Taylor expanded in n around 0
lower-*.f6460.0
Applied rewrites60.0%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 2.05e+64) (sqrt (* (* (fma (/ l Om) (/ (* U* (* l n)) Om) t) U) (* 2.0 n))) (sqrt (fma (* l (* (* n l) (/ U Om))) -4.0 (* (* (* n t) U) 2.0)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 2.05e+64) {
tmp = sqrt(((fma((l / Om), ((U_42_ * (l * n)) / Om), t) * U) * (2.0 * n)));
} else {
tmp = sqrt(fma((l * ((n * l) * (U / Om))), -4.0, (((n * t) * U) * 2.0)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 2.05e+64) tmp = sqrt(Float64(Float64(fma(Float64(l / Om), Float64(Float64(U_42_ * Float64(l * n)) / Om), t) * U) * Float64(2.0 * n))); else tmp = sqrt(fma(Float64(l * Float64(Float64(n * l) * Float64(U / Om))), -4.0, Float64(Float64(Float64(n * t) * U) * 2.0))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 2.05e+64], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(U$42$ * N[(l * n), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(l * N[(N[(n * l), $MachinePrecision] * N[(U / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(N[(N[(n * t), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.05 \cdot 10^{+64}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(\frac{\ell}{Om}, \frac{U* \cdot \left(\ell \cdot n\right)}{Om}, t\right) \cdot U\right) \cdot \left(2 \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\ell \cdot \left(\left(n \cdot \ell\right) \cdot \frac{U}{Om}\right), -4, \left(\left(n \cdot t\right) \cdot U\right) \cdot 2\right)}\\
\end{array}
\end{array}
if l < 2.04999999999999989e64Initial program 53.3%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower--.f6456.5
lift-*.f64N/A
Applied rewrites52.3%
Applied rewrites52.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.4%
Taylor expanded in U* around inf
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6456.7
Applied rewrites56.7%
if 2.04999999999999989e64 < l Initial program 33.6%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6434.2
Applied rewrites34.2%
Applied rewrites54.5%
(FPCore (n U t l Om U*) :precision binary64 (if (<= U 1.15e+99) (sqrt (* (* (fma (/ l Om) (* -2.0 l) t) U) (* 2.0 n))) (* (sqrt (* (* 2.0 n) t)) (sqrt U))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 1.15e+99) {
tmp = sqrt(((fma((l / Om), (-2.0 * l), t) * U) * (2.0 * n)));
} else {
tmp = sqrt(((2.0 * n) * t)) * sqrt(U);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= 1.15e+99) tmp = sqrt(Float64(Float64(fma(Float64(l / Om), Float64(-2.0 * l), t) * U) * Float64(2.0 * n))); else tmp = Float64(sqrt(Float64(Float64(2.0 * n) * t)) * sqrt(U)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, 1.15e+99], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * N[(-2.0 * l), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision] * N[Sqrt[U], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;U \leq 1.15 \cdot 10^{+99}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(\frac{\ell}{Om}, -2 \cdot \ell, t\right) \cdot U\right) \cdot \left(2 \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot t} \cdot \sqrt{U}\\
\end{array}
\end{array}
if U < 1.1500000000000001e99Initial program 48.8%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower--.f6455.6
lift-*.f64N/A
Applied rewrites51.9%
Applied rewrites51.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites59.7%
Taylor expanded in n around 0
lower-*.f6448.7
Applied rewrites48.7%
if 1.1500000000000001e99 < U Initial program 62.6%
Applied rewrites41.3%
Taylor expanded in n around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f6481.2
Applied rewrites81.2%
(FPCore (n U t l Om U*) :precision binary64 (if (<= U 1.4e+69) (sqrt (* (* (* (fma -2.0 (/ (* l l) Om) t) n) U) 2.0)) (* (sqrt (* (* 2.0 n) t)) (sqrt U))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 1.4e+69) {
tmp = sqrt((((fma(-2.0, ((l * l) / Om), t) * n) * U) * 2.0));
} else {
tmp = sqrt(((2.0 * n) * t)) * sqrt(U);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= 1.4e+69) tmp = sqrt(Float64(Float64(Float64(fma(-2.0, Float64(Float64(l * l) / Om), t) * n) * U) * 2.0)); else tmp = Float64(sqrt(Float64(Float64(2.0 * n) * t)) * sqrt(U)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, 1.4e+69], N[Sqrt[N[(N[(N[(N[(-2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision] * N[Sqrt[U], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;U \leq 1.4 \cdot 10^{+69}:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(-2, \frac{\ell \cdot \ell}{Om}, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot t} \cdot \sqrt{U}\\
\end{array}
\end{array}
if U < 1.39999999999999991e69Initial program 49.0%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6444.5
Applied rewrites44.5%
if 1.39999999999999991e69 < U Initial program 57.3%
Applied rewrites38.8%
Taylor expanded in n around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f6469.8
Applied rewrites69.8%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 7.8e+81) (sqrt (* (* 2.0 n) (* U t))) (sqrt (* -4.0 (/ (* (* U (* l l)) n) Om)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 7.8e+81) {
tmp = sqrt(((2.0 * n) * (U * t)));
} else {
tmp = sqrt((-4.0 * (((U * (l * l)) * n) / Om)));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (l <= 7.8d+81) then
tmp = sqrt(((2.0d0 * n) * (u * t)))
else
tmp = sqrt(((-4.0d0) * (((u * (l * l)) * n) / om)))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 7.8e+81) {
tmp = Math.sqrt(((2.0 * n) * (U * t)));
} else {
tmp = Math.sqrt((-4.0 * (((U * (l * l)) * n) / Om)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 7.8e+81: tmp = math.sqrt(((2.0 * n) * (U * t))) else: tmp = math.sqrt((-4.0 * (((U * (l * l)) * n) / Om))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 7.8e+81) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * t))); else tmp = sqrt(Float64(-4.0 * Float64(Float64(Float64(U * Float64(l * l)) * n) / Om))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 7.8e+81) tmp = sqrt(((2.0 * n) * (U * t))); else tmp = sqrt((-4.0 * (((U * (l * l)) * n) / Om))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 7.8e+81], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(-4.0 * N[(N[(N[(U * N[(l * l), $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 7.8 \cdot 10^{+81}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{-4 \cdot \frac{\left(U \cdot \left(\ell \cdot \ell\right)\right) \cdot n}{Om}}\\
\end{array}
\end{array}
if l < 7.8000000000000002e81Initial program 53.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6444.7
Applied rewrites44.7%
Applied rewrites44.3%
if 7.8000000000000002e81 < l Initial program 33.6%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6434.2
Applied rewrites34.2%
Taylor expanded in t around 0
Applied rewrites34.1%
(FPCore (n U t l Om U*) :precision binary64 (if (<= U 2.3e-305) (sqrt (* (* 2.0 n) (* U t))) (* (sqrt (* (* 2.0 n) t)) (sqrt U))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 2.3e-305) {
tmp = sqrt(((2.0 * n) * (U * t)));
} else {
tmp = sqrt(((2.0 * n) * t)) * sqrt(U);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (u <= 2.3d-305) then
tmp = sqrt(((2.0d0 * n) * (u * t)))
else
tmp = sqrt(((2.0d0 * n) * t)) * sqrt(u)
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 2.3e-305) {
tmp = Math.sqrt(((2.0 * n) * (U * t)));
} else {
tmp = Math.sqrt(((2.0 * n) * t)) * Math.sqrt(U);
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if U <= 2.3e-305: tmp = math.sqrt(((2.0 * n) * (U * t))) else: tmp = math.sqrt(((2.0 * n) * t)) * math.sqrt(U) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= 2.3e-305) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * t))); else tmp = Float64(sqrt(Float64(Float64(2.0 * n) * t)) * sqrt(U)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (U <= 2.3e-305) tmp = sqrt(((2.0 * n) * (U * t))); else tmp = sqrt(((2.0 * n) * t)) * sqrt(U); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, 2.3e-305], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision] * N[Sqrt[U], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;U \leq 2.3 \cdot 10^{-305}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot t} \cdot \sqrt{U}\\
\end{array}
\end{array}
if U < 2.3e-305Initial program 50.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6438.1
Applied rewrites38.1%
Applied rewrites39.6%
if 2.3e-305 < U Initial program 50.2%
Applied rewrites41.7%
Taylor expanded in n around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f6446.2
Applied rewrites46.2%
(FPCore (n U t l Om U*) :precision binary64 (if (<= n 1e-309) (sqrt (* (* 2.0 n) (* U t))) (* (sqrt n) (sqrt (* 2.0 (* U t))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= 1e-309) {
tmp = sqrt(((2.0 * n) * (U * t)));
} else {
tmp = sqrt(n) * sqrt((2.0 * (U * t)));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (n <= 1d-309) then
tmp = sqrt(((2.0d0 * n) * (u * t)))
else
tmp = sqrt(n) * sqrt((2.0d0 * (u * t)))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= 1e-309) {
tmp = Math.sqrt(((2.0 * n) * (U * t)));
} else {
tmp = Math.sqrt(n) * Math.sqrt((2.0 * (U * t)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if n <= 1e-309: tmp = math.sqrt(((2.0 * n) * (U * t))) else: tmp = math.sqrt(n) * math.sqrt((2.0 * (U * t))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= 1e-309) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * t))); else tmp = Float64(sqrt(n) * sqrt(Float64(2.0 * Float64(U * t)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (n <= 1e-309) tmp = sqrt(((2.0 * n) * (U * t))); else tmp = sqrt(n) * sqrt((2.0 * (U * t))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, 1e-309], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[n], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 10^{-309}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{n} \cdot \sqrt{2 \cdot \left(U \cdot t\right)}\\
\end{array}
\end{array}
if n < 1.000000000000002e-309Initial program 50.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6433.9
Applied rewrites33.9%
Applied rewrites35.4%
if 1.000000000000002e-309 < n Initial program 49.5%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower--.f6454.1
lift-*.f64N/A
Applied rewrites50.0%
Applied rewrites50.7%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
sqrt-prodN/A
pow1/2N/A
lower-*.f64N/A
Applied rewrites73.1%
Taylor expanded in t around inf
lower-*.f6448.1
Applied rewrites48.1%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 3e-191) (sqrt (* (* 2.0 n) (* U t))) (sqrt (* (* (* n t) U) 2.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 3e-191) {
tmp = sqrt(((2.0 * n) * (U * t)));
} else {
tmp = sqrt((((n * t) * 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 <= 3d-191) then
tmp = sqrt(((2.0d0 * n) * (u * t)))
else
tmp = sqrt((((n * t) * 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 <= 3e-191) {
tmp = Math.sqrt(((2.0 * n) * (U * t)));
} else {
tmp = Math.sqrt((((n * t) * U) * 2.0));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 3e-191: tmp = math.sqrt(((2.0 * n) * (U * t))) else: tmp = math.sqrt((((n * t) * U) * 2.0)) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 3e-191) tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * t))); else tmp = sqrt(Float64(Float64(Float64(n * t) * U) * 2.0)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 3e-191) tmp = sqrt(((2.0 * n) * (U * t))); else tmp = sqrt((((n * t) * U) * 2.0)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 3e-191], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(n * t), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3 \cdot 10^{-191}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(n \cdot t\right) \cdot U\right) \cdot 2}\\
\end{array}
\end{array}
if l < 3.0000000000000001e-191Initial program 49.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6440.7
Applied rewrites40.7%
Applied rewrites40.2%
if 3.0000000000000001e-191 < l Initial program 50.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6434.3
Applied rewrites34.3%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* t (* (+ U U) n))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((t * ((U + U) * n)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((t * ((u + u) * n)))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((t * ((U + U) * n)));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((t * ((U + U) * n)))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(t * Float64(Float64(U + U) * n))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((t * ((U + U) * n))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(t * N[(N[(U + U), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{t \cdot \left(\left(U + U\right) \cdot n\right)}
\end{array}
Initial program 50.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6438.3
Applied rewrites38.3%
Applied rewrites36.4%
Applied rewrites36.4%
herbie shell --seed 2024347
(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*))))))