
(FPCore (x eps) :precision binary64 (- (pow (+ x eps) 5.0) (pow x 5.0)))
double code(double x, double eps) {
return pow((x + eps), 5.0) - pow(x, 5.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(x, eps)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = ((x + eps) ** 5.0d0) - (x ** 5.0d0)
end function
public static double code(double x, double eps) {
return Math.pow((x + eps), 5.0) - Math.pow(x, 5.0);
}
def code(x, eps): return math.pow((x + eps), 5.0) - math.pow(x, 5.0)
function code(x, eps) return Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) end
function tmp = code(x, eps) tmp = ((x + eps) ^ 5.0) - (x ^ 5.0); end
code[x_, eps_] := N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(x + \varepsilon\right)}^{5} - {x}^{5}
\end{array}
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x eps) :precision binary64 (- (pow (+ x eps) 5.0) (pow x 5.0)))
double code(double x, double eps) {
return pow((x + eps), 5.0) - pow(x, 5.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(x, eps)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = ((x + eps) ** 5.0d0) - (x ** 5.0d0)
end function
public static double code(double x, double eps) {
return Math.pow((x + eps), 5.0) - Math.pow(x, 5.0);
}
def code(x, eps): return math.pow((x + eps), 5.0) - math.pow(x, 5.0)
function code(x, eps) return Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)) end
function tmp = code(x, eps) tmp = ((x + eps) ^ 5.0) - (x ^ 5.0); end
code[x_, eps_] := N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(x + \varepsilon\right)}^{5} - {x}^{5}
\end{array}
(FPCore (x eps)
:precision binary64
(let* ((t_0
(*
(*
(+ (- (/ (* -10.0 (+ eps (/ (* eps eps) x))) x)) 5.0)
(* (* (* x x) x) x))
eps)))
(if (<= x -1.65e-44)
t_0
(if (<= x 9.5e-50) (- (pow (+ x eps) 5.0) (pow x 5.0)) t_0))))
double code(double x, double eps) {
double t_0 = ((-((-10.0 * (eps + ((eps * eps) / x))) / x) + 5.0) * (((x * x) * x) * x)) * eps;
double tmp;
if (x <= -1.65e-44) {
tmp = t_0;
} else if (x <= 9.5e-50) {
tmp = pow((x + eps), 5.0) - pow(x, 5.0);
} else {
tmp = t_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(x, eps)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = ((-(((-10.0d0) * (eps + ((eps * eps) / x))) / x) + 5.0d0) * (((x * x) * x) * x)) * eps
if (x <= (-1.65d-44)) then
tmp = t_0
else if (x <= 9.5d-50) then
tmp = ((x + eps) ** 5.0d0) - (x ** 5.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = ((-((-10.0 * (eps + ((eps * eps) / x))) / x) + 5.0) * (((x * x) * x) * x)) * eps;
double tmp;
if (x <= -1.65e-44) {
tmp = t_0;
} else if (x <= 9.5e-50) {
tmp = Math.pow((x + eps), 5.0) - Math.pow(x, 5.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps): t_0 = ((-((-10.0 * (eps + ((eps * eps) / x))) / x) + 5.0) * (((x * x) * x) * x)) * eps tmp = 0 if x <= -1.65e-44: tmp = t_0 elif x <= 9.5e-50: tmp = math.pow((x + eps), 5.0) - math.pow(x, 5.0) else: tmp = t_0 return tmp
function code(x, eps) t_0 = Float64(Float64(Float64(Float64(-Float64(Float64(-10.0 * Float64(eps + Float64(Float64(eps * eps) / x))) / x)) + 5.0) * Float64(Float64(Float64(x * x) * x) * x)) * eps) tmp = 0.0 if (x <= -1.65e-44) tmp = t_0; elseif (x <= 9.5e-50) tmp = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, eps) t_0 = ((-((-10.0 * (eps + ((eps * eps) / x))) / x) + 5.0) * (((x * x) * x) * x)) * eps; tmp = 0.0; if (x <= -1.65e-44) tmp = t_0; elseif (x <= 9.5e-50) tmp = ((x + eps) ^ 5.0) - (x ^ 5.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[(N[((-N[(N[(-10.0 * N[(eps + N[(N[(eps * eps), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]) + 5.0), $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]}, If[LessEqual[x, -1.65e-44], t$95$0, If[LessEqual[x, 9.5e-50], N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\left(-\frac{-10 \cdot \left(\varepsilon + \frac{\varepsilon \cdot \varepsilon}{x}\right)}{x}\right) + 5\right) \cdot \left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right)\right) \cdot \varepsilon\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-44}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-50}:\\
\;\;\;\;{\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.65000000000000003e-44 or 9.4999999999999993e-50 < x Initial program 39.0%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites94.0%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites94.1%
if -1.65000000000000003e-44 < x < 9.4999999999999993e-50Initial program 99.4%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* x x) x)))
(if (<= x -3.2e-61)
(*
(fma
(fma (* eps x) 5.0 (* (* eps eps) 10.0))
x
(* (* (* eps eps) eps) 10.0))
(* x x))
(if (<= x 9.5e-78)
(- (pow (+ x eps) 5.0) (* (* x x) t_0))
(*
(* (+ (- (/ (* -10.0 (+ eps (/ (* eps eps) x))) x)) 5.0) (* t_0 x))
eps)))))
double code(double x, double eps) {
double t_0 = (x * x) * x;
double tmp;
if (x <= -3.2e-61) {
tmp = fma(fma((eps * x), 5.0, ((eps * eps) * 10.0)), x, (((eps * eps) * eps) * 10.0)) * (x * x);
} else if (x <= 9.5e-78) {
tmp = pow((x + eps), 5.0) - ((x * x) * t_0);
} else {
tmp = ((-((-10.0 * (eps + ((eps * eps) / x))) / x) + 5.0) * (t_0 * x)) * eps;
}
return tmp;
}
function code(x, eps) t_0 = Float64(Float64(x * x) * x) tmp = 0.0 if (x <= -3.2e-61) tmp = Float64(fma(fma(Float64(eps * x), 5.0, Float64(Float64(eps * eps) * 10.0)), x, Float64(Float64(Float64(eps * eps) * eps) * 10.0)) * Float64(x * x)); elseif (x <= 9.5e-78) tmp = Float64((Float64(x + eps) ^ 5.0) - Float64(Float64(x * x) * t_0)); else tmp = Float64(Float64(Float64(Float64(-Float64(Float64(-10.0 * Float64(eps + Float64(Float64(eps * eps) / x))) / x)) + 5.0) * Float64(t_0 * x)) * eps); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -3.2e-61], N[(N[(N[(N[(eps * x), $MachinePrecision] * 5.0 + N[(N[(eps * eps), $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[(eps * eps), $MachinePrecision] * eps), $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-78], N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[(N[(x * x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[((-N[(N[(-10.0 * N[(eps + N[(N[(eps * eps), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]) + 5.0), $MachinePrecision] * N[(t$95$0 * x), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x \cdot x\right) \cdot x\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{-61}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\varepsilon \cdot x, 5, \left(\varepsilon \cdot \varepsilon\right) \cdot 10\right), x, \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot 10\right) \cdot \left(x \cdot x\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-78}:\\
\;\;\;\;{\left(x + \varepsilon\right)}^{5} - \left(x \cdot x\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(-\frac{-10 \cdot \left(\varepsilon + \frac{\varepsilon \cdot \varepsilon}{x}\right)}{x}\right) + 5\right) \cdot \left(t\_0 \cdot x\right)\right) \cdot \varepsilon\\
\end{array}
\end{array}
if x < -3.2000000000000001e-61Initial program 48.9%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.8%
if -3.2000000000000001e-61 < x < 9.4999999999999997e-78Initial program 100.0%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow3N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64100.0
Applied rewrites100.0%
if 9.4999999999999997e-78 < x Initial program 57.9%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites90.9%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites91.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* x x) x)))
(if (<= x -3.2e-61)
(*
(fma
(fma (* eps x) 5.0 (* (* eps eps) 10.0))
x
(* (* (* eps eps) eps) 10.0))
(* x x))
(if (<= x 9.5e-78)
(- (pow (+ x eps) 5.0) (* (* x x) t_0))
(* (* (fma (/ eps x) 10.0 5.0) (* t_0 x)) eps)))))
double code(double x, double eps) {
double t_0 = (x * x) * x;
double tmp;
if (x <= -3.2e-61) {
tmp = fma(fma((eps * x), 5.0, ((eps * eps) * 10.0)), x, (((eps * eps) * eps) * 10.0)) * (x * x);
} else if (x <= 9.5e-78) {
tmp = pow((x + eps), 5.0) - ((x * x) * t_0);
} else {
tmp = (fma((eps / x), 10.0, 5.0) * (t_0 * x)) * eps;
}
return tmp;
}
function code(x, eps) t_0 = Float64(Float64(x * x) * x) tmp = 0.0 if (x <= -3.2e-61) tmp = Float64(fma(fma(Float64(eps * x), 5.0, Float64(Float64(eps * eps) * 10.0)), x, Float64(Float64(Float64(eps * eps) * eps) * 10.0)) * Float64(x * x)); elseif (x <= 9.5e-78) tmp = Float64((Float64(x + eps) ^ 5.0) - Float64(Float64(x * x) * t_0)); else tmp = Float64(Float64(fma(Float64(eps / x), 10.0, 5.0) * Float64(t_0 * x)) * eps); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -3.2e-61], N[(N[(N[(N[(eps * x), $MachinePrecision] * 5.0 + N[(N[(eps * eps), $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[(eps * eps), $MachinePrecision] * eps), $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-78], N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[(N[(x * x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(eps / x), $MachinePrecision] * 10.0 + 5.0), $MachinePrecision] * N[(t$95$0 * x), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x \cdot x\right) \cdot x\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{-61}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\varepsilon \cdot x, 5, \left(\varepsilon \cdot \varepsilon\right) \cdot 10\right), x, \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot 10\right) \cdot \left(x \cdot x\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-78}:\\
\;\;\;\;{\left(x + \varepsilon\right)}^{5} - \left(x \cdot x\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{\varepsilon}{x}, 10, 5\right) \cdot \left(t\_0 \cdot x\right)\right) \cdot \varepsilon\\
\end{array}
\end{array}
if x < -3.2000000000000001e-61Initial program 48.9%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.8%
if -3.2000000000000001e-61 < x < 9.4999999999999997e-78Initial program 100.0%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow3N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64100.0
Applied rewrites100.0%
if 9.4999999999999997e-78 < x Initial program 57.9%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites90.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6490.4
Applied rewrites90.4%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* x x) x)))
(if (<= x -3.2e-61)
(* (* (fma (fma 10.0 eps (* 5.0 x)) x (* (* eps eps) 10.0)) (* x x)) eps)
(if (<= x 9.5e-78)
(- (pow (+ x eps) 5.0) (* (* x x) t_0))
(* (* (fma (/ eps x) 10.0 5.0) (* t_0 x)) eps)))))
double code(double x, double eps) {
double t_0 = (x * x) * x;
double tmp;
if (x <= -3.2e-61) {
tmp = (fma(fma(10.0, eps, (5.0 * x)), x, ((eps * eps) * 10.0)) * (x * x)) * eps;
} else if (x <= 9.5e-78) {
tmp = pow((x + eps), 5.0) - ((x * x) * t_0);
} else {
tmp = (fma((eps / x), 10.0, 5.0) * (t_0 * x)) * eps;
}
return tmp;
}
function code(x, eps) t_0 = Float64(Float64(x * x) * x) tmp = 0.0 if (x <= -3.2e-61) tmp = Float64(Float64(fma(fma(10.0, eps, Float64(5.0 * x)), x, Float64(Float64(eps * eps) * 10.0)) * Float64(x * x)) * eps); elseif (x <= 9.5e-78) tmp = Float64((Float64(x + eps) ^ 5.0) - Float64(Float64(x * x) * t_0)); else tmp = Float64(Float64(fma(Float64(eps / x), 10.0, 5.0) * Float64(t_0 * x)) * eps); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -3.2e-61], N[(N[(N[(N[(10.0 * eps + N[(5.0 * x), $MachinePrecision]), $MachinePrecision] * x + N[(N[(eps * eps), $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], If[LessEqual[x, 9.5e-78], N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[(N[(x * x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(eps / x), $MachinePrecision] * 10.0 + 5.0), $MachinePrecision] * N[(t$95$0 * x), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x \cdot x\right) \cdot x\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{-61}:\\
\;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(10, \varepsilon, 5 \cdot x\right), x, \left(\varepsilon \cdot \varepsilon\right) \cdot 10\right) \cdot \left(x \cdot x\right)\right) \cdot \varepsilon\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-78}:\\
\;\;\;\;{\left(x + \varepsilon\right)}^{5} - \left(x \cdot x\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{\varepsilon}{x}, 10, 5\right) \cdot \left(t\_0 \cdot x\right)\right) \cdot \varepsilon\\
\end{array}
\end{array}
if x < -3.2000000000000001e-61Initial program 48.9%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6492.9
Applied rewrites92.9%
if -3.2000000000000001e-61 < x < 9.4999999999999997e-78Initial program 100.0%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow3N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64100.0
Applied rewrites100.0%
if 9.4999999999999997e-78 < x Initial program 57.9%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites90.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6490.4
Applied rewrites90.4%
(FPCore (x eps)
:precision binary64
(if (<= x -1.65e-44)
(* (* (fma (fma 10.0 eps (* 5.0 x)) x (* (* eps eps) 10.0)) (* x x)) eps)
(if (<= x 9.5e-50)
(* (/ (fma 5.0 x eps) eps) (* (* (* eps eps) (* eps eps)) eps))
(* (* (fma (/ eps x) 10.0 5.0) (* (* (* x x) x) x)) eps))))
double code(double x, double eps) {
double tmp;
if (x <= -1.65e-44) {
tmp = (fma(fma(10.0, eps, (5.0 * x)), x, ((eps * eps) * 10.0)) * (x * x)) * eps;
} else if (x <= 9.5e-50) {
tmp = (fma(5.0, x, eps) / eps) * (((eps * eps) * (eps * eps)) * eps);
} else {
tmp = (fma((eps / x), 10.0, 5.0) * (((x * x) * x) * x)) * eps;
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -1.65e-44) tmp = Float64(Float64(fma(fma(10.0, eps, Float64(5.0 * x)), x, Float64(Float64(eps * eps) * 10.0)) * Float64(x * x)) * eps); elseif (x <= 9.5e-50) tmp = Float64(Float64(fma(5.0, x, eps) / eps) * Float64(Float64(Float64(eps * eps) * Float64(eps * eps)) * eps)); else tmp = Float64(Float64(fma(Float64(eps / x), 10.0, 5.0) * Float64(Float64(Float64(x * x) * x) * x)) * eps); end return tmp end
code[x_, eps_] := If[LessEqual[x, -1.65e-44], N[(N[(N[(N[(10.0 * eps + N[(5.0 * x), $MachinePrecision]), $MachinePrecision] * x + N[(N[(eps * eps), $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], If[LessEqual[x, 9.5e-50], N[(N[(N[(5.0 * x + eps), $MachinePrecision] / eps), $MachinePrecision] * N[(N[(N[(eps * eps), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(eps / x), $MachinePrecision] * 10.0 + 5.0), $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{-44}:\\
\;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(10, \varepsilon, 5 \cdot x\right), x, \left(\varepsilon \cdot \varepsilon\right) \cdot 10\right) \cdot \left(x \cdot x\right)\right) \cdot \varepsilon\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-50}:\\
\;\;\;\;\frac{\mathsf{fma}\left(5, x, \varepsilon\right)}{\varepsilon} \cdot \left(\left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \varepsilon\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{\varepsilon}{x}, 10, 5\right) \cdot \left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right)\right) \cdot \varepsilon\\
\end{array}
\end{array}
if x < -1.65000000000000003e-44Initial program 37.3%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites94.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6495.0
Applied rewrites95.0%
if -1.65000000000000003e-44 < x < 9.4999999999999993e-50Initial program 99.4%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
pow-plus-revN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.1
Applied rewrites99.1%
Taylor expanded in eps around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f6499.1
Applied rewrites99.1%
if 9.4999999999999993e-50 < x Initial program 40.4%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6492.7
Applied rewrites92.7%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* (fma (/ eps x) 10.0 5.0) (* (* (* x x) x) x)) eps)))
(if (<= x -1.65e-44)
t_0
(if (<= x 9.5e-50)
(* (/ (fma 5.0 x eps) eps) (* (* (* eps eps) (* eps eps)) eps))
t_0))))
double code(double x, double eps) {
double t_0 = (fma((eps / x), 10.0, 5.0) * (((x * x) * x) * x)) * eps;
double tmp;
if (x <= -1.65e-44) {
tmp = t_0;
} else if (x <= 9.5e-50) {
tmp = (fma(5.0, x, eps) / eps) * (((eps * eps) * (eps * eps)) * eps);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, eps) t_0 = Float64(Float64(fma(Float64(eps / x), 10.0, 5.0) * Float64(Float64(Float64(x * x) * x) * x)) * eps) tmp = 0.0 if (x <= -1.65e-44) tmp = t_0; elseif (x <= 9.5e-50) tmp = Float64(Float64(fma(5.0, x, eps) / eps) * Float64(Float64(Float64(eps * eps) * Float64(eps * eps)) * eps)); else tmp = t_0; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[(N[(N[(eps / x), $MachinePrecision] * 10.0 + 5.0), $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]}, If[LessEqual[x, -1.65e-44], t$95$0, If[LessEqual[x, 9.5e-50], N[(N[(N[(5.0 * x + eps), $MachinePrecision] / eps), $MachinePrecision] * N[(N[(N[(eps * eps), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\mathsf{fma}\left(\frac{\varepsilon}{x}, 10, 5\right) \cdot \left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right)\right) \cdot \varepsilon\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-44}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-50}:\\
\;\;\;\;\frac{\mathsf{fma}\left(5, x, \varepsilon\right)}{\varepsilon} \cdot \left(\left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \varepsilon\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.65000000000000003e-44 or 9.4999999999999993e-50 < x Initial program 39.0%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites94.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6493.4
Applied rewrites93.4%
if -1.65000000000000003e-44 < x < 9.4999999999999993e-50Initial program 99.4%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
pow-plus-revN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.1
Applied rewrites99.1%
Taylor expanded in eps around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f6499.1
Applied rewrites99.1%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* (fma (/ eps x) 10.0 5.0) (* (* (* x x) x) x)) eps)))
(if (<= x -1.65e-44)
t_0
(if (<= x 9.5e-50) (* (* (fma 5.0 x eps) (* (* eps eps) eps)) eps) t_0))))
double code(double x, double eps) {
double t_0 = (fma((eps / x), 10.0, 5.0) * (((x * x) * x) * x)) * eps;
double tmp;
if (x <= -1.65e-44) {
tmp = t_0;
} else if (x <= 9.5e-50) {
tmp = (fma(5.0, x, eps) * ((eps * eps) * eps)) * eps;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, eps) t_0 = Float64(Float64(fma(Float64(eps / x), 10.0, 5.0) * Float64(Float64(Float64(x * x) * x) * x)) * eps) tmp = 0.0 if (x <= -1.65e-44) tmp = t_0; elseif (x <= 9.5e-50) tmp = Float64(Float64(fma(5.0, x, eps) * Float64(Float64(eps * eps) * eps)) * eps); else tmp = t_0; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[(N[(N[(eps / x), $MachinePrecision] * 10.0 + 5.0), $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]}, If[LessEqual[x, -1.65e-44], t$95$0, If[LessEqual[x, 9.5e-50], N[(N[(N[(5.0 * x + eps), $MachinePrecision] * N[(N[(eps * eps), $MachinePrecision] * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\mathsf{fma}\left(\frac{\varepsilon}{x}, 10, 5\right) \cdot \left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right)\right) \cdot \varepsilon\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-44}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-50}:\\
\;\;\;\;\left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \varepsilon\right)\right) \cdot \varepsilon\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.65000000000000003e-44 or 9.4999999999999993e-50 < x Initial program 39.0%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites94.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6493.4
Applied rewrites93.4%
if -1.65000000000000003e-44 < x < 9.4999999999999993e-50Initial program 99.4%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
pow-plus-revN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.1
Applied rewrites99.1%
Taylor expanded in eps around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f6499.1
Applied rewrites99.1%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6499.1
Applied rewrites99.1%
Taylor expanded in eps around 0
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6499.1
Applied rewrites99.1%
(FPCore (x eps)
:precision binary64
(if (<= x -1.65e-44)
(* (* (fma x 5.0 (* 10.0 eps)) eps) (* (* x x) x))
(if (<= x 9.5e-50)
(* (* (fma 5.0 x eps) (* (* eps eps) eps)) eps)
(* (* (fma (* 5.0 eps) x (* 10.0 (* eps eps))) (* x x)) x))))
double code(double x, double eps) {
double tmp;
if (x <= -1.65e-44) {
tmp = (fma(x, 5.0, (10.0 * eps)) * eps) * ((x * x) * x);
} else if (x <= 9.5e-50) {
tmp = (fma(5.0, x, eps) * ((eps * eps) * eps)) * eps;
} else {
tmp = (fma((5.0 * eps), x, (10.0 * (eps * eps))) * (x * x)) * x;
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -1.65e-44) tmp = Float64(Float64(fma(x, 5.0, Float64(10.0 * eps)) * eps) * Float64(Float64(x * x) * x)); elseif (x <= 9.5e-50) tmp = Float64(Float64(fma(5.0, x, eps) * Float64(Float64(eps * eps) * eps)) * eps); else tmp = Float64(Float64(fma(Float64(5.0 * eps), x, Float64(10.0 * Float64(eps * eps))) * Float64(x * x)) * x); end return tmp end
code[x_, eps_] := If[LessEqual[x, -1.65e-44], N[(N[(N[(x * 5.0 + N[(10.0 * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-50], N[(N[(N[(5.0 * x + eps), $MachinePrecision] * N[(N[(eps * eps), $MachinePrecision] * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], N[(N[(N[(N[(5.0 * eps), $MachinePrecision] * x + N[(10.0 * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{-44}:\\
\;\;\;\;\left(\mathsf{fma}\left(x, 5, 10 \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-50}:\\
\;\;\;\;\left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \varepsilon\right)\right) \cdot \varepsilon\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(5 \cdot \varepsilon, x, 10 \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \left(x \cdot x\right)\right) \cdot x\\
\end{array}
\end{array}
if x < -1.65000000000000003e-44Initial program 37.3%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites94.1%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites94.2%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6494.2
Applied rewrites94.2%
lift-*.f64N/A
lift-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6494.2
Applied rewrites94.2%
if -1.65000000000000003e-44 < x < 9.4999999999999993e-50Initial program 99.4%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
pow-plus-revN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.1
Applied rewrites99.1%
Taylor expanded in eps around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f6499.1
Applied rewrites99.1%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6499.1
Applied rewrites99.1%
Taylor expanded in eps around 0
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6499.1
Applied rewrites99.1%
if 9.4999999999999993e-50 < x Initial program 40.4%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.6%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites92.6%
(FPCore (x eps)
:precision binary64
(if (<= x -1.65e-44)
(* (* (fma x 5.0 (* 10.0 eps)) eps) (* (* x x) x))
(if (<= x 9.5e-50)
(* (* (fma 5.0 x eps) (* (* eps eps) eps)) eps)
(* (* (* (fma 10.0 eps (* 5.0 x)) eps) (* x x)) x))))
double code(double x, double eps) {
double tmp;
if (x <= -1.65e-44) {
tmp = (fma(x, 5.0, (10.0 * eps)) * eps) * ((x * x) * x);
} else if (x <= 9.5e-50) {
tmp = (fma(5.0, x, eps) * ((eps * eps) * eps)) * eps;
} else {
tmp = ((fma(10.0, eps, (5.0 * x)) * eps) * (x * x)) * x;
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -1.65e-44) tmp = Float64(Float64(fma(x, 5.0, Float64(10.0 * eps)) * eps) * Float64(Float64(x * x) * x)); elseif (x <= 9.5e-50) tmp = Float64(Float64(fma(5.0, x, eps) * Float64(Float64(eps * eps) * eps)) * eps); else tmp = Float64(Float64(Float64(fma(10.0, eps, Float64(5.0 * x)) * eps) * Float64(x * x)) * x); end return tmp end
code[x_, eps_] := If[LessEqual[x, -1.65e-44], N[(N[(N[(x * 5.0 + N[(10.0 * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-50], N[(N[(N[(5.0 * x + eps), $MachinePrecision] * N[(N[(eps * eps), $MachinePrecision] * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], N[(N[(N[(N[(10.0 * eps + N[(5.0 * x), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{-44}:\\
\;\;\;\;\left(\mathsf{fma}\left(x, 5, 10 \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-50}:\\
\;\;\;\;\left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \varepsilon\right)\right) \cdot \varepsilon\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(10, \varepsilon, 5 \cdot x\right) \cdot \varepsilon\right) \cdot \left(x \cdot x\right)\right) \cdot x\\
\end{array}
\end{array}
if x < -1.65000000000000003e-44Initial program 37.3%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites94.1%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites94.2%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6494.2
Applied rewrites94.2%
lift-*.f64N/A
lift-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6494.2
Applied rewrites94.2%
if -1.65000000000000003e-44 < x < 9.4999999999999993e-50Initial program 99.4%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
pow-plus-revN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.1
Applied rewrites99.1%
Taylor expanded in eps around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f6499.1
Applied rewrites99.1%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6499.1
Applied rewrites99.1%
Taylor expanded in eps around 0
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6499.1
Applied rewrites99.1%
if 9.4999999999999993e-50 < x Initial program 40.4%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.6%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6492.6
Applied rewrites92.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6492.6
Applied rewrites92.6%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (fma 10.0 eps (* 5.0 x)) eps)))
(if (<= x -1.65e-44)
(* t_0 (* (* x x) x))
(if (<= x 9.5e-50)
(* (* (fma 5.0 x eps) (* (* eps eps) eps)) eps)
(* (* t_0 (* x x)) x)))))
double code(double x, double eps) {
double t_0 = fma(10.0, eps, (5.0 * x)) * eps;
double tmp;
if (x <= -1.65e-44) {
tmp = t_0 * ((x * x) * x);
} else if (x <= 9.5e-50) {
tmp = (fma(5.0, x, eps) * ((eps * eps) * eps)) * eps;
} else {
tmp = (t_0 * (x * x)) * x;
}
return tmp;
}
function code(x, eps) t_0 = Float64(fma(10.0, eps, Float64(5.0 * x)) * eps) tmp = 0.0 if (x <= -1.65e-44) tmp = Float64(t_0 * Float64(Float64(x * x) * x)); elseif (x <= 9.5e-50) tmp = Float64(Float64(fma(5.0, x, eps) * Float64(Float64(eps * eps) * eps)) * eps); else tmp = Float64(Float64(t_0 * Float64(x * x)) * x); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[(10.0 * eps + N[(5.0 * x), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]}, If[LessEqual[x, -1.65e-44], N[(t$95$0 * N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-50], N[(N[(N[(5.0 * x + eps), $MachinePrecision] * N[(N[(eps * eps), $MachinePrecision] * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], N[(N[(t$95$0 * N[(x * x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(10, \varepsilon, 5 \cdot x\right) \cdot \varepsilon\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-44}:\\
\;\;\;\;t\_0 \cdot \left(\left(x \cdot x\right) \cdot x\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-50}:\\
\;\;\;\;\left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \varepsilon\right)\right) \cdot \varepsilon\\
\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot \left(x \cdot x\right)\right) \cdot x\\
\end{array}
\end{array}
if x < -1.65000000000000003e-44Initial program 37.3%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites94.1%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites94.2%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6494.2
Applied rewrites94.2%
if -1.65000000000000003e-44 < x < 9.4999999999999993e-50Initial program 99.4%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
pow-plus-revN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.1
Applied rewrites99.1%
Taylor expanded in eps around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f6499.1
Applied rewrites99.1%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6499.1
Applied rewrites99.1%
Taylor expanded in eps around 0
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6499.1
Applied rewrites99.1%
if 9.4999999999999993e-50 < x Initial program 40.4%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.6%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6492.6
Applied rewrites92.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6492.6
Applied rewrites92.6%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* (* (fma 10.0 eps (* 5.0 x)) eps) (* x x)) x)))
(if (<= x -1.65e-44)
t_0
(if (<= x 9.5e-50) (* (* (fma 5.0 x eps) (* (* eps eps) eps)) eps) t_0))))
double code(double x, double eps) {
double t_0 = ((fma(10.0, eps, (5.0 * x)) * eps) * (x * x)) * x;
double tmp;
if (x <= -1.65e-44) {
tmp = t_0;
} else if (x <= 9.5e-50) {
tmp = (fma(5.0, x, eps) * ((eps * eps) * eps)) * eps;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, eps) t_0 = Float64(Float64(Float64(fma(10.0, eps, Float64(5.0 * x)) * eps) * Float64(x * x)) * x) tmp = 0.0 if (x <= -1.65e-44) tmp = t_0; elseif (x <= 9.5e-50) tmp = Float64(Float64(fma(5.0, x, eps) * Float64(Float64(eps * eps) * eps)) * eps); else tmp = t_0; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[(N[(N[(10.0 * eps + N[(5.0 * x), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.65e-44], t$95$0, If[LessEqual[x, 9.5e-50], N[(N[(N[(5.0 * x + eps), $MachinePrecision] * N[(N[(eps * eps), $MachinePrecision] * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\mathsf{fma}\left(10, \varepsilon, 5 \cdot x\right) \cdot \varepsilon\right) \cdot \left(x \cdot x\right)\right) \cdot x\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-44}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-50}:\\
\;\;\;\;\left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \varepsilon\right)\right) \cdot \varepsilon\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.65000000000000003e-44 or 9.4999999999999993e-50 < x Initial program 39.0%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.4%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6493.4
Applied rewrites93.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6493.4
Applied rewrites93.4%
if -1.65000000000000003e-44 < x < 9.4999999999999993e-50Initial program 99.4%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
pow-plus-revN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.1
Applied rewrites99.1%
Taylor expanded in eps around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f6499.1
Applied rewrites99.1%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6499.1
Applied rewrites99.1%
Taylor expanded in eps around 0
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6499.1
Applied rewrites99.1%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* (* (* (* x x) x) x) 5.0) eps)))
(if (<= x -1.65e-44)
t_0
(if (<= x 9.5e-50) (* (* (fma 5.0 x eps) (* (* eps eps) eps)) eps) t_0))))
double code(double x, double eps) {
double t_0 = ((((x * x) * x) * x) * 5.0) * eps;
double tmp;
if (x <= -1.65e-44) {
tmp = t_0;
} else if (x <= 9.5e-50) {
tmp = (fma(5.0, x, eps) * ((eps * eps) * eps)) * eps;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, eps) t_0 = Float64(Float64(Float64(Float64(Float64(x * x) * x) * x) * 5.0) * eps) tmp = 0.0 if (x <= -1.65e-44) tmp = t_0; elseif (x <= 9.5e-50) tmp = Float64(Float64(fma(5.0, x, eps) * Float64(Float64(eps * eps) * eps)) * eps); else tmp = t_0; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[(N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * 5.0), $MachinePrecision] * eps), $MachinePrecision]}, If[LessEqual[x, -1.65e-44], t$95$0, If[LessEqual[x, 9.5e-50], N[(N[(N[(5.0 * x + eps), $MachinePrecision] * N[(N[(eps * eps), $MachinePrecision] * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot 5\right) \cdot \varepsilon\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-44}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-50}:\\
\;\;\;\;\left(\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \varepsilon\right)\right) \cdot \varepsilon\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.65000000000000003e-44 or 9.4999999999999993e-50 < x Initial program 39.0%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
distribute-lft1-inN/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6492.1
Applied rewrites92.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
pow-prod-upN/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6492.3
Applied rewrites92.3%
if -1.65000000000000003e-44 < x < 9.4999999999999993e-50Initial program 99.4%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
pow-plus-revN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.1
Applied rewrites99.1%
Taylor expanded in eps around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f6499.1
Applied rewrites99.1%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6499.1
Applied rewrites99.1%
Taylor expanded in eps around 0
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6499.1
Applied rewrites99.1%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* (* (* (* x x) x) x) 5.0) eps)))
(if (<= x -1.65e-44)
t_0
(if (<= x 9.5e-50) (* (fma 5.0 x eps) (* (* eps eps) (* eps eps))) t_0))))
double code(double x, double eps) {
double t_0 = ((((x * x) * x) * x) * 5.0) * eps;
double tmp;
if (x <= -1.65e-44) {
tmp = t_0;
} else if (x <= 9.5e-50) {
tmp = fma(5.0, x, eps) * ((eps * eps) * (eps * eps));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, eps) t_0 = Float64(Float64(Float64(Float64(Float64(x * x) * x) * x) * 5.0) * eps) tmp = 0.0 if (x <= -1.65e-44) tmp = t_0; elseif (x <= 9.5e-50) tmp = Float64(fma(5.0, x, eps) * Float64(Float64(eps * eps) * Float64(eps * eps))); else tmp = t_0; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[(N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * 5.0), $MachinePrecision] * eps), $MachinePrecision]}, If[LessEqual[x, -1.65e-44], t$95$0, If[LessEqual[x, 9.5e-50], N[(N[(5.0 * x + eps), $MachinePrecision] * N[(N[(eps * eps), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot 5\right) \cdot \varepsilon\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-44}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-50}:\\
\;\;\;\;\mathsf{fma}\left(5, x, \varepsilon\right) \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.65000000000000003e-44 or 9.4999999999999993e-50 < x Initial program 39.0%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
distribute-lft1-inN/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6492.1
Applied rewrites92.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
pow-prod-upN/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6492.3
Applied rewrites92.3%
if -1.65000000000000003e-44 < x < 9.4999999999999993e-50Initial program 99.4%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-lft1-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
pow-plus-revN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.1
Applied rewrites99.1%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
pow-powN/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6499.1
Applied rewrites99.1%
(FPCore (x eps) :precision binary64 (let* ((t_0 (* (* (* (* (* x x) x) x) 5.0) eps))) (if (<= x -1.65e-44) t_0 (if (<= x 9.5e-50) (pow eps 5.0) t_0))))
double code(double x, double eps) {
double t_0 = ((((x * x) * x) * x) * 5.0) * eps;
double tmp;
if (x <= -1.65e-44) {
tmp = t_0;
} else if (x <= 9.5e-50) {
tmp = pow(eps, 5.0);
} else {
tmp = t_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(x, eps)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = ((((x * x) * x) * x) * 5.0d0) * eps
if (x <= (-1.65d-44)) then
tmp = t_0
else if (x <= 9.5d-50) then
tmp = eps ** 5.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = ((((x * x) * x) * x) * 5.0) * eps;
double tmp;
if (x <= -1.65e-44) {
tmp = t_0;
} else if (x <= 9.5e-50) {
tmp = Math.pow(eps, 5.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps): t_0 = ((((x * x) * x) * x) * 5.0) * eps tmp = 0 if x <= -1.65e-44: tmp = t_0 elif x <= 9.5e-50: tmp = math.pow(eps, 5.0) else: tmp = t_0 return tmp
function code(x, eps) t_0 = Float64(Float64(Float64(Float64(Float64(x * x) * x) * x) * 5.0) * eps) tmp = 0.0 if (x <= -1.65e-44) tmp = t_0; elseif (x <= 9.5e-50) tmp = eps ^ 5.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, eps) t_0 = ((((x * x) * x) * x) * 5.0) * eps; tmp = 0.0; if (x <= -1.65e-44) tmp = t_0; elseif (x <= 9.5e-50) tmp = eps ^ 5.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[(N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * 5.0), $MachinePrecision] * eps), $MachinePrecision]}, If[LessEqual[x, -1.65e-44], t$95$0, If[LessEqual[x, 9.5e-50], N[Power[eps, 5.0], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot 5\right) \cdot \varepsilon\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-44}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-50}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.65000000000000003e-44 or 9.4999999999999993e-50 < x Initial program 39.0%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
distribute-lft1-inN/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6492.1
Applied rewrites92.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
pow-prod-upN/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6492.3
Applied rewrites92.3%
if -1.65000000000000003e-44 < x < 9.4999999999999993e-50Initial program 99.4%
Taylor expanded in x around 0
metadata-evalN/A
pow-plus-revN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.0
Applied rewrites99.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
pow-prod-upN/A
metadata-evalN/A
pow-plus-revN/A
metadata-evalN/A
lower-pow.f6499.2
Applied rewrites99.2%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* (* (* (* x x) x) x) 5.0) eps)))
(if (<= x -1.65e-44)
t_0
(if (<= x 9.5e-50) (* (* (* eps eps) (* eps eps)) eps) t_0))))
double code(double x, double eps) {
double t_0 = ((((x * x) * x) * x) * 5.0) * eps;
double tmp;
if (x <= -1.65e-44) {
tmp = t_0;
} else if (x <= 9.5e-50) {
tmp = ((eps * eps) * (eps * eps)) * eps;
} else {
tmp = t_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(x, eps)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = ((((x * x) * x) * x) * 5.0d0) * eps
if (x <= (-1.65d-44)) then
tmp = t_0
else if (x <= 9.5d-50) then
tmp = ((eps * eps) * (eps * eps)) * eps
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = ((((x * x) * x) * x) * 5.0) * eps;
double tmp;
if (x <= -1.65e-44) {
tmp = t_0;
} else if (x <= 9.5e-50) {
tmp = ((eps * eps) * (eps * eps)) * eps;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps): t_0 = ((((x * x) * x) * x) * 5.0) * eps tmp = 0 if x <= -1.65e-44: tmp = t_0 elif x <= 9.5e-50: tmp = ((eps * eps) * (eps * eps)) * eps else: tmp = t_0 return tmp
function code(x, eps) t_0 = Float64(Float64(Float64(Float64(Float64(x * x) * x) * x) * 5.0) * eps) tmp = 0.0 if (x <= -1.65e-44) tmp = t_0; elseif (x <= 9.5e-50) tmp = Float64(Float64(Float64(eps * eps) * Float64(eps * eps)) * eps); else tmp = t_0; end return tmp end
function tmp_2 = code(x, eps) t_0 = ((((x * x) * x) * x) * 5.0) * eps; tmp = 0.0; if (x <= -1.65e-44) tmp = t_0; elseif (x <= 9.5e-50) tmp = ((eps * eps) * (eps * eps)) * eps; else tmp = t_0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[(N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * 5.0), $MachinePrecision] * eps), $MachinePrecision]}, If[LessEqual[x, -1.65e-44], t$95$0, If[LessEqual[x, 9.5e-50], N[(N[(N[(eps * eps), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot 5\right) \cdot \varepsilon\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-44}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-50}:\\
\;\;\;\;\left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \varepsilon\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.65000000000000003e-44 or 9.4999999999999993e-50 < x Initial program 39.0%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
distribute-lft1-inN/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6492.1
Applied rewrites92.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
pow-prod-upN/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6492.3
Applied rewrites92.3%
if -1.65000000000000003e-44 < x < 9.4999999999999993e-50Initial program 99.4%
Taylor expanded in x around 0
metadata-evalN/A
pow-plus-revN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.0
Applied rewrites99.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* (* (* x x) x) x) (* 5.0 eps))))
(if (<= x -1.65e-44)
t_0
(if (<= x 9.5e-50) (* (* (* eps eps) (* eps eps)) eps) t_0))))
double code(double x, double eps) {
double t_0 = (((x * x) * x) * x) * (5.0 * eps);
double tmp;
if (x <= -1.65e-44) {
tmp = t_0;
} else if (x <= 9.5e-50) {
tmp = ((eps * eps) * (eps * eps)) * eps;
} else {
tmp = t_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(x, eps)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = (((x * x) * x) * x) * (5.0d0 * eps)
if (x <= (-1.65d-44)) then
tmp = t_0
else if (x <= 9.5d-50) then
tmp = ((eps * eps) * (eps * eps)) * eps
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = (((x * x) * x) * x) * (5.0 * eps);
double tmp;
if (x <= -1.65e-44) {
tmp = t_0;
} else if (x <= 9.5e-50) {
tmp = ((eps * eps) * (eps * eps)) * eps;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps): t_0 = (((x * x) * x) * x) * (5.0 * eps) tmp = 0 if x <= -1.65e-44: tmp = t_0 elif x <= 9.5e-50: tmp = ((eps * eps) * (eps * eps)) * eps else: tmp = t_0 return tmp
function code(x, eps) t_0 = Float64(Float64(Float64(Float64(x * x) * x) * x) * Float64(5.0 * eps)) tmp = 0.0 if (x <= -1.65e-44) tmp = t_0; elseif (x <= 9.5e-50) tmp = Float64(Float64(Float64(eps * eps) * Float64(eps * eps)) * eps); else tmp = t_0; end return tmp end
function tmp_2 = code(x, eps) t_0 = (((x * x) * x) * x) * (5.0 * eps); tmp = 0.0; if (x <= -1.65e-44) tmp = t_0; elseif (x <= 9.5e-50) tmp = ((eps * eps) * (eps * eps)) * eps; else tmp = t_0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * N[(5.0 * eps), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.65e-44], t$95$0, If[LessEqual[x, 9.5e-50], N[(N[(N[(eps * eps), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot \left(5 \cdot \varepsilon\right)\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-44}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-50}:\\
\;\;\;\;\left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \varepsilon\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.65000000000000003e-44 or 9.4999999999999993e-50 < x Initial program 39.0%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
distribute-lft1-inN/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6492.1
Applied rewrites92.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
pow-prod-upN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6492.3
Applied rewrites92.3%
if -1.65000000000000003e-44 < x < 9.4999999999999993e-50Initial program 99.4%
Taylor expanded in x around 0
metadata-evalN/A
pow-plus-revN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.0
Applied rewrites99.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* (* (* (* x x) x) eps) 5.0) x)))
(if (<= x -1.65e-44)
t_0
(if (<= x 9.5e-50) (* (* (* eps eps) (* eps eps)) eps) t_0))))
double code(double x, double eps) {
double t_0 = ((((x * x) * x) * eps) * 5.0) * x;
double tmp;
if (x <= -1.65e-44) {
tmp = t_0;
} else if (x <= 9.5e-50) {
tmp = ((eps * eps) * (eps * eps)) * eps;
} else {
tmp = t_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(x, eps)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = ((((x * x) * x) * eps) * 5.0d0) * x
if (x <= (-1.65d-44)) then
tmp = t_0
else if (x <= 9.5d-50) then
tmp = ((eps * eps) * (eps * eps)) * eps
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = ((((x * x) * x) * eps) * 5.0) * x;
double tmp;
if (x <= -1.65e-44) {
tmp = t_0;
} else if (x <= 9.5e-50) {
tmp = ((eps * eps) * (eps * eps)) * eps;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps): t_0 = ((((x * x) * x) * eps) * 5.0) * x tmp = 0 if x <= -1.65e-44: tmp = t_0 elif x <= 9.5e-50: tmp = ((eps * eps) * (eps * eps)) * eps else: tmp = t_0 return tmp
function code(x, eps) t_0 = Float64(Float64(Float64(Float64(Float64(x * x) * x) * eps) * 5.0) * x) tmp = 0.0 if (x <= -1.65e-44) tmp = t_0; elseif (x <= 9.5e-50) tmp = Float64(Float64(Float64(eps * eps) * Float64(eps * eps)) * eps); else tmp = t_0; end return tmp end
function tmp_2 = code(x, eps) t_0 = ((((x * x) * x) * eps) * 5.0) * x; tmp = 0.0; if (x <= -1.65e-44) tmp = t_0; elseif (x <= 9.5e-50) tmp = ((eps * eps) * (eps * eps)) * eps; else tmp = t_0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[(N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * eps), $MachinePrecision] * 5.0), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.65e-44], t$95$0, If[LessEqual[x, 9.5e-50], N[(N[(N[(eps * eps), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot \varepsilon\right) \cdot 5\right) \cdot x\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-44}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-50}:\\
\;\;\;\;\left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \varepsilon\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.65000000000000003e-44 or 9.4999999999999993e-50 < x Initial program 39.0%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.4%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites93.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6492.2
Applied rewrites92.2%
if -1.65000000000000003e-44 < x < 9.4999999999999993e-50Initial program 99.4%
Taylor expanded in x around 0
metadata-evalN/A
pow-plus-revN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.0
Applied rewrites99.0%
(FPCore (x eps) :precision binary64 (* (* (* eps eps) (* eps eps)) eps))
double code(double x, double eps) {
return ((eps * eps) * (eps * eps)) * eps;
}
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(x, eps)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = ((eps * eps) * (eps * eps)) * eps
end function
public static double code(double x, double eps) {
return ((eps * eps) * (eps * eps)) * eps;
}
def code(x, eps): return ((eps * eps) * (eps * eps)) * eps
function code(x, eps) return Float64(Float64(Float64(eps * eps) * Float64(eps * eps)) * eps) end
function tmp = code(x, eps) tmp = ((eps * eps) * (eps * eps)) * eps; end
code[x_, eps_] := N[(N[(N[(eps * eps), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\varepsilon \cdot \varepsilon\right)\right) \cdot \varepsilon
\end{array}
Initial program 89.2%
Taylor expanded in x around 0
metadata-evalN/A
pow-plus-revN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6488.2
Applied rewrites88.2%
(FPCore (x eps) :precision binary64 (* (* eps eps) (* (* eps eps) eps)))
double code(double x, double eps) {
return (eps * eps) * ((eps * eps) * eps);
}
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(x, eps)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (eps * eps) * ((eps * eps) * eps)
end function
public static double code(double x, double eps) {
return (eps * eps) * ((eps * eps) * eps);
}
def code(x, eps): return (eps * eps) * ((eps * eps) * eps)
function code(x, eps) return Float64(Float64(eps * eps) * Float64(Float64(eps * eps) * eps)) end
function tmp = code(x, eps) tmp = (eps * eps) * ((eps * eps) * eps); end
code[x_, eps_] := N[(N[(eps * eps), $MachinePrecision] * N[(N[(eps * eps), $MachinePrecision] * eps), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \varepsilon\right)
\end{array}
Initial program 89.2%
Taylor expanded in x around 0
metadata-evalN/A
pow-plus-revN/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6488.2
Applied rewrites88.2%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-*l*N/A
pow2N/A
unpow3N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow3N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f6488.1
Applied rewrites88.1%
herbie shell --seed 2025114
(FPCore (x eps)
:name "ENA, Section 1.4, Exercise 4b, n=5"
:precision binary64
:pre (and (and (<= -1000000000.0 x) (<= x 1000000000.0)) (and (<= -1.0 eps) (<= eps 1.0)))
(- (pow (+ x eps) 5.0) (pow x 5.0)))