
(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 8 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 (* n (- U U*)))
(t_2 (pow (/ l Om) 2.0))
(t_3
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 (/ (* l l) Om))) (* (* n t_2) (- U U*))))))
(if (<= t_3 0.0)
(sqrt
(*
(* n 2.0)
(+
(/ (- (* (- U) (* (* l l) (/ t_1 Om))) (* 2.0 (* U (* l l)))) Om)
(* U t))))
(if (<= t_3 1e+289)
(sqrt t_3)
(if (<= t_3 INFINITY)
(sqrt
(*
(* n 2.0)
(* U (- (- t (* (* l (/ l Om)) 2.0)) (* (- U U*) (* t_2 n))))))
(sqrt
(*
(* n 2.0)
(/ (* (* l l) (+ (* 2.0 U) (/ (* U t_1) Om))) (- Om)))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = n * (U - U_42_);
double t_2 = pow((l / Om), 2.0);
double t_3 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * t_2) * (U - U_42_)));
double tmp;
if (t_3 <= 0.0) {
tmp = sqrt(((n * 2.0) * ((((-U * ((l * l) * (t_1 / Om))) - (2.0 * (U * (l * l)))) / Om) + (U * t))));
} else if (t_3 <= 1e+289) {
tmp = sqrt(t_3);
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt(((n * 2.0) * (U * ((t - ((l * (l / Om)) * 2.0)) - ((U - U_42_) * (t_2 * n))))));
} else {
tmp = sqrt(((n * 2.0) * (((l * l) * ((2.0 * U) + ((U * t_1) / Om))) / -Om)));
}
return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = n * (U - U_42_);
double t_2 = Math.pow((l / Om), 2.0);
double t_3 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * t_2) * (U - U_42_)));
double tmp;
if (t_3 <= 0.0) {
tmp = Math.sqrt(((n * 2.0) * ((((-U * ((l * l) * (t_1 / Om))) - (2.0 * (U * (l * l)))) / Om) + (U * t))));
} else if (t_3 <= 1e+289) {
tmp = Math.sqrt(t_3);
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt(((n * 2.0) * (U * ((t - ((l * (l / Om)) * 2.0)) - ((U - U_42_) * (t_2 * n))))));
} else {
tmp = Math.sqrt(((n * 2.0) * (((l * l) * ((2.0 * U) + ((U * t_1) / Om))) / -Om)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = n * (U - U_42_) t_2 = math.pow((l / Om), 2.0) t_3 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * t_2) * (U - U_42_))) tmp = 0 if t_3 <= 0.0: tmp = math.sqrt(((n * 2.0) * ((((-U * ((l * l) * (t_1 / Om))) - (2.0 * (U * (l * l)))) / Om) + (U * t)))) elif t_3 <= 1e+289: tmp = math.sqrt(t_3) elif t_3 <= math.inf: tmp = math.sqrt(((n * 2.0) * (U * ((t - ((l * (l / Om)) * 2.0)) - ((U - U_42_) * (t_2 * n)))))) else: tmp = math.sqrt(((n * 2.0) * (((l * l) * ((2.0 * U) + ((U * t_1) / Om))) / -Om))) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(n * Float64(U - U_42_)) t_2 = Float64(l / Om) ^ 2.0 t_3 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * t_2) * Float64(U - U_42_)))) tmp = 0.0 if (t_3 <= 0.0) tmp = sqrt(Float64(Float64(n * 2.0) * Float64(Float64(Float64(Float64(Float64(-U) * Float64(Float64(l * l) * Float64(t_1 / Om))) - Float64(2.0 * Float64(U * Float64(l * l)))) / Om) + Float64(U * t)))); elseif (t_3 <= 1e+289) tmp = sqrt(t_3); elseif (t_3 <= Inf) tmp = sqrt(Float64(Float64(n * 2.0) * Float64(U * Float64(Float64(t - Float64(Float64(l * Float64(l / Om)) * 2.0)) - Float64(Float64(U - U_42_) * Float64(t_2 * n)))))); else tmp = sqrt(Float64(Float64(n * 2.0) * Float64(Float64(Float64(l * l) * Float64(Float64(2.0 * U) + Float64(Float64(U * t_1) / Om))) / Float64(-Om)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = n * (U - U_42_); t_2 = (l / Om) ^ 2.0; t_3 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * t_2) * (U - U_42_))); tmp = 0.0; if (t_3 <= 0.0) tmp = sqrt(((n * 2.0) * ((((-U * ((l * l) * (t_1 / Om))) - (2.0 * (U * (l * l)))) / Om) + (U * t)))); elseif (t_3 <= 1e+289) tmp = sqrt(t_3); elseif (t_3 <= Inf) tmp = sqrt(((n * 2.0) * (U * ((t - ((l * (l / Om)) * 2.0)) - ((U - U_42_) * (t_2 * n)))))); else tmp = sqrt(((n * 2.0) * (((l * l) * ((2.0 * U) + ((U * t_1) / Om))) / -Om))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = 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$2), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(N[(N[(N[((-U) * N[(N[(l * l), $MachinePrecision] * N[(t$95$1 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 * N[(U * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] + N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, 1e+289], N[Sqrt[t$95$3], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(U * N[(N[(t - N[(N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] - N[(N[(U - U$42$), $MachinePrecision] * N[(t$95$2 * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(N[(N[(l * l), $MachinePrecision] * N[(N[(2.0 * U), $MachinePrecision] + N[(N[(U * t$95$1), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-Om)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := n \cdot \left(U - U*\right)\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \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\_2\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_3 \leq 0:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(\frac{\left(-U\right) \cdot \left(\left(\ell \cdot \ell\right) \cdot \frac{t\_1}{Om}\right) - 2 \cdot \left(U \cdot \left(\ell \cdot \ell\right)\right)}{Om} + U \cdot t\right)}\\
\mathbf{elif}\;t\_3 \leq 10^{+289}:\\
\;\;\;\;\sqrt{t\_3}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot \left(\left(t - \left(\ell \cdot \frac{\ell}{Om}\right) \cdot 2\right) - \left(U - U*\right) \cdot \left(t\_2 \cdot n\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \frac{\left(\ell \cdot \ell\right) \cdot \left(2 \cdot U + \frac{U \cdot t\_1}{Om}\right)}{-Om}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 14.8%
Applied rewrites44.4%
Taylor expanded in t around inf
Applied rewrites34.4%
Taylor expanded in Om around -inf
lower-+.f64N/A
Applied rewrites46.7%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1.0000000000000001e289Initial program 98.7%
if 1.0000000000000001e289 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 33.3%
Applied rewrites45.5%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Applied rewrites6.6%
Taylor expanded in Om around -inf
lower-+.f64N/A
Applied rewrites12.6%
Taylor expanded in l around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift--.f6439.6
Applied rewrites39.6%
Final simplification68.4%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* n (- U U*)))
(t_2 (* (* 2.0 n) U))
(t_3 (- t (* 2.0 (/ (* l l) Om))))
(t_4 (pow (/ l Om) 2.0))
(t_5 (* t_2 (- t_3 (* (* n t_4) (- U U*))))))
(if (<= t_5 0.0)
(sqrt
(*
(* n 2.0)
(+
(/ (- (* (- U) (* (* l l) (/ t_1 Om))) (* 2.0 (* U (* l l)))) Om)
(* U t))))
(if (<= t_5 1e+289)
(sqrt (* t_2 (- t_3 (* (* n (ratio-of-squares l Om)) (- U U*)))))
(if (<= t_5 INFINITY)
(sqrt
(*
(* n 2.0)
(* U (- (- t (* (* l (/ l Om)) 2.0)) (* (- U U*) (* t_4 n))))))
(sqrt
(*
(* n 2.0)
(/ (* (* l l) (+ (* 2.0 U) (/ (* U t_1) Om))) (- Om)))))))))\begin{array}{l}
\\
\begin{array}{l}
t_1 := n \cdot \left(U - U*\right)\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := t - 2 \cdot \frac{\ell \cdot \ell}{Om}\\
t_4 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_5 := t\_2 \cdot \left(t\_3 - \left(n \cdot t\_4\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_5 \leq 0:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(\frac{\left(-U\right) \cdot \left(\left(\ell \cdot \ell\right) \cdot \frac{t\_1}{Om}\right) - 2 \cdot \left(U \cdot \left(\ell \cdot \ell\right)\right)}{Om} + U \cdot t\right)}\\
\mathbf{elif}\;t\_5 \leq 10^{+289}:\\
\;\;\;\;\sqrt{t\_2 \cdot \left(t\_3 - \left(n \cdot \mathsf{ratio\_of\_squares}\left(\ell, Om\right)\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{elif}\;t\_5 \leq \infty:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot \left(\left(t - \left(\ell \cdot \frac{\ell}{Om}\right) \cdot 2\right) - \left(U - U*\right) \cdot \left(t\_4 \cdot n\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \frac{\left(\ell \cdot \ell\right) \cdot \left(2 \cdot U + \frac{U \cdot t\_1}{Om}\right)}{-Om}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 14.8%
Applied rewrites44.4%
Taylor expanded in t around inf
Applied rewrites34.4%
Taylor expanded in Om around -inf
lower-+.f64N/A
Applied rewrites46.7%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1.0000000000000001e289Initial program 98.7%
Taylor expanded in l around 0
pow2N/A
unpow2N/A
lower-ratio-of-squares.f6498.7
Applied rewrites98.7%
if 1.0000000000000001e289 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 33.3%
Applied rewrites45.5%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Applied rewrites6.6%
Taylor expanded in Om around -inf
lower-+.f64N/A
Applied rewrites12.6%
Taylor expanded in l around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift--.f6439.6
Applied rewrites39.6%
Final simplification68.4%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* n (- U U*)))
(t_2 (* (* 2.0 n) U))
(t_3 (- t (* 2.0 (/ (* l l) Om))))
(t_4 (* t_2 (- t_3 (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_4 0.0)
(sqrt
(*
(* n 2.0)
(+
(/ (- (* (- U) (* (* l l) (/ t_1 Om))) (* 2.0 (* U (* l l)))) Om)
(* U t))))
(if (<= t_4 INFINITY)
(sqrt (* t_2 (- t_3 (* (* n (ratio-of-squares l Om)) (- U U*)))))
(sqrt
(*
(* n 2.0)
(/ (* (* l l) (+ (* 2.0 U) (/ (* U t_1) Om))) (- Om))))))))\begin{array}{l}
\\
\begin{array}{l}
t_1 := n \cdot \left(U - U*\right)\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := t - 2 \cdot \frac{\ell \cdot \ell}{Om}\\
t_4 := t\_2 \cdot \left(t\_3 - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_4 \leq 0:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(\frac{\left(-U\right) \cdot \left(\left(\ell \cdot \ell\right) \cdot \frac{t\_1}{Om}\right) - 2 \cdot \left(U \cdot \left(\ell \cdot \ell\right)\right)}{Om} + U \cdot t\right)}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{t\_2 \cdot \left(t\_3 - \left(n \cdot \mathsf{ratio\_of\_squares}\left(\ell, Om\right)\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \frac{\left(\ell \cdot \ell\right) \cdot \left(2 \cdot U + \frac{U \cdot t\_1}{Om}\right)}{-Om}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 0.0Initial program 14.8%
Applied rewrites44.4%
Taylor expanded in t around inf
Applied rewrites34.4%
Taylor expanded in Om around -inf
lower-+.f64N/A
Applied rewrites46.7%
if 0.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < +inf.0Initial program 73.5%
Taylor expanded in l around 0
pow2N/A
unpow2N/A
lower-ratio-of-squares.f6473.5
Applied rewrites73.5%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 0.0%
Applied rewrites6.6%
Taylor expanded in Om around -inf
lower-+.f64N/A
Applied rewrites12.6%
Taylor expanded in l around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift--.f6439.6
Applied rewrites39.6%
Final simplification65.0%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U)))
(if (<=
(sqrt
(*
t_1
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))
0.0)
(sqrt (* (* n 2.0) (* U t)))
(sqrt (* t_1 (- t (* (* n (ratio-of-squares l Om)) (- U U*))))))))\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
\mathbf{if}\;\sqrt{t\_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \leq 0:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(t - \left(n \cdot \mathsf{ratio\_of\_squares}\left(\ell, Om\right)\right) \cdot \left(U - U*\right)\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*))))) < 0.0Initial program 16.0%
Applied rewrites47.9%
Taylor expanded in t around inf
Applied rewrites37.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 61.4%
Taylor expanded in l around 0
pow2N/A
unpow2N/A
lower-ratio-of-squares.f6461.4
Applied rewrites61.4%
Taylor expanded in t around inf
Applied rewrites64.0%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U)) (t_2 (- t (* 2.0 (/ (* l l) Om)))))
(if (<= (* t_1 (- t_2 (* (* n (pow (/ l Om) 2.0)) (- U U*)))) 5e-272)
(sqrt (* 2.0 (* U (* n t_2))))
(sqrt (* t_1 (- t (* (* n (ratio-of-squares l Om)) (- U U*))))))))\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
t_2 := t - 2 \cdot \frac{\ell \cdot \ell}{Om}\\
\mathbf{if}\;t\_1 \cdot \left(t\_2 - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right) \leq 5 \cdot 10^{-272}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\_2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(t - \left(n \cdot \mathsf{ratio\_of\_squares}\left(\ell, Om\right)\right) \cdot \left(U - U*\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*)))) < 4.99999999999999982e-272Initial program 25.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6440.8
Applied rewrites40.8%
Taylor expanded in n around 0
lower-*.f64N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6449.5
Applied rewrites49.5%
if 4.99999999999999982e-272 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) Initial program 61.3%
Taylor expanded in l around 0
pow2N/A
unpow2N/A
lower-ratio-of-squares.f6461.3
Applied rewrites61.3%
Taylor expanded in t around inf
Applied rewrites64.3%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* 2.0 n) U)))
(if (<=
(sqrt
(*
t_1
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))
2e-136)
(sqrt (* (* (* t n) U) 2.0))
(sqrt (* t_1 t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double tmp;
if (sqrt((t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_))))) <= 2e-136) {
tmp = sqrt((((t * n) * U) * 2.0));
} else {
tmp = sqrt((t_1 * t));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: t_1
real(8) :: tmp
t_1 = (2.0d0 * n) * u
if (sqrt((t_1 * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42))))) <= 2d-136) then
tmp = sqrt((((t * n) * u) * 2.0d0))
else
tmp = sqrt((t_1 * t))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (2.0 * n) * U;
double tmp;
if (Math.sqrt((t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_))))) <= 2e-136) {
tmp = Math.sqrt((((t * n) * U) * 2.0));
} else {
tmp = Math.sqrt((t_1 * t));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = (2.0 * n) * U tmp = 0 if math.sqrt((t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_))))) <= 2e-136: tmp = math.sqrt((((t * n) * U) * 2.0)) else: tmp = math.sqrt((t_1 * t)) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(2.0 * n) * U) tmp = 0.0 if (sqrt(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_))))) <= 2e-136) tmp = sqrt(Float64(Float64(Float64(t * n) * U) * 2.0)); else tmp = sqrt(Float64(t_1 * t)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (2.0 * n) * U; tmp = 0.0; if (sqrt((t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))) <= 2e-136) tmp = sqrt((((t * n) * U) * 2.0)); else tmp = sqrt((t_1 * t)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, If[LessEqual[N[Sqrt[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]], $MachinePrecision], 2e-136], N[Sqrt[N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(t$95$1 * t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 \cdot n\right) \cdot U\\
\mathbf{if}\;\sqrt{t\_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \leq 2 \cdot 10^{-136}:\\
\;\;\;\;\sqrt{\left(\left(t \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t\_1 \cdot t}\\
\end{array}
\end{array}
if (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 2e-136Initial program 27.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6443.8
Applied rewrites43.8%
if 2e-136 < (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.4%
Taylor expanded in t around inf
Applied rewrites48.1%
Final simplification47.4%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* n (ratio-of-squares l Om))) (t_2 (* (* 2.0 n) U)))
(if (<= n -0.108)
(sqrt (* t_2 (- t (* t_1 (- U U*)))))
(if (<= n 9e-53)
(sqrt (* (* (* (- t (* (* l (/ l Om)) 2.0)) n) U) 2.0))
(sqrt (* t_2 (- t (* t_1 (- U*)))))))))\begin{array}{l}
\\
\begin{array}{l}
t_1 := n \cdot \mathsf{ratio\_of\_squares}\left(\ell, Om\right)\\
t_2 := \left(2 \cdot n\right) \cdot U\\
\mathbf{if}\;n \leq -0.108:\\
\;\;\;\;\sqrt{t\_2 \cdot \left(t - t\_1 \cdot \left(U - U*\right)\right)}\\
\mathbf{elif}\;n \leq 9 \cdot 10^{-53}:\\
\;\;\;\;\sqrt{\left(\left(\left(t - \left(\ell \cdot \frac{\ell}{Om}\right) \cdot 2\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t\_2 \cdot \left(t - t\_1 \cdot \left(-U*\right)\right)}\\
\end{array}
\end{array}
if n < -0.107999999999999999Initial program 62.9%
Taylor expanded in l around 0
pow2N/A
unpow2N/A
lower-ratio-of-squares.f6462.8
Applied rewrites62.8%
Taylor expanded in t around inf
Applied rewrites72.9%
if -0.107999999999999999 < n < 8.9999999999999997e-53Initial program 45.8%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6457.9
Applied rewrites57.9%
if 8.9999999999999997e-53 < n Initial program 63.5%
Taylor expanded in l around 0
pow2N/A
unpow2N/A
lower-ratio-of-squares.f6463.5
Applied rewrites63.5%
Taylor expanded in t around inf
Applied rewrites67.8%
Taylor expanded in U around 0
lower-*.f6467.8
Applied rewrites67.8%
Final simplification64.4%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* t n) U) 2.0)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((t * n) * U) * 2.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((t * n) * u) * 2.0d0))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((t * n) * U) * 2.0));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((t * n) * U) * 2.0))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(t * n) * U) * 2.0)) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((t * n) * U) * 2.0)); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(t \cdot n\right) \cdot U\right) \cdot 2}
\end{array}
Initial program 55.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6444.2
Applied rewrites44.2%
herbie shell --seed 2025058
(FPCore (n U t l Om U*)
:name "Toniolo and Linder, Equation (13)"
:precision binary64
(sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))