From Rump in a 1983 paper

Percentage Accurate: 18.8% → 30.9%
Time: 4.3s
Alternatives: 12
Speedup: 4.3×

Specification

?
\[x = 10864 \land y = 18817\]
\[\begin{array}{l} \\ \left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \end{array} \]
(FPCore (x y)
 :precision binary64
 (+ (- (* 9.0 (pow x 4.0)) (pow y 4.0)) (* 2.0 (* y y))))
double code(double x, double y) {
	return ((9.0 * pow(x, 4.0)) - pow(y, 4.0)) + (2.0 * (y * y));
}
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, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((9.0d0 * (x ** 4.0d0)) - (y ** 4.0d0)) + (2.0d0 * (y * y))
end function
public static double code(double x, double y) {
	return ((9.0 * Math.pow(x, 4.0)) - Math.pow(y, 4.0)) + (2.0 * (y * y));
}
def code(x, y):
	return ((9.0 * math.pow(x, 4.0)) - math.pow(y, 4.0)) + (2.0 * (y * y))
function code(x, y)
	return Float64(Float64(Float64(9.0 * (x ^ 4.0)) - (y ^ 4.0)) + Float64(2.0 * Float64(y * y)))
end
function tmp = code(x, y)
	tmp = ((9.0 * (x ^ 4.0)) - (y ^ 4.0)) + (2.0 * (y * y));
end
code[x_, y_] := N[(N[(N[(9.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right)
\end{array}

Sampling outcomes in binary64 precision:

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 12 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: 18.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \end{array} \]
(FPCore (x y)
 :precision binary64
 (+ (- (* 9.0 (pow x 4.0)) (pow y 4.0)) (* 2.0 (* y y))))
double code(double x, double y) {
	return ((9.0 * pow(x, 4.0)) - pow(y, 4.0)) + (2.0 * (y * y));
}
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, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((9.0d0 * (x ** 4.0d0)) - (y ** 4.0d0)) + (2.0d0 * (y * y))
end function
public static double code(double x, double y) {
	return ((9.0 * Math.pow(x, 4.0)) - Math.pow(y, 4.0)) + (2.0 * (y * y));
}
def code(x, y):
	return ((9.0 * math.pow(x, 4.0)) - math.pow(y, 4.0)) + (2.0 * (y * y))
function code(x, y)
	return Float64(Float64(Float64(9.0 * (x ^ 4.0)) - (y ^ 4.0)) + Float64(2.0 * Float64(y * y)))
end
function tmp = code(x, y)
	tmp = ((9.0 * (x ^ 4.0)) - (y ^ 4.0)) + (2.0 * (y * y));
end
code[x_, y_] := N[(N[(N[(9.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right)
\end{array}

Alternative 1: 30.9% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\\ t_1 := \log y \cdot 2\\ t_2 := {x}^{4} \cdot 9 - {y}^{4}\\ t_3 := {x}^{8} \cdot 81\\ \frac{{t\_2}^{3} - {\left(-2 \cdot \left(\cosh t\_1 + \sinh t\_1\right)\right)}^{3}}{\frac{{t\_3}^{3} + {t\_0}^{3}}{{t\_3}^{2} + \left({t\_0}^{2} - t\_3 \cdot t\_0\right)} + \left({y}^{4} \cdot 4 + t\_2 \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (+ (* (pow (* y x) 4.0) -18.0) (pow y 8.0)))
        (t_1 (* (log y) 2.0))
        (t_2 (- (* (pow x 4.0) 9.0) (pow y 4.0)))
        (t_3 (* (pow x 8.0) 81.0)))
   (/
    (- (pow t_2 3.0) (pow (* -2.0 (+ (cosh t_1) (sinh t_1))) 3.0))
    (+
     (/
      (+ (pow t_3 3.0) (pow t_0 3.0))
      (+ (pow t_3 2.0) (- (pow t_0 2.0) (* t_3 t_0))))
     (+ (* (pow y 4.0) 4.0) (* t_2 (* -2.0 (* y y))))))))
double code(double x, double y) {
	double t_0 = (pow((y * x), 4.0) * -18.0) + pow(y, 8.0);
	double t_1 = log(y) * 2.0;
	double t_2 = (pow(x, 4.0) * 9.0) - pow(y, 4.0);
	double t_3 = pow(x, 8.0) * 81.0;
	return (pow(t_2, 3.0) - pow((-2.0 * (cosh(t_1) + sinh(t_1))), 3.0)) / (((pow(t_3, 3.0) + pow(t_0, 3.0)) / (pow(t_3, 2.0) + (pow(t_0, 2.0) - (t_3 * t_0)))) + ((pow(y, 4.0) * 4.0) + (t_2 * (-2.0 * (y * y)))));
}
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, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    t_0 = (((y * x) ** 4.0d0) * (-18.0d0)) + (y ** 8.0d0)
    t_1 = log(y) * 2.0d0
    t_2 = ((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)
    t_3 = (x ** 8.0d0) * 81.0d0
    code = ((t_2 ** 3.0d0) - (((-2.0d0) * (cosh(t_1) + sinh(t_1))) ** 3.0d0)) / ((((t_3 ** 3.0d0) + (t_0 ** 3.0d0)) / ((t_3 ** 2.0d0) + ((t_0 ** 2.0d0) - (t_3 * t_0)))) + (((y ** 4.0d0) * 4.0d0) + (t_2 * ((-2.0d0) * (y * y)))))
end function
public static double code(double x, double y) {
	double t_0 = (Math.pow((y * x), 4.0) * -18.0) + Math.pow(y, 8.0);
	double t_1 = Math.log(y) * 2.0;
	double t_2 = (Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0);
	double t_3 = Math.pow(x, 8.0) * 81.0;
	return (Math.pow(t_2, 3.0) - Math.pow((-2.0 * (Math.cosh(t_1) + Math.sinh(t_1))), 3.0)) / (((Math.pow(t_3, 3.0) + Math.pow(t_0, 3.0)) / (Math.pow(t_3, 2.0) + (Math.pow(t_0, 2.0) - (t_3 * t_0)))) + ((Math.pow(y, 4.0) * 4.0) + (t_2 * (-2.0 * (y * y)))));
}
def code(x, y):
	t_0 = (math.pow((y * x), 4.0) * -18.0) + math.pow(y, 8.0)
	t_1 = math.log(y) * 2.0
	t_2 = (math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0)
	t_3 = math.pow(x, 8.0) * 81.0
	return (math.pow(t_2, 3.0) - math.pow((-2.0 * (math.cosh(t_1) + math.sinh(t_1))), 3.0)) / (((math.pow(t_3, 3.0) + math.pow(t_0, 3.0)) / (math.pow(t_3, 2.0) + (math.pow(t_0, 2.0) - (t_3 * t_0)))) + ((math.pow(y, 4.0) * 4.0) + (t_2 * (-2.0 * (y * y)))))
function code(x, y)
	t_0 = Float64(Float64((Float64(y * x) ^ 4.0) * -18.0) + (y ^ 8.0))
	t_1 = Float64(log(y) * 2.0)
	t_2 = Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0))
	t_3 = Float64((x ^ 8.0) * 81.0)
	return Float64(Float64((t_2 ^ 3.0) - (Float64(-2.0 * Float64(cosh(t_1) + sinh(t_1))) ^ 3.0)) / Float64(Float64(Float64((t_3 ^ 3.0) + (t_0 ^ 3.0)) / Float64((t_3 ^ 2.0) + Float64((t_0 ^ 2.0) - Float64(t_3 * t_0)))) + Float64(Float64((y ^ 4.0) * 4.0) + Float64(t_2 * Float64(-2.0 * Float64(y * y))))))
end
function tmp = code(x, y)
	t_0 = (((y * x) ^ 4.0) * -18.0) + (y ^ 8.0);
	t_1 = log(y) * 2.0;
	t_2 = ((x ^ 4.0) * 9.0) - (y ^ 4.0);
	t_3 = (x ^ 8.0) * 81.0;
	tmp = ((t_2 ^ 3.0) - ((-2.0 * (cosh(t_1) + sinh(t_1))) ^ 3.0)) / ((((t_3 ^ 3.0) + (t_0 ^ 3.0)) / ((t_3 ^ 2.0) + ((t_0 ^ 2.0) - (t_3 * t_0)))) + (((y ^ 4.0) * 4.0) + (t_2 * (-2.0 * (y * y)))));
end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Power[N[(y * x), $MachinePrecision], 4.0], $MachinePrecision] * -18.0), $MachinePrecision] + N[Power[y, 8.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[x, 8.0], $MachinePrecision] * 81.0), $MachinePrecision]}, N[(N[(N[Power[t$95$2, 3.0], $MachinePrecision] - N[Power[N[(-2.0 * N[(N[Cosh[t$95$1], $MachinePrecision] + N[Sinh[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[t$95$3, 3.0], $MachinePrecision] + N[Power[t$95$0, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[t$95$3, 2.0], $MachinePrecision] + N[(N[Power[t$95$0, 2.0], $MachinePrecision] - N[(t$95$3 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[y, 4.0], $MachinePrecision] * 4.0), $MachinePrecision] + N[(t$95$2 * N[(-2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\\
t_1 := \log y \cdot 2\\
t_2 := {x}^{4} \cdot 9 - {y}^{4}\\
t_3 := {x}^{8} \cdot 81\\
\frac{{t\_2}^{3} - {\left(-2 \cdot \left(\cosh t\_1 + \sinh t\_1\right)\right)}^{3}}{\frac{{t\_3}^{3} + {t\_0}^{3}}{{t\_3}^{2} + \left({t\_0}^{2} - t\_3 \cdot t\_0\right)} + \left({y}^{4} \cdot 4 + t\_2 \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 18.8%

    \[\left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
  2. Add Preprocessing
  3. Applied rewrites18.8%

    \[\leadsto \color{blue}{\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)}} \]
  4. Taylor expanded in y around 0

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\color{blue}{\left(81 \cdot {x}^{8} + {y}^{4} \cdot \left(-18 \cdot {x}^{4} + {y}^{4}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  5. Step-by-step derivation
    1. distribute-rgt-inN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(\left(-18 \cdot {x}^{4}\right) \cdot {y}^{4} + \color{blue}{{y}^{4} \cdot {y}^{4}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    2. associate-*r*N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + \color{blue}{{y}^{4}} \cdot {y}^{4}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    3. pow-prod-upN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{\color{blue}{\left(4 + 4\right)}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    4. metadata-evalN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    5. lower-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \color{blue}{\left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)}\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    6. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18 \cdot \left({x}^{4} \cdot {y}^{4}\right)} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    7. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18 \cdot \left({x}^{4} \cdot {y}^{4}\right)} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    8. lower-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18} \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    9. lower-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + \color{blue}{{y}^{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    10. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({x}^{4} \cdot {y}^{4}\right) \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    11. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({x}^{4} \cdot {y}^{4}\right) \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    12. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({y}^{4} \cdot {x}^{4}\right) \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    13. pow-prod-downN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    14. lower-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    15. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    16. lower-pow.f6422.6

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{\color{blue}{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  6. Applied rewrites22.6%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\color{blue}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  7. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \color{blue}{\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{{\left(y \cdot x\right)}^{4} \cdot -18} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    3. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{{\left(y \cdot x\right)}^{4}} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    4. lift-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + \color{blue}{{y}^{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    5. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    6. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    7. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    8. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{\color{blue}{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    9. flip3-+N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\color{blue}{\left({x}^{8} \cdot 81\right) \cdot \left({x}^{8} \cdot 81\right) + \left(\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    10. lower-/.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\color{blue}{\left({x}^{8} \cdot 81\right) \cdot \left({x}^{8} \cdot 81\right) + \left(\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  8. Applied rewrites30.9%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\color{blue}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  9. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \color{blue}{\left(y \cdot y\right)}\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    2. pow2N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \color{blue}{{y}^{2}}\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    3. pow-to-expN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \color{blue}{e^{\log y \cdot 2}}\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    4. sinh-+-cosh-revN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \color{blue}{\left(\cosh \left(\log y \cdot 2\right) + \sinh \left(\log y \cdot 2\right)\right)}\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    5. lower-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \color{blue}{\left(\cosh \left(\log y \cdot 2\right) + \sinh \left(\log y \cdot 2\right)\right)}\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    6. lower-cosh.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(\color{blue}{\cosh \left(\log y \cdot 2\right)} + \sinh \left(\log y \cdot 2\right)\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    7. lift-log.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(\cosh \left(\color{blue}{\log y} \cdot 2\right) + \sinh \left(\log y \cdot 2\right)\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    8. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(\cosh \color{blue}{\left(\log y \cdot 2\right)} + \sinh \left(\log y \cdot 2\right)\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    9. lower-sinh.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(\cosh \left(\log y \cdot 2\right) + \color{blue}{\sinh \left(\log y \cdot 2\right)}\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    10. lift-log.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(\cosh \left(\log y \cdot 2\right) + \sinh \left(\color{blue}{\log y} \cdot 2\right)\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    11. lift-*.f6430.9

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(\cosh \left(\log y \cdot 2\right) + \sinh \color{blue}{\left(\log y \cdot 2\right)}\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  10. Applied rewrites30.9%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \color{blue}{\left(\cosh \left(\log y \cdot 2\right) + \sinh \left(\log y \cdot 2\right)\right)}\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  11. Add Preprocessing

Alternative 2: 30.9% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{4} \cdot 9 - {y}^{4}\\ t_1 := {x}^{8} \cdot 81\\ t_2 := {\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\\ \frac{{t\_0}^{3} - {\left(-2 \cdot e^{\log y \cdot 2}\right)}^{3}}{\frac{{t\_1}^{3} + {t\_2}^{3}}{{t\_1}^{2} + \left({t\_2}^{2} - t\_1 \cdot t\_2\right)} + \left({y}^{4} \cdot 4 + t\_0 \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (- (* (pow x 4.0) 9.0) (pow y 4.0)))
        (t_1 (* (pow x 8.0) 81.0))
        (t_2 (+ (* (pow (* y x) 4.0) -18.0) (pow y 8.0))))
   (/
    (- (pow t_0 3.0) (pow (* -2.0 (exp (* (log y) 2.0))) 3.0))
    (+
     (/
      (+ (pow t_1 3.0) (pow t_2 3.0))
      (+ (pow t_1 2.0) (- (pow t_2 2.0) (* t_1 t_2))))
     (+ (* (pow y 4.0) 4.0) (* t_0 (* -2.0 (* y y))))))))
double code(double x, double y) {
	double t_0 = (pow(x, 4.0) * 9.0) - pow(y, 4.0);
	double t_1 = pow(x, 8.0) * 81.0;
	double t_2 = (pow((y * x), 4.0) * -18.0) + pow(y, 8.0);
	return (pow(t_0, 3.0) - pow((-2.0 * exp((log(y) * 2.0))), 3.0)) / (((pow(t_1, 3.0) + pow(t_2, 3.0)) / (pow(t_1, 2.0) + (pow(t_2, 2.0) - (t_1 * t_2)))) + ((pow(y, 4.0) * 4.0) + (t_0 * (-2.0 * (y * y)))));
}
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, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    t_0 = ((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)
    t_1 = (x ** 8.0d0) * 81.0d0
    t_2 = (((y * x) ** 4.0d0) * (-18.0d0)) + (y ** 8.0d0)
    code = ((t_0 ** 3.0d0) - (((-2.0d0) * exp((log(y) * 2.0d0))) ** 3.0d0)) / ((((t_1 ** 3.0d0) + (t_2 ** 3.0d0)) / ((t_1 ** 2.0d0) + ((t_2 ** 2.0d0) - (t_1 * t_2)))) + (((y ** 4.0d0) * 4.0d0) + (t_0 * ((-2.0d0) * (y * y)))))
end function
public static double code(double x, double y) {
	double t_0 = (Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0);
	double t_1 = Math.pow(x, 8.0) * 81.0;
	double t_2 = (Math.pow((y * x), 4.0) * -18.0) + Math.pow(y, 8.0);
	return (Math.pow(t_0, 3.0) - Math.pow((-2.0 * Math.exp((Math.log(y) * 2.0))), 3.0)) / (((Math.pow(t_1, 3.0) + Math.pow(t_2, 3.0)) / (Math.pow(t_1, 2.0) + (Math.pow(t_2, 2.0) - (t_1 * t_2)))) + ((Math.pow(y, 4.0) * 4.0) + (t_0 * (-2.0 * (y * y)))));
}
def code(x, y):
	t_0 = (math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0)
	t_1 = math.pow(x, 8.0) * 81.0
	t_2 = (math.pow((y * x), 4.0) * -18.0) + math.pow(y, 8.0)
	return (math.pow(t_0, 3.0) - math.pow((-2.0 * math.exp((math.log(y) * 2.0))), 3.0)) / (((math.pow(t_1, 3.0) + math.pow(t_2, 3.0)) / (math.pow(t_1, 2.0) + (math.pow(t_2, 2.0) - (t_1 * t_2)))) + ((math.pow(y, 4.0) * 4.0) + (t_0 * (-2.0 * (y * y)))))
function code(x, y)
	t_0 = Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0))
	t_1 = Float64((x ^ 8.0) * 81.0)
	t_2 = Float64(Float64((Float64(y * x) ^ 4.0) * -18.0) + (y ^ 8.0))
	return Float64(Float64((t_0 ^ 3.0) - (Float64(-2.0 * exp(Float64(log(y) * 2.0))) ^ 3.0)) / Float64(Float64(Float64((t_1 ^ 3.0) + (t_2 ^ 3.0)) / Float64((t_1 ^ 2.0) + Float64((t_2 ^ 2.0) - Float64(t_1 * t_2)))) + Float64(Float64((y ^ 4.0) * 4.0) + Float64(t_0 * Float64(-2.0 * Float64(y * y))))))
end
function tmp = code(x, y)
	t_0 = ((x ^ 4.0) * 9.0) - (y ^ 4.0);
	t_1 = (x ^ 8.0) * 81.0;
	t_2 = (((y * x) ^ 4.0) * -18.0) + (y ^ 8.0);
	tmp = ((t_0 ^ 3.0) - ((-2.0 * exp((log(y) * 2.0))) ^ 3.0)) / ((((t_1 ^ 3.0) + (t_2 ^ 3.0)) / ((t_1 ^ 2.0) + ((t_2 ^ 2.0) - (t_1 * t_2)))) + (((y ^ 4.0) * 4.0) + (t_0 * (-2.0 * (y * y)))));
end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[x, 8.0], $MachinePrecision] * 81.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(y * x), $MachinePrecision], 4.0], $MachinePrecision] * -18.0), $MachinePrecision] + N[Power[y, 8.0], $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Power[t$95$0, 3.0], $MachinePrecision] - N[Power[N[(-2.0 * N[Exp[N[(N[Log[y], $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[t$95$1, 3.0], $MachinePrecision] + N[Power[t$95$2, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[t$95$1, 2.0], $MachinePrecision] + N[(N[Power[t$95$2, 2.0], $MachinePrecision] - N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[y, 4.0], $MachinePrecision] * 4.0), $MachinePrecision] + N[(t$95$0 * N[(-2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {x}^{4} \cdot 9 - {y}^{4}\\
t_1 := {x}^{8} \cdot 81\\
t_2 := {\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\\
\frac{{t\_0}^{3} - {\left(-2 \cdot e^{\log y \cdot 2}\right)}^{3}}{\frac{{t\_1}^{3} + {t\_2}^{3}}{{t\_1}^{2} + \left({t\_2}^{2} - t\_1 \cdot t\_2\right)} + \left({y}^{4} \cdot 4 + t\_0 \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 18.8%

    \[\left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
  2. Add Preprocessing
  3. Applied rewrites18.8%

    \[\leadsto \color{blue}{\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)}} \]
  4. Taylor expanded in y around 0

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\color{blue}{\left(81 \cdot {x}^{8} + {y}^{4} \cdot \left(-18 \cdot {x}^{4} + {y}^{4}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  5. Step-by-step derivation
    1. distribute-rgt-inN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(\left(-18 \cdot {x}^{4}\right) \cdot {y}^{4} + \color{blue}{{y}^{4} \cdot {y}^{4}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    2. associate-*r*N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + \color{blue}{{y}^{4}} \cdot {y}^{4}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    3. pow-prod-upN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{\color{blue}{\left(4 + 4\right)}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    4. metadata-evalN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    5. lower-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \color{blue}{\left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)}\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    6. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18 \cdot \left({x}^{4} \cdot {y}^{4}\right)} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    7. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18 \cdot \left({x}^{4} \cdot {y}^{4}\right)} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    8. lower-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18} \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    9. lower-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + \color{blue}{{y}^{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    10. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({x}^{4} \cdot {y}^{4}\right) \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    11. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({x}^{4} \cdot {y}^{4}\right) \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    12. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({y}^{4} \cdot {x}^{4}\right) \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    13. pow-prod-downN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    14. lower-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    15. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    16. lower-pow.f6422.6

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{\color{blue}{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  6. Applied rewrites22.6%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\color{blue}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  7. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \color{blue}{\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{{\left(y \cdot x\right)}^{4} \cdot -18} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    3. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{{\left(y \cdot x\right)}^{4}} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    4. lift-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + \color{blue}{{y}^{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    5. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    6. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    7. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    8. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{\color{blue}{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    9. flip3-+N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\color{blue}{\left({x}^{8} \cdot 81\right) \cdot \left({x}^{8} \cdot 81\right) + \left(\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    10. lower-/.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\color{blue}{\left({x}^{8} \cdot 81\right) \cdot \left({x}^{8} \cdot 81\right) + \left(\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  8. Applied rewrites30.9%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\color{blue}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  9. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \color{blue}{\left(y \cdot y\right)}\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    2. pow2N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \color{blue}{{y}^{2}}\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    3. pow-to-expN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \color{blue}{e^{\log y \cdot 2}}\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    4. lift-log.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot e^{\color{blue}{\log y} \cdot 2}\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    5. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot e^{\color{blue}{\log y \cdot 2}}\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    6. lift-exp.f6430.9

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \color{blue}{e^{\log y \cdot 2}}\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  10. Applied rewrites30.9%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \color{blue}{e^{\log y \cdot 2}}\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  11. Add Preprocessing

Alternative 3: 30.9% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{8} \cdot 81\\ t_1 := {\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\\ t_2 := -2 \cdot \left(y \cdot y\right)\\ \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {t\_2}^{3}}{\frac{{t\_0}^{3} + {t\_1}^{3}}{{t\_0}^{2} + \left({t\_1}^{2} - t\_0 \cdot t\_1\right)} + \left({y}^{4} \cdot 4 + \left(e^{\log x \cdot 4} \cdot 9 - {y}^{4}\right) \cdot t\_2\right)} \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (pow x 8.0) 81.0))
        (t_1 (+ (* (pow (* y x) 4.0) -18.0) (pow y 8.0)))
        (t_2 (* -2.0 (* y y))))
   (/
    (- (pow (- (* (pow x 4.0) 9.0) (pow y 4.0)) 3.0) (pow t_2 3.0))
    (+
     (/
      (+ (pow t_0 3.0) (pow t_1 3.0))
      (+ (pow t_0 2.0) (- (pow t_1 2.0) (* t_0 t_1))))
     (+
      (* (pow y 4.0) 4.0)
      (* (- (* (exp (* (log x) 4.0)) 9.0) (pow y 4.0)) t_2))))))
double code(double x, double y) {
	double t_0 = pow(x, 8.0) * 81.0;
	double t_1 = (pow((y * x), 4.0) * -18.0) + pow(y, 8.0);
	double t_2 = -2.0 * (y * y);
	return (pow(((pow(x, 4.0) * 9.0) - pow(y, 4.0)), 3.0) - pow(t_2, 3.0)) / (((pow(t_0, 3.0) + pow(t_1, 3.0)) / (pow(t_0, 2.0) + (pow(t_1, 2.0) - (t_0 * t_1)))) + ((pow(y, 4.0) * 4.0) + (((exp((log(x) * 4.0)) * 9.0) - pow(y, 4.0)) * t_2)));
}
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, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    t_0 = (x ** 8.0d0) * 81.0d0
    t_1 = (((y * x) ** 4.0d0) * (-18.0d0)) + (y ** 8.0d0)
    t_2 = (-2.0d0) * (y * y)
    code = (((((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)) ** 3.0d0) - (t_2 ** 3.0d0)) / ((((t_0 ** 3.0d0) + (t_1 ** 3.0d0)) / ((t_0 ** 2.0d0) + ((t_1 ** 2.0d0) - (t_0 * t_1)))) + (((y ** 4.0d0) * 4.0d0) + (((exp((log(x) * 4.0d0)) * 9.0d0) - (y ** 4.0d0)) * t_2)))
end function
public static double code(double x, double y) {
	double t_0 = Math.pow(x, 8.0) * 81.0;
	double t_1 = (Math.pow((y * x), 4.0) * -18.0) + Math.pow(y, 8.0);
	double t_2 = -2.0 * (y * y);
	return (Math.pow(((Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0)), 3.0) - Math.pow(t_2, 3.0)) / (((Math.pow(t_0, 3.0) + Math.pow(t_1, 3.0)) / (Math.pow(t_0, 2.0) + (Math.pow(t_1, 2.0) - (t_0 * t_1)))) + ((Math.pow(y, 4.0) * 4.0) + (((Math.exp((Math.log(x) * 4.0)) * 9.0) - Math.pow(y, 4.0)) * t_2)));
}
def code(x, y):
	t_0 = math.pow(x, 8.0) * 81.0
	t_1 = (math.pow((y * x), 4.0) * -18.0) + math.pow(y, 8.0)
	t_2 = -2.0 * (y * y)
	return (math.pow(((math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0)), 3.0) - math.pow(t_2, 3.0)) / (((math.pow(t_0, 3.0) + math.pow(t_1, 3.0)) / (math.pow(t_0, 2.0) + (math.pow(t_1, 2.0) - (t_0 * t_1)))) + ((math.pow(y, 4.0) * 4.0) + (((math.exp((math.log(x) * 4.0)) * 9.0) - math.pow(y, 4.0)) * t_2)))
function code(x, y)
	t_0 = Float64((x ^ 8.0) * 81.0)
	t_1 = Float64(Float64((Float64(y * x) ^ 4.0) * -18.0) + (y ^ 8.0))
	t_2 = Float64(-2.0 * Float64(y * y))
	return Float64(Float64((Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 3.0) - (t_2 ^ 3.0)) / Float64(Float64(Float64((t_0 ^ 3.0) + (t_1 ^ 3.0)) / Float64((t_0 ^ 2.0) + Float64((t_1 ^ 2.0) - Float64(t_0 * t_1)))) + Float64(Float64((y ^ 4.0) * 4.0) + Float64(Float64(Float64(exp(Float64(log(x) * 4.0)) * 9.0) - (y ^ 4.0)) * t_2))))
end
function tmp = code(x, y)
	t_0 = (x ^ 8.0) * 81.0;
	t_1 = (((y * x) ^ 4.0) * -18.0) + (y ^ 8.0);
	t_2 = -2.0 * (y * y);
	tmp = (((((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 3.0) - (t_2 ^ 3.0)) / ((((t_0 ^ 3.0) + (t_1 ^ 3.0)) / ((t_0 ^ 2.0) + ((t_1 ^ 2.0) - (t_0 * t_1)))) + (((y ^ 4.0) * 4.0) + (((exp((log(x) * 4.0)) * 9.0) - (y ^ 4.0)) * t_2)));
end
code[x_, y_] := Block[{t$95$0 = N[(N[Power[x, 8.0], $MachinePrecision] * 81.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(y * x), $MachinePrecision], 4.0], $MachinePrecision] * -18.0), $MachinePrecision] + N[Power[y, 8.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Power[N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] - N[Power[t$95$2, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[t$95$0, 3.0], $MachinePrecision] + N[Power[t$95$1, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[t$95$0, 2.0], $MachinePrecision] + N[(N[Power[t$95$1, 2.0], $MachinePrecision] - N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[y, 4.0], $MachinePrecision] * 4.0), $MachinePrecision] + N[(N[(N[(N[Exp[N[(N[Log[x], $MachinePrecision] * 4.0), $MachinePrecision]], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {x}^{8} \cdot 81\\
t_1 := {\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\\
t_2 := -2 \cdot \left(y \cdot y\right)\\
\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {t\_2}^{3}}{\frac{{t\_0}^{3} + {t\_1}^{3}}{{t\_0}^{2} + \left({t\_1}^{2} - t\_0 \cdot t\_1\right)} + \left({y}^{4} \cdot 4 + \left(e^{\log x \cdot 4} \cdot 9 - {y}^{4}\right) \cdot t\_2\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 18.8%

    \[\left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
  2. Add Preprocessing
  3. Applied rewrites18.8%

    \[\leadsto \color{blue}{\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)}} \]
  4. Taylor expanded in y around 0

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\color{blue}{\left(81 \cdot {x}^{8} + {y}^{4} \cdot \left(-18 \cdot {x}^{4} + {y}^{4}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  5. Step-by-step derivation
    1. distribute-rgt-inN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(\left(-18 \cdot {x}^{4}\right) \cdot {y}^{4} + \color{blue}{{y}^{4} \cdot {y}^{4}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    2. associate-*r*N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + \color{blue}{{y}^{4}} \cdot {y}^{4}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    3. pow-prod-upN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{\color{blue}{\left(4 + 4\right)}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    4. metadata-evalN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    5. lower-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \color{blue}{\left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)}\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    6. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18 \cdot \left({x}^{4} \cdot {y}^{4}\right)} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    7. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18 \cdot \left({x}^{4} \cdot {y}^{4}\right)} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    8. lower-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18} \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    9. lower-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + \color{blue}{{y}^{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    10. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({x}^{4} \cdot {y}^{4}\right) \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    11. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({x}^{4} \cdot {y}^{4}\right) \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    12. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({y}^{4} \cdot {x}^{4}\right) \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    13. pow-prod-downN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    14. lower-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    15. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    16. lower-pow.f6422.6

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{\color{blue}{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  6. Applied rewrites22.6%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\color{blue}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  7. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \color{blue}{\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{{\left(y \cdot x\right)}^{4} \cdot -18} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    3. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{{\left(y \cdot x\right)}^{4}} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    4. lift-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + \color{blue}{{y}^{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    5. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    6. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    7. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    8. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{\color{blue}{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    9. flip3-+N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\color{blue}{\left({x}^{8} \cdot 81\right) \cdot \left({x}^{8} \cdot 81\right) + \left(\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    10. lower-/.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\color{blue}{\left({x}^{8} \cdot 81\right) \cdot \left({x}^{8} \cdot 81\right) + \left(\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  8. Applied rewrites30.9%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\color{blue}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  9. Step-by-step derivation
    1. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left(\color{blue}{{x}^{4}} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    2. pow-to-expN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left(\color{blue}{e^{\log x \cdot 4}} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    3. lower-exp.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left(\color{blue}{e^{\log x \cdot 4}} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    4. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left(e^{\color{blue}{\log x \cdot 4}} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    5. lower-log.f6430.9

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left(e^{\color{blue}{\log x} \cdot 4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  10. Applied rewrites30.9%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left(\color{blue}{e^{\log x \cdot 4}} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  11. Add Preprocessing

Alternative 4: 30.9% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{4} \cdot 9 - {y}^{4}\\ t_1 := {x}^{8} \cdot 81\\ t_2 := {\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\\ t_3 := -2 \cdot \left(y \cdot y\right)\\ \frac{{t\_0}^{3} - {t\_3}^{3}}{\frac{{t\_1}^{3} + {t\_2}^{3}}{{t\_1}^{2} + \left({y}^{16} - t\_1 \cdot t\_2\right)} + \left({y}^{4} \cdot 4 + t\_0 \cdot t\_3\right)} \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (- (* (pow x 4.0) 9.0) (pow y 4.0)))
        (t_1 (* (pow x 8.0) 81.0))
        (t_2 (+ (* (pow (* y x) 4.0) -18.0) (pow y 8.0)))
        (t_3 (* -2.0 (* y y))))
   (/
    (- (pow t_0 3.0) (pow t_3 3.0))
    (+
     (/
      (+ (pow t_1 3.0) (pow t_2 3.0))
      (+ (pow t_1 2.0) (- (pow y 16.0) (* t_1 t_2))))
     (+ (* (pow y 4.0) 4.0) (* t_0 t_3))))))
double code(double x, double y) {
	double t_0 = (pow(x, 4.0) * 9.0) - pow(y, 4.0);
	double t_1 = pow(x, 8.0) * 81.0;
	double t_2 = (pow((y * x), 4.0) * -18.0) + pow(y, 8.0);
	double t_3 = -2.0 * (y * y);
	return (pow(t_0, 3.0) - pow(t_3, 3.0)) / (((pow(t_1, 3.0) + pow(t_2, 3.0)) / (pow(t_1, 2.0) + (pow(y, 16.0) - (t_1 * t_2)))) + ((pow(y, 4.0) * 4.0) + (t_0 * t_3)));
}
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, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    t_0 = ((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)
    t_1 = (x ** 8.0d0) * 81.0d0
    t_2 = (((y * x) ** 4.0d0) * (-18.0d0)) + (y ** 8.0d0)
    t_3 = (-2.0d0) * (y * y)
    code = ((t_0 ** 3.0d0) - (t_3 ** 3.0d0)) / ((((t_1 ** 3.0d0) + (t_2 ** 3.0d0)) / ((t_1 ** 2.0d0) + ((y ** 16.0d0) - (t_1 * t_2)))) + (((y ** 4.0d0) * 4.0d0) + (t_0 * t_3)))
end function
public static double code(double x, double y) {
	double t_0 = (Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0);
	double t_1 = Math.pow(x, 8.0) * 81.0;
	double t_2 = (Math.pow((y * x), 4.0) * -18.0) + Math.pow(y, 8.0);
	double t_3 = -2.0 * (y * y);
	return (Math.pow(t_0, 3.0) - Math.pow(t_3, 3.0)) / (((Math.pow(t_1, 3.0) + Math.pow(t_2, 3.0)) / (Math.pow(t_1, 2.0) + (Math.pow(y, 16.0) - (t_1 * t_2)))) + ((Math.pow(y, 4.0) * 4.0) + (t_0 * t_3)));
}
def code(x, y):
	t_0 = (math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0)
	t_1 = math.pow(x, 8.0) * 81.0
	t_2 = (math.pow((y * x), 4.0) * -18.0) + math.pow(y, 8.0)
	t_3 = -2.0 * (y * y)
	return (math.pow(t_0, 3.0) - math.pow(t_3, 3.0)) / (((math.pow(t_1, 3.0) + math.pow(t_2, 3.0)) / (math.pow(t_1, 2.0) + (math.pow(y, 16.0) - (t_1 * t_2)))) + ((math.pow(y, 4.0) * 4.0) + (t_0 * t_3)))
function code(x, y)
	t_0 = Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0))
	t_1 = Float64((x ^ 8.0) * 81.0)
	t_2 = Float64(Float64((Float64(y * x) ^ 4.0) * -18.0) + (y ^ 8.0))
	t_3 = Float64(-2.0 * Float64(y * y))
	return Float64(Float64((t_0 ^ 3.0) - (t_3 ^ 3.0)) / Float64(Float64(Float64((t_1 ^ 3.0) + (t_2 ^ 3.0)) / Float64((t_1 ^ 2.0) + Float64((y ^ 16.0) - Float64(t_1 * t_2)))) + Float64(Float64((y ^ 4.0) * 4.0) + Float64(t_0 * t_3))))
end
function tmp = code(x, y)
	t_0 = ((x ^ 4.0) * 9.0) - (y ^ 4.0);
	t_1 = (x ^ 8.0) * 81.0;
	t_2 = (((y * x) ^ 4.0) * -18.0) + (y ^ 8.0);
	t_3 = -2.0 * (y * y);
	tmp = ((t_0 ^ 3.0) - (t_3 ^ 3.0)) / ((((t_1 ^ 3.0) + (t_2 ^ 3.0)) / ((t_1 ^ 2.0) + ((y ^ 16.0) - (t_1 * t_2)))) + (((y ^ 4.0) * 4.0) + (t_0 * t_3)));
end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[x, 8.0], $MachinePrecision] * 81.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(y * x), $MachinePrecision], 4.0], $MachinePrecision] * -18.0), $MachinePrecision] + N[Power[y, 8.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Power[t$95$0, 3.0], $MachinePrecision] - N[Power[t$95$3, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[t$95$1, 3.0], $MachinePrecision] + N[Power[t$95$2, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[t$95$1, 2.0], $MachinePrecision] + N[(N[Power[y, 16.0], $MachinePrecision] - N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[y, 4.0], $MachinePrecision] * 4.0), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {x}^{4} \cdot 9 - {y}^{4}\\
t_1 := {x}^{8} \cdot 81\\
t_2 := {\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\\
t_3 := -2 \cdot \left(y \cdot y\right)\\
\frac{{t\_0}^{3} - {t\_3}^{3}}{\frac{{t\_1}^{3} + {t\_2}^{3}}{{t\_1}^{2} + \left({y}^{16} - t\_1 \cdot t\_2\right)} + \left({y}^{4} \cdot 4 + t\_0 \cdot t\_3\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 18.8%

    \[\left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
  2. Add Preprocessing
  3. Applied rewrites18.8%

    \[\leadsto \color{blue}{\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)}} \]
  4. Taylor expanded in y around 0

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\color{blue}{\left(81 \cdot {x}^{8} + {y}^{4} \cdot \left(-18 \cdot {x}^{4} + {y}^{4}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  5. Step-by-step derivation
    1. distribute-rgt-inN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(\left(-18 \cdot {x}^{4}\right) \cdot {y}^{4} + \color{blue}{{y}^{4} \cdot {y}^{4}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    2. associate-*r*N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + \color{blue}{{y}^{4}} \cdot {y}^{4}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    3. pow-prod-upN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{\color{blue}{\left(4 + 4\right)}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    4. metadata-evalN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    5. lower-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \color{blue}{\left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)}\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    6. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18 \cdot \left({x}^{4} \cdot {y}^{4}\right)} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    7. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18 \cdot \left({x}^{4} \cdot {y}^{4}\right)} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    8. lower-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18} \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    9. lower-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + \color{blue}{{y}^{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    10. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({x}^{4} \cdot {y}^{4}\right) \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    11. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({x}^{4} \cdot {y}^{4}\right) \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    12. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({y}^{4} \cdot {x}^{4}\right) \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    13. pow-prod-downN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    14. lower-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    15. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    16. lower-pow.f6422.6

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{\color{blue}{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  6. Applied rewrites22.6%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\color{blue}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  7. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \color{blue}{\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{{\left(y \cdot x\right)}^{4} \cdot -18} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    3. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{{\left(y \cdot x\right)}^{4}} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    4. lift-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + \color{blue}{{y}^{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    5. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    6. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    7. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    8. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{\color{blue}{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    9. flip3-+N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\color{blue}{\left({x}^{8} \cdot 81\right) \cdot \left({x}^{8} \cdot 81\right) + \left(\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    10. lower-/.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\color{blue}{\left({x}^{8} \cdot 81\right) \cdot \left({x}^{8} \cdot 81\right) + \left(\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  8. Applied rewrites30.9%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\color{blue}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  9. Taylor expanded in x around 0

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({y}^{16} - \color{blue}{\left({x}^{8} \cdot 81\right)} \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  10. Step-by-step derivation
    1. lower-pow.f6430.9

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({y}^{16} - \left({x}^{8} \cdot \color{blue}{81}\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  11. Applied rewrites30.9%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({y}^{16} - \color{blue}{\left({x}^{8} \cdot 81\right)} \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  12. Add Preprocessing

Alternative 5: 30.9% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{4} \cdot 9 - {y}^{4}\\ t_1 := -2 \cdot \left(y \cdot y\right)\\ \frac{{t\_0}^{3} - {t\_1}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\left(1458 \cdot {x}^{12}\right) \cdot {y}^{4} - -6561 \cdot {x}^{16}} + \left({y}^{4} \cdot 4 + t\_0 \cdot t\_1\right)} \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (- (* (pow x 4.0) 9.0) (pow y 4.0))) (t_1 (* -2.0 (* y y))))
   (/
    (- (pow t_0 3.0) (pow t_1 3.0))
    (+
     (/
      (+
       (pow (* (pow x 8.0) 81.0) 3.0)
       (pow (+ (* (pow (* y x) 4.0) -18.0) (pow y 8.0)) 3.0))
      (- (* (* 1458.0 (pow x 12.0)) (pow y 4.0)) (* -6561.0 (pow x 16.0))))
     (+ (* (pow y 4.0) 4.0) (* t_0 t_1))))))
double code(double x, double y) {
	double t_0 = (pow(x, 4.0) * 9.0) - pow(y, 4.0);
	double t_1 = -2.0 * (y * y);
	return (pow(t_0, 3.0) - pow(t_1, 3.0)) / (((pow((pow(x, 8.0) * 81.0), 3.0) + pow(((pow((y * x), 4.0) * -18.0) + pow(y, 8.0)), 3.0)) / (((1458.0 * pow(x, 12.0)) * pow(y, 4.0)) - (-6561.0 * pow(x, 16.0)))) + ((pow(y, 4.0) * 4.0) + (t_0 * t_1)));
}
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, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    t_0 = ((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)
    t_1 = (-2.0d0) * (y * y)
    code = ((t_0 ** 3.0d0) - (t_1 ** 3.0d0)) / ((((((x ** 8.0d0) * 81.0d0) ** 3.0d0) + (((((y * x) ** 4.0d0) * (-18.0d0)) + (y ** 8.0d0)) ** 3.0d0)) / (((1458.0d0 * (x ** 12.0d0)) * (y ** 4.0d0)) - ((-6561.0d0) * (x ** 16.0d0)))) + (((y ** 4.0d0) * 4.0d0) + (t_0 * t_1)))
end function
public static double code(double x, double y) {
	double t_0 = (Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0);
	double t_1 = -2.0 * (y * y);
	return (Math.pow(t_0, 3.0) - Math.pow(t_1, 3.0)) / (((Math.pow((Math.pow(x, 8.0) * 81.0), 3.0) + Math.pow(((Math.pow((y * x), 4.0) * -18.0) + Math.pow(y, 8.0)), 3.0)) / (((1458.0 * Math.pow(x, 12.0)) * Math.pow(y, 4.0)) - (-6561.0 * Math.pow(x, 16.0)))) + ((Math.pow(y, 4.0) * 4.0) + (t_0 * t_1)));
}
def code(x, y):
	t_0 = (math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0)
	t_1 = -2.0 * (y * y)
	return (math.pow(t_0, 3.0) - math.pow(t_1, 3.0)) / (((math.pow((math.pow(x, 8.0) * 81.0), 3.0) + math.pow(((math.pow((y * x), 4.0) * -18.0) + math.pow(y, 8.0)), 3.0)) / (((1458.0 * math.pow(x, 12.0)) * math.pow(y, 4.0)) - (-6561.0 * math.pow(x, 16.0)))) + ((math.pow(y, 4.0) * 4.0) + (t_0 * t_1)))
function code(x, y)
	t_0 = Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0))
	t_1 = Float64(-2.0 * Float64(y * y))
	return Float64(Float64((t_0 ^ 3.0) - (t_1 ^ 3.0)) / Float64(Float64(Float64((Float64((x ^ 8.0) * 81.0) ^ 3.0) + (Float64(Float64((Float64(y * x) ^ 4.0) * -18.0) + (y ^ 8.0)) ^ 3.0)) / Float64(Float64(Float64(1458.0 * (x ^ 12.0)) * (y ^ 4.0)) - Float64(-6561.0 * (x ^ 16.0)))) + Float64(Float64((y ^ 4.0) * 4.0) + Float64(t_0 * t_1))))
end
function tmp = code(x, y)
	t_0 = ((x ^ 4.0) * 9.0) - (y ^ 4.0);
	t_1 = -2.0 * (y * y);
	tmp = ((t_0 ^ 3.0) - (t_1 ^ 3.0)) / ((((((x ^ 8.0) * 81.0) ^ 3.0) + (((((y * x) ^ 4.0) * -18.0) + (y ^ 8.0)) ^ 3.0)) / (((1458.0 * (x ^ 12.0)) * (y ^ 4.0)) - (-6561.0 * (x ^ 16.0)))) + (((y ^ 4.0) * 4.0) + (t_0 * t_1)));
end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Power[t$95$0, 3.0], $MachinePrecision] - N[Power[t$95$1, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[N[(N[Power[x, 8.0], $MachinePrecision] * 81.0), $MachinePrecision], 3.0], $MachinePrecision] + N[Power[N[(N[(N[Power[N[(y * x), $MachinePrecision], 4.0], $MachinePrecision] * -18.0), $MachinePrecision] + N[Power[y, 8.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(1458.0 * N[Power[x, 12.0], $MachinePrecision]), $MachinePrecision] * N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision] - N[(-6561.0 * N[Power[x, 16.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[y, 4.0], $MachinePrecision] * 4.0), $MachinePrecision] + N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {x}^{4} \cdot 9 - {y}^{4}\\
t_1 := -2 \cdot \left(y \cdot y\right)\\
\frac{{t\_0}^{3} - {t\_1}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\left(1458 \cdot {x}^{12}\right) \cdot {y}^{4} - -6561 \cdot {x}^{16}} + \left({y}^{4} \cdot 4 + t\_0 \cdot t\_1\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 18.8%

    \[\left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
  2. Add Preprocessing
  3. Applied rewrites18.8%

    \[\leadsto \color{blue}{\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)}} \]
  4. Taylor expanded in y around 0

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\color{blue}{\left(81 \cdot {x}^{8} + {y}^{4} \cdot \left(-18 \cdot {x}^{4} + {y}^{4}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  5. Step-by-step derivation
    1. distribute-rgt-inN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(\left(-18 \cdot {x}^{4}\right) \cdot {y}^{4} + \color{blue}{{y}^{4} \cdot {y}^{4}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    2. associate-*r*N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + \color{blue}{{y}^{4}} \cdot {y}^{4}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    3. pow-prod-upN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{\color{blue}{\left(4 + 4\right)}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    4. metadata-evalN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    5. lower-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \color{blue}{\left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)}\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    6. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18 \cdot \left({x}^{4} \cdot {y}^{4}\right)} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    7. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18 \cdot \left({x}^{4} \cdot {y}^{4}\right)} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    8. lower-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18} \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    9. lower-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + \color{blue}{{y}^{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    10. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({x}^{4} \cdot {y}^{4}\right) \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    11. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({x}^{4} \cdot {y}^{4}\right) \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    12. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({y}^{4} \cdot {x}^{4}\right) \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    13. pow-prod-downN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    14. lower-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    15. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    16. lower-pow.f6422.6

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{\color{blue}{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  6. Applied rewrites22.6%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\color{blue}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  7. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \color{blue}{\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{{\left(y \cdot x\right)}^{4} \cdot -18} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    3. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{{\left(y \cdot x\right)}^{4}} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    4. lift-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + \color{blue}{{y}^{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    5. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    6. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    7. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    8. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{\color{blue}{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    9. flip3-+N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\color{blue}{\left({x}^{8} \cdot 81\right) \cdot \left({x}^{8} \cdot 81\right) + \left(\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    10. lower-/.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\color{blue}{\left({x}^{8} \cdot 81\right) \cdot \left({x}^{8} \cdot 81\right) + \left(\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right) - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  8. Applied rewrites30.9%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\color{blue}{{\left({x}^{8} \cdot 81\right)}^{2} + \left({\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{2} - \left({x}^{8} \cdot 81\right) \cdot \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  9. Taylor expanded in y around 0

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{1458 \cdot \left({x}^{12} \cdot {y}^{4}\right) + \color{blue}{6561 \cdot {x}^{16}}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  10. Step-by-step derivation
    1. fp-cancel-sign-sub-invN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{1458 \cdot \left({x}^{12} \cdot {y}^{4}\right) - \left(\mathsf{neg}\left(6561\right)\right) \cdot \color{blue}{{x}^{16}}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    2. lower--.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{1458 \cdot \left({x}^{12} \cdot {y}^{4}\right) - \left(\mathsf{neg}\left(6561\right)\right) \cdot \color{blue}{{x}^{16}}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    3. associate-*r*N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\left(1458 \cdot {x}^{12}\right) \cdot {y}^{4} - \left(\mathsf{neg}\left(6561\right)\right) \cdot {\color{blue}{x}}^{16}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    4. metadata-evalN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\left(\left(\mathsf{neg}\left(-1458\right)\right) \cdot {x}^{12}\right) \cdot {y}^{4} - \left(\mathsf{neg}\left(6561\right)\right) \cdot {x}^{16}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    5. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\left(\left(\mathsf{neg}\left(-1458\right)\right) \cdot {x}^{12}\right) \cdot {y}^{4} - \left(\mathsf{neg}\left(6561\right)\right) \cdot {\color{blue}{x}}^{16}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    6. metadata-evalN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\left(1458 \cdot {x}^{12}\right) \cdot {y}^{4} - \left(\mathsf{neg}\left(6561\right)\right) \cdot {x}^{16}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    7. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\left(1458 \cdot {x}^{12}\right) \cdot {y}^{4} - \left(\mathsf{neg}\left(6561\right)\right) \cdot {x}^{16}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    8. lower-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\left(1458 \cdot {x}^{12}\right) \cdot {y}^{4} - \left(\mathsf{neg}\left(6561\right)\right) \cdot {x}^{16}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    9. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\left(1458 \cdot {x}^{12}\right) \cdot {y}^{4} - \left(\mathsf{neg}\left(6561\right)\right) \cdot {x}^{16}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    10. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\left(1458 \cdot {x}^{12}\right) \cdot {y}^{4} - \left(\mathsf{neg}\left(6561\right)\right) \cdot {x}^{\color{blue}{16}}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    11. metadata-evalN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\left(1458 \cdot {x}^{12}\right) \cdot {y}^{4} - -6561 \cdot {x}^{16}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    12. lower-pow.f6430.9

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\left(1458 \cdot {x}^{12}\right) \cdot {y}^{4} - -6561 \cdot {x}^{16}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  11. Applied rewrites30.9%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\left(1458 \cdot {x}^{12}\right) \cdot {y}^{4} - \color{blue}{-6561 \cdot {x}^{16}}} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  12. Add Preprocessing

Alternative 6: 24.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left(\frac{-18 \cdot {x}^{4}}{{y}^{4}} + 2\right) \cdot {y}^{6}} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/
  (- (pow (- (* (pow x 4.0) 9.0) (pow y 4.0)) 3.0) (pow (* -2.0 (* y y)) 3.0))
  (+
   (+ (* (pow x 8.0) 81.0) (+ (* (pow (* y x) 4.0) -18.0) (pow y 8.0)))
   (* (+ (/ (* -18.0 (pow x 4.0)) (pow y 4.0)) 2.0) (pow y 6.0)))))
double code(double x, double y) {
	return (pow(((pow(x, 4.0) * 9.0) - pow(y, 4.0)), 3.0) - pow((-2.0 * (y * y)), 3.0)) / (((pow(x, 8.0) * 81.0) + ((pow((y * x), 4.0) * -18.0) + pow(y, 8.0))) + ((((-18.0 * pow(x, 4.0)) / pow(y, 4.0)) + 2.0) * pow(y, 6.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, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (((((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)) ** 3.0d0) - (((-2.0d0) * (y * y)) ** 3.0d0)) / ((((x ** 8.0d0) * 81.0d0) + ((((y * x) ** 4.0d0) * (-18.0d0)) + (y ** 8.0d0))) + (((((-18.0d0) * (x ** 4.0d0)) / (y ** 4.0d0)) + 2.0d0) * (y ** 6.0d0)))
end function
public static double code(double x, double y) {
	return (Math.pow(((Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0)), 3.0) - Math.pow((-2.0 * (y * y)), 3.0)) / (((Math.pow(x, 8.0) * 81.0) + ((Math.pow((y * x), 4.0) * -18.0) + Math.pow(y, 8.0))) + ((((-18.0 * Math.pow(x, 4.0)) / Math.pow(y, 4.0)) + 2.0) * Math.pow(y, 6.0)));
}
def code(x, y):
	return (math.pow(((math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0)), 3.0) - math.pow((-2.0 * (y * y)), 3.0)) / (((math.pow(x, 8.0) * 81.0) + ((math.pow((y * x), 4.0) * -18.0) + math.pow(y, 8.0))) + ((((-18.0 * math.pow(x, 4.0)) / math.pow(y, 4.0)) + 2.0) * math.pow(y, 6.0)))
function code(x, y)
	return Float64(Float64((Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 3.0) - (Float64(-2.0 * Float64(y * y)) ^ 3.0)) / Float64(Float64(Float64((x ^ 8.0) * 81.0) + Float64(Float64((Float64(y * x) ^ 4.0) * -18.0) + (y ^ 8.0))) + Float64(Float64(Float64(Float64(-18.0 * (x ^ 4.0)) / (y ^ 4.0)) + 2.0) * (y ^ 6.0))))
end
function tmp = code(x, y)
	tmp = (((((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 3.0) - ((-2.0 * (y * y)) ^ 3.0)) / ((((x ^ 8.0) * 81.0) + ((((y * x) ^ 4.0) * -18.0) + (y ^ 8.0))) + ((((-18.0 * (x ^ 4.0)) / (y ^ 4.0)) + 2.0) * (y ^ 6.0)));
end
code[x_, y_] := N[(N[(N[Power[N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] - N[Power[N[(-2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[x, 8.0], $MachinePrecision] * 81.0), $MachinePrecision] + N[(N[(N[Power[N[(y * x), $MachinePrecision], 4.0], $MachinePrecision] * -18.0), $MachinePrecision] + N[Power[y, 8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(-18.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] / N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] * N[Power[y, 6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left(\frac{-18 \cdot {x}^{4}}{{y}^{4}} + 2\right) \cdot {y}^{6}}
\end{array}
Derivation
  1. Initial program 18.8%

    \[\left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
  2. Add Preprocessing
  3. Applied rewrites18.8%

    \[\leadsto \color{blue}{\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)}} \]
  4. Taylor expanded in y around 0

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\color{blue}{\left(81 \cdot {x}^{8} + {y}^{4} \cdot \left(-18 \cdot {x}^{4} + {y}^{4}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  5. Step-by-step derivation
    1. distribute-rgt-inN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(\left(-18 \cdot {x}^{4}\right) \cdot {y}^{4} + \color{blue}{{y}^{4} \cdot {y}^{4}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    2. associate-*r*N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + \color{blue}{{y}^{4}} \cdot {y}^{4}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    3. pow-prod-upN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{\color{blue}{\left(4 + 4\right)}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    4. metadata-evalN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    5. lower-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \color{blue}{\left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)}\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    6. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18 \cdot \left({x}^{4} \cdot {y}^{4}\right)} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    7. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18 \cdot \left({x}^{4} \cdot {y}^{4}\right)} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    8. lower-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18} \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    9. lower-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + \color{blue}{{y}^{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    10. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({x}^{4} \cdot {y}^{4}\right) \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    11. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({x}^{4} \cdot {y}^{4}\right) \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    12. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({y}^{4} \cdot {x}^{4}\right) \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    13. pow-prod-downN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    14. lower-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    15. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    16. lower-pow.f6422.6

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{\color{blue}{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  6. Applied rewrites22.6%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\color{blue}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  7. Taylor expanded in y around inf

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \color{blue}{{y}^{6} \cdot \left(2 + \left(-18 \cdot \frac{{x}^{4}}{{y}^{4}} + 4 \cdot \frac{1}{{y}^{2}}\right)\right)}} \]
  8. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left(2 + \left(-18 \cdot \frac{{x}^{4}}{{y}^{4}} + 4 \cdot \frac{1}{{y}^{2}}\right)\right) \cdot \color{blue}{{y}^{6}}} \]
    2. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left(2 + \left(-18 \cdot \frac{{x}^{4}}{{y}^{4}} + 4 \cdot \frac{1}{{y}^{2}}\right)\right) \cdot \color{blue}{{y}^{6}}} \]
  9. Applied rewrites22.6%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \color{blue}{\left(\left(\frac{-18 \cdot {x}^{4}}{{y}^{4}} - -4 \cdot {y}^{-2}\right) + 2\right) \cdot {y}^{6}}} \]
  10. Taylor expanded in x around inf

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left(-18 \cdot \frac{{x}^{4}}{{y}^{4}} + 2\right) \cdot {y}^{6}} \]
  11. Step-by-step derivation
    1. associate-*r/N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left(\frac{-18 \cdot {x}^{4}}{{y}^{4}} + 2\right) \cdot {y}^{6}} \]
    2. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left(\frac{-18 \cdot {x}^{4}}{{y}^{4}} + 2\right) \cdot {y}^{6}} \]
    3. lift-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left(\frac{-18 \cdot {x}^{4}}{{y}^{4}} + 2\right) \cdot {y}^{6}} \]
    4. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left(\frac{-18 \cdot {x}^{4}}{{y}^{4}} + 2\right) \cdot {y}^{6}} \]
    5. lift-/.f6424.7

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left(\frac{-18 \cdot {x}^{4}}{{y}^{4}} + 2\right) \cdot {y}^{6}} \]
  12. Applied rewrites24.7%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left(\frac{-18 \cdot {x}^{4}}{{y}^{4}} + 2\right) \cdot {y}^{6}} \]
  13. Add Preprocessing

Alternative 7: 22.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left(\left(\left(y \cdot y\right) \cdot 2 + 4\right) \cdot \left(y \cdot y\right) + -18 \cdot {x}^{4}\right) \cdot \left(y \cdot y\right)} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/
  (- (pow (- (* (pow x 4.0) 9.0) (pow y 4.0)) 3.0) (pow (* -2.0 (* y y)) 3.0))
  (+
   (+ (* (pow x 8.0) 81.0) (+ (* (pow (* y x) 4.0) -18.0) (pow y 8.0)))
   (* (+ (* (+ (* (* y y) 2.0) 4.0) (* y y)) (* -18.0 (pow x 4.0))) (* y y)))))
double code(double x, double y) {
	return (pow(((pow(x, 4.0) * 9.0) - pow(y, 4.0)), 3.0) - pow((-2.0 * (y * y)), 3.0)) / (((pow(x, 8.0) * 81.0) + ((pow((y * x), 4.0) * -18.0) + pow(y, 8.0))) + ((((((y * y) * 2.0) + 4.0) * (y * y)) + (-18.0 * pow(x, 4.0))) * (y * y)));
}
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, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (((((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)) ** 3.0d0) - (((-2.0d0) * (y * y)) ** 3.0d0)) / ((((x ** 8.0d0) * 81.0d0) + ((((y * x) ** 4.0d0) * (-18.0d0)) + (y ** 8.0d0))) + ((((((y * y) * 2.0d0) + 4.0d0) * (y * y)) + ((-18.0d0) * (x ** 4.0d0))) * (y * y)))
end function
public static double code(double x, double y) {
	return (Math.pow(((Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0)), 3.0) - Math.pow((-2.0 * (y * y)), 3.0)) / (((Math.pow(x, 8.0) * 81.0) + ((Math.pow((y * x), 4.0) * -18.0) + Math.pow(y, 8.0))) + ((((((y * y) * 2.0) + 4.0) * (y * y)) + (-18.0 * Math.pow(x, 4.0))) * (y * y)));
}
def code(x, y):
	return (math.pow(((math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0)), 3.0) - math.pow((-2.0 * (y * y)), 3.0)) / (((math.pow(x, 8.0) * 81.0) + ((math.pow((y * x), 4.0) * -18.0) + math.pow(y, 8.0))) + ((((((y * y) * 2.0) + 4.0) * (y * y)) + (-18.0 * math.pow(x, 4.0))) * (y * y)))
function code(x, y)
	return Float64(Float64((Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 3.0) - (Float64(-2.0 * Float64(y * y)) ^ 3.0)) / Float64(Float64(Float64((x ^ 8.0) * 81.0) + Float64(Float64((Float64(y * x) ^ 4.0) * -18.0) + (y ^ 8.0))) + Float64(Float64(Float64(Float64(Float64(Float64(y * y) * 2.0) + 4.0) * Float64(y * y)) + Float64(-18.0 * (x ^ 4.0))) * Float64(y * y))))
end
function tmp = code(x, y)
	tmp = (((((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 3.0) - ((-2.0 * (y * y)) ^ 3.0)) / ((((x ^ 8.0) * 81.0) + ((((y * x) ^ 4.0) * -18.0) + (y ^ 8.0))) + ((((((y * y) * 2.0) + 4.0) * (y * y)) + (-18.0 * (x ^ 4.0))) * (y * y)));
end
code[x_, y_] := N[(N[(N[Power[N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] - N[Power[N[(-2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[x, 8.0], $MachinePrecision] * 81.0), $MachinePrecision] + N[(N[(N[Power[N[(y * x), $MachinePrecision], 4.0], $MachinePrecision] * -18.0), $MachinePrecision] + N[Power[y, 8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 2.0), $MachinePrecision] + 4.0), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision] + N[(-18.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left(\left(\left(y \cdot y\right) \cdot 2 + 4\right) \cdot \left(y \cdot y\right) + -18 \cdot {x}^{4}\right) \cdot \left(y \cdot y\right)}
\end{array}
Derivation
  1. Initial program 18.8%

    \[\left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
  2. Add Preprocessing
  3. Applied rewrites18.8%

    \[\leadsto \color{blue}{\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)}} \]
  4. Taylor expanded in y around 0

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\color{blue}{\left(81 \cdot {x}^{8} + {y}^{4} \cdot \left(-18 \cdot {x}^{4} + {y}^{4}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  5. Step-by-step derivation
    1. distribute-rgt-inN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(\left(-18 \cdot {x}^{4}\right) \cdot {y}^{4} + \color{blue}{{y}^{4} \cdot {y}^{4}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    2. associate-*r*N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + \color{blue}{{y}^{4}} \cdot {y}^{4}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    3. pow-prod-upN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{\color{blue}{\left(4 + 4\right)}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    4. metadata-evalN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    5. lower-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(81 \cdot {x}^{8} + \color{blue}{\left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)}\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    6. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18 \cdot \left({x}^{4} \cdot {y}^{4}\right)} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    7. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18 \cdot \left({x}^{4} \cdot {y}^{4}\right)} + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    8. lower-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\color{blue}{-18} \cdot \left({x}^{4} \cdot {y}^{4}\right) + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    9. lower-+.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(-18 \cdot \left({x}^{4} \cdot {y}^{4}\right) + \color{blue}{{y}^{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    10. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({x}^{4} \cdot {y}^{4}\right) \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    11. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({x}^{4} \cdot {y}^{4}\right) \cdot -18 + {\color{blue}{y}}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    12. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left(\left({y}^{4} \cdot {x}^{4}\right) \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    13. pow-prod-downN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    14. lower-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    15. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
    16. lower-pow.f6422.6

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{\color{blue}{8}}\right)\right) + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  6. Applied rewrites22.6%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\color{blue}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right)} + \left({y}^{4} \cdot 4 + \left({x}^{4} \cdot 9 - {y}^{4}\right) \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)} \]
  7. Taylor expanded in y around 0

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \color{blue}{{y}^{2} \cdot \left(-18 \cdot {x}^{4} + {y}^{2} \cdot \left(4 + 2 \cdot {y}^{2}\right)\right)}} \]
  8. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left(-18 \cdot {x}^{4} + {y}^{2} \cdot \left(4 + 2 \cdot {y}^{2}\right)\right) \cdot \color{blue}{{y}^{2}}} \]
    2. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left(-18 \cdot {x}^{4} + {y}^{2} \cdot \left(4 + 2 \cdot {y}^{2}\right)\right) \cdot \color{blue}{{y}^{2}}} \]
  9. Applied rewrites22.6%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \color{blue}{\left(\left(\left(y \cdot y\right) \cdot 2 + 4\right) \cdot \left(y \cdot y\right) + -18 \cdot {x}^{4}\right) \cdot \left(y \cdot y\right)}} \]
  10. Add Preprocessing

Alternative 8: 18.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot 9 - {\left(e^{\log y}\right)}^{4}\right) - \left(y \cdot y\right) \cdot 2} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/
  (- (pow (- (* (pow x 4.0) 9.0) (pow y 4.0)) 2.0) (* (pow y 4.0) 4.0))
  (- (- (* (* (* (* x x) x) x) 9.0) (pow (exp (log y)) 4.0)) (* (* y y) 2.0))))
double code(double x, double y) {
	return (pow(((pow(x, 4.0) * 9.0) - pow(y, 4.0)), 2.0) - (pow(y, 4.0) * 4.0)) / ((((((x * x) * x) * x) * 9.0) - pow(exp(log(y)), 4.0)) - ((y * y) * 2.0));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (((((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)) ** 2.0d0) - ((y ** 4.0d0) * 4.0d0)) / ((((((x * x) * x) * x) * 9.0d0) - (exp(log(y)) ** 4.0d0)) - ((y * y) * 2.0d0))
end function
public static double code(double x, double y) {
	return (Math.pow(((Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0)), 2.0) - (Math.pow(y, 4.0) * 4.0)) / ((((((x * x) * x) * x) * 9.0) - Math.pow(Math.exp(Math.log(y)), 4.0)) - ((y * y) * 2.0));
}
def code(x, y):
	return (math.pow(((math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0)), 2.0) - (math.pow(y, 4.0) * 4.0)) / ((((((x * x) * x) * x) * 9.0) - math.pow(math.exp(math.log(y)), 4.0)) - ((y * y) * 2.0))
function code(x, y)
	return Float64(Float64((Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 2.0) - Float64((y ^ 4.0) * 4.0)) / Float64(Float64(Float64(Float64(Float64(Float64(x * x) * x) * x) * 9.0) - (exp(log(y)) ^ 4.0)) - Float64(Float64(y * y) * 2.0)))
end
function tmp = code(x, y)
	tmp = (((((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 2.0) - ((y ^ 4.0) * 4.0)) / ((((((x * x) * x) * x) * 9.0) - (exp(log(y)) ^ 4.0)) - ((y * y) * 2.0));
end
code[x_, y_] := N[(N[(N[Power[N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] - N[(N[Power[y, 4.0], $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[N[Exp[N[Log[y], $MachinePrecision]], $MachinePrecision], 4.0], $MachinePrecision]), $MachinePrecision] - N[(N[(y * y), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot 9 - {\left(e^{\log y}\right)}^{4}\right) - \left(y \cdot y\right) \cdot 2}
\end{array}
Derivation
  1. Initial program 18.8%

    \[\left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-+.f64N/A

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

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

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

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

      \[\leadsto \left(9 \cdot {x}^{4} - \color{blue}{{y}^{4}}\right) + 2 \cdot \left(y \cdot y\right) \]
    6. flip-+N/A

      \[\leadsto \color{blue}{\frac{\left(9 \cdot {x}^{4} - {y}^{4}\right) \cdot \left(9 \cdot {x}^{4} - {y}^{4}\right) - \left(2 \cdot \left(y \cdot y\right)\right) \cdot \left(2 \cdot \left(y \cdot y\right)\right)}{\left(9 \cdot {x}^{4} - {y}^{4}\right) - 2 \cdot \left(y \cdot y\right)}} \]
    7. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{\left(9 \cdot {x}^{4} - {y}^{4}\right) \cdot \left(9 \cdot {x}^{4} - {y}^{4}\right) - \left(2 \cdot \left(y \cdot y\right)\right) \cdot \left(2 \cdot \left(y \cdot y\right)\right)}{\left(9 \cdot {x}^{4} - {y}^{4}\right) - 2 \cdot \left(y \cdot y\right)}} \]
  4. Applied rewrites18.8%

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

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - \color{blue}{{y}^{4}}\right) - \left(y \cdot y\right) \cdot 2} \]
    2. pow-to-expN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - \color{blue}{e^{\log y \cdot 4}}\right) - \left(y \cdot y\right) \cdot 2} \]
    3. exp-prodN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - \color{blue}{{\left(e^{\log y}\right)}^{4}}\right) - \left(y \cdot y\right) \cdot 2} \]
    4. lower-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - \color{blue}{{\left(e^{\log y}\right)}^{4}}\right) - \left(y \cdot y\right) \cdot 2} \]
    5. lower-exp.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - {\color{blue}{\left(e^{\log y}\right)}}^{4}\right) - \left(y \cdot y\right) \cdot 2} \]
    6. lower-log.f6418.8

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - {\left(e^{\color{blue}{\log y}}\right)}^{4}\right) - \left(y \cdot y\right) \cdot 2} \]
  6. Applied rewrites18.8%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - \color{blue}{{\left(e^{\log y}\right)}^{4}}\right) - \left(y \cdot y\right) \cdot 2} \]
  7. Step-by-step derivation
    1. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\color{blue}{{x}^{4}} \cdot 9 - {\left(e^{\log y}\right)}^{4}\right) - \left(y \cdot y\right) \cdot 2} \]
    2. sqr-powN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\color{blue}{\left({x}^{\left(\frac{4}{2}\right)} \cdot {x}^{\left(\frac{4}{2}\right)}\right)} \cdot 9 - {\left(e^{\log y}\right)}^{4}\right) - \left(y \cdot y\right) \cdot 2} \]
    3. metadata-evalN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\left({x}^{\color{blue}{2}} \cdot {x}^{\left(\frac{4}{2}\right)}\right) \cdot 9 - {\left(e^{\log y}\right)}^{4}\right) - \left(y \cdot y\right) \cdot 2} \]
    4. pow2N/A

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

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\left(\color{blue}{\left(x \cdot x\right)} \cdot {x}^{\left(\frac{4}{2}\right)}\right) \cdot 9 - {\left(e^{\log y}\right)}^{4}\right) - \left(y \cdot y\right) \cdot 2} \]
    6. metadata-evalN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot {x}^{\color{blue}{2}}\right) \cdot 9 - {\left(e^{\log y}\right)}^{4}\right) - \left(y \cdot y\right) \cdot 2} \]
    7. pow2N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \color{blue}{\left(x \cdot x\right)}\right) \cdot 9 - {\left(e^{\log y}\right)}^{4}\right) - \left(y \cdot y\right) \cdot 2} \]
    8. associate-*r*N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\color{blue}{\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right)} \cdot 9 - {\left(e^{\log y}\right)}^{4}\right) - \left(y \cdot y\right) \cdot 2} \]
    9. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\color{blue}{\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right)} \cdot 9 - {\left(e^{\log y}\right)}^{4}\right) - \left(y \cdot y\right) \cdot 2} \]
    10. lower-*.f6418.8

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\left(\color{blue}{\left(\left(x \cdot x\right) \cdot x\right)} \cdot x\right) \cdot 9 - {\left(e^{\log y}\right)}^{4}\right) - \left(y \cdot y\right) \cdot 2} \]
  8. Applied rewrites18.8%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\color{blue}{\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right)} \cdot 9 - {\left(e^{\log y}\right)}^{4}\right) - \left(y \cdot y\right) \cdot 2} \]
  9. Add Preprocessing

Alternative 9: 18.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9 - e^{\log y \cdot 4}\right) - \left(y \cdot y\right) \cdot 2} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/
  (- (pow (- (* (pow x 4.0) 9.0) (pow y 4.0)) 2.0) (* (pow y 4.0) 4.0))
  (- (- (* (* (* x x) (* x x)) 9.0) (exp (* (log y) 4.0))) (* (* y y) 2.0))))
double code(double x, double y) {
	return (pow(((pow(x, 4.0) * 9.0) - pow(y, 4.0)), 2.0) - (pow(y, 4.0) * 4.0)) / (((((x * x) * (x * x)) * 9.0) - exp((log(y) * 4.0))) - ((y * y) * 2.0));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (((((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)) ** 2.0d0) - ((y ** 4.0d0) * 4.0d0)) / (((((x * x) * (x * x)) * 9.0d0) - exp((log(y) * 4.0d0))) - ((y * y) * 2.0d0))
end function
public static double code(double x, double y) {
	return (Math.pow(((Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0)), 2.0) - (Math.pow(y, 4.0) * 4.0)) / (((((x * x) * (x * x)) * 9.0) - Math.exp((Math.log(y) * 4.0))) - ((y * y) * 2.0));
}
def code(x, y):
	return (math.pow(((math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0)), 2.0) - (math.pow(y, 4.0) * 4.0)) / (((((x * x) * (x * x)) * 9.0) - math.exp((math.log(y) * 4.0))) - ((y * y) * 2.0))
function code(x, y)
	return Float64(Float64((Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 2.0) - Float64((y ^ 4.0) * 4.0)) / Float64(Float64(Float64(Float64(Float64(x * x) * Float64(x * x)) * 9.0) - exp(Float64(log(y) * 4.0))) - Float64(Float64(y * y) * 2.0)))
end
function tmp = code(x, y)
	tmp = (((((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 2.0) - ((y ^ 4.0) * 4.0)) / (((((x * x) * (x * x)) * 9.0) - exp((log(y) * 4.0))) - ((y * y) * 2.0));
end
code[x_, y_] := N[(N[(N[Power[N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] - N[(N[Power[y, 4.0], $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision] - N[Exp[N[(N[Log[y], $MachinePrecision] * 4.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(y * y), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9 - e^{\log y \cdot 4}\right) - \left(y \cdot y\right) \cdot 2}
\end{array}
Derivation
  1. Initial program 18.8%

    \[\left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-+.f64N/A

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

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

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

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

      \[\leadsto \left(9 \cdot {x}^{4} - \color{blue}{{y}^{4}}\right) + 2 \cdot \left(y \cdot y\right) \]
    6. flip-+N/A

      \[\leadsto \color{blue}{\frac{\left(9 \cdot {x}^{4} - {y}^{4}\right) \cdot \left(9 \cdot {x}^{4} - {y}^{4}\right) - \left(2 \cdot \left(y \cdot y\right)\right) \cdot \left(2 \cdot \left(y \cdot y\right)\right)}{\left(9 \cdot {x}^{4} - {y}^{4}\right) - 2 \cdot \left(y \cdot y\right)}} \]
    7. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{\left(9 \cdot {x}^{4} - {y}^{4}\right) \cdot \left(9 \cdot {x}^{4} - {y}^{4}\right) - \left(2 \cdot \left(y \cdot y\right)\right) \cdot \left(2 \cdot \left(y \cdot y\right)\right)}{\left(9 \cdot {x}^{4} - {y}^{4}\right) - 2 \cdot \left(y \cdot y\right)}} \]
  4. Applied rewrites18.8%

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

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - \color{blue}{{y}^{4}}\right) - \left(y \cdot y\right) \cdot 2} \]
    2. pow-to-expN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - \color{blue}{e^{\log y \cdot 4}}\right) - \left(y \cdot y\right) \cdot 2} \]
    3. lower-exp.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - \color{blue}{e^{\log y \cdot 4}}\right) - \left(y \cdot y\right) \cdot 2} \]
    4. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - e^{\color{blue}{\log y \cdot 4}}\right) - \left(y \cdot y\right) \cdot 2} \]
    5. lower-log.f6418.8

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - e^{\color{blue}{\log y} \cdot 4}\right) - \left(y \cdot y\right) \cdot 2} \]
  6. Applied rewrites18.8%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - \color{blue}{e^{\log y \cdot 4}}\right) - \left(y \cdot y\right) \cdot 2} \]
  7. Step-by-step derivation
    1. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\color{blue}{{x}^{4}} \cdot 9 - e^{\log y \cdot 4}\right) - \left(y \cdot y\right) \cdot 2} \]
    2. metadata-evalN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{\color{blue}{\left(2 \cdot 2\right)}} \cdot 9 - e^{\log y \cdot 4}\right) - \left(y \cdot y\right) \cdot 2} \]
    3. pow-unpowN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\color{blue}{{\left({x}^{2}\right)}^{2}} \cdot 9 - e^{\log y \cdot 4}\right) - \left(y \cdot y\right) \cdot 2} \]
    4. pow2N/A

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

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({\color{blue}{\left(x \cdot x\right)}}^{2} \cdot 9 - e^{\log y \cdot 4}\right) - \left(y \cdot y\right) \cdot 2} \]
    6. pow2N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\color{blue}{\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)} \cdot 9 - e^{\log y \cdot 4}\right) - \left(y \cdot y\right) \cdot 2} \]
    7. lower-*.f6418.8

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\color{blue}{\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)} \cdot 9 - e^{\log y \cdot 4}\right) - \left(y \cdot y\right) \cdot 2} \]
  8. Applied rewrites18.8%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\color{blue}{\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)} \cdot 9 - e^{\log y \cdot 4}\right) - \left(y \cdot y\right) \cdot 2} \]
  9. Add Preprocessing

Alternative 10: 18.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot y\right) \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/
  (- (pow (- (* (pow x 4.0) 9.0) (pow y 4.0)) 2.0) (* (* (* (* y y) y) y) 4.0))
  (- (- (* (* (* x x) (* x x)) 9.0) (* (* y y) (* y y))) (* (* y y) 2.0))))
double code(double x, double y) {
	return (pow(((pow(x, 4.0) * 9.0) - pow(y, 4.0)), 2.0) - ((((y * y) * y) * y) * 4.0)) / (((((x * x) * (x * x)) * 9.0) - ((y * y) * (y * y))) - ((y * y) * 2.0));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (((((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)) ** 2.0d0) - ((((y * y) * y) * y) * 4.0d0)) / (((((x * x) * (x * x)) * 9.0d0) - ((y * y) * (y * y))) - ((y * y) * 2.0d0))
end function
public static double code(double x, double y) {
	return (Math.pow(((Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0)), 2.0) - ((((y * y) * y) * y) * 4.0)) / (((((x * x) * (x * x)) * 9.0) - ((y * y) * (y * y))) - ((y * y) * 2.0));
}
def code(x, y):
	return (math.pow(((math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0)), 2.0) - ((((y * y) * y) * y) * 4.0)) / (((((x * x) * (x * x)) * 9.0) - ((y * y) * (y * y))) - ((y * y) * 2.0))
function code(x, y)
	return Float64(Float64((Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 2.0) - Float64(Float64(Float64(Float64(y * y) * y) * y) * 4.0)) / Float64(Float64(Float64(Float64(Float64(x * x) * Float64(x * x)) * 9.0) - Float64(Float64(y * y) * Float64(y * y))) - Float64(Float64(y * y) * 2.0)))
end
function tmp = code(x, y)
	tmp = (((((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 2.0) - ((((y * y) * y) * y) * 4.0)) / (((((x * x) * (x * x)) * 9.0) - ((y * y) * (y * y))) - ((y * y) * 2.0));
end
code[x_, y_] := N[(N[(N[Power[N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] - N[(N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * y), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision] - N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y * y), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot y\right) \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2}
\end{array}
Derivation
  1. Initial program 18.8%

    \[\left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-+.f64N/A

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

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

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

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

      \[\leadsto \left(9 \cdot {x}^{4} - \color{blue}{{y}^{4}}\right) + 2 \cdot \left(y \cdot y\right) \]
    6. flip-+N/A

      \[\leadsto \color{blue}{\frac{\left(9 \cdot {x}^{4} - {y}^{4}\right) \cdot \left(9 \cdot {x}^{4} - {y}^{4}\right) - \left(2 \cdot \left(y \cdot y\right)\right) \cdot \left(2 \cdot \left(y \cdot y\right)\right)}{\left(9 \cdot {x}^{4} - {y}^{4}\right) - 2 \cdot \left(y \cdot y\right)}} \]
    7. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{\left(9 \cdot {x}^{4} - {y}^{4}\right) \cdot \left(9 \cdot {x}^{4} - {y}^{4}\right) - \left(2 \cdot \left(y \cdot y\right)\right) \cdot \left(2 \cdot \left(y \cdot y\right)\right)}{\left(9 \cdot {x}^{4} - {y}^{4}\right) - 2 \cdot \left(y \cdot y\right)}} \]
  4. Applied rewrites18.8%

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

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - \color{blue}{{y}^{4}}\right) - \left(y \cdot y\right) \cdot 2} \]
    2. metadata-evalN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - {y}^{\color{blue}{\left(2 + 2\right)}}\right) - \left(y \cdot y\right) \cdot 2} \]
    3. pow-prod-upN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - \color{blue}{{y}^{2} \cdot {y}^{2}}\right) - \left(y \cdot y\right) \cdot 2} \]
    4. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - \color{blue}{{y}^{2} \cdot {y}^{2}}\right) - \left(y \cdot y\right) \cdot 2} \]
    5. pow2N/A

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

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - \color{blue}{\left(y \cdot y\right)} \cdot {y}^{2}\right) - \left(y \cdot y\right) \cdot 2} \]
    7. pow2N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - \left(y \cdot y\right) \cdot \color{blue}{\left(y \cdot y\right)}\right) - \left(y \cdot y\right) \cdot 2} \]
    8. lift-*.f6418.8

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - \left(y \cdot y\right) \cdot \color{blue}{\left(y \cdot y\right)}\right) - \left(y \cdot y\right) \cdot 2} \]
  6. Applied rewrites18.8%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{4} \cdot 9 - \color{blue}{\left(y \cdot y\right) \cdot \left(y \cdot y\right)}\right) - \left(y \cdot y\right) \cdot 2} \]
  7. Step-by-step derivation
    1. lift-pow.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\color{blue}{{x}^{4}} \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \]
    2. metadata-evalN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({x}^{\color{blue}{\left(2 \cdot 2\right)}} \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \]
    3. pow-unpowN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\color{blue}{{\left({x}^{2}\right)}^{2}} \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \]
    4. pow2N/A

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

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left({\color{blue}{\left(x \cdot x\right)}}^{2} \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \]
    6. pow2N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\color{blue}{\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)} \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \]
    7. lower-*.f6418.8

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\color{blue}{\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)} \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \]
  8. Applied rewrites18.8%

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

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - \color{blue}{{y}^{4}} \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \]
    2. sqr-powN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - \color{blue}{\left({y}^{\left(\frac{4}{2}\right)} \cdot {y}^{\left(\frac{4}{2}\right)}\right)} \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \]
    3. metadata-evalN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - \left({y}^{\color{blue}{2}} \cdot {y}^{\left(\frac{4}{2}\right)}\right) \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \]
    4. metadata-evalN/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - \left({y}^{2} \cdot {y}^{\color{blue}{2}}\right) \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \]
    5. pow2N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - \left({y}^{2} \cdot \color{blue}{\left(y \cdot y\right)}\right) \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \]
    6. associate-*r*N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - \color{blue}{\left(\left({y}^{2} \cdot y\right) \cdot y\right)} \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \]
    7. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - \color{blue}{\left(\left({y}^{2} \cdot y\right) \cdot y\right)} \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \]
    8. lower-*.f64N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - \left(\color{blue}{\left({y}^{2} \cdot y\right)} \cdot y\right) \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \]
    9. pow2N/A

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - \left(\left(\color{blue}{\left(y \cdot y\right)} \cdot y\right) \cdot y\right) \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \]
    10. lift-*.f6418.8

      \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - \left(\left(\color{blue}{\left(y \cdot y\right)} \cdot y\right) \cdot y\right) \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \]
  10. Applied rewrites18.8%

    \[\leadsto \frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - \color{blue}{\left(\left(\left(y \cdot y\right) \cdot y\right) \cdot y\right)} \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2} \]
  11. Add Preprocessing

Alternative 11: 18.8% accurate, 4.3× speedup?

\[\begin{array}{l} \\ \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right) - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) + 2 \cdot \left(y \cdot y\right) \end{array} \]
(FPCore (x y)
 :precision binary64
 (+ (- (* (* x x) (* (* x x) 9.0)) (* (* y y) (* y y))) (* 2.0 (* y y))))
double code(double x, double y) {
	return (((x * x) * ((x * x) * 9.0)) - ((y * y) * (y * y))) + (2.0 * (y * y));
}
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, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (((x * x) * ((x * x) * 9.0d0)) - ((y * y) * (y * y))) + (2.0d0 * (y * y))
end function
public static double code(double x, double y) {
	return (((x * x) * ((x * x) * 9.0)) - ((y * y) * (y * y))) + (2.0 * (y * y));
}
def code(x, y):
	return (((x * x) * ((x * x) * 9.0)) - ((y * y) * (y * y))) + (2.0 * (y * y))
function code(x, y)
	return Float64(Float64(Float64(Float64(x * x) * Float64(Float64(x * x) * 9.0)) - Float64(Float64(y * y) * Float64(y * y))) + Float64(2.0 * Float64(y * y)))
end
function tmp = code(x, y)
	tmp = (((x * x) * ((x * x) * 9.0)) - ((y * y) * (y * y))) + (2.0 * (y * y));
end
code[x_, y_] := N[(N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] - N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right) - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) + 2 \cdot \left(y \cdot y\right)
\end{array}
Derivation
  1. Initial program 18.8%

    \[\left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f64N/A

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

      \[\leadsto \left(9 \cdot \color{blue}{{x}^{4}} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
    3. *-commutativeN/A

      \[\leadsto \left(\color{blue}{{x}^{4} \cdot 9} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
    4. sqr-powN/A

      \[\leadsto \left(\color{blue}{\left({x}^{\left(\frac{4}{2}\right)} \cdot {x}^{\left(\frac{4}{2}\right)}\right)} \cdot 9 - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
    5. associate-*l*N/A

      \[\leadsto \left(\color{blue}{{x}^{\left(\frac{4}{2}\right)} \cdot \left({x}^{\left(\frac{4}{2}\right)} \cdot 9\right)} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
    6. lower-*.f64N/A

      \[\leadsto \left(\color{blue}{{x}^{\left(\frac{4}{2}\right)} \cdot \left({x}^{\left(\frac{4}{2}\right)} \cdot 9\right)} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
    7. metadata-evalN/A

      \[\leadsto \left({x}^{\color{blue}{2}} \cdot \left({x}^{\left(\frac{4}{2}\right)} \cdot 9\right) - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
    8. unpow2N/A

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

      \[\leadsto \left(\color{blue}{\left(x \cdot x\right)} \cdot \left({x}^{\left(\frac{4}{2}\right)} \cdot 9\right) - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
    10. lower-*.f64N/A

      \[\leadsto \left(\left(x \cdot x\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} \cdot 9\right)} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
    11. metadata-evalN/A

      \[\leadsto \left(\left(x \cdot x\right) \cdot \left({x}^{\color{blue}{2}} \cdot 9\right) - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
    12. unpow2N/A

      \[\leadsto \left(\left(x \cdot x\right) \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot 9\right) - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
    13. lower-*.f6418.8

      \[\leadsto \left(\left(x \cdot x\right) \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot 9\right) - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
  4. Applied rewrites18.8%

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

      \[\leadsto \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right) - \color{blue}{{y}^{4}}\right) + 2 \cdot \left(y \cdot y\right) \]
    2. metadata-evalN/A

      \[\leadsto \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right) - {y}^{\color{blue}{\left(2 + 2\right)}}\right) + 2 \cdot \left(y \cdot y\right) \]
    3. pow-prod-upN/A

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

      \[\leadsto \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right) - \color{blue}{{y}^{2} \cdot {y}^{2}}\right) + 2 \cdot \left(y \cdot y\right) \]
    5. pow2N/A

      \[\leadsto \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right) - \color{blue}{\left(y \cdot y\right)} \cdot {y}^{2}\right) + 2 \cdot \left(y \cdot y\right) \]
    6. lift-*.f64N/A

      \[\leadsto \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right) - \color{blue}{\left(y \cdot y\right)} \cdot {y}^{2}\right) + 2 \cdot \left(y \cdot y\right) \]
    7. pow2N/A

      \[\leadsto \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right) - \left(y \cdot y\right) \cdot \color{blue}{\left(y \cdot y\right)}\right) + 2 \cdot \left(y \cdot y\right) \]
    8. lift-*.f6418.8

      \[\leadsto \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right) - \left(y \cdot y\right) \cdot \color{blue}{\left(y \cdot y\right)}\right) + 2 \cdot \left(y \cdot y\right) \]
  6. Applied rewrites18.8%

    \[\leadsto \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right) - \color{blue}{\left(y \cdot y\right) \cdot \left(y \cdot y\right)}\right) + 2 \cdot \left(y \cdot y\right) \]
  7. Add Preprocessing

Alternative 12: 11.1% accurate, 20.4× speedup?

\[\begin{array}{l} \\ \left(2 \cdot y\right) \cdot y \end{array} \]
(FPCore (x y) :precision binary64 (* (* 2.0 y) y))
double code(double x, double y) {
	return (2.0 * y) * y;
}
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, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (2.0d0 * y) * y
end function
public static double code(double x, double y) {
	return (2.0 * y) * y;
}
def code(x, y):
	return (2.0 * y) * y
function code(x, y)
	return Float64(Float64(2.0 * y) * y)
end
function tmp = code(x, y)
	tmp = (2.0 * y) * y;
end
code[x_, y_] := N[(N[(2.0 * y), $MachinePrecision] * y), $MachinePrecision]
\begin{array}{l}

\\
\left(2 \cdot y\right) \cdot y
\end{array}
Derivation
  1. Initial program 18.8%

    \[\left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right) \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0

    \[\leadsto \color{blue}{2 \cdot {y}^{2} - {y}^{4}} \]
  4. Step-by-step derivation
    1. metadata-evalN/A

      \[\leadsto 2 \cdot {y}^{2} - {y}^{\left(2 + \color{blue}{2}\right)} \]
    2. pow-prod-upN/A

      \[\leadsto 2 \cdot {y}^{2} - {y}^{2} \cdot \color{blue}{{y}^{2}} \]
    3. cancel-sign-sub-invN/A

      \[\leadsto 2 \cdot {y}^{2} + \color{blue}{\left(\mathsf{neg}\left({y}^{2}\right)\right) \cdot {y}^{2}} \]
    4. mul-1-negN/A

      \[\leadsto 2 \cdot {y}^{2} + \left(-1 \cdot {y}^{2}\right) \cdot {\color{blue}{y}}^{2} \]
    5. distribute-rgt-inN/A

      \[\leadsto {y}^{2} \cdot \color{blue}{\left(2 + -1 \cdot {y}^{2}\right)} \]
    6. *-commutativeN/A

      \[\leadsto \left(2 + -1 \cdot {y}^{2}\right) \cdot \color{blue}{{y}^{2}} \]
    7. pow2N/A

      \[\leadsto \left(2 + -1 \cdot {y}^{2}\right) \cdot \left(y \cdot \color{blue}{y}\right) \]
    8. associate-*r*N/A

      \[\leadsto \left(\left(2 + -1 \cdot {y}^{2}\right) \cdot y\right) \cdot \color{blue}{y} \]
    9. lower-*.f64N/A

      \[\leadsto \left(\left(2 + -1 \cdot {y}^{2}\right) \cdot y\right) \cdot \color{blue}{y} \]
    10. lower-*.f64N/A

      \[\leadsto \left(\left(2 + -1 \cdot {y}^{2}\right) \cdot y\right) \cdot y \]
    11. cancel-sign-subN/A

      \[\leadsto \left(\left(2 - \left(\mathsf{neg}\left(-1\right)\right) \cdot {y}^{2}\right) \cdot y\right) \cdot y \]
    12. metadata-evalN/A

      \[\leadsto \left(\left(2 - 1 \cdot {y}^{2}\right) \cdot y\right) \cdot y \]
    13. *-lft-identityN/A

      \[\leadsto \left(\left(2 - {y}^{2}\right) \cdot y\right) \cdot y \]
    14. lower--.f64N/A

      \[\leadsto \left(\left(2 - {y}^{2}\right) \cdot y\right) \cdot y \]
    15. pow2N/A

      \[\leadsto \left(\left(2 - y \cdot y\right) \cdot y\right) \cdot y \]
    16. lift-*.f641.5

      \[\leadsto \left(\left(2 - y \cdot y\right) \cdot y\right) \cdot y \]
  5. Applied rewrites1.5%

    \[\leadsto \color{blue}{\left(\left(2 - y \cdot y\right) \cdot y\right) \cdot y} \]
  6. Taylor expanded in y around 0

    \[\leadsto \left(2 \cdot y\right) \cdot y \]
  7. Step-by-step derivation
    1. Applied rewrites11.1%

      \[\leadsto \left(2 \cdot y\right) \cdot y \]
    2. Add Preprocessing

    Reproduce

    ?
    herbie shell --seed 2025065 
    (FPCore (x y)
      :name "From Rump in a 1983 paper"
      :precision binary64
      :pre (and (== x 10864.0) (== y 18817.0))
      (+ (- (* 9.0 (pow x 4.0)) (pow y 4.0)) (* 2.0 (* y y))))