
(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 10 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 (fma -2.0 (* l (/ l Om)) t))
(t_2 (pow (/ l Om) 2.0))
(t_3
(sqrt
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 (/ (* l l) Om))) (* (* n t_2) (- U U*)))))))
(if (<= t_3 2e-149)
(* (pow (* n 2.0) 0.5) (pow (* U (- t_1 (* (- U U*) (* t_2 n)))) 0.5))
(if (<= t_3 2e+154) t_3 (* (pow 2.0 0.5) (pow (* (* t_1 n) U) 0.5))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma(-2.0, (l * (l / Om)), t);
double t_2 = pow((l / Om), 2.0);
double t_3 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * t_2) * (U - U_42_)))));
double tmp;
if (t_3 <= 2e-149) {
tmp = pow((n * 2.0), 0.5) * pow((U * (t_1 - ((U - U_42_) * (t_2 * n)))), 0.5);
} else if (t_3 <= 2e+154) {
tmp = t_3;
} else {
tmp = pow(2.0, 0.5) * pow(((t_1 * n) * U), 0.5);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = fma(-2.0, Float64(l * Float64(l / Om)), t) t_2 = Float64(l / Om) ^ 2.0 t_3 = sqrt(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 <= 2e-149) tmp = Float64((Float64(n * 2.0) ^ 0.5) * (Float64(U * Float64(t_1 - Float64(Float64(U - U_42_) * Float64(t_2 * n)))) ^ 0.5)); elseif (t_3 <= 2e+154) tmp = t_3; else tmp = Float64((2.0 ^ 0.5) * (Float64(Float64(t_1 * n) * U) ^ 0.5)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = 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 * t$95$2), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 2e-149], N[(N[Power[N[(n * 2.0), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(U * N[(t$95$1 - N[(N[(U - U$42$), $MachinePrecision] * N[(t$95$2 * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+154], t$95$3, N[(N[Power[2.0, 0.5], $MachinePrecision] * N[Power[N[(N[(t$95$1 * n), $MachinePrecision] * U), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right)\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \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 t\_2\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_3 \leq 2 \cdot 10^{-149}:\\
\;\;\;\;{\left(n \cdot 2\right)}^{0.5} \cdot {\left(U \cdot \left(t\_1 - \left(U - U*\right) \cdot \left(t\_2 \cdot n\right)\right)\right)}^{0.5}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+154}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;{2}^{0.5} \cdot {\left(\left(t\_1 \cdot n\right) \cdot U\right)}^{0.5}\\
\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*))))) < 1.99999999999999996e-149Initial program 17.4%
Applied rewrites47.6%
if 1.99999999999999996e-149 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 2.00000000000000007e154Initial program 99.1%
if 2.00000000000000007e154 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) Initial program 25.5%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
pow1/2N/A
lower-pow.f64N/A
pow1/2N/A
lower-pow.f64N/A
Applied rewrites53.2%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (fma -2.0 (* l (/ l Om)) t))
(t_2 (pow (/ l Om) 2.0))
(t_3
(sqrt
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 (/ (* l l) Om))) (* (* n t_2) (- U U*)))))))
(if (<= t_3 5e-146)
(sqrt (* (* n 2.0) (* U (- t_1 (* (- U U*) (* t_2 n))))))
(if (<= t_3 2e+154) t_3 (* (pow 2.0 0.5) (pow (* (* t_1 n) U) 0.5))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma(-2.0, (l * (l / Om)), t);
double t_2 = pow((l / Om), 2.0);
double t_3 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * t_2) * (U - U_42_)))));
double tmp;
if (t_3 <= 5e-146) {
tmp = sqrt(((n * 2.0) * (U * (t_1 - ((U - U_42_) * (t_2 * n))))));
} else if (t_3 <= 2e+154) {
tmp = t_3;
} else {
tmp = pow(2.0, 0.5) * pow(((t_1 * n) * U), 0.5);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = fma(-2.0, Float64(l * Float64(l / Om)), t) t_2 = Float64(l / Om) ^ 2.0 t_3 = sqrt(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 <= 5e-146) tmp = sqrt(Float64(Float64(n * 2.0) * Float64(U * Float64(t_1 - Float64(Float64(U - U_42_) * Float64(t_2 * n)))))); elseif (t_3 <= 2e+154) tmp = t_3; else tmp = Float64((2.0 ^ 0.5) * (Float64(Float64(t_1 * n) * U) ^ 0.5)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = 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 * t$95$2), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 5e-146], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(U * N[(t$95$1 - N[(N[(U - U$42$), $MachinePrecision] * N[(t$95$2 * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, 2e+154], t$95$3, N[(N[Power[2.0, 0.5], $MachinePrecision] * N[Power[N[(N[(t$95$1 * n), $MachinePrecision] * U), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right)\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \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 t\_2\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_3 \leq 5 \cdot 10^{-146}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot \left(t\_1 - \left(U - U*\right) \cdot \left(t\_2 \cdot n\right)\right)\right)}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+154}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;{2}^{0.5} \cdot {\left(\left(t\_1 \cdot n\right) \cdot U\right)}^{0.5}\\
\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*))))) < 4.99999999999999957e-146Initial program 20.2%
Applied rewrites43.3%
if 4.99999999999999957e-146 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 2.00000000000000007e154Initial program 99.6%
if 2.00000000000000007e154 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) Initial program 25.5%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
pow1/2N/A
lower-pow.f64N/A
pow1/2N/A
lower-pow.f64N/A
Applied rewrites53.2%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* 2.0 (/ (* l l) Om)))
(t_2 (fma -2.0 (* l (/ l Om)) t))
(t_3 (pow (/ l Om) 2.0))
(t_4 (* (* 2.0 n) U))
(t_5 (sqrt (* t_4 (- (- t t_1) (* (* n t_3) (- U U*)))))))
(if (<= t_5 4e+64)
(sqrt (* (* n 2.0) (* U (- t_2 (* (- U U*) (* t_3 n))))))
(if (<= t_5 2e+154)
(sqrt (* t_4 (- t (fma -1.0 (* (/ U* Om) (/ (* (* l l) n) Om)) t_1))))
(* (pow 2.0 0.5) (pow (* (* t_2 n) U) 0.5))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = 2.0 * ((l * l) / Om);
double t_2 = fma(-2.0, (l * (l / Om)), t);
double t_3 = pow((l / Om), 2.0);
double t_4 = (2.0 * n) * U;
double t_5 = sqrt((t_4 * ((t - t_1) - ((n * t_3) * (U - U_42_)))));
double tmp;
if (t_5 <= 4e+64) {
tmp = sqrt(((n * 2.0) * (U * (t_2 - ((U - U_42_) * (t_3 * n))))));
} else if (t_5 <= 2e+154) {
tmp = sqrt((t_4 * (t - fma(-1.0, ((U_42_ / Om) * (((l * l) * n) / Om)), t_1))));
} else {
tmp = pow(2.0, 0.5) * pow(((t_2 * n) * U), 0.5);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(2.0 * Float64(Float64(l * l) / Om)) t_2 = fma(-2.0, Float64(l * Float64(l / Om)), t) t_3 = Float64(l / Om) ^ 2.0 t_4 = Float64(Float64(2.0 * n) * U) t_5 = sqrt(Float64(t_4 * Float64(Float64(t - t_1) - Float64(Float64(n * t_3) * Float64(U - U_42_))))) tmp = 0.0 if (t_5 <= 4e+64) tmp = sqrt(Float64(Float64(n * 2.0) * Float64(U * Float64(t_2 - Float64(Float64(U - U_42_) * Float64(t_3 * n)))))); elseif (t_5 <= 2e+154) tmp = sqrt(Float64(t_4 * Float64(t - fma(-1.0, Float64(Float64(U_42_ / Om) * Float64(Float64(Float64(l * l) * n) / Om)), t_1)))); else tmp = Float64((2.0 ^ 0.5) * (Float64(Float64(t_2 * n) * U) ^ 0.5)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$4 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(t$95$4 * N[(N[(t - t$95$1), $MachinePrecision] - N[(N[(n * t$95$3), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$5, 4e+64], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(U * N[(t$95$2 - N[(N[(U - U$42$), $MachinePrecision] * N[(t$95$3 * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$5, 2e+154], N[Sqrt[N[(t$95$4 * N[(t - N[(-1.0 * N[(N[(U$42$ / Om), $MachinePrecision] * N[(N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Power[2.0, 0.5], $MachinePrecision] * N[Power[N[(N[(t$95$2 * n), $MachinePrecision] * U), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \frac{\ell \cdot \ell}{Om}\\
t_2 := \mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right)\\
t_3 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_4 := \left(2 \cdot n\right) \cdot U\\
t_5 := \sqrt{t\_4 \cdot \left(\left(t - t\_1\right) - \left(n \cdot t\_3\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_5 \leq 4 \cdot 10^{+64}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot \left(t\_2 - \left(U - U*\right) \cdot \left(t\_3 \cdot n\right)\right)\right)}\\
\mathbf{elif}\;t\_5 \leq 2 \cdot 10^{+154}:\\
\;\;\;\;\sqrt{t\_4 \cdot \left(t - \mathsf{fma}\left(-1, \frac{U*}{Om} \cdot \frac{\left(\ell \cdot \ell\right) \cdot n}{Om}, t\_1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{2}^{0.5} \cdot {\left(\left(t\_2 \cdot n\right) \cdot U\right)}^{0.5}\\
\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*))))) < 4.00000000000000009e64Initial program 73.4%
Applied rewrites78.3%
if 4.00000000000000009e64 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 2.00000000000000007e154Initial program 99.7%
Taylor expanded in t around 0
lower-*.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6425.2
Applied rewrites25.2%
Taylor expanded in U around 0
lower--.f64N/A
lower-fma.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites92.8%
if 2.00000000000000007e154 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) Initial program 25.5%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
pow1/2N/A
lower-pow.f64N/A
pow1/2N/A
lower-pow.f64N/A
Applied rewrites53.2%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (fma -2.0 (* l (/ l Om)) t)) (t_2 (pow (/ l Om) 2.0)))
(if (<=
(sqrt
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 (/ (* l l) Om))) (* (* n t_2) (- U U*)))))
2e+94)
(sqrt (* (* n 2.0) (* U (- t_1 (* (- U U*) (* t_2 n))))))
(* (pow 2.0 0.5) (pow (* (* t_1 n) U) 0.5)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma(-2.0, (l * (l / Om)), t);
double t_2 = pow((l / Om), 2.0);
double tmp;
if (sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * t_2) * (U - U_42_))))) <= 2e+94) {
tmp = sqrt(((n * 2.0) * (U * (t_1 - ((U - U_42_) * (t_2 * n))))));
} else {
tmp = pow(2.0, 0.5) * pow(((t_1 * n) * U), 0.5);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = fma(-2.0, Float64(l * Float64(l / Om)), t) t_2 = Float64(l / Om) ^ 2.0 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 * t_2) * Float64(U - U_42_))))) <= 2e+94) tmp = sqrt(Float64(Float64(n * 2.0) * Float64(U * Float64(t_1 - Float64(Float64(U - U_42_) * Float64(t_2 * n)))))); else tmp = Float64((2.0 ^ 0.5) * (Float64(Float64(t_1 * n) * U) ^ 0.5)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, 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 * t$95$2), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2e+94], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(U * N[(t$95$1 - N[(N[(U - U$42$), $MachinePrecision] * N[(t$95$2 * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Power[2.0, 0.5], $MachinePrecision] * N[Power[N[(N[(t$95$1 * n), $MachinePrecision] * U), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right)\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
\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 t\_2\right) \cdot \left(U - U*\right)\right)} \leq 2 \cdot 10^{+94}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot \left(t\_1 - \left(U - U*\right) \cdot \left(t\_2 \cdot n\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{2}^{0.5} \cdot {\left(\left(t\_1 \cdot n\right) \cdot U\right)}^{0.5}\\
\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*))))) < 2e94Initial program 76.6%
Applied rewrites78.0%
if 2e94 < (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 33.2%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
pow1/2N/A
lower-pow.f64N/A
pow1/2N/A
lower-pow.f64N/A
Applied rewrites55.7%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (fma -2.0 (* l (/ l Om)) t) n)))
(if (<= U 1e-302)
(* (pow 2.0 0.5) (pow (* t_1 U) 0.5))
(* (exp (* (log 2.0) 0.5)) (* (pow t_1 0.5) (pow U 0.5))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma(-2.0, (l * (l / Om)), t) * n;
double tmp;
if (U <= 1e-302) {
tmp = pow(2.0, 0.5) * pow((t_1 * U), 0.5);
} else {
tmp = exp((log(2.0) * 0.5)) * (pow(t_1, 0.5) * pow(U, 0.5));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(fma(-2.0, Float64(l * Float64(l / Om)), t) * n) tmp = 0.0 if (U <= 1e-302) tmp = Float64((2.0 ^ 0.5) * (Float64(t_1 * U) ^ 0.5)); else tmp = Float64(exp(Float64(log(2.0) * 0.5)) * Float64((t_1 ^ 0.5) * (U ^ 0.5))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision]}, If[LessEqual[U, 1e-302], N[(N[Power[2.0, 0.5], $MachinePrecision] * N[Power[N[(t$95$1 * U), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[Log[2.0], $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] * N[(N[Power[t$95$1, 0.5], $MachinePrecision] * N[Power[U, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right) \cdot n\\
\mathbf{if}\;U \leq 10^{-302}:\\
\;\;\;\;{2}^{0.5} \cdot {\left(t\_1 \cdot U\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;e^{\log 2 \cdot 0.5} \cdot \left({t\_1}^{0.5} \cdot {U}^{0.5}\right)\\
\end{array}
\end{array}
if U < 9.9999999999999996e-303Initial program 53.6%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
pow1/2N/A
lower-pow.f64N/A
pow1/2N/A
lower-pow.f64N/A
Applied rewrites57.3%
if 9.9999999999999996e-303 < U Initial program 57.1%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
pow1/2N/A
lower-pow.f64N/A
pow1/2N/A
lower-pow.f64N/A
Applied rewrites62.1%
lift-pow.f64N/A
pow-to-expN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f6462.0
Applied rewrites62.0%
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-/.f64N/A
unpow-prod-downN/A
pow1/2N/A
lower-*.f64N/A
lower-pow.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
pow1/2N/A
Applied rewrites68.4%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (fma -2.0 (* l (/ l Om)) t) n)) (t_2 (exp (* (log 2.0) 0.5))))
(if (<= U 4.3e-307)
(* t_2 (pow (* t_1 U) 0.5))
(* t_2 (* (pow t_1 0.5) (pow U 0.5))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma(-2.0, (l * (l / Om)), t) * n;
double t_2 = exp((log(2.0) * 0.5));
double tmp;
if (U <= 4.3e-307) {
tmp = t_2 * pow((t_1 * U), 0.5);
} else {
tmp = t_2 * (pow(t_1, 0.5) * pow(U, 0.5));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(fma(-2.0, Float64(l * Float64(l / Om)), t) * n) t_2 = exp(Float64(log(2.0) * 0.5)) tmp = 0.0 if (U <= 4.3e-307) tmp = Float64(t_2 * (Float64(t_1 * U) ^ 0.5)); else tmp = Float64(t_2 * Float64((t_1 ^ 0.5) * (U ^ 0.5))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[Log[2.0], $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[U, 4.3e-307], N[(t$95$2 * N[Power[N[(t$95$1 * U), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(N[Power[t$95$1, 0.5], $MachinePrecision] * N[Power[U, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right) \cdot n\\
t_2 := e^{\log 2 \cdot 0.5}\\
\mathbf{if}\;U \leq 4.3 \cdot 10^{-307}:\\
\;\;\;\;t\_2 \cdot {\left(t\_1 \cdot U\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left({t\_1}^{0.5} \cdot {U}^{0.5}\right)\\
\end{array}
\end{array}
if U < 4.3000000000000001e-307Initial program 54.4%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
pow1/2N/A
lower-pow.f64N/A
pow1/2N/A
lower-pow.f64N/A
Applied rewrites57.4%
lift-pow.f64N/A
pow-to-expN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f6457.3
Applied rewrites57.3%
if 4.3000000000000001e-307 < U Initial program 56.3%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
pow1/2N/A
lower-pow.f64N/A
pow1/2N/A
lower-pow.f64N/A
Applied rewrites61.9%
lift-pow.f64N/A
pow-to-expN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f6461.8
Applied rewrites61.8%
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-/.f64N/A
unpow-prod-downN/A
pow1/2N/A
lower-*.f64N/A
lower-pow.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
pow1/2N/A
Applied rewrites68.1%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= U 1.35e-303)
(* (* (/ (* l n) Om) (pow (* U U*) 0.5)) (pow 2.0 0.5))
(*
(exp (* (log 2.0) 0.5))
(* (pow (* (fma -2.0 (* l (/ l Om)) t) n) 0.5) (pow U 0.5)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (U <= 1.35e-303) {
tmp = (((l * n) / Om) * pow((U * U_42_), 0.5)) * pow(2.0, 0.5);
} else {
tmp = exp((log(2.0) * 0.5)) * (pow((fma(-2.0, (l * (l / Om)), t) * n), 0.5) * pow(U, 0.5));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (U <= 1.35e-303) tmp = Float64(Float64(Float64(Float64(l * n) / Om) * (Float64(U * U_42_) ^ 0.5)) * (2.0 ^ 0.5)); else tmp = Float64(exp(Float64(log(2.0) * 0.5)) * Float64((Float64(fma(-2.0, Float64(l * Float64(l / Om)), t) * n) ^ 0.5) * (U ^ 0.5))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, 1.35e-303], N[(N[(N[(N[(l * n), $MachinePrecision] / Om), $MachinePrecision] * N[Power[N[(U * U$42$), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[Power[2.0, 0.5], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[Log[2.0], $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[(N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[U, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;U \leq 1.35 \cdot 10^{-303}:\\
\;\;\;\;\left(\frac{\ell \cdot n}{Om} \cdot {\left(U \cdot U*\right)}^{0.5}\right) \cdot {2}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;e^{\log 2 \cdot 0.5} \cdot \left({\left(\mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\right) \cdot n\right)}^{0.5} \cdot {U}^{0.5}\right)\\
\end{array}
\end{array}
if U < 1.34999999999999993e-303Initial program 54.0%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
pow1/2N/A
lower-pow.f64N/A
pow1/2N/A
lower-pow.f64N/A
Applied rewrites56.9%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites0.0%
Taylor expanded in n around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow1/2N/A
lower-pow.f64N/A
lower-*.f6414.3
Applied rewrites14.3%
if 1.34999999999999993e-303 < U Initial program 56.7%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
pow1/2N/A
lower-pow.f64N/A
pow1/2N/A
lower-pow.f64N/A
Applied rewrites62.4%
lift-pow.f64N/A
pow-to-expN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f6462.3
Applied rewrites62.3%
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-/.f64N/A
unpow-prod-downN/A
pow1/2N/A
lower-*.f64N/A
lower-pow.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
pow1/2N/A
Applied rewrites68.6%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* n (pow 2.0 0.5))))
(if (<= n -4.7e+50)
(/
(*
U
(fma
-1.0
(* (* Om (* l (pow 2.0 0.5))) (pow (pow (* U U*) -1.0) 0.5))
(* (pow (/ U* U) 0.5) (* l t_1))))
Om)
(/
(*
l
(fma
-1.0
(* (* Om (pow 2.0 0.5)) (pow (/ U U*) 0.5))
(* (pow (* U U*) 0.5) t_1)))
Om))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = n * pow(2.0, 0.5);
double tmp;
if (n <= -4.7e+50) {
tmp = (U * fma(-1.0, ((Om * (l * pow(2.0, 0.5))) * pow(pow((U * U_42_), -1.0), 0.5)), (pow((U_42_ / U), 0.5) * (l * t_1)))) / Om;
} else {
tmp = (l * fma(-1.0, ((Om * pow(2.0, 0.5)) * pow((U / U_42_), 0.5)), (pow((U * U_42_), 0.5) * t_1))) / Om;
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(n * (2.0 ^ 0.5)) tmp = 0.0 if (n <= -4.7e+50) tmp = Float64(Float64(U * fma(-1.0, Float64(Float64(Om * Float64(l * (2.0 ^ 0.5))) * ((Float64(U * U_42_) ^ -1.0) ^ 0.5)), Float64((Float64(U_42_ / U) ^ 0.5) * Float64(l * t_1)))) / Om); else tmp = Float64(Float64(l * fma(-1.0, Float64(Float64(Om * (2.0 ^ 0.5)) * (Float64(U / U_42_) ^ 0.5)), Float64((Float64(U * U_42_) ^ 0.5) * t_1))) / Om); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(n * N[Power[2.0, 0.5], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -4.7e+50], N[(N[(U * N[(-1.0 * N[(N[(Om * N[(l * N[Power[2.0, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[Power[N[(U * U$42$), $MachinePrecision], -1.0], $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[(U$42$ / U), $MachinePrecision], 0.5], $MachinePrecision] * N[(l * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision], N[(N[(l * N[(-1.0 * N[(N[(Om * N[Power[2.0, 0.5], $MachinePrecision]), $MachinePrecision] * N[Power[N[(U / U$42$), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[(U * U$42$), $MachinePrecision], 0.5], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := n \cdot {2}^{0.5}\\
\mathbf{if}\;n \leq -4.7 \cdot 10^{+50}:\\
\;\;\;\;\frac{U \cdot \mathsf{fma}\left(-1, \left(Om \cdot \left(\ell \cdot {2}^{0.5}\right)\right) \cdot {\left({\left(U \cdot U*\right)}^{-1}\right)}^{0.5}, {\left(\frac{U*}{U}\right)}^{0.5} \cdot \left(\ell \cdot t\_1\right)\right)}{Om}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \mathsf{fma}\left(-1, \left(Om \cdot {2}^{0.5}\right) \cdot {\left(\frac{U}{U*}\right)}^{0.5}, {\left(U \cdot U*\right)}^{0.5} \cdot t\_1\right)}{Om}\\
\end{array}
\end{array}
if n < -4.69999999999999974e50Initial program 63.6%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
pow1/2N/A
lower-pow.f64N/A
pow1/2N/A
lower-pow.f64N/A
Applied rewrites57.7%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites25.1%
Taylor expanded in Om around 0
lower-/.f64N/A
Applied rewrites24.6%
Taylor expanded in U around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites14.2%
if -4.69999999999999974e50 < n Initial program 53.6%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
pow1/2N/A
lower-pow.f64N/A
pow1/2N/A
lower-pow.f64N/A
Applied rewrites60.2%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites30.3%
Taylor expanded in Om around 0
lower-/.f64N/A
Applied rewrites10.3%
Taylor expanded in l around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow1/2N/A
lift-pow.f64N/A
pow1/2N/A
lift-pow.f64N/A
lift-/.f64N/A
lower-*.f64N/A
pow1/2N/A
lift-pow.f64N/A
lift-*.f64N/A
pow1/2N/A
lift-pow.f64N/A
lift-*.f6412.0
Applied rewrites12.0%
(FPCore (n U t l Om U*)
:precision binary64
(/
(*
U
(fma
-1.0
(* (* Om (* l (pow 2.0 0.5))) (pow (pow (* U U*) -1.0) 0.5))
(* (pow (/ U* U) 0.5) (* l (* n (pow 2.0 0.5))))))
Om))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return (U * fma(-1.0, ((Om * (l * pow(2.0, 0.5))) * pow(pow((U * U_42_), -1.0), 0.5)), (pow((U_42_ / U), 0.5) * (l * (n * pow(2.0, 0.5)))))) / Om;
}
function code(n, U, t, l, Om, U_42_) return Float64(Float64(U * fma(-1.0, Float64(Float64(Om * Float64(l * (2.0 ^ 0.5))) * ((Float64(U * U_42_) ^ -1.0) ^ 0.5)), Float64((Float64(U_42_ / U) ^ 0.5) * Float64(l * Float64(n * (2.0 ^ 0.5)))))) / Om) end
code[n_, U_, t_, l_, Om_, U$42$_] := N[(N[(U * N[(-1.0 * N[(N[(Om * N[(l * N[Power[2.0, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[Power[N[(U * U$42$), $MachinePrecision], -1.0], $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[(U$42$ / U), $MachinePrecision], 0.5], $MachinePrecision] * N[(l * N[(n * N[Power[2.0, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]
\begin{array}{l}
\\
\frac{U \cdot \mathsf{fma}\left(-1, \left(Om \cdot \left(\ell \cdot {2}^{0.5}\right)\right) \cdot {\left({\left(U \cdot U*\right)}^{-1}\right)}^{0.5}, {\left(\frac{U*}{U}\right)}^{0.5} \cdot \left(\ell \cdot \left(n \cdot {2}^{0.5}\right)\right)\right)}{Om}
\end{array}
Initial program 55.4%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
pow1/2N/A
lower-pow.f64N/A
pow1/2N/A
lower-pow.f64N/A
Applied rewrites59.7%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites29.4%
Taylor expanded in Om around 0
lower-/.f64N/A
Applied rewrites12.8%
Taylor expanded in U around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites9.3%
(FPCore (n U t l Om U*) :precision binary64 (* U* (fma -1.0 (* (pow (/ U (* (* U* U*) U*)) 0.5) (* l (pow 2.0 0.5))) (* (/ (* l (* n (pow 2.0 0.5))) Om) (pow (/ U U*) 0.5)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return U_42_ * fma(-1.0, (pow((U / ((U_42_ * U_42_) * U_42_)), 0.5) * (l * pow(2.0, 0.5))), (((l * (n * pow(2.0, 0.5))) / Om) * pow((U / U_42_), 0.5)));
}
function code(n, U, t, l, Om, U_42_) return Float64(U_42_ * fma(-1.0, Float64((Float64(U / Float64(Float64(U_42_ * U_42_) * U_42_)) ^ 0.5) * Float64(l * (2.0 ^ 0.5))), Float64(Float64(Float64(l * Float64(n * (2.0 ^ 0.5))) / Om) * (Float64(U / U_42_) ^ 0.5)))) end
code[n_, U_, t_, l_, Om_, U$42$_] := N[(U$42$ * N[(-1.0 * N[(N[Power[N[(U / N[(N[(U$42$ * U$42$), $MachinePrecision] * U$42$), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] * N[(l * N[Power[2.0, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(l * N[(n * N[Power[2.0, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] * N[Power[N[(U / U$42$), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U* \cdot \mathsf{fma}\left(-1, {\left(\frac{U}{\left(U* \cdot U*\right) \cdot U*}\right)}^{0.5} \cdot \left(\ell \cdot {2}^{0.5}\right), \frac{\ell \cdot \left(n \cdot {2}^{0.5}\right)}{Om} \cdot {\left(\frac{U}{U*}\right)}^{0.5}\right)
\end{array}
Initial program 55.4%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
pow1/2N/A
lower-pow.f64N/A
pow1/2N/A
lower-pow.f64N/A
Applied rewrites59.7%
Taylor expanded in U around 0
lower-*.f64N/A
Applied rewrites29.4%
Taylor expanded in Om around 0
lower-/.f64N/A
Applied rewrites12.8%
Taylor expanded in U* around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites8.8%
herbie shell --seed 2025064
(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*))))))