
(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 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}
\end{array}
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (/ l Om) -2.0))
(t_2 (* (* 2.0 U) n))
(t_3 (pow (/ l Om) 2.0))
(t_4
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 (/ (* l l) Om))) (* (* n t_3) (- U U*))))))
(if (<= t_4 8e-320)
(* (sqrt n) (sqrt (* 2.0 (* (- (fma t_1 l t) (* (* (- U U*) n) t_3)) U))))
(if (<= t_4 5e+301)
(sqrt
(fma
t_1
(* l t_2)
(* t_2 (fma (* (/ (- l) Om) (* (/ l Om) n)) (- U U*) t))))
(sqrt
(*
(* -2.0 U)
(* (* (fma (/ n Om) (/ (- U U*) Om) (/ 2.0 Om)) l) (* n l))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l / Om) * -2.0;
double t_2 = (2.0 * U) * n;
double t_3 = pow((l / Om), 2.0);
double t_4 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * t_3) * (U - U_42_)));
double tmp;
if (t_4 <= 8e-320) {
tmp = sqrt(n) * sqrt((2.0 * ((fma(t_1, l, t) - (((U - U_42_) * n) * t_3)) * U)));
} else if (t_4 <= 5e+301) {
tmp = sqrt(fma(t_1, (l * t_2), (t_2 * fma(((-l / Om) * ((l / Om) * n)), (U - U_42_), t))));
} else {
tmp = sqrt(((-2.0 * U) * ((fma((n / Om), ((U - U_42_) / Om), (2.0 / Om)) * l) * (n * l))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l / Om) * -2.0) t_2 = Float64(Float64(2.0 * U) * n) t_3 = Float64(l / Om) ^ 2.0 t_4 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * t_3) * Float64(U - U_42_)))) tmp = 0.0 if (t_4 <= 8e-320) tmp = Float64(sqrt(n) * sqrt(Float64(2.0 * Float64(Float64(fma(t_1, l, t) - Float64(Float64(Float64(U - U_42_) * n) * t_3)) * U)))); elseif (t_4 <= 5e+301) tmp = sqrt(fma(t_1, Float64(l * t_2), Float64(t_2 * fma(Float64(Float64(Float64(-l) / Om) * Float64(Float64(l / Om) * n)), Float64(U - U_42_), t)))); else tmp = sqrt(Float64(Float64(-2.0 * U) * Float64(Float64(fma(Float64(n / Om), Float64(Float64(U - U_42_) / Om), Float64(2.0 / Om)) * l) * Float64(n * l)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l / Om), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * U), $MachinePrecision] * n), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$4 = 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 * t$95$3), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 8e-320], N[(N[Sqrt[n], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(N[(N[(t$95$1 * l + t), $MachinePrecision] - N[(N[(N[(U - U$42$), $MachinePrecision] * n), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 5e+301], N[Sqrt[N[(t$95$1 * N[(l * t$95$2), $MachinePrecision] + N[(t$95$2 * N[(N[(N[((-l) / Om), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(-2.0 * U), $MachinePrecision] * N[(N[(N[(N[(n / Om), $MachinePrecision] * N[(N[(U - U$42$), $MachinePrecision] / Om), $MachinePrecision] + N[(2.0 / Om), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] * N[(n * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell}{Om} \cdot -2\\
t_2 := \left(2 \cdot U\right) \cdot n\\
t_3 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_4 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot t\_3\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_4 \leq 8 \cdot 10^{-320}:\\
\;\;\;\;\sqrt{n} \cdot \sqrt{2 \cdot \left(\left(\mathsf{fma}\left(t\_1, \ell, t\right) - \left(\left(U - U*\right) \cdot n\right) \cdot t\_3\right) \cdot U\right)}\\
\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(t\_1, \ell \cdot t\_2, t\_2 \cdot \mathsf{fma}\left(\frac{-\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right), U - U*, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(-2 \cdot U\right) \cdot \left(\left(\mathsf{fma}\left(\frac{n}{Om}, \frac{U - U*}{Om}, \frac{2}{Om}\right) \cdot \ell\right) \cdot \left(n \cdot \ell\right)\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 7.99991e-320Initial program 20.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.0
lift-*.f64N/A
Applied rewrites25.8%
Applied rewrites51.0%
if 7.99991e-320 < (*.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.0000000000000004e301Initial program 97.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--.f6497.3
lift-*.f64N/A
Applied rewrites91.5%
Applied rewrites97.0%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6498.6
Applied rewrites98.6%
if 5.0000000000000004e301 < (*.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.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6413.1
Applied rewrites13.1%
Applied rewrites8.4%
Taylor expanded in l around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6430.9
Applied rewrites30.9%
Applied rewrites51.3%
Final simplification73.0%
(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*)))))
(t_3 (sqrt (* n (fma U (+ t t) (* (* (* (/ l Om) l) U) -4.0))))))
(if (<= t_2 1e-320)
t_3
(if (<= t_2 5e+301)
(sqrt (* t_1 (- t (/ (* (* l l) (- (/ (* (- U U*) n) Om) -2.0)) Om))))
(if (<= t_2 INFINITY)
t_3
(sqrt
(*
(* -2.0 U)
(* (* (* l l) n) (/ (fma n (/ (- U U*) Om) 2.0) 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 t_3 = sqrt((n * fma(U, (t + t), ((((l / Om) * l) * U) * -4.0))));
double tmp;
if (t_2 <= 1e-320) {
tmp = t_3;
} else if (t_2 <= 5e+301) {
tmp = sqrt((t_1 * (t - (((l * l) * ((((U - U_42_) * n) / Om) - -2.0)) / Om))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = sqrt(((-2.0 * U) * (((l * l) * n) * (fma(n, ((U - U_42_) / Om), 2.0) / 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_)))) t_3 = sqrt(Float64(n * fma(U, Float64(t + t), Float64(Float64(Float64(Float64(l / Om) * l) * U) * -4.0)))) tmp = 0.0 if (t_2 <= 1e-320) tmp = t_3; elseif (t_2 <= 5e+301) tmp = sqrt(Float64(t_1 * Float64(t - Float64(Float64(Float64(l * l) * Float64(Float64(Float64(Float64(U - U_42_) * n) / Om) - -2.0)) / Om)))); elseif (t_2 <= Inf) tmp = t_3; else tmp = sqrt(Float64(Float64(-2.0 * U) * Float64(Float64(Float64(l * l) * n) * Float64(fma(n, Float64(Float64(U - U_42_) / Om), 2.0) / 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]}, Block[{t$95$3 = N[Sqrt[N[(n * N[(U * N[(t + t), $MachinePrecision] + N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * U), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 1e-320], t$95$3, If[LessEqual[t$95$2, 5e+301], N[Sqrt[N[(t$95$1 * N[(t - N[(N[(N[(l * l), $MachinePrecision] * N[(N[(N[(N[(U - U$42$), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] - -2.0), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$3, N[Sqrt[N[(N[(-2.0 * U), $MachinePrecision] * N[(N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision] * N[(N[(n * N[(N[(U - U$42$), $MachinePrecision] / Om), $MachinePrecision] + 2.0), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := t\_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
t_3 := \sqrt{n \cdot \mathsf{fma}\left(U, t + t, \left(\left(\frac{\ell}{Om} \cdot \ell\right) \cdot U\right) \cdot -4\right)}\\
\mathbf{if}\;t\_2 \leq 10^{-320}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(t - \frac{\left(\ell \cdot \ell\right) \cdot \left(\frac{\left(U - U*\right) \cdot n}{Om} - -2\right)}{Om}\right)}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(-2 \cdot U\right) \cdot \left(\left(\left(\ell \cdot \ell\right) \cdot n\right) \cdot \frac{\mathsf{fma}\left(n, \frac{U - U*}{Om}, 2\right)}{Om}\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 9.99989e-321 or 5.0000000000000004e301 < (*.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 28.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--.f6440.6
lift-*.f64N/A
Applied rewrites39.1%
Applied rewrites40.5%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6433.9
Applied rewrites33.9%
Applied rewrites43.7%
if 9.99989e-321 < (*.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.0000000000000004e301Initial program 96.9%
Taylor expanded in Om around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites86.0%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f647.6
Applied rewrites7.6%
Applied rewrites2.1%
Taylor expanded in l around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6432.6
Applied rewrites32.6%
Taylor expanded in Om around inf
Applied rewrites41.6%
Final simplification63.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (* (* 2.0 n) U))
(t_3
(* t_2 (- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*)))))
(t_4 (sqrt (* n (fma U (+ t t) (* (* (* (/ l Om) l) U) -4.0))))))
(if (<= t_3 5e-237)
t_4
(if (<= t_3 5e+301)
(sqrt (* t_2 (fma -2.0 t_1 t)))
(if (<= t_3 INFINITY)
t_4
(sqrt
(*
(* -2.0 U)
(* (* (* l l) n) (/ (fma n (/ (- U U*) Om) 2.0) Om)))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = (2.0 * n) * U;
double t_3 = t_2 * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double t_4 = sqrt((n * fma(U, (t + t), ((((l / Om) * l) * U) * -4.0))));
double tmp;
if (t_3 <= 5e-237) {
tmp = t_4;
} else if (t_3 <= 5e+301) {
tmp = sqrt((t_2 * fma(-2.0, t_1, t)));
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = sqrt(((-2.0 * U) * (((l * l) * n) * (fma(n, ((U - U_42_) / Om), 2.0) / Om))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(Float64(2.0 * n) * U) t_3 = Float64(t_2 * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) t_4 = sqrt(Float64(n * fma(U, Float64(t + t), Float64(Float64(Float64(Float64(l / Om) * l) * U) * -4.0)))) tmp = 0.0 if (t_3 <= 5e-237) tmp = t_4; elseif (t_3 <= 5e+301) tmp = sqrt(Float64(t_2 * fma(-2.0, t_1, t))); elseif (t_3 <= Inf) tmp = t_4; else tmp = sqrt(Float64(Float64(-2.0 * U) * Float64(Float64(Float64(l * l) * n) * Float64(fma(n, Float64(Float64(U - U_42_) / Om), 2.0) / Om)))); 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[(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]}, Block[{t$95$4 = N[Sqrt[N[(n * N[(U * N[(t + t), $MachinePrecision] + N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * U), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 5e-237], t$95$4, If[LessEqual[t$95$3, 5e+301], N[Sqrt[N[(t$95$2 * N[(-2.0 * t$95$1 + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$4, N[Sqrt[N[(N[(-2.0 * U), $MachinePrecision] * N[(N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision] * N[(N[(n * N[(N[(U - U$42$), $MachinePrecision] / Om), $MachinePrecision] + 2.0), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := t\_2 \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
t_4 := \sqrt{n \cdot \mathsf{fma}\left(U, t + t, \left(\left(\frac{\ell}{Om} \cdot \ell\right) \cdot U\right) \cdot -4\right)}\\
\mathbf{if}\;t\_3 \leq 5 \cdot 10^{-237}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\sqrt{t\_2 \cdot \mathsf{fma}\left(-2, t\_1, t\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(-2 \cdot U\right) \cdot \left(\left(\left(\ell \cdot \ell\right) \cdot n\right) \cdot \frac{\mathsf{fma}\left(n, \frac{U - U*}{Om}, 2\right)}{Om}\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 5.0000000000000002e-237 or 5.0000000000000004e301 < (*.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 34.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--.f6445.1
lift-*.f64N/A
Applied rewrites43.7%
Applied rewrites44.6%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6438.0
Applied rewrites38.0%
Applied rewrites47.2%
if 5.0000000000000002e-237 < (*.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.0000000000000004e301Initial program 97.9%
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-*.f6481.9
Applied rewrites81.9%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f647.6
Applied rewrites7.6%
Applied rewrites2.1%
Taylor expanded in l around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6432.6
Applied rewrites32.6%
Taylor expanded in Om around inf
Applied rewrites41.6%
Final simplification61.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (* (* 2.0 n) U))
(t_3
(* t_2 (- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*)))))
(t_4 (sqrt (* n (fma U (+ t t) (* (* (* (/ l Om) l) U) -4.0))))))
(if (<= t_3 5e-237)
t_4
(if (<= t_3 5e+301)
(sqrt (* t_2 (fma -2.0 t_1 t)))
(if (<= t_3 INFINITY)
t_4
(sqrt
(*
(* -2.0 U)
(* (* (* l l) n) (/ (fma 2.0 Om (* n (- U U*))) (* Om Om))))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = (2.0 * n) * U;
double t_3 = t_2 * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double t_4 = sqrt((n * fma(U, (t + t), ((((l / Om) * l) * U) * -4.0))));
double tmp;
if (t_3 <= 5e-237) {
tmp = t_4;
} else if (t_3 <= 5e+301) {
tmp = sqrt((t_2 * fma(-2.0, t_1, t)));
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = sqrt(((-2.0 * U) * (((l * l) * n) * (fma(2.0, Om, (n * (U - U_42_))) / (Om * Om)))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(Float64(2.0 * n) * U) t_3 = Float64(t_2 * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) t_4 = sqrt(Float64(n * fma(U, Float64(t + t), Float64(Float64(Float64(Float64(l / Om) * l) * U) * -4.0)))) tmp = 0.0 if (t_3 <= 5e-237) tmp = t_4; elseif (t_3 <= 5e+301) tmp = sqrt(Float64(t_2 * fma(-2.0, t_1, t))); elseif (t_3 <= Inf) tmp = t_4; else tmp = sqrt(Float64(Float64(-2.0 * U) * Float64(Float64(Float64(l * l) * n) * Float64(fma(2.0, Om, 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[(l * l), $MachinePrecision] / Om), $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 * 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]}, Block[{t$95$4 = N[Sqrt[N[(n * N[(U * N[(t + t), $MachinePrecision] + N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * U), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 5e-237], t$95$4, If[LessEqual[t$95$3, 5e+301], N[Sqrt[N[(t$95$2 * N[(-2.0 * t$95$1 + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$4, N[Sqrt[N[(N[(-2.0 * U), $MachinePrecision] * N[(N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision] * N[(N[(2.0 * Om + N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := t\_2 \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
t_4 := \sqrt{n \cdot \mathsf{fma}\left(U, t + t, \left(\left(\frac{\ell}{Om} \cdot \ell\right) \cdot U\right) \cdot -4\right)}\\
\mathbf{if}\;t\_3 \leq 5 \cdot 10^{-237}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\sqrt{t\_2 \cdot \mathsf{fma}\left(-2, t\_1, t\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(-2 \cdot U\right) \cdot \left(\left(\left(\ell \cdot \ell\right) \cdot n\right) \cdot \frac{\mathsf{fma}\left(2, Om, n \cdot \left(U - U*\right)\right)}{Om \cdot Om}\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 5.0000000000000002e-237 or 5.0000000000000004e301 < (*.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 34.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--.f6445.1
lift-*.f64N/A
Applied rewrites43.7%
Applied rewrites44.6%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6438.0
Applied rewrites38.0%
Applied rewrites47.2%
if 5.0000000000000002e-237 < (*.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.0000000000000004e301Initial program 97.9%
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-*.f6481.9
Applied rewrites81.9%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f647.6
Applied rewrites7.6%
Applied rewrites2.1%
Taylor expanded in l around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6432.6
Applied rewrites32.6%
Taylor expanded in Om around 0
Applied rewrites33.0%
Final simplification59.9%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (* (* 2.0 n) U))
(t_3
(* t_2 (- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*)))))
(t_4 (sqrt (* n (fma U (+ t t) (* (* (* (/ l Om) l) U) -4.0))))))
(if (<= t_3 5e-237)
t_4
(if (<= t_3 5e+301)
(sqrt (* t_2 (fma -2.0 t_1 t)))
(if (<= t_3 INFINITY)
t_4
(sqrt (* t_2 (* (/ l Om) (* l (* (/ n Om) U*))))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = (2.0 * n) * U;
double t_3 = t_2 * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double t_4 = sqrt((n * fma(U, (t + t), ((((l / Om) * l) * U) * -4.0))));
double tmp;
if (t_3 <= 5e-237) {
tmp = t_4;
} else if (t_3 <= 5e+301) {
tmp = sqrt((t_2 * fma(-2.0, t_1, t)));
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = sqrt((t_2 * ((l / Om) * (l * ((n / Om) * U_42_)))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(Float64(2.0 * n) * U) t_3 = Float64(t_2 * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) t_4 = sqrt(Float64(n * fma(U, Float64(t + t), Float64(Float64(Float64(Float64(l / Om) * l) * U) * -4.0)))) tmp = 0.0 if (t_3 <= 5e-237) tmp = t_4; elseif (t_3 <= 5e+301) tmp = sqrt(Float64(t_2 * fma(-2.0, t_1, t))); elseif (t_3 <= Inf) tmp = t_4; else tmp = sqrt(Float64(t_2 * Float64(Float64(l / Om) * Float64(l * Float64(Float64(n / Om) * U_42_))))); 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[(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]}, Block[{t$95$4 = N[Sqrt[N[(n * N[(U * N[(t + t), $MachinePrecision] + N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * U), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 5e-237], t$95$4, If[LessEqual[t$95$3, 5e+301], N[Sqrt[N[(t$95$2 * N[(-2.0 * t$95$1 + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$4, N[Sqrt[N[(t$95$2 * N[(N[(l / Om), $MachinePrecision] * N[(l * N[(N[(n / Om), $MachinePrecision] * U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := t\_2 \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
t_4 := \sqrt{n \cdot \mathsf{fma}\left(U, t + t, \left(\left(\frac{\ell}{Om} \cdot \ell\right) \cdot U\right) \cdot -4\right)}\\
\mathbf{if}\;t\_3 \leq 5 \cdot 10^{-237}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\sqrt{t\_2 \cdot \mathsf{fma}\left(-2, t\_1, t\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t\_2 \cdot \left(\frac{\ell}{Om} \cdot \left(\ell \cdot \left(\frac{n}{Om} \cdot U*\right)\right)\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 5.0000000000000002e-237 or 5.0000000000000004e301 < (*.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 34.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--.f6445.1
lift-*.f64N/A
Applied rewrites43.7%
Applied rewrites44.6%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6438.0
Applied rewrites38.0%
Applied rewrites47.2%
if 5.0000000000000002e-237 < (*.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.0000000000000004e301Initial program 97.9%
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-*.f6481.9
Applied rewrites81.9%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Taylor expanded in U* around inf
associate-*r*N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6432.0
Applied rewrites32.0%
Applied rewrites28.6%
Applied rewrites32.3%
Final simplification59.8%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (* (/ l Om) l))
(t_3 (* (* 2.0 n) U))
(t_4
(* t_3 (- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*)))))
(t_5 (sqrt (* n (fma U (+ t t) (* (* t_2 U) -4.0))))))
(if (<= t_4 5e-237)
t_5
(if (<= t_4 5e+301)
(sqrt (* t_3 (fma -2.0 t_1 t)))
(if (<= t_4 INFINITY) t_5 (sqrt (* t_3 (* (* (/ n Om) U*) t_2))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = (l / Om) * l;
double t_3 = (2.0 * n) * U;
double t_4 = t_3 * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double t_5 = sqrt((n * fma(U, (t + t), ((t_2 * U) * -4.0))));
double tmp;
if (t_4 <= 5e-237) {
tmp = t_5;
} else if (t_4 <= 5e+301) {
tmp = sqrt((t_3 * fma(-2.0, t_1, t)));
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_5;
} else {
tmp = sqrt((t_3 * (((n / Om) * U_42_) * t_2)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(Float64(l / Om) * l) t_3 = Float64(Float64(2.0 * n) * U) t_4 = Float64(t_3 * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) t_5 = sqrt(Float64(n * fma(U, Float64(t + t), Float64(Float64(t_2 * U) * -4.0)))) tmp = 0.0 if (t_4 <= 5e-237) tmp = t_5; elseif (t_4 <= 5e+301) tmp = sqrt(Float64(t_3 * fma(-2.0, t_1, t))); elseif (t_4 <= Inf) tmp = t_5; else tmp = sqrt(Float64(t_3 * Float64(Float64(Float64(n / Om) * U_42_) * t_2))); 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[(l / Om), $MachinePrecision] * l), $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * 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]}, Block[{t$95$5 = N[Sqrt[N[(n * N[(U * N[(t + t), $MachinePrecision] + N[(N[(t$95$2 * U), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 5e-237], t$95$5, If[LessEqual[t$95$4, 5e+301], N[Sqrt[N[(t$95$3 * N[(-2.0 * t$95$1 + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$5, N[Sqrt[N[(t$95$3 * N[(N[(N[(n / Om), $MachinePrecision] * U$42$), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \frac{\ell}{Om} \cdot \ell\\
t_3 := \left(2 \cdot n\right) \cdot U\\
t_4 := t\_3 \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)\\
t_5 := \sqrt{n \cdot \mathsf{fma}\left(U, t + t, \left(t\_2 \cdot U\right) \cdot -4\right)}\\
\mathbf{if}\;t\_4 \leq 5 \cdot 10^{-237}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\sqrt{t\_3 \cdot \mathsf{fma}\left(-2, t\_1, t\right)}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t\_3 \cdot \left(\left(\frac{n}{Om} \cdot U*\right) \cdot t\_2\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 5.0000000000000002e-237 or 5.0000000000000004e301 < (*.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 34.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--.f6445.1
lift-*.f64N/A
Applied rewrites43.7%
Applied rewrites44.6%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6438.0
Applied rewrites38.0%
Applied rewrites47.2%
if 5.0000000000000002e-237 < (*.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.0000000000000004e301Initial program 97.9%
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-*.f6481.9
Applied rewrites81.9%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Taylor expanded in U* around inf
associate-*r*N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6432.0
Applied rewrites32.0%
Applied rewrites32.0%
Final simplification59.8%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (* (* 2.0 n) U))
(t_3
(* t_2 (- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*)))))
(t_4 (sqrt (* n (fma U (+ t t) (* (* (* (/ l Om) l) U) -4.0))))))
(if (<= t_3 5e-237)
t_4
(if (<= t_3 5e+301)
(sqrt (* t_2 (fma -2.0 t_1 t)))
(if (<= t_3 INFINITY)
t_4
(sqrt (* t_2 (* l (* l (* (/ n (* Om Om)) U*))))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = (2.0 * n) * U;
double t_3 = t_2 * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double t_4 = sqrt((n * fma(U, (t + t), ((((l / Om) * l) * U) * -4.0))));
double tmp;
if (t_3 <= 5e-237) {
tmp = t_4;
} else if (t_3 <= 5e+301) {
tmp = sqrt((t_2 * fma(-2.0, t_1, t)));
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = sqrt((t_2 * (l * (l * ((n / (Om * Om)) * U_42_)))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(Float64(2.0 * n) * U) t_3 = Float64(t_2 * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) t_4 = sqrt(Float64(n * fma(U, Float64(t + t), Float64(Float64(Float64(Float64(l / Om) * l) * U) * -4.0)))) tmp = 0.0 if (t_3 <= 5e-237) tmp = t_4; elseif (t_3 <= 5e+301) tmp = sqrt(Float64(t_2 * fma(-2.0, t_1, t))); elseif (t_3 <= Inf) tmp = t_4; else tmp = sqrt(Float64(t_2 * Float64(l * Float64(l * Float64(Float64(n / Float64(Om * Om)) * U_42_))))); 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[(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]}, Block[{t$95$4 = N[Sqrt[N[(n * N[(U * N[(t + t), $MachinePrecision] + N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * U), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 5e-237], t$95$4, If[LessEqual[t$95$3, 5e+301], N[Sqrt[N[(t$95$2 * N[(-2.0 * t$95$1 + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$4, N[Sqrt[N[(t$95$2 * N[(l * N[(l * N[(N[(n / N[(Om * Om), $MachinePrecision]), $MachinePrecision] * U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := t\_2 \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
t_4 := \sqrt{n \cdot \mathsf{fma}\left(U, t + t, \left(\left(\frac{\ell}{Om} \cdot \ell\right) \cdot U\right) \cdot -4\right)}\\
\mathbf{if}\;t\_3 \leq 5 \cdot 10^{-237}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\sqrt{t\_2 \cdot \mathsf{fma}\left(-2, t\_1, t\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t\_2 \cdot \left(\ell \cdot \left(\ell \cdot \left(\frac{n}{Om \cdot Om} \cdot U*\right)\right)\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 5.0000000000000002e-237 or 5.0000000000000004e301 < (*.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 34.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--.f6445.1
lift-*.f64N/A
Applied rewrites43.7%
Applied rewrites44.6%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6438.0
Applied rewrites38.0%
Applied rewrites47.2%
if 5.0000000000000002e-237 < (*.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.0000000000000004e301Initial program 97.9%
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-*.f6481.9
Applied rewrites81.9%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Taylor expanded in U* around inf
associate-*r*N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6432.0
Applied rewrites32.0%
Applied rewrites28.6%
Applied rewrites28.9%
Final simplification59.4%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (* (* 2.0 n) U))
(t_3
(* t_2 (- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*)))))
(t_4 (sqrt (* n (fma U (+ t t) (* (* (* (/ l Om) l) U) -4.0))))))
(if (<= t_3 5e-237)
t_4
(if (<= t_3 5e+301)
(sqrt (* t_2 (fma -2.0 t_1 t)))
(if (<= t_3 INFINITY)
t_4
(sqrt (* 2.0 (/ (* (* U U*) (* (* l l) (* n n))) (* Om Om)))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = (2.0 * n) * U;
double t_3 = t_2 * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double t_4 = sqrt((n * fma(U, (t + t), ((((l / Om) * l) * U) * -4.0))));
double tmp;
if (t_3 <= 5e-237) {
tmp = t_4;
} else if (t_3 <= 5e+301) {
tmp = sqrt((t_2 * fma(-2.0, t_1, t)));
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = sqrt((2.0 * (((U * U_42_) * ((l * l) * (n * n))) / (Om * Om))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(Float64(2.0 * n) * U) t_3 = Float64(t_2 * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) t_4 = sqrt(Float64(n * fma(U, Float64(t + t), Float64(Float64(Float64(Float64(l / Om) * l) * U) * -4.0)))) tmp = 0.0 if (t_3 <= 5e-237) tmp = t_4; elseif (t_3 <= 5e+301) tmp = sqrt(Float64(t_2 * fma(-2.0, t_1, t))); elseif (t_3 <= Inf) tmp = t_4; else tmp = sqrt(Float64(2.0 * Float64(Float64(Float64(U * U_42_) * Float64(Float64(l * l) * Float64(n * n))) / Float64(Om * Om)))); 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[(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]}, Block[{t$95$4 = N[Sqrt[N[(n * N[(U * N[(t + t), $MachinePrecision] + N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * U), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 5e-237], t$95$4, If[LessEqual[t$95$3, 5e+301], N[Sqrt[N[(t$95$2 * N[(-2.0 * t$95$1 + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$4, N[Sqrt[N[(2.0 * N[(N[(N[(U * U$42$), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := t\_2 \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
t_4 := \sqrt{n \cdot \mathsf{fma}\left(U, t + t, \left(\left(\frac{\ell}{Om} \cdot \ell\right) \cdot U\right) \cdot -4\right)}\\
\mathbf{if}\;t\_3 \leq 5 \cdot 10^{-237}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\sqrt{t\_2 \cdot \mathsf{fma}\left(-2, t\_1, t\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \frac{\left(U \cdot U*\right) \cdot \left(\left(\ell \cdot \ell\right) \cdot \left(n \cdot n\right)\right)}{Om \cdot Om}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 5.0000000000000002e-237 or 5.0000000000000004e301 < (*.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 34.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--.f6445.1
lift-*.f64N/A
Applied rewrites43.7%
Applied rewrites44.6%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6438.0
Applied rewrites38.0%
Applied rewrites47.2%
if 5.0000000000000002e-237 < (*.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.0000000000000004e301Initial program 97.9%
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-*.f6481.9
Applied rewrites81.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
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--.f646.9
lift-*.f64N/A
Applied rewrites6.9%
Taylor expanded in U* around inf
lower-*.f64N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6425.0
Applied rewrites25.0%
Final simplification58.9%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (/ l Om) -2.0))
(t_2 (* (* 2.0 U) n))
(t_3 (pow (/ l Om) 2.0))
(t_4
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 (/ (* l l) Om))) (* (* n t_3) (- U U*))))))
(if (<= t_4 1e-319)
(sqrt (* (* (- (fma t_1 l t) (* (* (- U U*) n) t_3)) (* 2.0 n)) U))
(if (<= t_4 5e+301)
(sqrt
(fma
t_1
(* l t_2)
(* t_2 (fma (* (/ (- l) Om) (* (/ l Om) n)) (- U U*) t))))
(sqrt
(*
(* -2.0 U)
(* (* (fma (/ n Om) (/ (- U U*) Om) (/ 2.0 Om)) l) (* n l))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l / Om) * -2.0;
double t_2 = (2.0 * U) * n;
double t_3 = pow((l / Om), 2.0);
double t_4 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * t_3) * (U - U_42_)));
double tmp;
if (t_4 <= 1e-319) {
tmp = sqrt((((fma(t_1, l, t) - (((U - U_42_) * n) * t_3)) * (2.0 * n)) * U));
} else if (t_4 <= 5e+301) {
tmp = sqrt(fma(t_1, (l * t_2), (t_2 * fma(((-l / Om) * ((l / Om) * n)), (U - U_42_), t))));
} else {
tmp = sqrt(((-2.0 * U) * ((fma((n / Om), ((U - U_42_) / Om), (2.0 / Om)) * l) * (n * l))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l / Om) * -2.0) t_2 = Float64(Float64(2.0 * U) * n) t_3 = Float64(l / Om) ^ 2.0 t_4 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * t_3) * Float64(U - U_42_)))) tmp = 0.0 if (t_4 <= 1e-319) tmp = sqrt(Float64(Float64(Float64(fma(t_1, l, t) - Float64(Float64(Float64(U - U_42_) * n) * t_3)) * Float64(2.0 * n)) * U)); elseif (t_4 <= 5e+301) tmp = sqrt(fma(t_1, Float64(l * t_2), Float64(t_2 * fma(Float64(Float64(Float64(-l) / Om) * Float64(Float64(l / Om) * n)), Float64(U - U_42_), t)))); else tmp = sqrt(Float64(Float64(-2.0 * U) * Float64(Float64(fma(Float64(n / Om), Float64(Float64(U - U_42_) / Om), Float64(2.0 / Om)) * l) * Float64(n * l)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l / Om), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * U), $MachinePrecision] * n), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$4 = 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 * t$95$3), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 1e-319], N[Sqrt[N[(N[(N[(N[(t$95$1 * l + t), $MachinePrecision] - N[(N[(N[(U - U$42$), $MachinePrecision] * n), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision] * N[(2.0 * n), $MachinePrecision]), $MachinePrecision] * U), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 5e+301], N[Sqrt[N[(t$95$1 * N[(l * t$95$2), $MachinePrecision] + N[(t$95$2 * N[(N[(N[((-l) / Om), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(-2.0 * U), $MachinePrecision] * N[(N[(N[(N[(n / Om), $MachinePrecision] * N[(N[(U - U$42$), $MachinePrecision] / Om), $MachinePrecision] + N[(2.0 / Om), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] * N[(n * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell}{Om} \cdot -2\\
t_2 := \left(2 \cdot U\right) \cdot n\\
t_3 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_4 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot t\_3\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_4 \leq 10^{-319}:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(t\_1, \ell, t\right) - \left(\left(U - U*\right) \cdot n\right) \cdot t\_3\right) \cdot \left(2 \cdot n\right)\right) \cdot U}\\
\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(t\_1, \ell \cdot t\_2, t\_2 \cdot \mathsf{fma}\left(\frac{-\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right), U - U*, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(-2 \cdot U\right) \cdot \left(\left(\mathsf{fma}\left(\frac{n}{Om}, \frac{U - U*}{Om}, \frac{2}{Om}\right) \cdot \ell\right) \cdot \left(n \cdot \ell\right)\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 9.99989e-320Initial program 20.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--.f6426.5
lift-*.f64N/A
Applied rewrites26.3%
Applied rewrites47.6%
if 9.99989e-320 < (*.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.0000000000000004e301Initial program 97.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--.f6497.8
lift-*.f64N/A
Applied rewrites91.9%
Applied rewrites97.8%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6499.4
Applied rewrites99.4%
if 5.0000000000000004e301 < (*.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.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6413.1
Applied rewrites13.1%
Applied rewrites8.4%
Taylor expanded in l around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6430.9
Applied rewrites30.9%
Applied rewrites51.3%
Final simplification72.7%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))
(t_2 (* (* 2.0 U) n)))
(if (<= t_1 1e-319)
(sqrt (* n (fma U (+ t t) (* (* (* (/ l Om) l) U) -4.0))))
(if (<= t_1 5e+301)
(sqrt
(fma
(* (/ l Om) -2.0)
(* l t_2)
(* t_2 (fma (* (/ (- l) Om) (* (/ l Om) n)) (- U U*) t))))
(sqrt
(*
(* -2.0 U)
(* (* (fma (/ n Om) (/ (- U U*) Om) (/ 2.0 Om)) l) (* n l))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double t_2 = (2.0 * U) * n;
double tmp;
if (t_1 <= 1e-319) {
tmp = sqrt((n * fma(U, (t + t), ((((l / Om) * l) * U) * -4.0))));
} else if (t_1 <= 5e+301) {
tmp = sqrt(fma(((l / Om) * -2.0), (l * t_2), (t_2 * fma(((-l / Om) * ((l / Om) * n)), (U - U_42_), t))));
} else {
tmp = sqrt(((-2.0 * U) * ((fma((n / Om), ((U - U_42_) / Om), (2.0 / Om)) * l) * (n * l))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) t_2 = Float64(Float64(2.0 * U) * n) tmp = 0.0 if (t_1 <= 1e-319) tmp = sqrt(Float64(n * fma(U, Float64(t + t), Float64(Float64(Float64(Float64(l / Om) * l) * U) * -4.0)))); elseif (t_1 <= 5e+301) tmp = sqrt(fma(Float64(Float64(l / Om) * -2.0), Float64(l * t_2), Float64(t_2 * fma(Float64(Float64(Float64(-l) / Om) * Float64(Float64(l / Om) * n)), Float64(U - U_42_), t)))); else tmp = sqrt(Float64(Float64(-2.0 * U) * Float64(Float64(fma(Float64(n / Om), Float64(Float64(U - U_42_) / Om), Float64(2.0 / Om)) * l) * Float64(n * l)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * U), $MachinePrecision] * n), $MachinePrecision]}, If[LessEqual[t$95$1, 1e-319], N[Sqrt[N[(n * N[(U * N[(t + t), $MachinePrecision] + N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * U), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 5e+301], N[Sqrt[N[(N[(N[(l / Om), $MachinePrecision] * -2.0), $MachinePrecision] * N[(l * t$95$2), $MachinePrecision] + N[(t$95$2 * N[(N[(N[((-l) / Om), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(-2.0 * U), $MachinePrecision] * N[(N[(N[(N[(n / Om), $MachinePrecision] * N[(N[(U - U$42$), $MachinePrecision] / Om), $MachinePrecision] + N[(2.0 / Om), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] * N[(n * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
t_2 := \left(2 \cdot U\right) \cdot n\\
\mathbf{if}\;t\_1 \leq 10^{-319}:\\
\;\;\;\;\sqrt{n \cdot \mathsf{fma}\left(U, t + t, \left(\left(\frac{\ell}{Om} \cdot \ell\right) \cdot U\right) \cdot -4\right)}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\ell}{Om} \cdot -2, \ell \cdot t\_2, t\_2 \cdot \mathsf{fma}\left(\frac{-\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right), U - U*, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(-2 \cdot U\right) \cdot \left(\left(\mathsf{fma}\left(\frac{n}{Om}, \frac{U - U*}{Om}, \frac{2}{Om}\right) \cdot \ell\right) \cdot \left(n \cdot \ell\right)\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 9.99989e-320Initial program 20.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--.f6426.5
lift-*.f64N/A
Applied rewrites26.3%
Applied rewrites25.2%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Applied rewrites46.6%
if 9.99989e-320 < (*.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.0000000000000004e301Initial program 97.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--.f6497.8
lift-*.f64N/A
Applied rewrites91.9%
Applied rewrites97.8%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6499.4
Applied rewrites99.4%
if 5.0000000000000004e301 < (*.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.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6413.1
Applied rewrites13.1%
Applied rewrites8.4%
Taylor expanded in l around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6430.9
Applied rewrites30.9%
Applied rewrites51.3%
Final simplification72.6%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2
(*
t_1
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_2 0.0)
(sqrt (* n (fma U (+ t t) (* (* (* (/ l Om) l) U) -4.0))))
(if (<= t_2 5e+301)
(sqrt
(*
t_1
(fma
(* (* n (- U U*)) (/ (- l) Om))
(/ l Om)
(fma (* (/ l Om) -2.0) l t))))
(sqrt
(*
(* -2.0 U)
(* (* (fma (/ n Om) (/ (- U U*) Om) (/ 2.0 Om)) l) (* n l))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 0.0) {
tmp = sqrt((n * fma(U, (t + t), ((((l / Om) * l) * U) * -4.0))));
} else if (t_2 <= 5e+301) {
tmp = sqrt((t_1 * fma(((n * (U - U_42_)) * (-l / Om)), (l / Om), fma(((l / Om) * -2.0), l, t))));
} else {
tmp = sqrt(((-2.0 * U) * ((fma((n / Om), ((U - U_42_) / Om), (2.0 / Om)) * l) * (n * l))));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) t_2 = Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_2 <= 0.0) tmp = sqrt(Float64(n * fma(U, Float64(t + t), Float64(Float64(Float64(Float64(l / Om) * l) * U) * -4.0)))); elseif (t_2 <= 5e+301) tmp = sqrt(Float64(t_1 * fma(Float64(Float64(n * Float64(U - U_42_)) * Float64(Float64(-l) / Om)), Float64(l / Om), fma(Float64(Float64(l / Om) * -2.0), l, t)))); else tmp = sqrt(Float64(Float64(-2.0 * U) * Float64(Float64(fma(Float64(n / Om), Float64(Float64(U - U_42_) / Om), Float64(2.0 / Om)) * l) * Float64(n * l)))); 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, 0.0], N[Sqrt[N[(n * N[(U * N[(t + t), $MachinePrecision] + N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * U), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, 5e+301], N[Sqrt[N[(t$95$1 * N[(N[(N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] * N[((-l) / Om), $MachinePrecision]), $MachinePrecision] * N[(l / Om), $MachinePrecision] + N[(N[(N[(l / Om), $MachinePrecision] * -2.0), $MachinePrecision] * l + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(-2.0 * U), $MachinePrecision] * N[(N[(N[(N[(n / Om), $MachinePrecision] * N[(N[(U - U$42$), $MachinePrecision] / Om), $MachinePrecision] + N[(2.0 / Om), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] * N[(n * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := t\_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;\sqrt{n \cdot \mathsf{fma}\left(U, t + t, \left(\left(\frac{\ell}{Om} \cdot \ell\right) \cdot U\right) \cdot -4\right)}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\sqrt{t\_1 \cdot \mathsf{fma}\left(\left(n \cdot \left(U - U*\right)\right) \cdot \frac{-\ell}{Om}, \frac{\ell}{Om}, \mathsf{fma}\left(\frac{\ell}{Om} \cdot -2, \ell, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(-2 \cdot U\right) \cdot \left(\left(\mathsf{fma}\left(\frac{n}{Om}, \frac{U - U*}{Om}, \frac{2}{Om}\right) \cdot \ell\right) \cdot \left(n \cdot \ell\right)\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 18.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--.f6425.1
lift-*.f64N/A
Applied rewrites24.8%
Applied rewrites24.8%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.0
Applied rewrites42.0%
Applied rewrites48.1%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 5.0000000000000004e301Initial program 96.4%
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--.f6496.4
lift-*.f64N/A
Applied rewrites90.6%
Applied rewrites90.6%
if 5.0000000000000004e301 < (*.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.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6413.1
Applied rewrites13.1%
Applied rewrites8.4%
Taylor expanded in l around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6430.9
Applied rewrites30.9%
Applied rewrites51.3%
Final simplification69.3%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U))
(t_2
(*
t_1
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_2 1e-320)
(sqrt (* n (fma U (+ t t) (* (* (* (/ l Om) l) U) -4.0))))
(if (<= t_2 5e+301)
(sqrt (* t_1 (- t (/ (* (* l l) (- (/ (* (- U U*) n) Om) -2.0)) Om))))
(sqrt
(*
(* -2.0 U)
(* (* (fma (/ n Om) (/ (- U U*) Om) (/ 2.0 Om)) l) (* n l))))))))
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-320) {
tmp = sqrt((n * fma(U, (t + t), ((((l / Om) * l) * U) * -4.0))));
} else if (t_2 <= 5e+301) {
tmp = sqrt((t_1 * (t - (((l * l) * ((((U - U_42_) * n) / Om) - -2.0)) / Om))));
} else {
tmp = sqrt(((-2.0 * U) * ((fma((n / Om), ((U - U_42_) / Om), (2.0 / Om)) * l) * (n * l))));
}
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-320) tmp = sqrt(Float64(n * fma(U, Float64(t + t), Float64(Float64(Float64(Float64(l / Om) * l) * U) * -4.0)))); elseif (t_2 <= 5e+301) tmp = sqrt(Float64(t_1 * Float64(t - Float64(Float64(Float64(l * l) * Float64(Float64(Float64(Float64(U - U_42_) * n) / Om) - -2.0)) / Om)))); else tmp = sqrt(Float64(Float64(-2.0 * U) * Float64(Float64(fma(Float64(n / Om), Float64(Float64(U - U_42_) / Om), Float64(2.0 / Om)) * l) * Float64(n * l)))); 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-320], N[Sqrt[N[(n * N[(U * N[(t + t), $MachinePrecision] + N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * U), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, 5e+301], N[Sqrt[N[(t$95$1 * N[(t - N[(N[(N[(l * l), $MachinePrecision] * N[(N[(N[(N[(U - U$42$), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] - -2.0), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(-2.0 * U), $MachinePrecision] * N[(N[(N[(N[(n / Om), $MachinePrecision] * N[(N[(U - U$42$), $MachinePrecision] / Om), $MachinePrecision] + N[(2.0 / Om), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] * N[(n * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := t\_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_2 \leq 10^{-320}:\\
\;\;\;\;\sqrt{n \cdot \mathsf{fma}\left(U, t + t, \left(\left(\frac{\ell}{Om} \cdot \ell\right) \cdot U\right) \cdot -4\right)}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(t - \frac{\left(\ell \cdot \ell\right) \cdot \left(\frac{\left(U - U*\right) \cdot n}{Om} - -2\right)}{Om}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(-2 \cdot U\right) \cdot \left(\left(\mathsf{fma}\left(\frac{n}{Om}, \frac{U - U*}{Om}, \frac{2}{Om}\right) \cdot \ell\right) \cdot \left(n \cdot \ell\right)\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 9.99989e-321Initial program 19.4%
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--.f6425.5
lift-*.f64N/A
Applied rewrites25.3%
Applied rewrites25.3%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6440.9
Applied rewrites40.9%
Applied rewrites46.8%
if 9.99989e-321 < (*.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.0000000000000004e301Initial program 96.9%
Taylor expanded in Om around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites86.0%
if 5.0000000000000004e301 < (*.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.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6413.1
Applied rewrites13.1%
Applied rewrites8.4%
Taylor expanded in l around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6430.9
Applied rewrites30.9%
Applied rewrites51.3%
Final simplification66.8%
(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-320)
(sqrt (* n (fma U (+ t t) (* (* (* (/ l Om) l) U) -4.0))))
(if (<= t_2 5e+301)
(sqrt (* t_1 (- t (/ (* (* l l) (- (/ (* (- U U*) n) Om) -2.0)) Om))))
(*
l
(sqrt
(fma
-2.0
(/ (* (* U (* n n)) (- U U*)) (* Om Om))
(* -4.0 (/ (* U n) 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-320) {
tmp = sqrt((n * fma(U, (t + t), ((((l / Om) * l) * U) * -4.0))));
} else if (t_2 <= 5e+301) {
tmp = sqrt((t_1 * (t - (((l * l) * ((((U - U_42_) * n) / Om) - -2.0)) / Om))));
} else {
tmp = l * sqrt(fma(-2.0, (((U * (n * n)) * (U - U_42_)) / (Om * Om)), (-4.0 * ((U * n) / 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-320) tmp = sqrt(Float64(n * fma(U, Float64(t + t), Float64(Float64(Float64(Float64(l / Om) * l) * U) * -4.0)))); elseif (t_2 <= 5e+301) tmp = sqrt(Float64(t_1 * Float64(t - Float64(Float64(Float64(l * l) * Float64(Float64(Float64(Float64(U - U_42_) * n) / Om) - -2.0)) / Om)))); else tmp = Float64(l * sqrt(fma(-2.0, Float64(Float64(Float64(U * Float64(n * n)) * Float64(U - U_42_)) / Float64(Om * Om)), Float64(-4.0 * Float64(Float64(U * n) / 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-320], N[Sqrt[N[(n * N[(U * N[(t + t), $MachinePrecision] + N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * U), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, 5e+301], N[Sqrt[N[(t$95$1 * N[(t - N[(N[(N[(l * l), $MachinePrecision] * N[(N[(N[(N[(U - U$42$), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] - -2.0), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(l * N[Sqrt[N[(-2.0 * N[(N[(N[(U * N[(n * n), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(N[(U * n), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := t\_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_2 \leq 10^{-320}:\\
\;\;\;\;\sqrt{n \cdot \mathsf{fma}\left(U, t + t, \left(\left(\frac{\ell}{Om} \cdot \ell\right) \cdot U\right) \cdot -4\right)}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(t - \frac{\left(\ell \cdot \ell\right) \cdot \left(\frac{\left(U - U*\right) \cdot n}{Om} - -2\right)}{Om}\right)}\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \sqrt{\mathsf{fma}\left(-2, \frac{\left(U \cdot \left(n \cdot n\right)\right) \cdot \left(U - U*\right)}{Om \cdot Om}, -4 \cdot \frac{U \cdot n}{Om}\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 9.99989e-321Initial program 19.4%
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--.f6425.5
lift-*.f64N/A
Applied rewrites25.3%
Applied rewrites25.3%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6440.9
Applied rewrites40.9%
Applied rewrites46.8%
if 9.99989e-321 < (*.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.0000000000000004e301Initial program 96.9%
Taylor expanded in Om around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites86.0%
if 5.0000000000000004e301 < (*.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.9%
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--.f6434.4
lift-*.f64N/A
Applied rewrites33.1%
Applied rewrites32.5%
Taylor expanded in l around inf
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6431.3
Applied rewrites31.3%
Final simplification58.7%
(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 1e-118)
(sqrt (* n (* U (fma -4.0 t_1 (* 2.0 t)))))
(if (<= t_3 1e+151)
(sqrt (* t_2 (fma -2.0 t_1 t)))
(sqrt (* n (fma U (+ t t) (* (* (* (/ l Om) l) U) -4.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 <= 1e-118) {
tmp = sqrt((n * (U * fma(-4.0, t_1, (2.0 * t)))));
} else if (t_3 <= 1e+151) {
tmp = sqrt((t_2 * fma(-2.0, t_1, t)));
} else {
tmp = sqrt((n * fma(U, (t + t), ((((l / Om) * l) * U) * -4.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 <= 1e-118) tmp = sqrt(Float64(n * Float64(U * fma(-4.0, t_1, Float64(2.0 * t))))); elseif (t_3 <= 1e+151) tmp = sqrt(Float64(t_2 * fma(-2.0, t_1, t))); else tmp = sqrt(Float64(n * fma(U, Float64(t + t), Float64(Float64(Float64(Float64(l / Om) * l) * U) * -4.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, 1e-118], N[Sqrt[N[(n * N[(U * N[(-4.0 * t$95$1 + N[(2.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, 1e+151], N[Sqrt[N[(t$95$2 * N[(-2.0 * t$95$1 + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(n * N[(U * N[(t + t), $MachinePrecision] + N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * U), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := \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 10^{-118}:\\
\;\;\;\;\sqrt{n \cdot \left(U \cdot \mathsf{fma}\left(-4, t\_1, 2 \cdot t\right)\right)}\\
\mathbf{elif}\;t\_3 \leq 10^{+151}:\\
\;\;\;\;\sqrt{t\_2 \cdot \mathsf{fma}\left(-2, t\_1, t\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{n \cdot \mathsf{fma}\left(U, t + t, \left(\left(\frac{\ell}{Om} \cdot \ell\right) \cdot U\right) \cdot -4\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*))))) < 9.99999999999999985e-119Initial program 39.4%
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--.f6439.4
lift-*.f64N/A
Applied rewrites39.4%
Applied rewrites38.5%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6454.4
Applied rewrites54.4%
Taylor expanded in U around 0
Applied rewrites55.4%
if 9.99999999999999985e-119 < (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.00000000000000002e151Initial program 97.9%
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-*.f6481.9
Applied rewrites81.9%
if 1.00000000000000002e151 < (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.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--.f6435.1
lift-*.f64N/A
Applied rewrites33.7%
Applied rewrites33.2%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6423.0
Applied rewrites23.0%
Applied rewrites32.4%
Final simplification56.9%
(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 1e-118)
(sqrt (* n (* U (fma -4.0 t_1 (* 2.0 t)))))
(if (<= t_3 INFINITY)
(sqrt (* t_2 (fma -2.0 t_1 t)))
(* (sqrt (* (fma 2.0 n t) (* n 2.0))) (sqrt U))))))
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 <= 1e-118) {
tmp = sqrt((n * (U * fma(-4.0, t_1, (2.0 * t)))));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((t_2 * fma(-2.0, t_1, t)));
} else {
tmp = sqrt((fma(2.0, n, t) * (n * 2.0))) * sqrt(U);
}
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 <= 1e-118) tmp = sqrt(Float64(n * Float64(U * fma(-4.0, t_1, Float64(2.0 * t))))); elseif (t_3 <= Inf) tmp = sqrt(Float64(t_2 * fma(-2.0, t_1, t))); else tmp = Float64(sqrt(Float64(fma(2.0, n, t) * Float64(n * 2.0))) * sqrt(U)); 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, 1e-118], N[Sqrt[N[(n * N[(U * N[(-4.0 * t$95$1 + N[(2.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(-2.0 * t$95$1 + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(2.0 * n + t), $MachinePrecision] * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[U], $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 10^{-118}:\\
\;\;\;\;\sqrt{n \cdot \left(U \cdot \mathsf{fma}\left(-4, t\_1, 2 \cdot t\right)\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{t\_2 \cdot \mathsf{fma}\left(-2, t\_1, t\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(2, n, t\right) \cdot \left(n \cdot 2\right)} \cdot \sqrt{U}\\
\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.99999999999999985e-119Initial program 39.4%
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--.f6439.4
lift-*.f64N/A
Applied rewrites39.4%
Applied rewrites38.5%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6454.4
Applied rewrites54.4%
Taylor expanded in U around 0
Applied rewrites55.4%
if 9.99999999999999985e-119 < (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 72.5%
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-*.f6461.4
Applied rewrites61.4%
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%
Applied rewrites21.7%
Taylor expanded in l around 0
+-commutativeN/A
lower-fma.f6414.2
Applied rewrites14.2%
Final simplification53.4%
(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*)))))
0.0)
(sqrt (* (* (* U t) n) 2.0))
(sqrt (* (* (* U n) t) 2.0))))
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_))))) <= 0.0) {
tmp = sqrt((((U * t) * n) * 2.0));
} else {
tmp = sqrt((((U * n) * t) * 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 (sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42))))) <= 0.0d0) then
tmp = sqrt((((u * t) * n) * 2.0d0))
else
tmp = sqrt((((u * n) * t) * 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 (Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_))))) <= 0.0) {
tmp = Math.sqrt((((U * t) * n) * 2.0));
} else {
tmp = Math.sqrt((((U * n) * t) * 2.0));
}
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_))))) <= 0.0: tmp = math.sqrt((((U * t) * n) * 2.0)) else: tmp = math.sqrt((((U * n) * t) * 2.0)) 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_))))) <= 0.0) tmp = sqrt(Float64(Float64(Float64(U * t) * n) * 2.0)); else tmp = sqrt(Float64(Float64(Float64(U * n) * t) * 2.0)); 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_))))) <= 0.0) tmp = sqrt((((U * t) * n) * 2.0)); else tmp = sqrt((((U * n) * t) * 2.0)); 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], 0.0], N[Sqrt[N[(N[(N[(U * t), $MachinePrecision] * n), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(U * n), $MachinePrecision] * t), $MachinePrecision] * 2.0), $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 0:\\
\;\;\;\;\sqrt{\left(\left(U \cdot t\right) \cdot n\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(U \cdot n\right) \cdot t\right) \cdot 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*))))) < 0.0Initial program 21.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6441.3
Applied rewrites41.3%
Applied rewrites41.3%
if 0.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) Initial program 60.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6437.6
Applied rewrites37.6%
Applied rewrites39.7%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om)))
(if (<= n -1.2e-250)
(sqrt (* n (* U (fma -4.0 t_1 (* 2.0 t)))))
(sqrt (* (* (* (fma -2.0 t_1 t) n) 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 tmp;
if (n <= -1.2e-250) {
tmp = sqrt((n * (U * fma(-4.0, t_1, (2.0 * t)))));
} else {
tmp = sqrt((((fma(-2.0, t_1, t) * n) * U) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) tmp = 0.0 if (n <= -1.2e-250) tmp = sqrt(Float64(n * Float64(U * fma(-4.0, t_1, Float64(2.0 * t))))); else tmp = sqrt(Float64(Float64(Float64(fma(-2.0, t_1, t) * n) * 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]}, If[LessEqual[n, -1.2e-250], N[Sqrt[N[(n * N[(U * N[(-4.0 * t$95$1 + N[(2.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(-2.0 * t$95$1 + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
\mathbf{if}\;n \leq -1.2 \cdot 10^{-250}:\\
\;\;\;\;\sqrt{n \cdot \left(U \cdot \mathsf{fma}\left(-4, t\_1, 2 \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(-2, t\_1, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\end{array}
\end{array}
if n < -1.1999999999999999e-250Initial program 60.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--.f6464.3
lift-*.f64N/A
Applied rewrites60.5%
Applied rewrites62.3%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6452.4
Applied rewrites52.4%
Taylor expanded in U around 0
Applied rewrites52.0%
if -1.1999999999999999e-250 < n Initial program 53.1%
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-*.f6450.7
Applied rewrites50.7%
Final simplification51.3%
(FPCore (n U t l Om U*) :precision binary64 (if (<= t -1.15e+240) (sqrt (* (* (* U n) t) 2.0)) (sqrt (* (* (* (fma -2.0 (/ (* l l) Om) t) n) U) 2.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= -1.15e+240) {
tmp = sqrt((((U * n) * t) * 2.0));
} else {
tmp = sqrt((((fma(-2.0, ((l * l) / Om), t) * n) * U) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= -1.15e+240) tmp = sqrt(Float64(Float64(Float64(U * n) * t) * 2.0)); else tmp = sqrt(Float64(Float64(Float64(fma(-2.0, Float64(Float64(l * l) / Om), t) * n) * U) * 2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, -1.15e+240], N[Sqrt[N[(N[(N[(U * n), $MachinePrecision] * t), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{+240}:\\
\;\;\;\;\sqrt{\left(\left(U \cdot n\right) \cdot t\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(-2, \frac{\ell \cdot \ell}{Om}, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\end{array}
\end{array}
if t < -1.15000000000000001e240Initial program 53.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6441.0
Applied rewrites41.0%
Applied rewrites59.1%
if -1.15000000000000001e240 < t Initial program 56.6%
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-*.f6449.4
Applied rewrites49.4%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 0.00135) (sqrt (* (* (* U n) t) 2.0)) (sqrt (* n (* -4.0 (/ (* U (* l l)) Om))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 0.00135) {
tmp = sqrt((((U * n) * t) * 2.0));
} else {
tmp = sqrt((n * (-4.0 * ((U * (l * l)) / Om))));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (l <= 0.00135d0) then
tmp = sqrt((((u * n) * t) * 2.0d0))
else
tmp = sqrt((n * ((-4.0d0) * ((u * (l * l)) / om))))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 0.00135) {
tmp = Math.sqrt((((U * n) * t) * 2.0));
} else {
tmp = Math.sqrt((n * (-4.0 * ((U * (l * l)) / Om))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 0.00135: tmp = math.sqrt((((U * n) * t) * 2.0)) else: tmp = math.sqrt((n * (-4.0 * ((U * (l * l)) / Om)))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 0.00135) tmp = sqrt(Float64(Float64(Float64(U * n) * t) * 2.0)); else tmp = sqrt(Float64(n * Float64(-4.0 * Float64(Float64(U * Float64(l * l)) / Om)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 0.00135) tmp = sqrt((((U * n) * t) * 2.0)); else tmp = sqrt((n * (-4.0 * ((U * (l * l)) / Om)))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 0.00135], N[Sqrt[N[(N[(N[(U * n), $MachinePrecision] * t), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(n * N[(-4.0 * N[(N[(U * N[(l * l), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 0.00135:\\
\;\;\;\;\sqrt{\left(\left(U \cdot n\right) \cdot t\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{n \cdot \left(-4 \cdot \frac{U \cdot \left(\ell \cdot \ell\right)}{Om}\right)}\\
\end{array}
\end{array}
if l < 0.0013500000000000001Initial program 60.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6444.4
Applied rewrites44.4%
Applied rewrites44.8%
if 0.0013500000000000001 < l Initial program 43.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--.f6454.0
lift-*.f64N/A
Applied rewrites52.5%
Applied rewrites52.9%
Taylor expanded in n around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in t around 0
Applied rewrites33.3%
Final simplification41.9%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 0.00135) (sqrt (* (* (* U n) t) 2.0)) (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 <= 0.00135) {
tmp = sqrt((((U * n) * t) * 2.0));
} 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 <= 0.00135d0) then
tmp = sqrt((((u * n) * t) * 2.0d0))
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 <= 0.00135) {
tmp = Math.sqrt((((U * n) * t) * 2.0));
} 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 <= 0.00135: tmp = math.sqrt((((U * n) * t) * 2.0)) 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 <= 0.00135) tmp = sqrt(Float64(Float64(Float64(U * n) * t) * 2.0)); 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 <= 0.00135) tmp = sqrt((((U * n) * t) * 2.0)); 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, 0.00135], N[Sqrt[N[(N[(N[(U * n), $MachinePrecision] * t), $MachinePrecision] * 2.0), $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 0.00135:\\
\;\;\;\;\sqrt{\left(\left(U \cdot n\right) \cdot t\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{-4 \cdot \frac{\left(U \cdot \left(\ell \cdot \ell\right)\right) \cdot n}{Om}}\\
\end{array}
\end{array}
if l < 0.0013500000000000001Initial program 60.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6444.4
Applied rewrites44.4%
Applied rewrites44.8%
if 0.0013500000000000001 < l Initial program 43.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6419.1
Applied rewrites19.1%
Applied rewrites16.1%
Taylor expanded in l around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6446.1
Applied rewrites46.1%
Taylor expanded in n around 0
Applied rewrites31.8%
(FPCore (n U t l Om U*) :precision binary64 (if (<= t 9.5e+150) (sqrt (* (* (* U n) t) 2.0)) (* (sqrt (* U (* n (fma 2.0 n t)))) (sqrt 2.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= 9.5e+150) {
tmp = sqrt((((U * n) * t) * 2.0));
} else {
tmp = sqrt((U * (n * fma(2.0, n, t)))) * sqrt(2.0);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= 9.5e+150) tmp = sqrt(Float64(Float64(Float64(U * n) * t) * 2.0)); else tmp = Float64(sqrt(Float64(U * Float64(n * fma(2.0, n, t)))) * sqrt(2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, 9.5e+150], N[Sqrt[N[(N[(N[(U * n), $MachinePrecision] * t), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(U * N[(n * N[(2.0 * n + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 9.5 \cdot 10^{+150}:\\
\;\;\;\;\sqrt{\left(\left(U \cdot n\right) \cdot t\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{U \cdot \left(n \cdot \mathsf{fma}\left(2, n, t\right)\right)} \cdot \sqrt{2}\\
\end{array}
\end{array}
if t < 9.5000000000000001e150Initial program 58.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
Applied rewrites38.3%
if 9.5000000000000001e150 < t Initial program 42.3%
Applied rewrites40.7%
Taylor expanded in l around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f6460.1
Applied rewrites60.1%
(FPCore (n U t l Om U*) :precision binary64 (if (<= n -6.6e-234) (sqrt (* (* (* U t) n) 2.0)) (sqrt (* (* (* n t) U) 2.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= -6.6e-234) {
tmp = sqrt((((U * t) * n) * 2.0));
} 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 (n <= (-6.6d-234)) then
tmp = sqrt((((u * t) * n) * 2.0d0))
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 (n <= -6.6e-234) {
tmp = Math.sqrt((((U * t) * n) * 2.0));
} else {
tmp = Math.sqrt((((n * t) * U) * 2.0));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if n <= -6.6e-234: tmp = math.sqrt((((U * t) * n) * 2.0)) else: tmp = math.sqrt((((n * t) * U) * 2.0)) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= -6.6e-234) tmp = sqrt(Float64(Float64(Float64(U * t) * n) * 2.0)); 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 (n <= -6.6e-234) tmp = sqrt((((U * t) * n) * 2.0)); else tmp = sqrt((((n * t) * U) * 2.0)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, -6.6e-234], N[Sqrt[N[(N[(N[(U * t), $MachinePrecision] * n), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(n * t), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -6.6 \cdot 10^{-234}:\\
\;\;\;\;\sqrt{\left(\left(U \cdot t\right) \cdot n\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(n \cdot t\right) \cdot U\right) \cdot 2}\\
\end{array}
\end{array}
if n < -6.60000000000000028e-234Initial program 61.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6435.2
Applied rewrites35.2%
Applied rewrites40.5%
if -6.60000000000000028e-234 < n Initial program 52.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6440.1
Applied rewrites40.1%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* U n) t) 2.0)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((U * n) * t) * 2.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((u * n) * t) * 2.0d0))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((U * n) * t) * 2.0));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((U * n) * t) * 2.0))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(U * n) * t) * 2.0)) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((U * n) * t) * 2.0)); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(U * n), $MachinePrecision] * t), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(U \cdot n\right) \cdot t\right) \cdot 2}
\end{array}
Initial program 56.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6438.0
Applied rewrites38.0%
Applied rewrites37.6%
herbie shell --seed 2025006
(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*))))))