ENA, Section 1.4, Exercise 4b, n=5

Percentage Accurate: 89.0% → 99.0%
Time: 3.0s
Alternatives: 7
Speedup: 0.4×

Specification

?
\[\left(-1000000000 \leq x \land x \leq 1000000000\right) \land \left(-1 \leq \varepsilon \land \varepsilon \leq 1\right)\]
\[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
(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]
{\left(x + \varepsilon\right)}^{5} - {x}^{5}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 7 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 89.0% accurate, 1.0× speedup?

\[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
(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]
{\left(x + \varepsilon\right)}^{5} - {x}^{5}

Alternative 1: 99.0% accurate, 0.3× speedup?

\[\begin{array}{l} t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\ \mathbf{if}\;t\_0 \leq -1 \cdot 10^{-323}:\\ \;\;\;\;{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\left({x}^{4} \cdot 5\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
(FPCore (x eps)
  :precision binary64
  (let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
  (if (<= t_0 -1e-323)
    (* (pow eps 5.0) (+ 1.0 (* 5.0 (/ x eps))))
    (if (<= t_0 0.0) (* (* (pow x 4.0) 5.0) eps) t_0))))
double code(double x, double eps) {
	double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
	double tmp;
	if (t_0 <= -1e-323) {
		tmp = pow(eps, 5.0) * (1.0 + (5.0 * (x / eps)));
	} else if (t_0 <= 0.0) {
		tmp = (pow(x, 4.0) * 5.0) * 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 + eps) ** 5.0d0) - (x ** 5.0d0)
    if (t_0 <= (-1d-323)) then
        tmp = (eps ** 5.0d0) * (1.0d0 + (5.0d0 * (x / eps)))
    else if (t_0 <= 0.0d0) then
        tmp = ((x ** 4.0d0) * 5.0d0) * eps
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double eps) {
	double t_0 = Math.pow((x + eps), 5.0) - Math.pow(x, 5.0);
	double tmp;
	if (t_0 <= -1e-323) {
		tmp = Math.pow(eps, 5.0) * (1.0 + (5.0 * (x / eps)));
	} else if (t_0 <= 0.0) {
		tmp = (Math.pow(x, 4.0) * 5.0) * eps;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, eps):
	t_0 = math.pow((x + eps), 5.0) - math.pow(x, 5.0)
	tmp = 0
	if t_0 <= -1e-323:
		tmp = math.pow(eps, 5.0) * (1.0 + (5.0 * (x / eps)))
	elif t_0 <= 0.0:
		tmp = (math.pow(x, 4.0) * 5.0) * eps
	else:
		tmp = t_0
	return tmp
function code(x, eps)
	t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0))
	tmp = 0.0
	if (t_0 <= -1e-323)
		tmp = Float64((eps ^ 5.0) * Float64(1.0 + Float64(5.0 * Float64(x / eps))));
	elseif (t_0 <= 0.0)
		tmp = Float64(Float64((x ^ 4.0) * 5.0) * eps);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, eps)
	t_0 = ((x + eps) ^ 5.0) - (x ^ 5.0);
	tmp = 0.0;
	if (t_0 <= -1e-323)
		tmp = (eps ^ 5.0) * (1.0 + (5.0 * (x / eps)));
	elseif (t_0 <= 0.0)
		tmp = ((x ^ 4.0) * 5.0) * eps;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-323], N[(N[Power[eps, 5.0], $MachinePrecision] * N[(1.0 + N[(5.0 * N[(x / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[Power[x, 4.0], $MachinePrecision] * 5.0), $MachinePrecision] * eps), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-323}:\\
\;\;\;\;{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left({x}^{4} \cdot 5\right) \cdot \varepsilon\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -9.8813129168249309e-324

    1. Initial program 89.0%

      \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
    2. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \color{blue}{{\left(x + \varepsilon\right)}^{5} - {x}^{5}} \]
      2. sub-flipN/A

        \[\leadsto \color{blue}{{\left(x + \varepsilon\right)}^{5} + \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      3. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left({x}^{5}\right)\right) + {\left(x + \varepsilon\right)}^{5}} \]
      4. sum-to-multN/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      5. lower-unsound-*.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      6. lower-unsound-+.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right)} \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      7. lower-unsound-/.f64N/A

        \[\leadsto \left(1 + \color{blue}{\frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      8. lift-+.f64N/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(x + \varepsilon\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(\varepsilon + x\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      10. lower-+.f64N/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(\varepsilon + x\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      11. lower-neg.f64N/A

        \[\leadsto \left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{\color{blue}{-{x}^{5}}}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      12. lower-neg.f6411.8%

        \[\leadsto \left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{-{x}^{5}}\right) \cdot \color{blue}{\left(-{x}^{5}\right)} \]
    3. Applied rewrites11.8%

      \[\leadsto \color{blue}{\left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{-{x}^{5}}\right) \cdot \left(-{x}^{5}\right)} \]
    4. Taylor expanded in eps around inf

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \color{blue}{\left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
      2. lower-pow.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(\color{blue}{1} + 5 \cdot \frac{x}{\varepsilon}\right) \]
      3. lower-+.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + \color{blue}{5 \cdot \frac{x}{\varepsilon}}\right) \]
      4. lower-*.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + 5 \cdot \color{blue}{\frac{x}{\varepsilon}}\right) \]
      5. lower-/.f6488.1%

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\color{blue}{\varepsilon}}\right) \]
    6. Applied rewrites88.1%

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]

    if -9.8813129168249309e-324 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0

    1. Initial program 89.0%

      \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{{x}^{4} \cdot \left(\varepsilon + 4 \cdot \varepsilon\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto {x}^{4} \cdot \color{blue}{\left(\varepsilon + 4 \cdot \varepsilon\right)} \]
      2. lower-pow.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\color{blue}{\varepsilon} + 4 \cdot \varepsilon\right) \]
      3. lower-+.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + \color{blue}{4 \cdot \varepsilon}\right) \]
      4. lower-*.f6482.1%

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + 4 \cdot \color{blue}{\varepsilon}\right) \]
    4. Applied rewrites82.1%

      \[\leadsto \color{blue}{{x}^{4} \cdot \left(\varepsilon + 4 \cdot \varepsilon\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto {x}^{4} \cdot \color{blue}{\left(\varepsilon + 4 \cdot \varepsilon\right)} \]
      2. lift-+.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + \color{blue}{4 \cdot \varepsilon}\right) \]
      3. lift-*.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + 4 \cdot \color{blue}{\varepsilon}\right) \]
      4. distribute-rgt1-inN/A

        \[\leadsto {x}^{4} \cdot \left(\left(4 + 1\right) \cdot \color{blue}{\varepsilon}\right) \]
      5. metadata-evalN/A

        \[\leadsto {x}^{4} \cdot \left(5 \cdot \varepsilon\right) \]
      6. associate-*r*N/A

        \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
      7. *-commutativeN/A

        \[\leadsto \left(5 \cdot {x}^{4}\right) \cdot \varepsilon \]
      8. metadata-evalN/A

        \[\leadsto \left(\left(4 + 1\right) \cdot {x}^{4}\right) \cdot \varepsilon \]
      9. distribute-lft1-inN/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      10. lift-*.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      11. lift-+.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      12. lower-*.f6482.1%

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \color{blue}{\varepsilon} \]
      13. lift-+.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      14. lift-*.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      15. distribute-lft1-inN/A

        \[\leadsto \left(\left(4 + 1\right) \cdot {x}^{4}\right) \cdot \varepsilon \]
      16. metadata-evalN/A

        \[\leadsto \left(5 \cdot {x}^{4}\right) \cdot \varepsilon \]
      17. *-commutativeN/A

        \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \varepsilon \]
      18. lower-*.f6482.1%

        \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \varepsilon \]
    6. Applied rewrites82.1%

      \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]

    if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64)))

    1. Initial program 89.0%

      \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 98.5% accurate, 0.4× speedup?

\[\begin{array}{l} t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\ \mathbf{if}\;t\_0 \leq -1 \cdot 10^{-323}:\\ \;\;\;\;{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\left({x}^{4} \cdot 5\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;{\varepsilon}^{5}\\ \end{array} \]
(FPCore (x eps)
  :precision binary64
  (let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
  (if (<= t_0 -1e-323)
    (* (pow eps 5.0) (+ 1.0 (* 5.0 (/ x eps))))
    (if (<= t_0 0.0) (* (* (pow x 4.0) 5.0) eps) (pow eps 5.0)))))
double code(double x, double eps) {
	double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
	double tmp;
	if (t_0 <= -1e-323) {
		tmp = pow(eps, 5.0) * (1.0 + (5.0 * (x / eps)));
	} else if (t_0 <= 0.0) {
		tmp = (pow(x, 4.0) * 5.0) * eps;
	} else {
		tmp = pow(eps, 5.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 + eps) ** 5.0d0) - (x ** 5.0d0)
    if (t_0 <= (-1d-323)) then
        tmp = (eps ** 5.0d0) * (1.0d0 + (5.0d0 * (x / eps)))
    else if (t_0 <= 0.0d0) then
        tmp = ((x ** 4.0d0) * 5.0d0) * eps
    else
        tmp = eps ** 5.0d0
    end if
    code = tmp
end function
public static double code(double x, double eps) {
	double t_0 = Math.pow((x + eps), 5.0) - Math.pow(x, 5.0);
	double tmp;
	if (t_0 <= -1e-323) {
		tmp = Math.pow(eps, 5.0) * (1.0 + (5.0 * (x / eps)));
	} else if (t_0 <= 0.0) {
		tmp = (Math.pow(x, 4.0) * 5.0) * eps;
	} else {
		tmp = Math.pow(eps, 5.0);
	}
	return tmp;
}
def code(x, eps):
	t_0 = math.pow((x + eps), 5.0) - math.pow(x, 5.0)
	tmp = 0
	if t_0 <= -1e-323:
		tmp = math.pow(eps, 5.0) * (1.0 + (5.0 * (x / eps)))
	elif t_0 <= 0.0:
		tmp = (math.pow(x, 4.0) * 5.0) * eps
	else:
		tmp = math.pow(eps, 5.0)
	return tmp
function code(x, eps)
	t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0))
	tmp = 0.0
	if (t_0 <= -1e-323)
		tmp = Float64((eps ^ 5.0) * Float64(1.0 + Float64(5.0 * Float64(x / eps))));
	elseif (t_0 <= 0.0)
		tmp = Float64(Float64((x ^ 4.0) * 5.0) * eps);
	else
		tmp = eps ^ 5.0;
	end
	return tmp
end
function tmp_2 = code(x, eps)
	t_0 = ((x + eps) ^ 5.0) - (x ^ 5.0);
	tmp = 0.0;
	if (t_0 <= -1e-323)
		tmp = (eps ^ 5.0) * (1.0 + (5.0 * (x / eps)));
	elseif (t_0 <= 0.0)
		tmp = ((x ^ 4.0) * 5.0) * eps;
	else
		tmp = eps ^ 5.0;
	end
	tmp_2 = tmp;
end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-323], N[(N[Power[eps, 5.0], $MachinePrecision] * N[(1.0 + N[(5.0 * N[(x / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[Power[x, 4.0], $MachinePrecision] * 5.0), $MachinePrecision] * eps), $MachinePrecision], N[Power[eps, 5.0], $MachinePrecision]]]]
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-323}:\\
\;\;\;\;{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left({x}^{4} \cdot 5\right) \cdot \varepsilon\\

\mathbf{else}:\\
\;\;\;\;{\varepsilon}^{5}\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -9.8813129168249309e-324

    1. Initial program 89.0%

      \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
    2. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \color{blue}{{\left(x + \varepsilon\right)}^{5} - {x}^{5}} \]
      2. sub-flipN/A

        \[\leadsto \color{blue}{{\left(x + \varepsilon\right)}^{5} + \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      3. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left({x}^{5}\right)\right) + {\left(x + \varepsilon\right)}^{5}} \]
      4. sum-to-multN/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      5. lower-unsound-*.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      6. lower-unsound-+.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right)} \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      7. lower-unsound-/.f64N/A

        \[\leadsto \left(1 + \color{blue}{\frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      8. lift-+.f64N/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(x + \varepsilon\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(\varepsilon + x\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      10. lower-+.f64N/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(\varepsilon + x\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      11. lower-neg.f64N/A

        \[\leadsto \left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{\color{blue}{-{x}^{5}}}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      12. lower-neg.f6411.8%

        \[\leadsto \left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{-{x}^{5}}\right) \cdot \color{blue}{\left(-{x}^{5}\right)} \]
    3. Applied rewrites11.8%

      \[\leadsto \color{blue}{\left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{-{x}^{5}}\right) \cdot \left(-{x}^{5}\right)} \]
    4. Taylor expanded in eps around inf

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \color{blue}{\left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
      2. lower-pow.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(\color{blue}{1} + 5 \cdot \frac{x}{\varepsilon}\right) \]
      3. lower-+.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + \color{blue}{5 \cdot \frac{x}{\varepsilon}}\right) \]
      4. lower-*.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + 5 \cdot \color{blue}{\frac{x}{\varepsilon}}\right) \]
      5. lower-/.f6488.1%

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\color{blue}{\varepsilon}}\right) \]
    6. Applied rewrites88.1%

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]

    if -9.8813129168249309e-324 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0

    1. Initial program 89.0%

      \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{{x}^{4} \cdot \left(\varepsilon + 4 \cdot \varepsilon\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto {x}^{4} \cdot \color{blue}{\left(\varepsilon + 4 \cdot \varepsilon\right)} \]
      2. lower-pow.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\color{blue}{\varepsilon} + 4 \cdot \varepsilon\right) \]
      3. lower-+.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + \color{blue}{4 \cdot \varepsilon}\right) \]
      4. lower-*.f6482.1%

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + 4 \cdot \color{blue}{\varepsilon}\right) \]
    4. Applied rewrites82.1%

      \[\leadsto \color{blue}{{x}^{4} \cdot \left(\varepsilon + 4 \cdot \varepsilon\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto {x}^{4} \cdot \color{blue}{\left(\varepsilon + 4 \cdot \varepsilon\right)} \]
      2. lift-+.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + \color{blue}{4 \cdot \varepsilon}\right) \]
      3. lift-*.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + 4 \cdot \color{blue}{\varepsilon}\right) \]
      4. distribute-rgt1-inN/A

        \[\leadsto {x}^{4} \cdot \left(\left(4 + 1\right) \cdot \color{blue}{\varepsilon}\right) \]
      5. metadata-evalN/A

        \[\leadsto {x}^{4} \cdot \left(5 \cdot \varepsilon\right) \]
      6. associate-*r*N/A

        \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
      7. *-commutativeN/A

        \[\leadsto \left(5 \cdot {x}^{4}\right) \cdot \varepsilon \]
      8. metadata-evalN/A

        \[\leadsto \left(\left(4 + 1\right) \cdot {x}^{4}\right) \cdot \varepsilon \]
      9. distribute-lft1-inN/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      10. lift-*.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      11. lift-+.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      12. lower-*.f6482.1%

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \color{blue}{\varepsilon} \]
      13. lift-+.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      14. lift-*.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      15. distribute-lft1-inN/A

        \[\leadsto \left(\left(4 + 1\right) \cdot {x}^{4}\right) \cdot \varepsilon \]
      16. metadata-evalN/A

        \[\leadsto \left(5 \cdot {x}^{4}\right) \cdot \varepsilon \]
      17. *-commutativeN/A

        \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \varepsilon \]
      18. lower-*.f6482.1%

        \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \varepsilon \]
    6. Applied rewrites82.1%

      \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]

    if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64)))

    1. Initial program 89.0%

      \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
    2. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \color{blue}{{\left(x + \varepsilon\right)}^{5} - {x}^{5}} \]
      2. sub-flipN/A

        \[\leadsto \color{blue}{{\left(x + \varepsilon\right)}^{5} + \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      3. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left({x}^{5}\right)\right) + {\left(x + \varepsilon\right)}^{5}} \]
      4. sum-to-multN/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      5. lower-unsound-*.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      6. lower-unsound-+.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right)} \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      7. lower-unsound-/.f64N/A

        \[\leadsto \left(1 + \color{blue}{\frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      8. lift-+.f64N/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(x + \varepsilon\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(\varepsilon + x\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      10. lower-+.f64N/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(\varepsilon + x\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      11. lower-neg.f64N/A

        \[\leadsto \left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{\color{blue}{-{x}^{5}}}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      12. lower-neg.f6411.8%

        \[\leadsto \left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{-{x}^{5}}\right) \cdot \color{blue}{\left(-{x}^{5}\right)} \]
    3. Applied rewrites11.8%

      \[\leadsto \color{blue}{\left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{-{x}^{5}}\right) \cdot \left(-{x}^{5}\right)} \]
    4. Taylor expanded in eps around inf

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \color{blue}{\left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
      2. lower-pow.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(\color{blue}{1} + 5 \cdot \frac{x}{\varepsilon}\right) \]
      3. lower-+.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + \color{blue}{5 \cdot \frac{x}{\varepsilon}}\right) \]
      4. lower-*.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + 5 \cdot \color{blue}{\frac{x}{\varepsilon}}\right) \]
      5. lower-/.f6488.1%

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\color{blue}{\varepsilon}}\right) \]
    6. Applied rewrites88.1%

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
    7. Taylor expanded in x around 0

      \[\leadsto {\varepsilon}^{\color{blue}{5}} \]
    8. Step-by-step derivation
      1. lower-pow.f6487.9%

        \[\leadsto {\varepsilon}^{5} \]
    9. Applied rewrites87.9%

      \[\leadsto {\varepsilon}^{\color{blue}{5}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 98.4% accurate, 0.4× speedup?

\[\begin{array}{l} t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\ \mathbf{if}\;t\_0 \leq -1 \cdot 10^{-323}:\\ \;\;\;\;{\varepsilon}^{4} \cdot \left(\varepsilon + 5 \cdot x\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\left({x}^{4} \cdot 5\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;{\varepsilon}^{5}\\ \end{array} \]
(FPCore (x eps)
  :precision binary64
  (let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
  (if (<= t_0 -1e-323)
    (* (pow eps 4.0) (+ eps (* 5.0 x)))
    (if (<= t_0 0.0) (* (* (pow x 4.0) 5.0) eps) (pow eps 5.0)))))
double code(double x, double eps) {
	double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
	double tmp;
	if (t_0 <= -1e-323) {
		tmp = pow(eps, 4.0) * (eps + (5.0 * x));
	} else if (t_0 <= 0.0) {
		tmp = (pow(x, 4.0) * 5.0) * eps;
	} else {
		tmp = pow(eps, 5.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 + eps) ** 5.0d0) - (x ** 5.0d0)
    if (t_0 <= (-1d-323)) then
        tmp = (eps ** 4.0d0) * (eps + (5.0d0 * x))
    else if (t_0 <= 0.0d0) then
        tmp = ((x ** 4.0d0) * 5.0d0) * eps
    else
        tmp = eps ** 5.0d0
    end if
    code = tmp
end function
public static double code(double x, double eps) {
	double t_0 = Math.pow((x + eps), 5.0) - Math.pow(x, 5.0);
	double tmp;
	if (t_0 <= -1e-323) {
		tmp = Math.pow(eps, 4.0) * (eps + (5.0 * x));
	} else if (t_0 <= 0.0) {
		tmp = (Math.pow(x, 4.0) * 5.0) * eps;
	} else {
		tmp = Math.pow(eps, 5.0);
	}
	return tmp;
}
def code(x, eps):
	t_0 = math.pow((x + eps), 5.0) - math.pow(x, 5.0)
	tmp = 0
	if t_0 <= -1e-323:
		tmp = math.pow(eps, 4.0) * (eps + (5.0 * x))
	elif t_0 <= 0.0:
		tmp = (math.pow(x, 4.0) * 5.0) * eps
	else:
		tmp = math.pow(eps, 5.0)
	return tmp
function code(x, eps)
	t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0))
	tmp = 0.0
	if (t_0 <= -1e-323)
		tmp = Float64((eps ^ 4.0) * Float64(eps + Float64(5.0 * x)));
	elseif (t_0 <= 0.0)
		tmp = Float64(Float64((x ^ 4.0) * 5.0) * eps);
	else
		tmp = eps ^ 5.0;
	end
	return tmp
end
function tmp_2 = code(x, eps)
	t_0 = ((x + eps) ^ 5.0) - (x ^ 5.0);
	tmp = 0.0;
	if (t_0 <= -1e-323)
		tmp = (eps ^ 4.0) * (eps + (5.0 * x));
	elseif (t_0 <= 0.0)
		tmp = ((x ^ 4.0) * 5.0) * eps;
	else
		tmp = eps ^ 5.0;
	end
	tmp_2 = tmp;
end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-323], N[(N[Power[eps, 4.0], $MachinePrecision] * N[(eps + N[(5.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[Power[x, 4.0], $MachinePrecision] * 5.0), $MachinePrecision] * eps), $MachinePrecision], N[Power[eps, 5.0], $MachinePrecision]]]]
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-323}:\\
\;\;\;\;{\varepsilon}^{4} \cdot \left(\varepsilon + 5 \cdot x\right)\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left({x}^{4} \cdot 5\right) \cdot \varepsilon\\

\mathbf{else}:\\
\;\;\;\;{\varepsilon}^{5}\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -9.8813129168249309e-324

    1. Initial program 89.0%

      \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
    2. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \color{blue}{{\left(x + \varepsilon\right)}^{5} - {x}^{5}} \]
      2. sub-flipN/A

        \[\leadsto \color{blue}{{\left(x + \varepsilon\right)}^{5} + \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      3. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left({x}^{5}\right)\right) + {\left(x + \varepsilon\right)}^{5}} \]
      4. sum-to-multN/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      5. lower-unsound-*.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      6. lower-unsound-+.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right)} \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      7. lower-unsound-/.f64N/A

        \[\leadsto \left(1 + \color{blue}{\frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      8. lift-+.f64N/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(x + \varepsilon\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(\varepsilon + x\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      10. lower-+.f64N/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(\varepsilon + x\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      11. lower-neg.f64N/A

        \[\leadsto \left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{\color{blue}{-{x}^{5}}}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      12. lower-neg.f6411.8%

        \[\leadsto \left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{-{x}^{5}}\right) \cdot \color{blue}{\left(-{x}^{5}\right)} \]
    3. Applied rewrites11.8%

      \[\leadsto \color{blue}{\left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{-{x}^{5}}\right) \cdot \left(-{x}^{5}\right)} \]
    4. Taylor expanded in eps around inf

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \color{blue}{\left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
      2. lower-pow.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(\color{blue}{1} + 5 \cdot \frac{x}{\varepsilon}\right) \]
      3. lower-+.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + \color{blue}{5 \cdot \frac{x}{\varepsilon}}\right) \]
      4. lower-*.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + 5 \cdot \color{blue}{\frac{x}{\varepsilon}}\right) \]
      5. lower-/.f6488.1%

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\color{blue}{\varepsilon}}\right) \]
    6. Applied rewrites88.1%

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
    7. Taylor expanded in x around 0

      \[\leadsto {\varepsilon}^{\color{blue}{5}} \]
    8. Step-by-step derivation
      1. lower-pow.f6487.9%

        \[\leadsto {\varepsilon}^{5} \]
    9. Applied rewrites87.9%

      \[\leadsto {\varepsilon}^{\color{blue}{5}} \]
    10. Taylor expanded in eps around 0

      \[\leadsto {\varepsilon}^{4} \cdot \color{blue}{\left(\varepsilon + 5 \cdot x\right)} \]
    11. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto {\varepsilon}^{4} \cdot \left(\varepsilon + \color{blue}{5 \cdot x}\right) \]
      2. lower-pow.f64N/A

        \[\leadsto {\varepsilon}^{4} \cdot \left(\varepsilon + \color{blue}{5} \cdot x\right) \]
      3. lower-+.f64N/A

        \[\leadsto {\varepsilon}^{4} \cdot \left(\varepsilon + 5 \cdot \color{blue}{x}\right) \]
      4. lower-*.f6488.0%

        \[\leadsto {\varepsilon}^{4} \cdot \left(\varepsilon + 5 \cdot x\right) \]
    12. Applied rewrites88.0%

      \[\leadsto {\varepsilon}^{4} \cdot \color{blue}{\left(\varepsilon + 5 \cdot x\right)} \]

    if -9.8813129168249309e-324 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0

    1. Initial program 89.0%

      \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{{x}^{4} \cdot \left(\varepsilon + 4 \cdot \varepsilon\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto {x}^{4} \cdot \color{blue}{\left(\varepsilon + 4 \cdot \varepsilon\right)} \]
      2. lower-pow.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\color{blue}{\varepsilon} + 4 \cdot \varepsilon\right) \]
      3. lower-+.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + \color{blue}{4 \cdot \varepsilon}\right) \]
      4. lower-*.f6482.1%

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + 4 \cdot \color{blue}{\varepsilon}\right) \]
    4. Applied rewrites82.1%

      \[\leadsto \color{blue}{{x}^{4} \cdot \left(\varepsilon + 4 \cdot \varepsilon\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto {x}^{4} \cdot \color{blue}{\left(\varepsilon + 4 \cdot \varepsilon\right)} \]
      2. lift-+.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + \color{blue}{4 \cdot \varepsilon}\right) \]
      3. lift-*.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + 4 \cdot \color{blue}{\varepsilon}\right) \]
      4. distribute-rgt1-inN/A

        \[\leadsto {x}^{4} \cdot \left(\left(4 + 1\right) \cdot \color{blue}{\varepsilon}\right) \]
      5. metadata-evalN/A

        \[\leadsto {x}^{4} \cdot \left(5 \cdot \varepsilon\right) \]
      6. associate-*r*N/A

        \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
      7. *-commutativeN/A

        \[\leadsto \left(5 \cdot {x}^{4}\right) \cdot \varepsilon \]
      8. metadata-evalN/A

        \[\leadsto \left(\left(4 + 1\right) \cdot {x}^{4}\right) \cdot \varepsilon \]
      9. distribute-lft1-inN/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      10. lift-*.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      11. lift-+.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      12. lower-*.f6482.1%

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \color{blue}{\varepsilon} \]
      13. lift-+.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      14. lift-*.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      15. distribute-lft1-inN/A

        \[\leadsto \left(\left(4 + 1\right) \cdot {x}^{4}\right) \cdot \varepsilon \]
      16. metadata-evalN/A

        \[\leadsto \left(5 \cdot {x}^{4}\right) \cdot \varepsilon \]
      17. *-commutativeN/A

        \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \varepsilon \]
      18. lower-*.f6482.1%

        \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \varepsilon \]
    6. Applied rewrites82.1%

      \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]

    if 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64)))

    1. Initial program 89.0%

      \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
    2. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \color{blue}{{\left(x + \varepsilon\right)}^{5} - {x}^{5}} \]
      2. sub-flipN/A

        \[\leadsto \color{blue}{{\left(x + \varepsilon\right)}^{5} + \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      3. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left({x}^{5}\right)\right) + {\left(x + \varepsilon\right)}^{5}} \]
      4. sum-to-multN/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      5. lower-unsound-*.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      6. lower-unsound-+.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right)} \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      7. lower-unsound-/.f64N/A

        \[\leadsto \left(1 + \color{blue}{\frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      8. lift-+.f64N/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(x + \varepsilon\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(\varepsilon + x\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      10. lower-+.f64N/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(\varepsilon + x\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      11. lower-neg.f64N/A

        \[\leadsto \left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{\color{blue}{-{x}^{5}}}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      12. lower-neg.f6411.8%

        \[\leadsto \left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{-{x}^{5}}\right) \cdot \color{blue}{\left(-{x}^{5}\right)} \]
    3. Applied rewrites11.8%

      \[\leadsto \color{blue}{\left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{-{x}^{5}}\right) \cdot \left(-{x}^{5}\right)} \]
    4. Taylor expanded in eps around inf

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \color{blue}{\left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
      2. lower-pow.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(\color{blue}{1} + 5 \cdot \frac{x}{\varepsilon}\right) \]
      3. lower-+.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + \color{blue}{5 \cdot \frac{x}{\varepsilon}}\right) \]
      4. lower-*.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + 5 \cdot \color{blue}{\frac{x}{\varepsilon}}\right) \]
      5. lower-/.f6488.1%

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\color{blue}{\varepsilon}}\right) \]
    6. Applied rewrites88.1%

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
    7. Taylor expanded in x around 0

      \[\leadsto {\varepsilon}^{\color{blue}{5}} \]
    8. Step-by-step derivation
      1. lower-pow.f6487.9%

        \[\leadsto {\varepsilon}^{5} \]
    9. Applied rewrites87.9%

      \[\leadsto {\varepsilon}^{\color{blue}{5}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 98.4% accurate, 0.4× speedup?

\[\begin{array}{l} t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\ \mathbf{if}\;t\_0 \leq -1 \cdot 10^{-323}:\\ \;\;\;\;{\varepsilon}^{5}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\left({x}^{4} \cdot 5\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;{\varepsilon}^{5}\\ \end{array} \]
(FPCore (x eps)
  :precision binary64
  (let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
  (if (<= t_0 -1e-323)
    (pow eps 5.0)
    (if (<= t_0 0.0) (* (* (pow x 4.0) 5.0) eps) (pow eps 5.0)))))
double code(double x, double eps) {
	double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
	double tmp;
	if (t_0 <= -1e-323) {
		tmp = pow(eps, 5.0);
	} else if (t_0 <= 0.0) {
		tmp = (pow(x, 4.0) * 5.0) * eps;
	} else {
		tmp = pow(eps, 5.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 + eps) ** 5.0d0) - (x ** 5.0d0)
    if (t_0 <= (-1d-323)) then
        tmp = eps ** 5.0d0
    else if (t_0 <= 0.0d0) then
        tmp = ((x ** 4.0d0) * 5.0d0) * eps
    else
        tmp = eps ** 5.0d0
    end if
    code = tmp
end function
public static double code(double x, double eps) {
	double t_0 = Math.pow((x + eps), 5.0) - Math.pow(x, 5.0);
	double tmp;
	if (t_0 <= -1e-323) {
		tmp = Math.pow(eps, 5.0);
	} else if (t_0 <= 0.0) {
		tmp = (Math.pow(x, 4.0) * 5.0) * eps;
	} else {
		tmp = Math.pow(eps, 5.0);
	}
	return tmp;
}
def code(x, eps):
	t_0 = math.pow((x + eps), 5.0) - math.pow(x, 5.0)
	tmp = 0
	if t_0 <= -1e-323:
		tmp = math.pow(eps, 5.0)
	elif t_0 <= 0.0:
		tmp = (math.pow(x, 4.0) * 5.0) * eps
	else:
		tmp = math.pow(eps, 5.0)
	return tmp
function code(x, eps)
	t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0))
	tmp = 0.0
	if (t_0 <= -1e-323)
		tmp = eps ^ 5.0;
	elseif (t_0 <= 0.0)
		tmp = Float64(Float64((x ^ 4.0) * 5.0) * eps);
	else
		tmp = eps ^ 5.0;
	end
	return tmp
end
function tmp_2 = code(x, eps)
	t_0 = ((x + eps) ^ 5.0) - (x ^ 5.0);
	tmp = 0.0;
	if (t_0 <= -1e-323)
		tmp = eps ^ 5.0;
	elseif (t_0 <= 0.0)
		tmp = ((x ^ 4.0) * 5.0) * eps;
	else
		tmp = eps ^ 5.0;
	end
	tmp_2 = tmp;
end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-323], N[Power[eps, 5.0], $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[Power[x, 4.0], $MachinePrecision] * 5.0), $MachinePrecision] * eps), $MachinePrecision], N[Power[eps, 5.0], $MachinePrecision]]]]
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-323}:\\
\;\;\;\;{\varepsilon}^{5}\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left({x}^{4} \cdot 5\right) \cdot \varepsilon\\

\mathbf{else}:\\
\;\;\;\;{\varepsilon}^{5}\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -9.8813129168249309e-324 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64)))

    1. Initial program 89.0%

      \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
    2. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \color{blue}{{\left(x + \varepsilon\right)}^{5} - {x}^{5}} \]
      2. sub-flipN/A

        \[\leadsto \color{blue}{{\left(x + \varepsilon\right)}^{5} + \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      3. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left({x}^{5}\right)\right) + {\left(x + \varepsilon\right)}^{5}} \]
      4. sum-to-multN/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      5. lower-unsound-*.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      6. lower-unsound-+.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right)} \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      7. lower-unsound-/.f64N/A

        \[\leadsto \left(1 + \color{blue}{\frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      8. lift-+.f64N/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(x + \varepsilon\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(\varepsilon + x\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      10. lower-+.f64N/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(\varepsilon + x\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      11. lower-neg.f64N/A

        \[\leadsto \left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{\color{blue}{-{x}^{5}}}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      12. lower-neg.f6411.8%

        \[\leadsto \left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{-{x}^{5}}\right) \cdot \color{blue}{\left(-{x}^{5}\right)} \]
    3. Applied rewrites11.8%

      \[\leadsto \color{blue}{\left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{-{x}^{5}}\right) \cdot \left(-{x}^{5}\right)} \]
    4. Taylor expanded in eps around inf

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \color{blue}{\left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
      2. lower-pow.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(\color{blue}{1} + 5 \cdot \frac{x}{\varepsilon}\right) \]
      3. lower-+.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + \color{blue}{5 \cdot \frac{x}{\varepsilon}}\right) \]
      4. lower-*.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + 5 \cdot \color{blue}{\frac{x}{\varepsilon}}\right) \]
      5. lower-/.f6488.1%

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\color{blue}{\varepsilon}}\right) \]
    6. Applied rewrites88.1%

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
    7. Taylor expanded in x around 0

      \[\leadsto {\varepsilon}^{\color{blue}{5}} \]
    8. Step-by-step derivation
      1. lower-pow.f6487.9%

        \[\leadsto {\varepsilon}^{5} \]
    9. Applied rewrites87.9%

      \[\leadsto {\varepsilon}^{\color{blue}{5}} \]

    if -9.8813129168249309e-324 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0

    1. Initial program 89.0%

      \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{{x}^{4} \cdot \left(\varepsilon + 4 \cdot \varepsilon\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto {x}^{4} \cdot \color{blue}{\left(\varepsilon + 4 \cdot \varepsilon\right)} \]
      2. lower-pow.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\color{blue}{\varepsilon} + 4 \cdot \varepsilon\right) \]
      3. lower-+.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + \color{blue}{4 \cdot \varepsilon}\right) \]
      4. lower-*.f6482.1%

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + 4 \cdot \color{blue}{\varepsilon}\right) \]
    4. Applied rewrites82.1%

      \[\leadsto \color{blue}{{x}^{4} \cdot \left(\varepsilon + 4 \cdot \varepsilon\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto {x}^{4} \cdot \color{blue}{\left(\varepsilon + 4 \cdot \varepsilon\right)} \]
      2. lift-+.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + \color{blue}{4 \cdot \varepsilon}\right) \]
      3. lift-*.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + 4 \cdot \color{blue}{\varepsilon}\right) \]
      4. distribute-rgt1-inN/A

        \[\leadsto {x}^{4} \cdot \left(\left(4 + 1\right) \cdot \color{blue}{\varepsilon}\right) \]
      5. metadata-evalN/A

        \[\leadsto {x}^{4} \cdot \left(5 \cdot \varepsilon\right) \]
      6. associate-*r*N/A

        \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
      7. *-commutativeN/A

        \[\leadsto \left(5 \cdot {x}^{4}\right) \cdot \varepsilon \]
      8. metadata-evalN/A

        \[\leadsto \left(\left(4 + 1\right) \cdot {x}^{4}\right) \cdot \varepsilon \]
      9. distribute-lft1-inN/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      10. lift-*.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      11. lift-+.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      12. lower-*.f6482.1%

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \color{blue}{\varepsilon} \]
      13. lift-+.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      14. lift-*.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      15. distribute-lft1-inN/A

        \[\leadsto \left(\left(4 + 1\right) \cdot {x}^{4}\right) \cdot \varepsilon \]
      16. metadata-evalN/A

        \[\leadsto \left(5 \cdot {x}^{4}\right) \cdot \varepsilon \]
      17. *-commutativeN/A

        \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \varepsilon \]
      18. lower-*.f6482.1%

        \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \varepsilon \]
    6. Applied rewrites82.1%

      \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 98.4% accurate, 0.4× speedup?

\[\begin{array}{l} t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\ \mathbf{if}\;t\_0 \leq -1 \cdot 10^{-323}:\\ \;\;\;\;{\varepsilon}^{5}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 5\right) \cdot \varepsilon\\ \mathbf{else}:\\ \;\;\;\;{\varepsilon}^{5}\\ \end{array} \]
(FPCore (x eps)
  :precision binary64
  (let* ((t_0 (- (pow (+ x eps) 5.0) (pow x 5.0))))
  (if (<= t_0 -1e-323)
    (pow eps 5.0)
    (if (<= t_0 0.0)
      (* (* (* (* x x) (* x x)) 5.0) eps)
      (pow eps 5.0)))))
double code(double x, double eps) {
	double t_0 = pow((x + eps), 5.0) - pow(x, 5.0);
	double tmp;
	if (t_0 <= -1e-323) {
		tmp = pow(eps, 5.0);
	} else if (t_0 <= 0.0) {
		tmp = (((x * x) * (x * x)) * 5.0) * eps;
	} else {
		tmp = pow(eps, 5.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 + eps) ** 5.0d0) - (x ** 5.0d0)
    if (t_0 <= (-1d-323)) then
        tmp = eps ** 5.0d0
    else if (t_0 <= 0.0d0) then
        tmp = (((x * x) * (x * x)) * 5.0d0) * eps
    else
        tmp = eps ** 5.0d0
    end if
    code = tmp
end function
public static double code(double x, double eps) {
	double t_0 = Math.pow((x + eps), 5.0) - Math.pow(x, 5.0);
	double tmp;
	if (t_0 <= -1e-323) {
		tmp = Math.pow(eps, 5.0);
	} else if (t_0 <= 0.0) {
		tmp = (((x * x) * (x * x)) * 5.0) * eps;
	} else {
		tmp = Math.pow(eps, 5.0);
	}
	return tmp;
}
def code(x, eps):
	t_0 = math.pow((x + eps), 5.0) - math.pow(x, 5.0)
	tmp = 0
	if t_0 <= -1e-323:
		tmp = math.pow(eps, 5.0)
	elif t_0 <= 0.0:
		tmp = (((x * x) * (x * x)) * 5.0) * eps
	else:
		tmp = math.pow(eps, 5.0)
	return tmp
function code(x, eps)
	t_0 = Float64((Float64(x + eps) ^ 5.0) - (x ^ 5.0))
	tmp = 0.0
	if (t_0 <= -1e-323)
		tmp = eps ^ 5.0;
	elseif (t_0 <= 0.0)
		tmp = Float64(Float64(Float64(Float64(x * x) * Float64(x * x)) * 5.0) * eps);
	else
		tmp = eps ^ 5.0;
	end
	return tmp
end
function tmp_2 = code(x, eps)
	t_0 = ((x + eps) ^ 5.0) - (x ^ 5.0);
	tmp = 0.0;
	if (t_0 <= -1e-323)
		tmp = eps ^ 5.0;
	elseif (t_0 <= 0.0)
		tmp = (((x * x) * (x * x)) * 5.0) * eps;
	else
		tmp = eps ^ 5.0;
	end
	tmp_2 = tmp;
end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[N[(x + eps), $MachinePrecision], 5.0], $MachinePrecision] - N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-323], N[Power[eps, 5.0], $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[(N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * 5.0), $MachinePrecision] * eps), $MachinePrecision], N[Power[eps, 5.0], $MachinePrecision]]]]
\begin{array}{l}
t_0 := {\left(x + \varepsilon\right)}^{5} - {x}^{5}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-323}:\\
\;\;\;\;{\varepsilon}^{5}\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 5\right) \cdot \varepsilon\\

\mathbf{else}:\\
\;\;\;\;{\varepsilon}^{5}\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < -9.8813129168249309e-324 or 0.0 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64)))

    1. Initial program 89.0%

      \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
    2. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \color{blue}{{\left(x + \varepsilon\right)}^{5} - {x}^{5}} \]
      2. sub-flipN/A

        \[\leadsto \color{blue}{{\left(x + \varepsilon\right)}^{5} + \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      3. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left({x}^{5}\right)\right) + {\left(x + \varepsilon\right)}^{5}} \]
      4. sum-to-multN/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      5. lower-unsound-*.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right)} \]
      6. lower-unsound-+.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right)} \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      7. lower-unsound-/.f64N/A

        \[\leadsto \left(1 + \color{blue}{\frac{{\left(x + \varepsilon\right)}^{5}}{\mathsf{neg}\left({x}^{5}\right)}}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      8. lift-+.f64N/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(x + \varepsilon\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(\varepsilon + x\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      10. lower-+.f64N/A

        \[\leadsto \left(1 + \frac{{\color{blue}{\left(\varepsilon + x\right)}}^{5}}{\mathsf{neg}\left({x}^{5}\right)}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      11. lower-neg.f64N/A

        \[\leadsto \left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{\color{blue}{-{x}^{5}}}\right) \cdot \left(\mathsf{neg}\left({x}^{5}\right)\right) \]
      12. lower-neg.f6411.8%

        \[\leadsto \left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{-{x}^{5}}\right) \cdot \color{blue}{\left(-{x}^{5}\right)} \]
    3. Applied rewrites11.8%

      \[\leadsto \color{blue}{\left(1 + \frac{{\left(\varepsilon + x\right)}^{5}}{-{x}^{5}}\right) \cdot \left(-{x}^{5}\right)} \]
    4. Taylor expanded in eps around inf

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \color{blue}{\left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
      2. lower-pow.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(\color{blue}{1} + 5 \cdot \frac{x}{\varepsilon}\right) \]
      3. lower-+.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + \color{blue}{5 \cdot \frac{x}{\varepsilon}}\right) \]
      4. lower-*.f64N/A

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + 5 \cdot \color{blue}{\frac{x}{\varepsilon}}\right) \]
      5. lower-/.f6488.1%

        \[\leadsto {\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\color{blue}{\varepsilon}}\right) \]
    6. Applied rewrites88.1%

      \[\leadsto \color{blue}{{\varepsilon}^{5} \cdot \left(1 + 5 \cdot \frac{x}{\varepsilon}\right)} \]
    7. Taylor expanded in x around 0

      \[\leadsto {\varepsilon}^{\color{blue}{5}} \]
    8. Step-by-step derivation
      1. lower-pow.f6487.9%

        \[\leadsto {\varepsilon}^{5} \]
    9. Applied rewrites87.9%

      \[\leadsto {\varepsilon}^{\color{blue}{5}} \]

    if -9.8813129168249309e-324 < (-.f64 (pow.f64 (+.f64 x eps) #s(literal 5 binary64)) (pow.f64 x #s(literal 5 binary64))) < 0.0

    1. Initial program 89.0%

      \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
    2. Taylor expanded in x around inf

      \[\leadsto \color{blue}{{x}^{4} \cdot \left(\varepsilon + 4 \cdot \varepsilon\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto {x}^{4} \cdot \color{blue}{\left(\varepsilon + 4 \cdot \varepsilon\right)} \]
      2. lower-pow.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\color{blue}{\varepsilon} + 4 \cdot \varepsilon\right) \]
      3. lower-+.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + \color{blue}{4 \cdot \varepsilon}\right) \]
      4. lower-*.f6482.1%

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + 4 \cdot \color{blue}{\varepsilon}\right) \]
    4. Applied rewrites82.1%

      \[\leadsto \color{blue}{{x}^{4} \cdot \left(\varepsilon + 4 \cdot \varepsilon\right)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto {x}^{4} \cdot \color{blue}{\left(\varepsilon + 4 \cdot \varepsilon\right)} \]
      2. lift-+.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + \color{blue}{4 \cdot \varepsilon}\right) \]
      3. lift-*.f64N/A

        \[\leadsto {x}^{4} \cdot \left(\varepsilon + 4 \cdot \color{blue}{\varepsilon}\right) \]
      4. distribute-rgt1-inN/A

        \[\leadsto {x}^{4} \cdot \left(\left(4 + 1\right) \cdot \color{blue}{\varepsilon}\right) \]
      5. metadata-evalN/A

        \[\leadsto {x}^{4} \cdot \left(5 \cdot \varepsilon\right) \]
      6. associate-*r*N/A

        \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
      7. *-commutativeN/A

        \[\leadsto \left(5 \cdot {x}^{4}\right) \cdot \varepsilon \]
      8. metadata-evalN/A

        \[\leadsto \left(\left(4 + 1\right) \cdot {x}^{4}\right) \cdot \varepsilon \]
      9. distribute-lft1-inN/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      10. lift-*.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      11. lift-+.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      12. lower-*.f6482.1%

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \color{blue}{\varepsilon} \]
      13. lift-+.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      14. lift-*.f64N/A

        \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
      15. distribute-lft1-inN/A

        \[\leadsto \left(\left(4 + 1\right) \cdot {x}^{4}\right) \cdot \varepsilon \]
      16. metadata-evalN/A

        \[\leadsto \left(5 \cdot {x}^{4}\right) \cdot \varepsilon \]
      17. *-commutativeN/A

        \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \varepsilon \]
      18. lower-*.f6482.1%

        \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \varepsilon \]
    6. Applied rewrites82.1%

      \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
      2. lift-*.f64N/A

        \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \varepsilon \]
      3. *-commutativeN/A

        \[\leadsto \left(5 \cdot {x}^{4}\right) \cdot \varepsilon \]
      4. associate-*l*N/A

        \[\leadsto 5 \cdot \color{blue}{\left({x}^{4} \cdot \varepsilon\right)} \]
      5. *-commutativeN/A

        \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot \color{blue}{5} \]
      6. lower-*.f64N/A

        \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot \color{blue}{5} \]
      7. lower-*.f6482.1%

        \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot 5 \]
    8. Applied rewrites82.1%

      \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot \color{blue}{5} \]
    9. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot \color{blue}{5} \]
      2. lift-*.f64N/A

        \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot 5 \]
      3. lift-pow.f64N/A

        \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot 5 \]
      4. exp-to-powN/A

        \[\leadsto \left(e^{\log x \cdot 4} \cdot \varepsilon\right) \cdot 5 \]
      5. lift-log.f64N/A

        \[\leadsto \left(e^{\log x \cdot 4} \cdot \varepsilon\right) \cdot 5 \]
      6. lift-*.f64N/A

        \[\leadsto \left(e^{\log x \cdot 4} \cdot \varepsilon\right) \cdot 5 \]
      7. lift-exp.f64N/A

        \[\leadsto \left(e^{\log x \cdot 4} \cdot \varepsilon\right) \cdot 5 \]
      8. associate-*l*N/A

        \[\leadsto e^{\log x \cdot 4} \cdot \color{blue}{\left(\varepsilon \cdot 5\right)} \]
      9. *-commutativeN/A

        \[\leadsto e^{\log x \cdot 4} \cdot \left(5 \cdot \color{blue}{\varepsilon}\right) \]
      10. associate-*l*N/A

        \[\leadsto \left(e^{\log x \cdot 4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
      11. lift-*.f64N/A

        \[\leadsto \left(e^{\log x \cdot 4} \cdot 5\right) \cdot \varepsilon \]
      12. lift-*.f6440.7%

        \[\leadsto \left(e^{\log x \cdot 4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
    10. Applied rewrites82.1%

      \[\leadsto \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 82.1% accurate, 8.0× speedup?

\[\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 5\right) \cdot \varepsilon \]
(FPCore (x eps)
  :precision binary64
  (* (* (* (* x x) (* x x)) 5.0) eps))
double code(double x, double eps) {
	return (((x * x) * (x * x)) * 5.0) * 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 = (((x * x) * (x * x)) * 5.0d0) * eps
end function
public static double code(double x, double eps) {
	return (((x * x) * (x * x)) * 5.0) * eps;
}
def code(x, eps):
	return (((x * x) * (x * x)) * 5.0) * eps
function code(x, eps)
	return Float64(Float64(Float64(Float64(x * x) * Float64(x * x)) * 5.0) * eps)
end
function tmp = code(x, eps)
	tmp = (((x * x) * (x * x)) * 5.0) * eps;
end
code[x_, eps_] := N[(N[(N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * 5.0), $MachinePrecision] * eps), $MachinePrecision]
\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 5\right) \cdot \varepsilon
Derivation
  1. Initial program 89.0%

    \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
  2. Taylor expanded in x around inf

    \[\leadsto \color{blue}{{x}^{4} \cdot \left(\varepsilon + 4 \cdot \varepsilon\right)} \]
  3. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto {x}^{4} \cdot \color{blue}{\left(\varepsilon + 4 \cdot \varepsilon\right)} \]
    2. lower-pow.f64N/A

      \[\leadsto {x}^{4} \cdot \left(\color{blue}{\varepsilon} + 4 \cdot \varepsilon\right) \]
    3. lower-+.f64N/A

      \[\leadsto {x}^{4} \cdot \left(\varepsilon + \color{blue}{4 \cdot \varepsilon}\right) \]
    4. lower-*.f6482.1%

      \[\leadsto {x}^{4} \cdot \left(\varepsilon + 4 \cdot \color{blue}{\varepsilon}\right) \]
  4. Applied rewrites82.1%

    \[\leadsto \color{blue}{{x}^{4} \cdot \left(\varepsilon + 4 \cdot \varepsilon\right)} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto {x}^{4} \cdot \color{blue}{\left(\varepsilon + 4 \cdot \varepsilon\right)} \]
    2. lift-+.f64N/A

      \[\leadsto {x}^{4} \cdot \left(\varepsilon + \color{blue}{4 \cdot \varepsilon}\right) \]
    3. lift-*.f64N/A

      \[\leadsto {x}^{4} \cdot \left(\varepsilon + 4 \cdot \color{blue}{\varepsilon}\right) \]
    4. distribute-rgt1-inN/A

      \[\leadsto {x}^{4} \cdot \left(\left(4 + 1\right) \cdot \color{blue}{\varepsilon}\right) \]
    5. metadata-evalN/A

      \[\leadsto {x}^{4} \cdot \left(5 \cdot \varepsilon\right) \]
    6. associate-*r*N/A

      \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
    7. *-commutativeN/A

      \[\leadsto \left(5 \cdot {x}^{4}\right) \cdot \varepsilon \]
    8. metadata-evalN/A

      \[\leadsto \left(\left(4 + 1\right) \cdot {x}^{4}\right) \cdot \varepsilon \]
    9. distribute-lft1-inN/A

      \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
    10. lift-*.f64N/A

      \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
    11. lift-+.f64N/A

      \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
    12. lower-*.f6482.1%

      \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \color{blue}{\varepsilon} \]
    13. lift-+.f64N/A

      \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
    14. lift-*.f64N/A

      \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
    15. distribute-lft1-inN/A

      \[\leadsto \left(\left(4 + 1\right) \cdot {x}^{4}\right) \cdot \varepsilon \]
    16. metadata-evalN/A

      \[\leadsto \left(5 \cdot {x}^{4}\right) \cdot \varepsilon \]
    17. *-commutativeN/A

      \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \varepsilon \]
    18. lower-*.f6482.1%

      \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \varepsilon \]
  6. Applied rewrites82.1%

    \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
  7. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
    2. lift-*.f64N/A

      \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \varepsilon \]
    3. *-commutativeN/A

      \[\leadsto \left(5 \cdot {x}^{4}\right) \cdot \varepsilon \]
    4. associate-*l*N/A

      \[\leadsto 5 \cdot \color{blue}{\left({x}^{4} \cdot \varepsilon\right)} \]
    5. *-commutativeN/A

      \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot \color{blue}{5} \]
    6. lower-*.f64N/A

      \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot \color{blue}{5} \]
    7. lower-*.f6482.1%

      \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot 5 \]
  8. Applied rewrites82.1%

    \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot \color{blue}{5} \]
  9. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot \color{blue}{5} \]
    2. lift-*.f64N/A

      \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot 5 \]
    3. lift-pow.f64N/A

      \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot 5 \]
    4. exp-to-powN/A

      \[\leadsto \left(e^{\log x \cdot 4} \cdot \varepsilon\right) \cdot 5 \]
    5. lift-log.f64N/A

      \[\leadsto \left(e^{\log x \cdot 4} \cdot \varepsilon\right) \cdot 5 \]
    6. lift-*.f64N/A

      \[\leadsto \left(e^{\log x \cdot 4} \cdot \varepsilon\right) \cdot 5 \]
    7. lift-exp.f64N/A

      \[\leadsto \left(e^{\log x \cdot 4} \cdot \varepsilon\right) \cdot 5 \]
    8. associate-*l*N/A

      \[\leadsto e^{\log x \cdot 4} \cdot \color{blue}{\left(\varepsilon \cdot 5\right)} \]
    9. *-commutativeN/A

      \[\leadsto e^{\log x \cdot 4} \cdot \left(5 \cdot \color{blue}{\varepsilon}\right) \]
    10. associate-*l*N/A

      \[\leadsto \left(e^{\log x \cdot 4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
    11. lift-*.f64N/A

      \[\leadsto \left(e^{\log x \cdot 4} \cdot 5\right) \cdot \varepsilon \]
    12. lift-*.f6440.7%

      \[\leadsto \left(e^{\log x \cdot 4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
  10. Applied rewrites82.1%

    \[\leadsto \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
  11. Add Preprocessing

Alternative 7: 82.1% accurate, 8.0× speedup?

\[\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(5 \cdot \varepsilon\right) \]
(FPCore (x eps)
  :precision binary64
  (* (* (* x x) (* x x)) (* 5.0 eps)))
double code(double x, double eps) {
	return ((x * x) * (x * x)) * (5.0 * 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 = ((x * x) * (x * x)) * (5.0d0 * eps)
end function
public static double code(double x, double eps) {
	return ((x * x) * (x * x)) * (5.0 * eps);
}
def code(x, eps):
	return ((x * x) * (x * x)) * (5.0 * eps)
function code(x, eps)
	return Float64(Float64(Float64(x * x) * Float64(x * x)) * Float64(5.0 * eps))
end
function tmp = code(x, eps)
	tmp = ((x * x) * (x * x)) * (5.0 * eps);
end
code[x_, eps_] := N[(N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(5.0 * eps), $MachinePrecision]), $MachinePrecision]
\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(5 \cdot \varepsilon\right)
Derivation
  1. Initial program 89.0%

    \[{\left(x + \varepsilon\right)}^{5} - {x}^{5} \]
  2. Taylor expanded in x around inf

    \[\leadsto \color{blue}{{x}^{4} \cdot \left(\varepsilon + 4 \cdot \varepsilon\right)} \]
  3. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto {x}^{4} \cdot \color{blue}{\left(\varepsilon + 4 \cdot \varepsilon\right)} \]
    2. lower-pow.f64N/A

      \[\leadsto {x}^{4} \cdot \left(\color{blue}{\varepsilon} + 4 \cdot \varepsilon\right) \]
    3. lower-+.f64N/A

      \[\leadsto {x}^{4} \cdot \left(\varepsilon + \color{blue}{4 \cdot \varepsilon}\right) \]
    4. lower-*.f6482.1%

      \[\leadsto {x}^{4} \cdot \left(\varepsilon + 4 \cdot \color{blue}{\varepsilon}\right) \]
  4. Applied rewrites82.1%

    \[\leadsto \color{blue}{{x}^{4} \cdot \left(\varepsilon + 4 \cdot \varepsilon\right)} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto {x}^{4} \cdot \color{blue}{\left(\varepsilon + 4 \cdot \varepsilon\right)} \]
    2. lift-+.f64N/A

      \[\leadsto {x}^{4} \cdot \left(\varepsilon + \color{blue}{4 \cdot \varepsilon}\right) \]
    3. lift-*.f64N/A

      \[\leadsto {x}^{4} \cdot \left(\varepsilon + 4 \cdot \color{blue}{\varepsilon}\right) \]
    4. distribute-rgt1-inN/A

      \[\leadsto {x}^{4} \cdot \left(\left(4 + 1\right) \cdot \color{blue}{\varepsilon}\right) \]
    5. metadata-evalN/A

      \[\leadsto {x}^{4} \cdot \left(5 \cdot \varepsilon\right) \]
    6. associate-*r*N/A

      \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
    7. *-commutativeN/A

      \[\leadsto \left(5 \cdot {x}^{4}\right) \cdot \varepsilon \]
    8. metadata-evalN/A

      \[\leadsto \left(\left(4 + 1\right) \cdot {x}^{4}\right) \cdot \varepsilon \]
    9. distribute-lft1-inN/A

      \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
    10. lift-*.f64N/A

      \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
    11. lift-+.f64N/A

      \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
    12. lower-*.f6482.1%

      \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \color{blue}{\varepsilon} \]
    13. lift-+.f64N/A

      \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
    14. lift-*.f64N/A

      \[\leadsto \left(4 \cdot {x}^{4} + {x}^{4}\right) \cdot \varepsilon \]
    15. distribute-lft1-inN/A

      \[\leadsto \left(\left(4 + 1\right) \cdot {x}^{4}\right) \cdot \varepsilon \]
    16. metadata-evalN/A

      \[\leadsto \left(5 \cdot {x}^{4}\right) \cdot \varepsilon \]
    17. *-commutativeN/A

      \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \varepsilon \]
    18. lower-*.f6482.1%

      \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \varepsilon \]
  6. Applied rewrites82.1%

    \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
  7. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \color{blue}{\varepsilon} \]
    2. lift-*.f64N/A

      \[\leadsto \left({x}^{4} \cdot 5\right) \cdot \varepsilon \]
    3. *-commutativeN/A

      \[\leadsto \left(5 \cdot {x}^{4}\right) \cdot \varepsilon \]
    4. associate-*l*N/A

      \[\leadsto 5 \cdot \color{blue}{\left({x}^{4} \cdot \varepsilon\right)} \]
    5. *-commutativeN/A

      \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot \color{blue}{5} \]
    6. lower-*.f64N/A

      \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot \color{blue}{5} \]
    7. lower-*.f6482.1%

      \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot 5 \]
  8. Applied rewrites82.1%

    \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot \color{blue}{5} \]
  9. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot \color{blue}{5} \]
    2. lift-*.f64N/A

      \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot 5 \]
    3. lift-pow.f64N/A

      \[\leadsto \left({x}^{4} \cdot \varepsilon\right) \cdot 5 \]
    4. exp-to-powN/A

      \[\leadsto \left(e^{\log x \cdot 4} \cdot \varepsilon\right) \cdot 5 \]
    5. lift-log.f64N/A

      \[\leadsto \left(e^{\log x \cdot 4} \cdot \varepsilon\right) \cdot 5 \]
    6. lift-*.f64N/A

      \[\leadsto \left(e^{\log x \cdot 4} \cdot \varepsilon\right) \cdot 5 \]
    7. lift-exp.f64N/A

      \[\leadsto \left(e^{\log x \cdot 4} \cdot \varepsilon\right) \cdot 5 \]
    8. associate-*l*N/A

      \[\leadsto e^{\log x \cdot 4} \cdot \color{blue}{\left(\varepsilon \cdot 5\right)} \]
    9. *-commutativeN/A

      \[\leadsto e^{\log x \cdot 4} \cdot \left(5 \cdot \color{blue}{\varepsilon}\right) \]
    10. lift-*.f64N/A

      \[\leadsto e^{\log x \cdot 4} \cdot \left(5 \cdot \color{blue}{\varepsilon}\right) \]
    11. lower-*.f6440.7%

      \[\leadsto e^{\log x \cdot 4} \cdot \color{blue}{\left(5 \cdot \varepsilon\right)} \]
  10. Applied rewrites82.1%

    \[\leadsto \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{\left(5 \cdot \varepsilon\right)} \]
  11. Add Preprocessing

Reproduce

?
herbie shell --seed 2025258 
(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)))