
(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 12 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
(if (<= x -1.35e-38)
(*
(+
(fma
4.0
eps
(-
(/
(fma
(* eps eps)
-10.0
(- (/ (fma (* (* eps eps) 6.0) eps (* (* (* eps eps) eps) 4.0)) x)))
x)))
eps)
(pow x 4.0))
(if (<= x 9.5e-34)
(- (pow (+ x eps) 5.0) (pow x 5.0))
(* (* 5.0 eps) (pow x 4.0)))))
double code(double x, double eps) {
double tmp;
if (x <= -1.35e-38) {
tmp = (fma(4.0, eps, -(fma((eps * eps), -10.0, -(fma(((eps * eps) * 6.0), eps, (((eps * eps) * eps) * 4.0)) / x)) / x)) + eps) * pow(x, 4.0);
} else if (x <= 9.5e-34) {
tmp = pow((x + eps), 5.0) - pow(x, 5.0);
} else {
tmp = (5.0 * eps) * pow(x, 4.0);
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -1.35e-38) tmp = Float64(Float64(fma(4.0, eps, Float64(-Float64(fma(Float64(eps * eps), -10.0, Float64(-Float64(fma(Float64(Float64(eps * eps) * 6.0), eps, Float64(Float64(Float64(eps * eps) * eps) * 4.0)) / x))) / x))) + eps) * (x ^ 4.0)); elseif (x <= 9.5e-34) tmp = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)); else tmp = Float64(Float64(5.0 * eps) * (x ^ 4.0)); end return tmp end
code[x_, eps_] := If[LessEqual[x, -1.35e-38], N[(N[(N[(4.0 * eps + (-N[(N[(N[(eps * eps), $MachinePrecision] * -10.0 + (-N[(N[(N[(N[(eps * eps), $MachinePrecision] * 6.0), $MachinePrecision] * eps + N[(N[(N[(eps * eps), $MachinePrecision] * eps), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision])), $MachinePrecision] / x), $MachinePrecision])), $MachinePrecision] + eps), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-34], N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision], N[(N[(5.0 * eps), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-38}:\\
\;\;\;\;\left(\mathsf{fma}\left(4, \varepsilon, -\frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon, -10, -\frac{\mathsf{fma}\left(\left(\varepsilon \cdot \varepsilon\right) \cdot 6, \varepsilon, \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \varepsilon\right) \cdot 4\right)}{x}\right)}{x}\right) + \varepsilon\right) \cdot {x}^{4}\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-34}:\\
\;\;\;\;{\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{else}:\\
\;\;\;\;\left(5 \cdot \varepsilon\right) \cdot {x}^{4}\\
\end{array}
\end{array}
if x < -1.35000000000000003e-38Initial program 88.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
lower-pow.f6487.6
Applied rewrites87.6%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-pow.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
metadata-evalN/A
lower-*.f6487.5
Applied rewrites87.5%
Taylor expanded in x around -inf
Applied rewrites80.9%
if -1.35000000000000003e-38 < x < 9.49999999999999985e-34Initial program 88.4%
if 9.49999999999999985e-34 < x Initial program 88.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-pow.f6482.1
Applied rewrites82.1%
(FPCore (x eps)
:precision binary64
(if (<= x -1.4e-38)
(* eps (fma (pow x 4.0) 5.0 (* (* 10.0 eps) (* (* x x) x))))
(if (<= x 9.5e-34)
(- (pow (+ x eps) 5.0) (pow x 5.0))
(* (* 5.0 eps) (pow x 4.0)))))
double code(double x, double eps) {
double tmp;
if (x <= -1.4e-38) {
tmp = eps * fma(pow(x, 4.0), 5.0, ((10.0 * eps) * ((x * x) * x)));
} else if (x <= 9.5e-34) {
tmp = pow((x + eps), 5.0) - pow(x, 5.0);
} else {
tmp = (5.0 * eps) * pow(x, 4.0);
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -1.4e-38) tmp = Float64(eps * fma((x ^ 4.0), 5.0, Float64(Float64(10.0 * eps) * Float64(Float64(x * x) * x)))); elseif (x <= 9.5e-34) tmp = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0)); else tmp = Float64(Float64(5.0 * eps) * (x ^ 4.0)); end return tmp end
code[x_, eps_] := If[LessEqual[x, -1.4e-38], N[(eps * N[(N[Power[x, 4.0], $MachinePrecision] * 5.0 + N[(N[(10.0 * eps), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-34], N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision], N[(N[(5.0 * eps), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{-38}:\\
\;\;\;\;\varepsilon \cdot \mathsf{fma}\left({x}^{4}, 5, \left(10 \cdot \varepsilon\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-34}:\\
\;\;\;\;{\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{else}:\\
\;\;\;\;\left(5 \cdot \varepsilon\right) \cdot {x}^{4}\\
\end{array}
\end{array}
if x < -1.4e-38Initial program 88.4%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.3%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-fma.f64N/A
lift-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6482.3
Applied rewrites82.3%
lift-fma.f64N/A
lift-pow.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-pow.f6482.3
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow3N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6482.3
Applied rewrites82.3%
if -1.4e-38 < x < 9.49999999999999985e-34Initial program 88.4%
if 9.49999999999999985e-34 < x Initial program 88.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-pow.f6482.1
Applied rewrites82.1%
(FPCore (x eps)
:precision binary64
(if (<= x -1.35e-38)
(* eps (fma (pow x 4.0) 5.0 (* (* 10.0 eps) (* (* x x) x))))
(if (<= x 9.5e-34)
(* (fma 5.0 (/ x eps) 1.0) (pow eps 5.0))
(* (* 5.0 eps) (pow x 4.0)))))
double code(double x, double eps) {
double tmp;
if (x <= -1.35e-38) {
tmp = eps * fma(pow(x, 4.0), 5.0, ((10.0 * eps) * ((x * x) * x)));
} else if (x <= 9.5e-34) {
tmp = fma(5.0, (x / eps), 1.0) * pow(eps, 5.0);
} else {
tmp = (5.0 * eps) * pow(x, 4.0);
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -1.35e-38) tmp = Float64(eps * fma((x ^ 4.0), 5.0, Float64(Float64(10.0 * eps) * Float64(Float64(x * x) * x)))); elseif (x <= 9.5e-34) tmp = Float64(fma(5.0, Float64(x / eps), 1.0) * (eps ^ 5.0)); else tmp = Float64(Float64(5.0 * eps) * (x ^ 4.0)); end return tmp end
code[x_, eps_] := If[LessEqual[x, -1.35e-38], N[(eps * N[(N[Power[x, 4.0], $MachinePrecision] * 5.0 + N[(N[(10.0 * eps), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-34], N[(N[(5.0 * N[(x / eps), $MachinePrecision] + 1.0), $MachinePrecision] * N[Power[eps, 5.0], $MachinePrecision]), $MachinePrecision], N[(N[(5.0 * eps), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-38}:\\
\;\;\;\;\varepsilon \cdot \mathsf{fma}\left({x}^{4}, 5, \left(10 \cdot \varepsilon\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-34}:\\
\;\;\;\;\mathsf{fma}\left(5, \frac{x}{\varepsilon}, 1\right) \cdot {\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;\left(5 \cdot \varepsilon\right) \cdot {x}^{4}\\
\end{array}
\end{array}
if x < -1.35000000000000003e-38Initial program 88.4%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.3%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-fma.f64N/A
lift-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6482.3
Applied rewrites82.3%
lift-fma.f64N/A
lift-pow.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-pow.f6482.3
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow3N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6482.3
Applied rewrites82.3%
if -1.35000000000000003e-38 < x < 9.49999999999999985e-34Initial program 88.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
lower-pow.f6487.6
Applied rewrites87.6%
if 9.49999999999999985e-34 < x Initial program 88.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-pow.f6482.1
Applied rewrites82.1%
(FPCore (x eps)
:precision binary64
(if (<= x -1.35e-38)
(* (* x x) (* x (fma (* eps x) 5.0 (* (* eps eps) 10.0))))
(if (<= x 9.5e-34)
(* (fma 5.0 (/ x eps) 1.0) (pow eps 5.0))
(* (* 5.0 eps) (pow x 4.0)))))
double code(double x, double eps) {
double tmp;
if (x <= -1.35e-38) {
tmp = (x * x) * (x * fma((eps * x), 5.0, ((eps * eps) * 10.0)));
} else if (x <= 9.5e-34) {
tmp = fma(5.0, (x / eps), 1.0) * pow(eps, 5.0);
} else {
tmp = (5.0 * eps) * pow(x, 4.0);
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -1.35e-38) tmp = Float64(Float64(x * x) * Float64(x * fma(Float64(eps * x), 5.0, Float64(Float64(eps * eps) * 10.0)))); elseif (x <= 9.5e-34) tmp = Float64(fma(5.0, Float64(x / eps), 1.0) * (eps ^ 5.0)); else tmp = Float64(Float64(5.0 * eps) * (x ^ 4.0)); end return tmp end
code[x_, eps_] := If[LessEqual[x, -1.35e-38], N[(N[(x * x), $MachinePrecision] * N[(x * N[(N[(eps * x), $MachinePrecision] * 5.0 + N[(N[(eps * eps), $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-34], N[(N[(5.0 * N[(x / eps), $MachinePrecision] + 1.0), $MachinePrecision] * N[Power[eps, 5.0], $MachinePrecision]), $MachinePrecision], N[(N[(5.0 * eps), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-38}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(x \cdot \mathsf{fma}\left(\varepsilon \cdot x, 5, \left(\varepsilon \cdot \varepsilon\right) \cdot 10\right)\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-34}:\\
\;\;\;\;\mathsf{fma}\left(5, \frac{x}{\varepsilon}, 1\right) \cdot {\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;\left(5 \cdot \varepsilon\right) \cdot {x}^{4}\\
\end{array}
\end{array}
if x < -1.35000000000000003e-38Initial program 88.4%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.3%
Taylor expanded in x around 0
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6482.3
Applied rewrites82.3%
Applied rewrites82.3%
if -1.35000000000000003e-38 < x < 9.49999999999999985e-34Initial program 88.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
lower-pow.f6487.6
Applied rewrites87.6%
if 9.49999999999999985e-34 < x Initial program 88.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-pow.f6482.1
Applied rewrites82.1%
(FPCore (x eps) :precision binary64 (if (<= x -1.35e-38) (* (* x x) (* x (fma (* eps x) 5.0 (* (* eps eps) 10.0)))) (if (<= x 9.5e-34) (pow eps 5.0) (* (* 5.0 eps) (pow x 4.0)))))
double code(double x, double eps) {
double tmp;
if (x <= -1.35e-38) {
tmp = (x * x) * (x * fma((eps * x), 5.0, ((eps * eps) * 10.0)));
} else if (x <= 9.5e-34) {
tmp = pow(eps, 5.0);
} else {
tmp = (5.0 * eps) * pow(x, 4.0);
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -1.35e-38) tmp = Float64(Float64(x * x) * Float64(x * fma(Float64(eps * x), 5.0, Float64(Float64(eps * eps) * 10.0)))); elseif (x <= 9.5e-34) tmp = eps ^ 5.0; else tmp = Float64(Float64(5.0 * eps) * (x ^ 4.0)); end return tmp end
code[x_, eps_] := If[LessEqual[x, -1.35e-38], N[(N[(x * x), $MachinePrecision] * N[(x * N[(N[(eps * x), $MachinePrecision] * 5.0 + N[(N[(eps * eps), $MachinePrecision] * 10.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-34], N[Power[eps, 5.0], $MachinePrecision], N[(N[(5.0 * eps), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-38}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(x \cdot \mathsf{fma}\left(\varepsilon \cdot x, 5, \left(\varepsilon \cdot \varepsilon\right) \cdot 10\right)\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-34}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;\left(5 \cdot \varepsilon\right) \cdot {x}^{4}\\
\end{array}
\end{array}
if x < -1.35000000000000003e-38Initial program 88.4%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.3%
Taylor expanded in x around 0
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6482.3
Applied rewrites82.3%
Applied rewrites82.3%
if -1.35000000000000003e-38 < x < 9.49999999999999985e-34Initial program 88.4%
Taylor expanded in x around 0
lower-pow.f6487.4
Applied rewrites87.4%
if 9.49999999999999985e-34 < x Initial program 88.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-pow.f6482.1
Applied rewrites82.1%
(FPCore (x eps) :precision binary64 (if (<= x -1.35e-38) (* (* (* x x) x) (* (fma 10.0 eps (* 5.0 x)) eps)) (if (<= x 9.5e-34) (pow eps 5.0) (* (* 5.0 eps) (pow x 4.0)))))
double code(double x, double eps) {
double tmp;
if (x <= -1.35e-38) {
tmp = ((x * x) * x) * (fma(10.0, eps, (5.0 * x)) * eps);
} else if (x <= 9.5e-34) {
tmp = pow(eps, 5.0);
} else {
tmp = (5.0 * eps) * pow(x, 4.0);
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -1.35e-38) tmp = Float64(Float64(Float64(x * x) * x) * Float64(fma(10.0, eps, Float64(5.0 * x)) * eps)); elseif (x <= 9.5e-34) tmp = eps ^ 5.0; else tmp = Float64(Float64(5.0 * eps) * (x ^ 4.0)); end return tmp end
code[x_, eps_] := If[LessEqual[x, -1.35e-38], N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * N[(N[(10.0 * eps + N[(5.0 * x), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-34], N[Power[eps, 5.0], $MachinePrecision], N[(N[(5.0 * eps), $MachinePrecision] * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-38}:\\
\;\;\;\;\left(\left(x \cdot x\right) \cdot x\right) \cdot \left(\mathsf{fma}\left(10, \varepsilon, 5 \cdot x\right) \cdot \varepsilon\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-34}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;\left(5 \cdot \varepsilon\right) \cdot {x}^{4}\\
\end{array}
\end{array}
if x < -1.35000000000000003e-38Initial program 88.4%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.3%
Taylor expanded in x around 0
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6482.3
Applied rewrites82.3%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6482.3
Applied rewrites82.3%
if -1.35000000000000003e-38 < x < 9.49999999999999985e-34Initial program 88.4%
Taylor expanded in x around 0
lower-pow.f6487.4
Applied rewrites87.4%
if 9.49999999999999985e-34 < x Initial program 88.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-pow.f6482.1
Applied rewrites82.1%
(FPCore (x eps) :precision binary64 (if (<= x -1.35e-38) (* (* (* x x) x) (* (fma 10.0 eps (* 5.0 x)) eps)) (if (<= x 9.5e-34) (pow eps 5.0) (* (* (pow x 4.0) 5.0) eps))))
double code(double x, double eps) {
double tmp;
if (x <= -1.35e-38) {
tmp = ((x * x) * x) * (fma(10.0, eps, (5.0 * x)) * eps);
} else if (x <= 9.5e-34) {
tmp = pow(eps, 5.0);
} else {
tmp = (pow(x, 4.0) * 5.0) * eps;
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -1.35e-38) tmp = Float64(Float64(Float64(x * x) * x) * Float64(fma(10.0, eps, Float64(5.0 * x)) * eps)); elseif (x <= 9.5e-34) tmp = eps ^ 5.0; else tmp = Float64(Float64((x ^ 4.0) * 5.0) * eps); end return tmp end
code[x_, eps_] := If[LessEqual[x, -1.35e-38], N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * N[(N[(10.0 * eps + N[(5.0 * x), $MachinePrecision]), $MachinePrecision] * eps), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-34], N[Power[eps, 5.0], $MachinePrecision], N[(N[(N[Power[x, 4.0], $MachinePrecision] * 5.0), $MachinePrecision] * eps), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-38}:\\
\;\;\;\;\left(\left(x \cdot x\right) \cdot x\right) \cdot \left(\mathsf{fma}\left(10, \varepsilon, 5 \cdot x\right) \cdot \varepsilon\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-34}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;\left({x}^{4} \cdot 5\right) \cdot \varepsilon\\
\end{array}
\end{array}
if x < -1.35000000000000003e-38Initial program 88.4%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.3%
Taylor expanded in x around 0
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6482.3
Applied rewrites82.3%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6482.3
Applied rewrites82.3%
if -1.35000000000000003e-38 < x < 9.49999999999999985e-34Initial program 88.4%
Taylor expanded in x around 0
lower-pow.f6487.4
Applied rewrites87.4%
if 9.49999999999999985e-34 < x Initial program 88.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
lower-pow.f6487.6
Applied rewrites87.6%
Taylor expanded in x around inf
lower-*.f64N/A
lift-pow.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f6482.1
Applied rewrites82.1%
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f6482.1
Applied rewrites82.1%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (* x x) x)) (t_1 (fma 10.0 eps (* 5.0 x))))
(if (<= x -1.35e-38)
(* t_0 (* t_1 eps))
(if (<= x 9.5e-34) (pow eps 5.0) (* eps (* t_1 t_0))))))
double code(double x, double eps) {
double t_0 = (x * x) * x;
double t_1 = fma(10.0, eps, (5.0 * x));
double tmp;
if (x <= -1.35e-38) {
tmp = t_0 * (t_1 * eps);
} else if (x <= 9.5e-34) {
tmp = pow(eps, 5.0);
} else {
tmp = eps * (t_1 * t_0);
}
return tmp;
}
function code(x, eps) t_0 = Float64(Float64(x * x) * x) t_1 = fma(10.0, eps, Float64(5.0 * x)) tmp = 0.0 if (x <= -1.35e-38) tmp = Float64(t_0 * Float64(t_1 * eps)); elseif (x <= 9.5e-34) tmp = eps ^ 5.0; else tmp = Float64(eps * Float64(t_1 * t_0)); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$1 = N[(10.0 * eps + N[(5.0 * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e-38], N[(t$95$0 * N[(t$95$1 * eps), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-34], N[Power[eps, 5.0], $MachinePrecision], N[(eps * N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x \cdot x\right) \cdot x\\
t_1 := \mathsf{fma}\left(10, \varepsilon, 5 \cdot x\right)\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{-38}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \varepsilon\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-34}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;\varepsilon \cdot \left(t\_1 \cdot t\_0\right)\\
\end{array}
\end{array}
if x < -1.35000000000000003e-38Initial program 88.4%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.3%
Taylor expanded in x around 0
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6482.3
Applied rewrites82.3%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6482.3
Applied rewrites82.3%
if -1.35000000000000003e-38 < x < 9.49999999999999985e-34Initial program 88.4%
Taylor expanded in x around 0
lower-pow.f6487.4
Applied rewrites87.4%
if 9.49999999999999985e-34 < x Initial program 88.4%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.3%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-fma.f64N/A
lift-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6482.3
Applied rewrites82.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6482.3
Applied rewrites82.3%
(FPCore (x eps) :precision binary64 (let* ((t_0 (* eps (* (fma 10.0 eps (* 5.0 x)) (* (* x x) x))))) (if (<= x -1.35e-38) t_0 (if (<= x 9.5e-34) (pow eps 5.0) t_0))))
double code(double x, double eps) {
double t_0 = eps * (fma(10.0, eps, (5.0 * x)) * ((x * x) * x));
double tmp;
if (x <= -1.35e-38) {
tmp = t_0;
} else if (x <= 9.5e-34) {
tmp = pow(eps, 5.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, eps) t_0 = Float64(eps * Float64(fma(10.0, eps, Float64(5.0 * x)) * Float64(Float64(x * x) * x))) tmp = 0.0 if (x <= -1.35e-38) tmp = t_0; elseif (x <= 9.5e-34) tmp = eps ^ 5.0; else tmp = t_0; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(eps * N[(N[(10.0 * eps + N[(5.0 * x), $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e-38], t$95$0, If[LessEqual[x, 9.5e-34], N[Power[eps, 5.0], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \varepsilon \cdot \left(\mathsf{fma}\left(10, \varepsilon, 5 \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{-38}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-34}:\\
\;\;\;\;{\varepsilon}^{5}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.35000000000000003e-38 or 9.49999999999999985e-34 < x Initial program 88.4%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.3%
Taylor expanded in eps around 0
lower-*.f64N/A
lower-fma.f64N/A
lift-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6482.3
Applied rewrites82.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6482.3
Applied rewrites82.3%
if -1.35000000000000003e-38 < x < 9.49999999999999985e-34Initial program 88.4%
Taylor expanded in x around 0
lower-pow.f6487.4
Applied rewrites87.4%
(FPCore (x eps) :precision binary64 (pow eps 5.0))
double code(double x, double eps) {
return pow(eps, 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 = eps ** 5.0d0
end function
public static double code(double x, double eps) {
return Math.pow(eps, 5.0);
}
def code(x, eps): return math.pow(eps, 5.0)
function code(x, eps) return eps ^ 5.0 end
function tmp = code(x, eps) tmp = eps ^ 5.0; end
code[x_, eps_] := N[Power[eps, 5.0], $MachinePrecision]
\begin{array}{l}
\\
{\varepsilon}^{5}
\end{array}
Initial program 88.4%
Taylor expanded in x around 0
lower-pow.f6487.4
Applied rewrites87.4%
(FPCore (x eps) :precision binary64 (* 10.0 (* (* eps eps) (* (* x x) x))))
double code(double x, double eps) {
return 10.0 * ((eps * eps) * ((x * x) * x));
}
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 = 10.0d0 * ((eps * eps) * ((x * x) * x))
end function
public static double code(double x, double eps) {
return 10.0 * ((eps * eps) * ((x * x) * x));
}
def code(x, eps): return 10.0 * ((eps * eps) * ((x * x) * x))
function code(x, eps) return Float64(10.0 * Float64(Float64(eps * eps) * Float64(Float64(x * x) * x))) end
function tmp = code(x, eps) tmp = 10.0 * ((eps * eps) * ((x * x) * x)); end
code[x_, eps_] := N[(10.0 * N[(N[(eps * eps), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
10 \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)
\end{array}
Initial program 88.4%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.3%
Taylor expanded in eps around inf
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6470.4
Applied rewrites70.4%
(FPCore (x eps) :precision binary64 (* 10.0 (* eps (* (* eps (* x x)) x))))
double code(double x, double eps) {
return 10.0 * (eps * ((eps * (x * x)) * x));
}
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 = 10.0d0 * (eps * ((eps * (x * x)) * x))
end function
public static double code(double x, double eps) {
return 10.0 * (eps * ((eps * (x * x)) * x));
}
def code(x, eps): return 10.0 * (eps * ((eps * (x * x)) * x))
function code(x, eps) return Float64(10.0 * Float64(eps * Float64(Float64(eps * Float64(x * x)) * x))) end
function tmp = code(x, eps) tmp = 10.0 * (eps * ((eps * (x * x)) * x)); end
code[x_, eps_] := N[(10.0 * N[(eps * N[(N[(eps * N[(x * x), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
10 \cdot \left(\varepsilon \cdot \left(\left(\varepsilon \cdot \left(x \cdot x\right)\right) \cdot x\right)\right)
\end{array}
Initial program 88.4%
Taylor expanded in x around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.3%
Taylor expanded in eps around inf
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6470.4
Applied rewrites70.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow3N/A
associate-*l*N/A
pow3N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6470.4
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow3N/A
unpow3N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6470.4
Applied rewrites70.4%
herbie shell --seed 2025132
(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)))