Radioactive exchange between two surfaces

Percentage Accurate: 85.8% → 98.0%
Time: 11.2s
Alternatives: 11
Speedup: 12.1×

Specification

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

\\
{x}^{4} - {y}^{4}
\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 11 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: 85.8% accurate, 1.0× speedup?

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

\\
{x}^{4} - {y}^{4}
\end{array}

Alternative 1: 98.0% accurate, 8.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{x + y}\\ \mathbf{if}\;y \leq -8.6 \cdot 10^{-42}:\\ \;\;\;\;\frac{1}{\frac{\frac{t\_0}{x - y}}{y \cdot y}}\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+24}:\\ \;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \frac{x - y}{t\_0}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ 1.0 (+ x y))))
   (if (<= y -8.6e-42)
     (/ 1.0 (/ (/ t_0 (- x y)) (* y y)))
     (if (<= y 1.5e+24)
       (- (* x (* x (* x x))) (* y (* y (* y y))))
       (* (* y y) (/ (- x y) t_0))))))
double code(double x, double y) {
	double t_0 = 1.0 / (x + y);
	double tmp;
	if (y <= -8.6e-42) {
		tmp = 1.0 / ((t_0 / (x - y)) / (y * y));
	} else if (y <= 1.5e+24) {
		tmp = (x * (x * (x * x))) - (y * (y * (y * y)));
	} else {
		tmp = (y * y) * ((x - y) / t_0);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 1.0d0 / (x + y)
    if (y <= (-8.6d-42)) then
        tmp = 1.0d0 / ((t_0 / (x - y)) / (y * y))
    else if (y <= 1.5d+24) then
        tmp = (x * (x * (x * x))) - (y * (y * (y * y)))
    else
        tmp = (y * y) * ((x - y) / t_0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 1.0 / (x + y);
	double tmp;
	if (y <= -8.6e-42) {
		tmp = 1.0 / ((t_0 / (x - y)) / (y * y));
	} else if (y <= 1.5e+24) {
		tmp = (x * (x * (x * x))) - (y * (y * (y * y)));
	} else {
		tmp = (y * y) * ((x - y) / t_0);
	}
	return tmp;
}
def code(x, y):
	t_0 = 1.0 / (x + y)
	tmp = 0
	if y <= -8.6e-42:
		tmp = 1.0 / ((t_0 / (x - y)) / (y * y))
	elif y <= 1.5e+24:
		tmp = (x * (x * (x * x))) - (y * (y * (y * y)))
	else:
		tmp = (y * y) * ((x - y) / t_0)
	return tmp
function code(x, y)
	t_0 = Float64(1.0 / Float64(x + y))
	tmp = 0.0
	if (y <= -8.6e-42)
		tmp = Float64(1.0 / Float64(Float64(t_0 / Float64(x - y)) / Float64(y * y)));
	elseif (y <= 1.5e+24)
		tmp = Float64(Float64(x * Float64(x * Float64(x * x))) - Float64(y * Float64(y * Float64(y * y))));
	else
		tmp = Float64(Float64(y * y) * Float64(Float64(x - y) / t_0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 1.0 / (x + y);
	tmp = 0.0;
	if (y <= -8.6e-42)
		tmp = 1.0 / ((t_0 / (x - y)) / (y * y));
	elseif (y <= 1.5e+24)
		tmp = (x * (x * (x * x))) - (y * (y * (y * y)));
	else
		tmp = (y * y) * ((x - y) / t_0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.6e-42], N[(1.0 / N[(N[(t$95$0 / N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e+24], N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * y), $MachinePrecision] * N[(N[(x - y), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1}{x + y}\\
\mathbf{if}\;y \leq -8.6 \cdot 10^{-42}:\\
\;\;\;\;\frac{1}{\frac{\frac{t\_0}{x - y}}{y \cdot y}}\\

\mathbf{elif}\;y \leq 1.5 \cdot 10^{+24}:\\
\;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \frac{x - y}{t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.6000000000000002e-42

    1. Initial program 70.6%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr86.5%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \frac{y \cdot \left(y \cdot \left(y \cdot y\right)\right) - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{y \cdot y - x \cdot x} \cdot \left(x \cdot x - y \cdot y\right) \]
      4. associate-*r*N/A

        \[\leadsto \frac{y \cdot \left(y \cdot \left(y \cdot y\right)\right) - x \cdot \left(x \cdot \left(x \cdot x\right)\right)}{y \cdot y - x \cdot x} \cdot \left(x \cdot x - y \cdot y\right) \]
      5. fmm-defN/A

        \[\leadsto \frac{\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)}{y \cdot y - x \cdot x} \cdot \left(\color{blue}{x} \cdot x - y \cdot y\right) \]
      6. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot x\right)\right)}{y \cdot y - x \cdot x} \cdot \left(x \cdot x - y \cdot y\right) \]
      7. associate-*l/N/A

        \[\leadsto \frac{\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot x\right)\right) \cdot \left(x \cdot x - y \cdot y\right)}{\color{blue}{y \cdot y - x \cdot x}} \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot x\right)\right) \cdot \left(x \cdot x - y \cdot y\right)\right), \color{blue}{\left(y \cdot y - x \cdot x\right)}\right) \]
    6. Applied egg-rr40.1%

      \[\leadsto \color{blue}{\frac{\left(y \cdot \left(y \cdot \left(y \cdot y\right)\right) - x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(x \cdot x - y \cdot y\right)}{y \cdot y - x \cdot x}} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \left(x \cdot x - y \cdot y\right) \cdot \color{blue}{\frac{y \cdot \left(y \cdot \left(y \cdot y\right)\right) - x \cdot \left(x \cdot \left(x \cdot x\right)\right)}{y \cdot y - x \cdot x}} \]
      3. flip--N/A

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

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

        \[\leadsto \frac{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}{x \cdot x + y \cdot y} \cdot \frac{y \cdot \color{blue}{\left(y \cdot \left(y \cdot y\right)\right)} - x \cdot \left(x \cdot \left(x \cdot x\right)\right)}{y \cdot y - x \cdot x} \]
      6. clear-numN/A

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

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

        \[\leadsto \frac{1}{\frac{x \cdot x + y \cdot y}{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}} \cdot \frac{\left(y \cdot y\right) \cdot \left(y \cdot y\right) - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{y \cdot \color{blue}{y} - x \cdot x} \]
      9. flip-+N/A

        \[\leadsto \frac{1}{\frac{x \cdot x + y \cdot y}{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}} \cdot \left(y \cdot y + \color{blue}{x \cdot x}\right) \]
    8. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{1}{\frac{\frac{\frac{1}{x + y}}{x - y}}{x \cdot x + y \cdot y}}} \]
    9. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(x, y\right)\right), \color{blue}{\left({y}^{2}\right)}\right)\right) \]
    10. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(x, y\right)\right), \left(y \cdot \color{blue}{y}\right)\right)\right) \]
      2. *-lowering-*.f6499.9%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(x, y\right)\right), \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right)\right) \]
    11. Simplified99.9%

      \[\leadsto \frac{1}{\frac{\frac{\frac{1}{x + y}}{x - y}}{\color{blue}{y \cdot y}}} \]

    if -8.6000000000000002e-42 < y < 1.49999999999999997e24

    1. Initial program 100.0%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left({x}^{4}\right), \color{blue}{\left({y}^{4}\right)}\right) \]
      2. sqr-powN/A

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

        \[\leadsto \mathsf{\_.f64}\left(\left({x}^{2} \cdot {x}^{\left(\frac{4}{2}\right)}\right), \left({y}^{4}\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\left(x \cdot x\right) \cdot {x}^{\left(\frac{4}{2}\right)}\right), \left({y}^{4}\right)\right) \]
      5. associate-*l*N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\left(x \cdot \left(x \cdot {x}^{2}\right)\right), \left({y}^{4}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right), \left({y}^{4}\right)\right) \]
      8. cube-unmultN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(x \cdot {x}^{3}\right), \left({y}^{4}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \left({x}^{3}\right)\right), \left({\color{blue}{y}}^{4}\right)\right) \]
      10. cube-unmultN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot \left(x \cdot x\right)\right)\right), \left({y}^{4}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot {x}^{2}\right)\right), \left({y}^{4}\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot {x}^{\left(\frac{4}{2}\right)}\right)\right), \left({y}^{4}\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left({x}^{\left(\frac{4}{2}\right)}\right)\right)\right), \left({y}^{4}\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left({x}^{2}\right)\right)\right), \left({y}^{4}\right)\right) \]
      15. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left({y}^{4}\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left({y}^{4}\right)\right) \]
      17. sqr-powN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left({y}^{\left(\frac{4}{2}\right)} \cdot \color{blue}{{y}^{\left(\frac{4}{2}\right)}}\right)\right) \]
      18. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left({y}^{2} \cdot {y}^{\left(\frac{4}{2}\right)}\right)\right) \]
      19. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\left(y \cdot y\right) \cdot {\color{blue}{y}}^{\left(\frac{4}{2}\right)}\right)\right) \]
      20. associate-*l*N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(y \cdot \color{blue}{\left(y \cdot {y}^{\left(\frac{4}{2}\right)}\right)}\right)\right) \]
      21. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(y \cdot \left(y \cdot {y}^{2}\right)\right)\right) \]
      22. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(y \cdot \left(y \cdot \left(y \cdot \color{blue}{y}\right)\right)\right)\right) \]
      23. cube-unmultN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(y \cdot {y}^{\color{blue}{3}}\right)\right) \]
      24. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(y, \color{blue}{\left({y}^{3}\right)}\right)\right) \]
      25. cube-unmultN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(y, \left(y \cdot \color{blue}{\left(y \cdot y\right)}\right)\right)\right) \]
      26. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(y, \left(y \cdot {y}^{\color{blue}{2}}\right)\right)\right) \]
      27. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(y, \left(y \cdot {y}^{\left(\frac{4}{\color{blue}{2}}\right)}\right)\right)\right) \]
    4. Applied egg-rr99.8%

      \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)} \]

    if 1.49999999999999997e24 < y

    1. Initial program 63.3%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr79.9%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \color{blue}{\left({y}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \left(y \cdot \color{blue}{y}\right)\right) \]
      2. *-lowering-*.f6479.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right) \]
    7. Simplified79.9%

      \[\leadsto \left(x \cdot x - y \cdot y\right) \cdot \color{blue}{\left(y \cdot y\right)} \]
    8. Step-by-step derivation
      1. difference-of-squaresN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x + y\right) \cdot \left(x - y\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x - y\right) \cdot \left(x + y\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      3. /-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x - y}{1} \cdot \left(x + y\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      4. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x - y}{\frac{1}{x + y}}\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - y\right), \left(\frac{1}{x + y}\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \left(\frac{1}{x + y}\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \mathsf{/.f64}\left(1, \left(x + y\right)\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      8. +-lowering-+.f6499.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
    9. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{x - y}{\frac{1}{x + y}}} \cdot \left(y \cdot y\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.6 \cdot 10^{-42}:\\ \;\;\;\;\frac{1}{\frac{\frac{\frac{1}{x + y}}{x - y}}{y \cdot y}}\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+24}:\\ \;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \frac{x - y}{\frac{1}{x + y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 89.6% accurate, 6.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(y \cdot \left(0 - y \cdot y\right)\right)\\ t_1 := x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\ t_2 := \left(x \cdot x\right) \cdot \left(x \cdot x - y \cdot y\right)\\ \mathbf{if}\;x \leq -3.1 \cdot 10^{+159}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -9.5 \cdot 10^{-79}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{-13}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.22 \cdot 10^{+173}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{+200}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* y (* y (- 0.0 (* y y)))))
        (t_1 (* x (* x (* x x))))
        (t_2 (* (* x x) (- (* x x) (* y y)))))
   (if (<= x -3.1e+159)
     t_1
     (if (<= x -9.5e-79)
       t_2
       (if (<= x 2.6e-13)
         t_0
         (if (<= x 1.22e+173) t_2 (if (<= x 1.7e+200) t_0 t_1)))))))
double code(double x, double y) {
	double t_0 = y * (y * (0.0 - (y * y)));
	double t_1 = x * (x * (x * x));
	double t_2 = (x * x) * ((x * x) - (y * y));
	double tmp;
	if (x <= -3.1e+159) {
		tmp = t_1;
	} else if (x <= -9.5e-79) {
		tmp = t_2;
	} else if (x <= 2.6e-13) {
		tmp = t_0;
	} else if (x <= 1.22e+173) {
		tmp = t_2;
	} else if (x <= 1.7e+200) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = y * (y * (0.0d0 - (y * y)))
    t_1 = x * (x * (x * x))
    t_2 = (x * x) * ((x * x) - (y * y))
    if (x <= (-3.1d+159)) then
        tmp = t_1
    else if (x <= (-9.5d-79)) then
        tmp = t_2
    else if (x <= 2.6d-13) then
        tmp = t_0
    else if (x <= 1.22d+173) then
        tmp = t_2
    else if (x <= 1.7d+200) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = y * (y * (0.0 - (y * y)));
	double t_1 = x * (x * (x * x));
	double t_2 = (x * x) * ((x * x) - (y * y));
	double tmp;
	if (x <= -3.1e+159) {
		tmp = t_1;
	} else if (x <= -9.5e-79) {
		tmp = t_2;
	} else if (x <= 2.6e-13) {
		tmp = t_0;
	} else if (x <= 1.22e+173) {
		tmp = t_2;
	} else if (x <= 1.7e+200) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y):
	t_0 = y * (y * (0.0 - (y * y)))
	t_1 = x * (x * (x * x))
	t_2 = (x * x) * ((x * x) - (y * y))
	tmp = 0
	if x <= -3.1e+159:
		tmp = t_1
	elif x <= -9.5e-79:
		tmp = t_2
	elif x <= 2.6e-13:
		tmp = t_0
	elif x <= 1.22e+173:
		tmp = t_2
	elif x <= 1.7e+200:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y)
	t_0 = Float64(y * Float64(y * Float64(0.0 - Float64(y * y))))
	t_1 = Float64(x * Float64(x * Float64(x * x)))
	t_2 = Float64(Float64(x * x) * Float64(Float64(x * x) - Float64(y * y)))
	tmp = 0.0
	if (x <= -3.1e+159)
		tmp = t_1;
	elseif (x <= -9.5e-79)
		tmp = t_2;
	elseif (x <= 2.6e-13)
		tmp = t_0;
	elseif (x <= 1.22e+173)
		tmp = t_2;
	elseif (x <= 1.7e+200)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = y * (y * (0.0 - (y * y)));
	t_1 = x * (x * (x * x));
	t_2 = (x * x) * ((x * x) - (y * y));
	tmp = 0.0;
	if (x <= -3.1e+159)
		tmp = t_1;
	elseif (x <= -9.5e-79)
		tmp = t_2;
	elseif (x <= 2.6e-13)
		tmp = t_0;
	elseif (x <= 1.22e+173)
		tmp = t_2;
	elseif (x <= 1.7e+200)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * N[(0.0 - N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] - N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.1e+159], t$95$1, If[LessEqual[x, -9.5e-79], t$95$2, If[LessEqual[x, 2.6e-13], t$95$0, If[LessEqual[x, 1.22e+173], t$95$2, If[LessEqual[x, 1.7e+200], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot \left(0 - y \cdot y\right)\right)\\
t_1 := x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
t_2 := \left(x \cdot x\right) \cdot \left(x \cdot x - y \cdot y\right)\\
\mathbf{if}\;x \leq -3.1 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -9.5 \cdot 10^{-79}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 2.6 \cdot 10^{-13}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq 1.22 \cdot 10^{+173}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 1.7 \cdot 10^{+200}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.0999999999999998e159 or 1.69999999999999985e200 < x

    1. Initial program 65.0%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr76.7%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
    5. Taylor expanded in x around inf

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

        \[\leadsto {x}^{\left(2 \cdot \color{blue}{2}\right)} \]
      2. pow-sqrN/A

        \[\leadsto {x}^{2} \cdot \color{blue}{{x}^{2}} \]
      3. +-lft-identityN/A

        \[\leadsto {x}^{2} \cdot \left(0 + \color{blue}{{x}^{2}}\right) \]
      4. mul0-lftN/A

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

        \[\leadsto {x}^{2} \cdot \left(\left(-1 + 1\right) \cdot {y}^{2} + {x}^{2}\right) \]
      6. distribute-lft1-inN/A

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(x \cdot \left(0 \cdot {y}^{2} + {x}^{2}\right)\right) \]
      15. mul0-lftN/A

        \[\leadsto x \cdot \left(x \cdot \left(0 + {\color{blue}{x}}^{2}\right)\right) \]
      16. +-lft-identityN/A

        \[\leadsto x \cdot \left(x \cdot {x}^{\color{blue}{2}}\right) \]
      17. unpow2N/A

        \[\leadsto x \cdot \left(x \cdot \left(x \cdot \color{blue}{x}\right)\right) \]
      18. cube-multN/A

        \[\leadsto x \cdot {x}^{\color{blue}{3}} \]
      19. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left({x}^{3}\right)}\right) \]
      20. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right)\right) \]
      21. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot {x}^{\color{blue}{2}}\right)\right) \]
    7. Simplified95.0%

      \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(x \cdot x\right)\right)} \]

    if -3.0999999999999998e159 < x < -9.4999999999999997e-79 or 2.6e-13 < x < 1.22e173

    1. Initial program 84.1%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr99.7%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \color{blue}{\left({x}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \left(x \cdot \color{blue}{x}\right)\right) \]
      2. *-lowering-*.f6491.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right) \]
    7. Simplified91.2%

      \[\leadsto \left(x \cdot x - y \cdot y\right) \cdot \color{blue}{\left(x \cdot x\right)} \]

    if -9.4999999999999997e-79 < x < 2.6e-13 or 1.22e173 < x < 1.69999999999999985e200

    1. Initial program 93.5%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr93.2%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \frac{y \cdot \left(y \cdot \left(y \cdot y\right)\right) - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{y \cdot y - x \cdot x} \cdot \left(x \cdot x - y \cdot y\right) \]
      4. associate-*r*N/A

        \[\leadsto \frac{y \cdot \left(y \cdot \left(y \cdot y\right)\right) - x \cdot \left(x \cdot \left(x \cdot x\right)\right)}{y \cdot y - x \cdot x} \cdot \left(x \cdot x - y \cdot y\right) \]
      5. fmm-defN/A

        \[\leadsto \frac{\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)}{y \cdot y - x \cdot x} \cdot \left(\color{blue}{x} \cdot x - y \cdot y\right) \]
      6. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot x\right)\right)}{y \cdot y - x \cdot x} \cdot \left(x \cdot x - y \cdot y\right) \]
      7. associate-*l/N/A

        \[\leadsto \frac{\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot x\right)\right) \cdot \left(x \cdot x - y \cdot y\right)}{\color{blue}{y \cdot y - x \cdot x}} \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot x\right)\right) \cdot \left(x \cdot x - y \cdot y\right)\right), \color{blue}{\left(y \cdot y - x \cdot x\right)}\right) \]
    6. Applied egg-rr54.0%

      \[\leadsto \color{blue}{\frac{\left(y \cdot \left(y \cdot \left(y \cdot y\right)\right) - x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(x \cdot x - y \cdot y\right)}{y \cdot y - x \cdot x}} \]
    7. Taylor expanded in y around inf

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{\left(\left(-1 \cdot {y}^{2}\right) \cdot y\right)}\right) \]
      8. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \color{blue}{\left(-1 \cdot {y}^{2}\right)}\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left({y}^{2}\right)\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \left(0 - \color{blue}{{y}^{2}}\right)\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(0, \color{blue}{\left({y}^{2}\right)}\right)\right)\right) \]
      13. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(0, \left(y \cdot \color{blue}{y}\right)\right)\right)\right) \]
      14. *-lowering-*.f6492.7%

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right)\right)\right) \]
    9. Simplified92.7%

      \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(0 - y \cdot y\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.1 \cdot 10^{+159}:\\ \;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\ \mathbf{elif}\;x \leq -9.5 \cdot 10^{-79}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(x \cdot x - y \cdot y\right)\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{-13}:\\ \;\;\;\;y \cdot \left(y \cdot \left(0 - y \cdot y\right)\right)\\ \mathbf{elif}\;x \leq 1.22 \cdot 10^{+173}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(x \cdot x - y \cdot y\right)\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{+200}:\\ \;\;\;\;y \cdot \left(y \cdot \left(0 - y \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 90.7% accurate, 6.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(y \cdot \left(0 - y \cdot y\right)\right)\\ t_1 := \left(y \cdot y\right) \cdot \left(x \cdot x - y \cdot y\right)\\ \mathbf{if}\;y \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq -3.4 \cdot 10^{-65}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2 \cdot 10^{-46}:\\ \;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+136}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* y (* y (- 0.0 (* y y)))))
        (t_1 (* (* y y) (- (* x x) (* y y)))))
   (if (<= y -1.32e+154)
     t_0
     (if (<= y -3.4e-65)
       t_1
       (if (<= y 2e-46) (* x (* x (* x x))) (if (<= y 6.5e+136) t_1 t_0))))))
double code(double x, double y) {
	double t_0 = y * (y * (0.0 - (y * y)));
	double t_1 = (y * y) * ((x * x) - (y * y));
	double tmp;
	if (y <= -1.32e+154) {
		tmp = t_0;
	} else if (y <= -3.4e-65) {
		tmp = t_1;
	} else if (y <= 2e-46) {
		tmp = x * (x * (x * x));
	} else if (y <= 6.5e+136) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = y * (y * (0.0d0 - (y * y)))
    t_1 = (y * y) * ((x * x) - (y * y))
    if (y <= (-1.32d+154)) then
        tmp = t_0
    else if (y <= (-3.4d-65)) then
        tmp = t_1
    else if (y <= 2d-46) then
        tmp = x * (x * (x * x))
    else if (y <= 6.5d+136) then
        tmp = t_1
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = y * (y * (0.0 - (y * y)));
	double t_1 = (y * y) * ((x * x) - (y * y));
	double tmp;
	if (y <= -1.32e+154) {
		tmp = t_0;
	} else if (y <= -3.4e-65) {
		tmp = t_1;
	} else if (y <= 2e-46) {
		tmp = x * (x * (x * x));
	} else if (y <= 6.5e+136) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = y * (y * (0.0 - (y * y)))
	t_1 = (y * y) * ((x * x) - (y * y))
	tmp = 0
	if y <= -1.32e+154:
		tmp = t_0
	elif y <= -3.4e-65:
		tmp = t_1
	elif y <= 2e-46:
		tmp = x * (x * (x * x))
	elif y <= 6.5e+136:
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(y * Float64(y * Float64(0.0 - Float64(y * y))))
	t_1 = Float64(Float64(y * y) * Float64(Float64(x * x) - Float64(y * y)))
	tmp = 0.0
	if (y <= -1.32e+154)
		tmp = t_0;
	elseif (y <= -3.4e-65)
		tmp = t_1;
	elseif (y <= 2e-46)
		tmp = Float64(x * Float64(x * Float64(x * x)));
	elseif (y <= 6.5e+136)
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = y * (y * (0.0 - (y * y)));
	t_1 = (y * y) * ((x * x) - (y * y));
	tmp = 0.0;
	if (y <= -1.32e+154)
		tmp = t_0;
	elseif (y <= -3.4e-65)
		tmp = t_1;
	elseif (y <= 2e-46)
		tmp = x * (x * (x * x));
	elseif (y <= 6.5e+136)
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * N[(0.0 - N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * y), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] - N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.32e+154], t$95$0, If[LessEqual[y, -3.4e-65], t$95$1, If[LessEqual[y, 2e-46], N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e+136], t$95$1, t$95$0]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot \left(0 - y \cdot y\right)\right)\\
t_1 := \left(y \cdot y\right) \cdot \left(x \cdot x - y \cdot y\right)\\
\mathbf{if}\;y \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq -3.4 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 2 \cdot 10^{-46}:\\
\;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\

\mathbf{elif}\;y \leq 6.5 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.31999999999999998e154 or 6.4999999999999998e136 < y

    1. Initial program 50.0%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr65.0%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \frac{y \cdot \left(y \cdot \left(y \cdot y\right)\right) - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{y \cdot y - x \cdot x} \cdot \left(x \cdot x - y \cdot y\right) \]
      4. associate-*r*N/A

        \[\leadsto \frac{y \cdot \left(y \cdot \left(y \cdot y\right)\right) - x \cdot \left(x \cdot \left(x \cdot x\right)\right)}{y \cdot y - x \cdot x} \cdot \left(x \cdot x - y \cdot y\right) \]
      5. fmm-defN/A

        \[\leadsto \frac{\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)}{y \cdot y - x \cdot x} \cdot \left(\color{blue}{x} \cdot x - y \cdot y\right) \]
      6. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot x\right)\right)}{y \cdot y - x \cdot x} \cdot \left(x \cdot x - y \cdot y\right) \]
      7. associate-*l/N/A

        \[\leadsto \frac{\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot x\right)\right) \cdot \left(x \cdot x - y \cdot y\right)}{\color{blue}{y \cdot y - x \cdot x}} \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot x\right)\right) \cdot \left(x \cdot x - y \cdot y\right)\right), \color{blue}{\left(y \cdot y - x \cdot x\right)}\right) \]
    6. Applied egg-rr3.3%

      \[\leadsto \color{blue}{\frac{\left(y \cdot \left(y \cdot \left(y \cdot y\right)\right) - x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(x \cdot x - y \cdot y\right)}{y \cdot y - x \cdot x}} \]
    7. Taylor expanded in y around inf

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{\left(\left(-1 \cdot {y}^{2}\right) \cdot y\right)}\right) \]
      8. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \color{blue}{\left(-1 \cdot {y}^{2}\right)}\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left({y}^{2}\right)\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \left(0 - \color{blue}{{y}^{2}}\right)\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(0, \color{blue}{\left({y}^{2}\right)}\right)\right)\right) \]
      13. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(0, \left(y \cdot \color{blue}{y}\right)\right)\right)\right) \]
      14. *-lowering-*.f6481.7%

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right)\right)\right) \]
    9. Simplified81.7%

      \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(0 - y \cdot y\right)\right)} \]

    if -1.31999999999999998e154 < y < -3.39999999999999987e-65 or 2.00000000000000005e-46 < y < 6.4999999999999998e136

    1. Initial program 86.2%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr99.6%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \color{blue}{\left({y}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \left(y \cdot \color{blue}{y}\right)\right) \]
      2. *-lowering-*.f6495.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right) \]
    7. Simplified95.4%

      \[\leadsto \left(x \cdot x - y \cdot y\right) \cdot \color{blue}{\left(y \cdot y\right)} \]

    if -3.39999999999999987e-65 < y < 2.00000000000000005e-46

    1. Initial program 100.0%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
    5. Taylor expanded in x around inf

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

        \[\leadsto {x}^{\left(2 \cdot \color{blue}{2}\right)} \]
      2. pow-sqrN/A

        \[\leadsto {x}^{2} \cdot \color{blue}{{x}^{2}} \]
      3. +-lft-identityN/A

        \[\leadsto {x}^{2} \cdot \left(0 + \color{blue}{{x}^{2}}\right) \]
      4. mul0-lftN/A

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

        \[\leadsto {x}^{2} \cdot \left(\left(-1 + 1\right) \cdot {y}^{2} + {x}^{2}\right) \]
      6. distribute-lft1-inN/A

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(x \cdot \left(0 \cdot {y}^{2} + {x}^{2}\right)\right) \]
      15. mul0-lftN/A

        \[\leadsto x \cdot \left(x \cdot \left(0 + {\color{blue}{x}}^{2}\right)\right) \]
      16. +-lft-identityN/A

        \[\leadsto x \cdot \left(x \cdot {x}^{\color{blue}{2}}\right) \]
      17. unpow2N/A

        \[\leadsto x \cdot \left(x \cdot \left(x \cdot \color{blue}{x}\right)\right) \]
      18. cube-multN/A

        \[\leadsto x \cdot {x}^{\color{blue}{3}} \]
      19. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left({x}^{3}\right)}\right) \]
      20. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right)\right) \]
      21. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot {x}^{\color{blue}{2}}\right)\right) \]
    7. Simplified98.0%

      \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(x \cdot x\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification93.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;y \cdot \left(y \cdot \left(0 - y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq -3.4 \cdot 10^{-65}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(x \cdot x - y \cdot y\right)\\ \mathbf{elif}\;y \leq 2 \cdot 10^{-46}:\\ \;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+136}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(x \cdot x - y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(y \cdot \left(0 - y \cdot y\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 97.4% accurate, 8.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(y \cdot y\right) \cdot \frac{x - y}{\frac{1}{x + y}}\\ \mathbf{if}\;y \leq -3.2 \cdot 10^{-62}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+24}:\\ \;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (* y y) (/ (- x y) (/ 1.0 (+ x y))))))
   (if (<= y -3.2e-62)
     t_0
     (if (<= y 1.6e+24) (- (* x (* x (* x x))) (* y (* y (* y y)))) t_0))))
double code(double x, double y) {
	double t_0 = (y * y) * ((x - y) / (1.0 / (x + y)));
	double tmp;
	if (y <= -3.2e-62) {
		tmp = t_0;
	} else if (y <= 1.6e+24) {
		tmp = (x * (x * (x * x))) - (y * (y * (y * y)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (y * y) * ((x - y) / (1.0d0 / (x + y)))
    if (y <= (-3.2d-62)) then
        tmp = t_0
    else if (y <= 1.6d+24) then
        tmp = (x * (x * (x * x))) - (y * (y * (y * y)))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = (y * y) * ((x - y) / (1.0 / (x + y)));
	double tmp;
	if (y <= -3.2e-62) {
		tmp = t_0;
	} else if (y <= 1.6e+24) {
		tmp = (x * (x * (x * x))) - (y * (y * (y * y)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = (y * y) * ((x - y) / (1.0 / (x + y)))
	tmp = 0
	if y <= -3.2e-62:
		tmp = t_0
	elif y <= 1.6e+24:
		tmp = (x * (x * (x * x))) - (y * (y * (y * y)))
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(Float64(y * y) * Float64(Float64(x - y) / Float64(1.0 / Float64(x + y))))
	tmp = 0.0
	if (y <= -3.2e-62)
		tmp = t_0;
	elseif (y <= 1.6e+24)
		tmp = Float64(Float64(x * Float64(x * Float64(x * x))) - Float64(y * Float64(y * Float64(y * y))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (y * y) * ((x - y) / (1.0 / (x + y)));
	tmp = 0.0;
	if (y <= -3.2e-62)
		tmp = t_0;
	elseif (y <= 1.6e+24)
		tmp = (x * (x * (x * x))) - (y * (y * (y * y)));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * y), $MachinePrecision] * N[(N[(x - y), $MachinePrecision] / N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.2e-62], t$95$0, If[LessEqual[y, 1.6e+24], N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(y \cdot y\right) \cdot \frac{x - y}{\frac{1}{x + y}}\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{-62}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 1.6 \cdot 10^{+24}:\\
\;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.20000000000000021e-62 or 1.5999999999999999e24 < y

    1. Initial program 68.2%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr83.9%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \color{blue}{\left({y}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \left(y \cdot \color{blue}{y}\right)\right) \]
      2. *-lowering-*.f6483.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right) \]
    7. Simplified83.9%

      \[\leadsto \left(x \cdot x - y \cdot y\right) \cdot \color{blue}{\left(y \cdot y\right)} \]
    8. Step-by-step derivation
      1. difference-of-squaresN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x + y\right) \cdot \left(x - y\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x - y\right) \cdot \left(x + y\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      3. /-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x - y}{1} \cdot \left(x + y\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      4. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x - y}{\frac{1}{x + y}}\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - y\right), \left(\frac{1}{x + y}\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \left(\frac{1}{x + y}\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \mathsf{/.f64}\left(1, \left(x + y\right)\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      8. +-lowering-+.f6499.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
    9. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{x - y}{\frac{1}{x + y}}} \cdot \left(y \cdot y\right) \]

    if -3.20000000000000021e-62 < y < 1.5999999999999999e24

    1. Initial program 100.0%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left({x}^{4}\right), \color{blue}{\left({y}^{4}\right)}\right) \]
      2. sqr-powN/A

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

        \[\leadsto \mathsf{\_.f64}\left(\left({x}^{2} \cdot {x}^{\left(\frac{4}{2}\right)}\right), \left({y}^{4}\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\left(x \cdot x\right) \cdot {x}^{\left(\frac{4}{2}\right)}\right), \left({y}^{4}\right)\right) \]
      5. associate-*l*N/A

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

        \[\leadsto \mathsf{\_.f64}\left(\left(x \cdot \left(x \cdot {x}^{2}\right)\right), \left({y}^{4}\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right), \left({y}^{4}\right)\right) \]
      8. cube-unmultN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(x \cdot {x}^{3}\right), \left({y}^{4}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \left({x}^{3}\right)\right), \left({\color{blue}{y}}^{4}\right)\right) \]
      10. cube-unmultN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot \left(x \cdot x\right)\right)\right), \left({y}^{4}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot {x}^{2}\right)\right), \left({y}^{4}\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot {x}^{\left(\frac{4}{2}\right)}\right)\right), \left({y}^{4}\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left({x}^{\left(\frac{4}{2}\right)}\right)\right)\right), \left({y}^{4}\right)\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left({x}^{2}\right)\right)\right), \left({y}^{4}\right)\right) \]
      15. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right), \left({y}^{4}\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left({y}^{4}\right)\right) \]
      17. sqr-powN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left({y}^{\left(\frac{4}{2}\right)} \cdot \color{blue}{{y}^{\left(\frac{4}{2}\right)}}\right)\right) \]
      18. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left({y}^{2} \cdot {y}^{\left(\frac{4}{2}\right)}\right)\right) \]
      19. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\left(y \cdot y\right) \cdot {\color{blue}{y}}^{\left(\frac{4}{2}\right)}\right)\right) \]
      20. associate-*l*N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(y \cdot \color{blue}{\left(y \cdot {y}^{\left(\frac{4}{2}\right)}\right)}\right)\right) \]
      21. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(y \cdot \left(y \cdot {y}^{2}\right)\right)\right) \]
      22. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(y \cdot \left(y \cdot \left(y \cdot \color{blue}{y}\right)\right)\right)\right) \]
      23. cube-unmultN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(y \cdot {y}^{\color{blue}{3}}\right)\right) \]
      24. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(y, \color{blue}{\left({y}^{3}\right)}\right)\right) \]
      25. cube-unmultN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(y, \left(y \cdot \color{blue}{\left(y \cdot y\right)}\right)\right)\right) \]
      26. unpow2N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(y, \left(y \cdot {y}^{\color{blue}{2}}\right)\right)\right) \]
      27. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{*.f64}\left(y, \left(y \cdot {y}^{\left(\frac{4}{\color{blue}{2}}\right)}\right)\right)\right) \]
    4. Applied egg-rr99.8%

      \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{-62}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \frac{x - y}{\frac{1}{x + y}}\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+24}:\\ \;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \frac{x - y}{\frac{1}{x + y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 98.5% accurate, 8.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{x + y}\\ \mathbf{if}\;y \leq -7.2 \cdot 10^{-22}:\\ \;\;\;\;\frac{y \cdot y}{\frac{t\_0}{x - y}}\\ \mathbf{elif}\;y \leq 10^{+41}:\\ \;\;\;\;\left(x \cdot x - y \cdot y\right) \cdot \left(x \cdot x + y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \frac{x - y}{t\_0}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ 1.0 (+ x y))))
   (if (<= y -7.2e-22)
     (/ (* y y) (/ t_0 (- x y)))
     (if (<= y 1e+41)
       (* (- (* x x) (* y y)) (+ (* x x) (* y y)))
       (* (* y y) (/ (- x y) t_0))))))
double code(double x, double y) {
	double t_0 = 1.0 / (x + y);
	double tmp;
	if (y <= -7.2e-22) {
		tmp = (y * y) / (t_0 / (x - y));
	} else if (y <= 1e+41) {
		tmp = ((x * x) - (y * y)) * ((x * x) + (y * y));
	} else {
		tmp = (y * y) * ((x - y) / t_0);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 1.0d0 / (x + y)
    if (y <= (-7.2d-22)) then
        tmp = (y * y) / (t_0 / (x - y))
    else if (y <= 1d+41) then
        tmp = ((x * x) - (y * y)) * ((x * x) + (y * y))
    else
        tmp = (y * y) * ((x - y) / t_0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 1.0 / (x + y);
	double tmp;
	if (y <= -7.2e-22) {
		tmp = (y * y) / (t_0 / (x - y));
	} else if (y <= 1e+41) {
		tmp = ((x * x) - (y * y)) * ((x * x) + (y * y));
	} else {
		tmp = (y * y) * ((x - y) / t_0);
	}
	return tmp;
}
def code(x, y):
	t_0 = 1.0 / (x + y)
	tmp = 0
	if y <= -7.2e-22:
		tmp = (y * y) / (t_0 / (x - y))
	elif y <= 1e+41:
		tmp = ((x * x) - (y * y)) * ((x * x) + (y * y))
	else:
		tmp = (y * y) * ((x - y) / t_0)
	return tmp
function code(x, y)
	t_0 = Float64(1.0 / Float64(x + y))
	tmp = 0.0
	if (y <= -7.2e-22)
		tmp = Float64(Float64(y * y) / Float64(t_0 / Float64(x - y)));
	elseif (y <= 1e+41)
		tmp = Float64(Float64(Float64(x * x) - Float64(y * y)) * Float64(Float64(x * x) + Float64(y * y)));
	else
		tmp = Float64(Float64(y * y) * Float64(Float64(x - y) / t_0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 1.0 / (x + y);
	tmp = 0.0;
	if (y <= -7.2e-22)
		tmp = (y * y) / (t_0 / (x - y));
	elseif (y <= 1e+41)
		tmp = ((x * x) - (y * y)) * ((x * x) + (y * y));
	else
		tmp = (y * y) * ((x - y) / t_0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.2e-22], N[(N[(y * y), $MachinePrecision] / N[(t$95$0 / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+41], N[(N[(N[(x * x), $MachinePrecision] - N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * y), $MachinePrecision] * N[(N[(x - y), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1}{x + y}\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{-22}:\\
\;\;\;\;\frac{y \cdot y}{\frac{t\_0}{x - y}}\\

\mathbf{elif}\;y \leq 10^{+41}:\\
\;\;\;\;\left(x \cdot x - y \cdot y\right) \cdot \left(x \cdot x + y \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \frac{x - y}{t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.1999999999999996e-22

    1. Initial program 69.7%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr86.1%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \color{blue}{\left({y}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \left(y \cdot \color{blue}{y}\right)\right) \]
      2. *-lowering-*.f6486.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right) \]
    7. Simplified86.1%

      \[\leadsto \left(x \cdot x - y \cdot y\right) \cdot \color{blue}{\left(y \cdot y\right)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot y\right) \cdot \color{blue}{\left(x \cdot x - y \cdot y\right)} \]
      2. difference-of-squaresN/A

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(x + y\right) \cdot \color{blue}{\left(x - y\right)}\right) \]
      3. remove-double-divN/A

        \[\leadsto \left(y \cdot y\right) \cdot \left(\frac{1}{\frac{1}{x + y}} \cdot \left(\color{blue}{x} - y\right)\right) \]
      4. associate-/r/N/A

        \[\leadsto \left(y \cdot y\right) \cdot \frac{1}{\color{blue}{\frac{\frac{1}{x + y}}{x - y}}} \]
      5. un-div-invN/A

        \[\leadsto \frac{y \cdot y}{\color{blue}{\frac{\frac{1}{x + y}}{x - y}}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot y\right), \color{blue}{\left(\frac{\frac{1}{x + y}}{x - y}\right)}\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, y\right), \left(\frac{\color{blue}{\frac{1}{x + y}}}{x - y}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{/.f64}\left(\left(\frac{1}{x + y}\right), \color{blue}{\left(x - y\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(x + y\right)\right), \left(\color{blue}{x} - y\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, y\right)\right), \left(x - y\right)\right)\right) \]
      11. --lowering--.f6499.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
    9. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{y \cdot y}{\frac{\frac{1}{x + y}}{x - y}}} \]

    if -7.1999999999999996e-22 < y < 1.00000000000000001e41

    1. Initial program 100.0%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]

    if 1.00000000000000001e41 < y

    1. Initial program 60.7%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr78.5%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \color{blue}{\left({y}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \left(y \cdot \color{blue}{y}\right)\right) \]
      2. *-lowering-*.f6478.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right) \]
    7. Simplified78.5%

      \[\leadsto \left(x \cdot x - y \cdot y\right) \cdot \color{blue}{\left(y \cdot y\right)} \]
    8. Step-by-step derivation
      1. difference-of-squaresN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x + y\right) \cdot \left(x - y\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x - y\right) \cdot \left(x + y\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      3. /-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x - y}{1} \cdot \left(x + y\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      4. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x - y}{\frac{1}{x + y}}\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - y\right), \left(\frac{1}{x + y}\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \left(\frac{1}{x + y}\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \mathsf{/.f64}\left(1, \left(x + y\right)\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      8. +-lowering-+.f6499.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
    9. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{x - y}{\frac{1}{x + y}}} \cdot \left(y \cdot y\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{-22}:\\ \;\;\;\;\frac{y \cdot y}{\frac{\frac{1}{x + y}}{x - y}}\\ \mathbf{elif}\;y \leq 10^{+41}:\\ \;\;\;\;\left(x \cdot x - y \cdot y\right) \cdot \left(x \cdot x + y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \frac{x - y}{\frac{1}{x + y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 94.2% accurate, 8.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{x + y}\\ t_1 := \frac{t\_0}{x - y}\\ \mathbf{if}\;y \leq -3.2 \cdot 10^{-65}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \frac{x - y}{t\_0}\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-48}:\\ \;\;\;\;\frac{x \cdot x}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot y}{t\_1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ 1.0 (+ x y))) (t_1 (/ t_0 (- x y))))
   (if (<= y -3.2e-65)
     (* (* y y) (/ (- x y) t_0))
     (if (<= y 1.85e-48) (/ (* x x) t_1) (/ (* y y) t_1)))))
double code(double x, double y) {
	double t_0 = 1.0 / (x + y);
	double t_1 = t_0 / (x - y);
	double tmp;
	if (y <= -3.2e-65) {
		tmp = (y * y) * ((x - y) / t_0);
	} else if (y <= 1.85e-48) {
		tmp = (x * x) / t_1;
	} else {
		tmp = (y * y) / t_1;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 1.0d0 / (x + y)
    t_1 = t_0 / (x - y)
    if (y <= (-3.2d-65)) then
        tmp = (y * y) * ((x - y) / t_0)
    else if (y <= 1.85d-48) then
        tmp = (x * x) / t_1
    else
        tmp = (y * y) / t_1
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 1.0 / (x + y);
	double t_1 = t_0 / (x - y);
	double tmp;
	if (y <= -3.2e-65) {
		tmp = (y * y) * ((x - y) / t_0);
	} else if (y <= 1.85e-48) {
		tmp = (x * x) / t_1;
	} else {
		tmp = (y * y) / t_1;
	}
	return tmp;
}
def code(x, y):
	t_0 = 1.0 / (x + y)
	t_1 = t_0 / (x - y)
	tmp = 0
	if y <= -3.2e-65:
		tmp = (y * y) * ((x - y) / t_0)
	elif y <= 1.85e-48:
		tmp = (x * x) / t_1
	else:
		tmp = (y * y) / t_1
	return tmp
function code(x, y)
	t_0 = Float64(1.0 / Float64(x + y))
	t_1 = Float64(t_0 / Float64(x - y))
	tmp = 0.0
	if (y <= -3.2e-65)
		tmp = Float64(Float64(y * y) * Float64(Float64(x - y) / t_0));
	elseif (y <= 1.85e-48)
		tmp = Float64(Float64(x * x) / t_1);
	else
		tmp = Float64(Float64(y * y) / t_1);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 1.0 / (x + y);
	t_1 = t_0 / (x - y);
	tmp = 0.0;
	if (y <= -3.2e-65)
		tmp = (y * y) * ((x - y) / t_0);
	elseif (y <= 1.85e-48)
		tmp = (x * x) / t_1;
	else
		tmp = (y * y) / t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(x - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.2e-65], N[(N[(y * y), $MachinePrecision] * N[(N[(x - y), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e-48], N[(N[(x * x), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(y * y), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1}{x + y}\\
t_1 := \frac{t\_0}{x - y}\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{-65}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \frac{x - y}{t\_0}\\

\mathbf{elif}\;y \leq 1.85 \cdot 10^{-48}:\\
\;\;\;\;\frac{x \cdot x}{t\_1}\\

\mathbf{else}:\\
\;\;\;\;\frac{y \cdot y}{t\_1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.1999999999999999e-65

    1. Initial program 72.2%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr87.2%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \color{blue}{\left({y}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \left(y \cdot \color{blue}{y}\right)\right) \]
      2. *-lowering-*.f6487.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right) \]
    7. Simplified87.2%

      \[\leadsto \left(x \cdot x - y \cdot y\right) \cdot \color{blue}{\left(y \cdot y\right)} \]
    8. Step-by-step derivation
      1. difference-of-squaresN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x + y\right) \cdot \left(x - y\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x - y\right) \cdot \left(x + y\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      3. /-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x - y}{1} \cdot \left(x + y\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      4. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x - y}{\frac{1}{x + y}}\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - y\right), \left(\frac{1}{x + y}\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \left(\frac{1}{x + y}\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \mathsf{/.f64}\left(1, \left(x + y\right)\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      8. +-lowering-+.f6499.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
    9. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{x - y}{\frac{1}{x + y}}} \cdot \left(y \cdot y\right) \]

    if -3.1999999999999999e-65 < y < 1.8499999999999999e-48

    1. Initial program 100.0%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr99.7%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \color{blue}{\left({x}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \left(x \cdot \color{blue}{x}\right)\right) \]
      2. *-lowering-*.f6497.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right) \]
    7. Simplified97.9%

      \[\leadsto \left(x \cdot x - y \cdot y\right) \cdot \color{blue}{\left(x \cdot x\right)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \left(x \cdot x\right) \cdot \frac{\left(x \cdot x\right) \cdot \left(x \cdot x\right) - \left(y \cdot y\right) \cdot \left(y \cdot y\right)}{\color{blue}{x \cdot x + y \cdot y}} \]
      3. associate-*r*N/A

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

        \[\leadsto \left(x \cdot x\right) \cdot \frac{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}{x \cdot \color{blue}{x} + y \cdot y} \]
      5. clear-numN/A

        \[\leadsto \left(x \cdot x\right) \cdot \frac{1}{\color{blue}{\frac{x \cdot x + y \cdot y}{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}}} \]
      6. un-div-invN/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{\frac{x \cdot x + y \cdot y}{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}}} \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\frac{x \cdot x + y \cdot y}{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}\right)}\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{\color{blue}{x \cdot x + y \cdot y}}{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}\right)\right) \]
      9. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{\color{blue}{\frac{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}{x \cdot x + y \cdot y}}}\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{\frac{\left(x \cdot x\right) \cdot \left(x \cdot x\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}{\color{blue}{x} \cdot x + y \cdot y}}\right)\right) \]
      11. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{\frac{\left(x \cdot x\right) \cdot \left(x \cdot x\right) - \left(y \cdot y\right) \cdot \left(y \cdot y\right)}{x \cdot \color{blue}{x} + y \cdot y}}\right)\right) \]
      12. flip--N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{x \cdot x - \color{blue}{y \cdot y}}\right)\right) \]
      13. difference-of-squaresN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{\left(x + y\right) \cdot \color{blue}{\left(x - y\right)}}\right)\right) \]
    9. Applied egg-rr98.0%

      \[\leadsto \color{blue}{\frac{x \cdot x}{\frac{\frac{1}{x + y}}{x - y}}} \]

    if 1.8499999999999999e-48 < y

    1. Initial program 70.7%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr83.8%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \color{blue}{\left({y}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \left(y \cdot \color{blue}{y}\right)\right) \]
      2. *-lowering-*.f6478.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right) \]
    7. Simplified78.9%

      \[\leadsto \left(x \cdot x - y \cdot y\right) \cdot \color{blue}{\left(y \cdot y\right)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(y \cdot y\right) \cdot \color{blue}{\left(x \cdot x - y \cdot y\right)} \]
      2. difference-of-squaresN/A

        \[\leadsto \left(y \cdot y\right) \cdot \left(\left(x + y\right) \cdot \color{blue}{\left(x - y\right)}\right) \]
      3. remove-double-divN/A

        \[\leadsto \left(y \cdot y\right) \cdot \left(\frac{1}{\frac{1}{x + y}} \cdot \left(\color{blue}{x} - y\right)\right) \]
      4. associate-/r/N/A

        \[\leadsto \left(y \cdot y\right) \cdot \frac{1}{\color{blue}{\frac{\frac{1}{x + y}}{x - y}}} \]
      5. un-div-invN/A

        \[\leadsto \frac{y \cdot y}{\color{blue}{\frac{\frac{1}{x + y}}{x - y}}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot y\right), \color{blue}{\left(\frac{\frac{1}{x + y}}{x - y}\right)}\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, y\right), \left(\frac{\color{blue}{\frac{1}{x + y}}}{x - y}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{/.f64}\left(\left(\frac{1}{x + y}\right), \color{blue}{\left(x - y\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(x + y\right)\right), \left(\color{blue}{x} - y\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, y\right)\right), \left(x - y\right)\right)\right) \]
      11. --lowering--.f6494.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, y\right)\right), \mathsf{\_.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
    9. Applied egg-rr94.9%

      \[\leadsto \color{blue}{\frac{y \cdot y}{\frac{\frac{1}{x + y}}{x - y}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification97.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{-65}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \frac{x - y}{\frac{1}{x + y}}\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-48}:\\ \;\;\;\;\frac{x \cdot x}{\frac{\frac{1}{x + y}}{x - y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot y}{\frac{\frac{1}{x + y}}{x - y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 94.3% accurate, 8.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{x + y}\\ t_1 := \left(y \cdot y\right) \cdot \frac{x - y}{t\_0}\\ \mathbf{if}\;y \leq -6.1 \cdot 10^{-64}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 10^{-46}:\\ \;\;\;\;\frac{x \cdot x}{\frac{t\_0}{x - y}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ 1.0 (+ x y))) (t_1 (* (* y y) (/ (- x y) t_0))))
   (if (<= y -6.1e-64) t_1 (if (<= y 1e-46) (/ (* x x) (/ t_0 (- x y))) t_1))))
double code(double x, double y) {
	double t_0 = 1.0 / (x + y);
	double t_1 = (y * y) * ((x - y) / t_0);
	double tmp;
	if (y <= -6.1e-64) {
		tmp = t_1;
	} else if (y <= 1e-46) {
		tmp = (x * x) / (t_0 / (x - y));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 1.0d0 / (x + y)
    t_1 = (y * y) * ((x - y) / t_0)
    if (y <= (-6.1d-64)) then
        tmp = t_1
    else if (y <= 1d-46) then
        tmp = (x * x) / (t_0 / (x - y))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 1.0 / (x + y);
	double t_1 = (y * y) * ((x - y) / t_0);
	double tmp;
	if (y <= -6.1e-64) {
		tmp = t_1;
	} else if (y <= 1e-46) {
		tmp = (x * x) / (t_0 / (x - y));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y):
	t_0 = 1.0 / (x + y)
	t_1 = (y * y) * ((x - y) / t_0)
	tmp = 0
	if y <= -6.1e-64:
		tmp = t_1
	elif y <= 1e-46:
		tmp = (x * x) / (t_0 / (x - y))
	else:
		tmp = t_1
	return tmp
function code(x, y)
	t_0 = Float64(1.0 / Float64(x + y))
	t_1 = Float64(Float64(y * y) * Float64(Float64(x - y) / t_0))
	tmp = 0.0
	if (y <= -6.1e-64)
		tmp = t_1;
	elseif (y <= 1e-46)
		tmp = Float64(Float64(x * x) / Float64(t_0 / Float64(x - y)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 1.0 / (x + y);
	t_1 = (y * y) * ((x - y) / t_0);
	tmp = 0.0;
	if (y <= -6.1e-64)
		tmp = t_1;
	elseif (y <= 1e-46)
		tmp = (x * x) / (t_0 / (x - y));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * y), $MachinePrecision] * N[(N[(x - y), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.1e-64], t$95$1, If[LessEqual[y, 1e-46], N[(N[(x * x), $MachinePrecision] / N[(t$95$0 / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1}{x + y}\\
t_1 := \left(y \cdot y\right) \cdot \frac{x - y}{t\_0}\\
\mathbf{if}\;y \leq -6.1 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 10^{-46}:\\
\;\;\;\;\frac{x \cdot x}{\frac{t\_0}{x - y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.0999999999999996e-64 or 1.00000000000000002e-46 < y

    1. Initial program 71.4%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr85.5%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \color{blue}{\left({y}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \left(y \cdot \color{blue}{y}\right)\right) \]
      2. *-lowering-*.f6483.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right) \]
    7. Simplified83.0%

      \[\leadsto \left(x \cdot x - y \cdot y\right) \cdot \color{blue}{\left(y \cdot y\right)} \]
    8. Step-by-step derivation
      1. difference-of-squaresN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x + y\right) \cdot \left(x - y\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x - y\right) \cdot \left(x + y\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      3. /-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x - y}{1} \cdot \left(x + y\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      4. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x - y}{\frac{1}{x + y}}\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - y\right), \left(\frac{1}{x + y}\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \left(\frac{1}{x + y}\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \mathsf{/.f64}\left(1, \left(x + y\right)\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      8. +-lowering-+.f6497.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
    9. Applied egg-rr97.3%

      \[\leadsto \color{blue}{\frac{x - y}{\frac{1}{x + y}}} \cdot \left(y \cdot y\right) \]

    if -6.0999999999999996e-64 < y < 1.00000000000000002e-46

    1. Initial program 100.0%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr99.7%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \color{blue}{\left({x}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \left(x \cdot \color{blue}{x}\right)\right) \]
      2. *-lowering-*.f6497.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right) \]
    7. Simplified97.9%

      \[\leadsto \left(x \cdot x - y \cdot y\right) \cdot \color{blue}{\left(x \cdot x\right)} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \left(x \cdot x\right) \cdot \frac{\left(x \cdot x\right) \cdot \left(x \cdot x\right) - \left(y \cdot y\right) \cdot \left(y \cdot y\right)}{\color{blue}{x \cdot x + y \cdot y}} \]
      3. associate-*r*N/A

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

        \[\leadsto \left(x \cdot x\right) \cdot \frac{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}{x \cdot \color{blue}{x} + y \cdot y} \]
      5. clear-numN/A

        \[\leadsto \left(x \cdot x\right) \cdot \frac{1}{\color{blue}{\frac{x \cdot x + y \cdot y}{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}}} \]
      6. un-div-invN/A

        \[\leadsto \frac{x \cdot x}{\color{blue}{\frac{x \cdot x + y \cdot y}{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}}} \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\frac{x \cdot x + y \cdot y}{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}\right)}\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{\color{blue}{x \cdot x + y \cdot y}}{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}\right)\right) \]
      9. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{\color{blue}{\frac{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}{x \cdot x + y \cdot y}}}\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{\frac{\left(x \cdot x\right) \cdot \left(x \cdot x\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}{\color{blue}{x} \cdot x + y \cdot y}}\right)\right) \]
      11. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{\frac{\left(x \cdot x\right) \cdot \left(x \cdot x\right) - \left(y \cdot y\right) \cdot \left(y \cdot y\right)}{x \cdot \color{blue}{x} + y \cdot y}}\right)\right) \]
      12. flip--N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{x \cdot x - \color{blue}{y \cdot y}}\right)\right) \]
      13. difference-of-squaresN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{\left(x + y\right) \cdot \color{blue}{\left(x - y\right)}}\right)\right) \]
    9. Applied egg-rr98.0%

      \[\leadsto \color{blue}{\frac{x \cdot x}{\frac{\frac{1}{x + y}}{x - y}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.1 \cdot 10^{-64}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \frac{x - y}{\frac{1}{x + y}}\\ \mathbf{elif}\;y \leq 10^{-46}:\\ \;\;\;\;\frac{x \cdot x}{\frac{\frac{1}{x + y}}{x - y}}\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \frac{x - y}{\frac{1}{x + y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 94.3% accurate, 8.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(y \cdot y\right) \cdot \frac{x - y}{\frac{1}{x + y}}\\ \mathbf{if}\;y \leq -1.4 \cdot 10^{-62}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-48}:\\ \;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (* y y) (/ (- x y) (/ 1.0 (+ x y))))))
   (if (<= y -1.4e-62) t_0 (if (<= y 5e-48) (* x (* x (* x x))) t_0))))
double code(double x, double y) {
	double t_0 = (y * y) * ((x - y) / (1.0 / (x + y)));
	double tmp;
	if (y <= -1.4e-62) {
		tmp = t_0;
	} else if (y <= 5e-48) {
		tmp = x * (x * (x * x));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (y * y) * ((x - y) / (1.0d0 / (x + y)))
    if (y <= (-1.4d-62)) then
        tmp = t_0
    else if (y <= 5d-48) then
        tmp = x * (x * (x * x))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = (y * y) * ((x - y) / (1.0 / (x + y)));
	double tmp;
	if (y <= -1.4e-62) {
		tmp = t_0;
	} else if (y <= 5e-48) {
		tmp = x * (x * (x * x));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = (y * y) * ((x - y) / (1.0 / (x + y)))
	tmp = 0
	if y <= -1.4e-62:
		tmp = t_0
	elif y <= 5e-48:
		tmp = x * (x * (x * x))
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(Float64(y * y) * Float64(Float64(x - y) / Float64(1.0 / Float64(x + y))))
	tmp = 0.0
	if (y <= -1.4e-62)
		tmp = t_0;
	elseif (y <= 5e-48)
		tmp = Float64(x * Float64(x * Float64(x * x)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (y * y) * ((x - y) / (1.0 / (x + y)));
	tmp = 0.0;
	if (y <= -1.4e-62)
		tmp = t_0;
	elseif (y <= 5e-48)
		tmp = x * (x * (x * x));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * y), $MachinePrecision] * N[(N[(x - y), $MachinePrecision] / N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e-62], t$95$0, If[LessEqual[y, 5e-48], N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(y \cdot y\right) \cdot \frac{x - y}{\frac{1}{x + y}}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{-62}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 5 \cdot 10^{-48}:\\
\;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.40000000000000001e-62 or 4.9999999999999999e-48 < y

    1. Initial program 71.4%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr85.5%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \color{blue}{\left({y}^{2}\right)}\right) \]
    6. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \left(y \cdot \color{blue}{y}\right)\right) \]
      2. *-lowering-*.f6483.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right) \]
    7. Simplified83.0%

      \[\leadsto \left(x \cdot x - y \cdot y\right) \cdot \color{blue}{\left(y \cdot y\right)} \]
    8. Step-by-step derivation
      1. difference-of-squaresN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x + y\right) \cdot \left(x - y\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x - y\right) \cdot \left(x + y\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      3. /-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x - y}{1} \cdot \left(x + y\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      4. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x - y}{\frac{1}{x + y}}\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x - y\right), \left(\frac{1}{x + y}\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, y\right)\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \left(\frac{1}{x + y}\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \mathsf{/.f64}\left(1, \left(x + y\right)\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
      8. +-lowering-+.f6497.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, y\right), \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{*.f64}\left(y, y\right)\right) \]
    9. Applied egg-rr97.3%

      \[\leadsto \color{blue}{\frac{x - y}{\frac{1}{x + y}}} \cdot \left(y \cdot y\right) \]

    if -1.40000000000000001e-62 < y < 4.9999999999999999e-48

    1. Initial program 100.0%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
    5. Taylor expanded in x around inf

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

        \[\leadsto {x}^{\left(2 \cdot \color{blue}{2}\right)} \]
      2. pow-sqrN/A

        \[\leadsto {x}^{2} \cdot \color{blue}{{x}^{2}} \]
      3. +-lft-identityN/A

        \[\leadsto {x}^{2} \cdot \left(0 + \color{blue}{{x}^{2}}\right) \]
      4. mul0-lftN/A

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

        \[\leadsto {x}^{2} \cdot \left(\left(-1 + 1\right) \cdot {y}^{2} + {x}^{2}\right) \]
      6. distribute-lft1-inN/A

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(x \cdot \left(0 \cdot {y}^{2} + {x}^{2}\right)\right) \]
      15. mul0-lftN/A

        \[\leadsto x \cdot \left(x \cdot \left(0 + {\color{blue}{x}}^{2}\right)\right) \]
      16. +-lft-identityN/A

        \[\leadsto x \cdot \left(x \cdot {x}^{\color{blue}{2}}\right) \]
      17. unpow2N/A

        \[\leadsto x \cdot \left(x \cdot \left(x \cdot \color{blue}{x}\right)\right) \]
      18. cube-multN/A

        \[\leadsto x \cdot {x}^{\color{blue}{3}} \]
      19. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left({x}^{3}\right)}\right) \]
      20. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right)\right) \]
      21. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot {x}^{\color{blue}{2}}\right)\right) \]
    7. Simplified98.0%

      \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(x \cdot x\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{-62}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \frac{x - y}{\frac{1}{x + y}}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-48}:\\ \;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \frac{x - y}{\frac{1}{x + y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 81.2% accurate, 10.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(y \cdot \left(0 - y \cdot y\right)\right)\\ \mathbf{if}\;y \leq -8.6 \cdot 10^{-42}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+40}:\\ \;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* y (* y (- 0.0 (* y y))))))
   (if (<= y -8.6e-42) t_0 (if (<= y 2.1e+40) (* x (* x (* x x))) t_0))))
double code(double x, double y) {
	double t_0 = y * (y * (0.0 - (y * y)));
	double tmp;
	if (y <= -8.6e-42) {
		tmp = t_0;
	} else if (y <= 2.1e+40) {
		tmp = x * (x * (x * x));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = y * (y * (0.0d0 - (y * y)))
    if (y <= (-8.6d-42)) then
        tmp = t_0
    else if (y <= 2.1d+40) then
        tmp = x * (x * (x * x))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = y * (y * (0.0 - (y * y)));
	double tmp;
	if (y <= -8.6e-42) {
		tmp = t_0;
	} else if (y <= 2.1e+40) {
		tmp = x * (x * (x * x));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = y * (y * (0.0 - (y * y)))
	tmp = 0
	if y <= -8.6e-42:
		tmp = t_0
	elif y <= 2.1e+40:
		tmp = x * (x * (x * x))
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(y * Float64(y * Float64(0.0 - Float64(y * y))))
	tmp = 0.0
	if (y <= -8.6e-42)
		tmp = t_0;
	elseif (y <= 2.1e+40)
		tmp = Float64(x * Float64(x * Float64(x * x)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = y * (y * (0.0 - (y * y)));
	tmp = 0.0;
	if (y <= -8.6e-42)
		tmp = t_0;
	elseif (y <= 2.1e+40)
		tmp = x * (x * (x * x));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * N[(0.0 - N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.6e-42], t$95$0, If[LessEqual[y, 2.1e+40], N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot \left(0 - y \cdot y\right)\right)\\
\mathbf{if}\;y \leq -8.6 \cdot 10^{-42}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{+40}:\\
\;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.6000000000000002e-42 or 2.1000000000000001e40 < y

    1. Initial program 66.4%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr83.0%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \frac{y \cdot \left(y \cdot \left(y \cdot y\right)\right) - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{y \cdot y - x \cdot x} \cdot \left(x \cdot x - y \cdot y\right) \]
      4. associate-*r*N/A

        \[\leadsto \frac{y \cdot \left(y \cdot \left(y \cdot y\right)\right) - x \cdot \left(x \cdot \left(x \cdot x\right)\right)}{y \cdot y - x \cdot x} \cdot \left(x \cdot x - y \cdot y\right) \]
      5. fmm-defN/A

        \[\leadsto \frac{\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)}{y \cdot y - x \cdot x} \cdot \left(\color{blue}{x} \cdot x - y \cdot y\right) \]
      6. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot x\right)\right)}{y \cdot y - x \cdot x} \cdot \left(x \cdot x - y \cdot y\right) \]
      7. associate-*l/N/A

        \[\leadsto \frac{\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot x\right)\right) \cdot \left(x \cdot x - y \cdot y\right)}{\color{blue}{y \cdot y - x \cdot x}} \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot x\right)\right) \cdot \left(x \cdot x - y \cdot y\right)\right), \color{blue}{\left(y \cdot y - x \cdot x\right)}\right) \]
    6. Applied egg-rr32.5%

      \[\leadsto \color{blue}{\frac{\left(y \cdot \left(y \cdot \left(y \cdot y\right)\right) - x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(x \cdot x - y \cdot y\right)}{y \cdot y - x \cdot x}} \]
    7. Taylor expanded in y around inf

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{\left(\left(-1 \cdot {y}^{2}\right) \cdot y\right)}\right) \]
      8. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \color{blue}{\left(-1 \cdot {y}^{2}\right)}\right)\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \left(\mathsf{neg}\left({y}^{2}\right)\right)\right)\right) \]
      11. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \left(0 - \color{blue}{{y}^{2}}\right)\right)\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(0, \color{blue}{\left({y}^{2}\right)}\right)\right)\right) \]
      13. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(0, \left(y \cdot \color{blue}{y}\right)\right)\right)\right) \]
      14. *-lowering-*.f6475.9%

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right)\right)\right) \]
    9. Simplified75.9%

      \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(0 - y \cdot y\right)\right)} \]

    if -8.6000000000000002e-42 < y < 2.1000000000000001e40

    1. Initial program 100.0%

      \[{x}^{4} - {y}^{4} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqr-powN/A

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

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

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

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

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

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

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
    4. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
    5. Taylor expanded in x around inf

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

        \[\leadsto {x}^{\left(2 \cdot \color{blue}{2}\right)} \]
      2. pow-sqrN/A

        \[\leadsto {x}^{2} \cdot \color{blue}{{x}^{2}} \]
      3. +-lft-identityN/A

        \[\leadsto {x}^{2} \cdot \left(0 + \color{blue}{{x}^{2}}\right) \]
      4. mul0-lftN/A

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

        \[\leadsto {x}^{2} \cdot \left(\left(-1 + 1\right) \cdot {y}^{2} + {x}^{2}\right) \]
      6. distribute-lft1-inN/A

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(x \cdot \left(0 \cdot {y}^{2} + {x}^{2}\right)\right) \]
      15. mul0-lftN/A

        \[\leadsto x \cdot \left(x \cdot \left(0 + {\color{blue}{x}}^{2}\right)\right) \]
      16. +-lft-identityN/A

        \[\leadsto x \cdot \left(x \cdot {x}^{\color{blue}{2}}\right) \]
      17. unpow2N/A

        \[\leadsto x \cdot \left(x \cdot \left(x \cdot \color{blue}{x}\right)\right) \]
      18. cube-multN/A

        \[\leadsto x \cdot {x}^{\color{blue}{3}} \]
      19. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left({x}^{3}\right)}\right) \]
      20. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right)\right) \]
      21. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot {x}^{\color{blue}{2}}\right)\right) \]
    7. Simplified90.2%

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

Alternative 10: 99.8% accurate, 12.1× speedup?

\[\begin{array}{l} \\ \frac{x \cdot x + y \cdot y}{\frac{\frac{1}{x + y}}{x - y}} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/ (+ (* x x) (* y y)) (/ (/ 1.0 (+ x y)) (- x y))))
double code(double x, double y) {
	return ((x * x) + (y * y)) / ((1.0 / (x + y)) / (x - y));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((x * x) + (y * y)) / ((1.0d0 / (x + y)) / (x - y))
end function
public static double code(double x, double y) {
	return ((x * x) + (y * y)) / ((1.0 / (x + y)) / (x - y));
}
def code(x, y):
	return ((x * x) + (y * y)) / ((1.0 / (x + y)) / (x - y))
function code(x, y)
	return Float64(Float64(Float64(x * x) + Float64(y * y)) / Float64(Float64(1.0 / Float64(x + y)) / Float64(x - y)))
end
function tmp = code(x, y)
	tmp = ((x * x) + (y * y)) / ((1.0 / (x + y)) / (x - y));
end
code[x_, y_] := N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot x + y \cdot y}{\frac{\frac{1}{x + y}}{x - y}}
\end{array}
Derivation
  1. Initial program 83.6%

    \[{x}^{4} - {y}^{4} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. sqr-powN/A

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

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

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

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

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

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

      \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
    8. unpow2N/A

      \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
    9. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
  4. Applied egg-rr91.6%

    \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
  5. Step-by-step derivation
    1. *-commutativeN/A

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

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

      \[\leadsto \frac{y \cdot \left(y \cdot \left(y \cdot y\right)\right) - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{y \cdot y - x \cdot x} \cdot \left(x \cdot x - y \cdot y\right) \]
    4. associate-*r*N/A

      \[\leadsto \frac{y \cdot \left(y \cdot \left(y \cdot y\right)\right) - x \cdot \left(x \cdot \left(x \cdot x\right)\right)}{y \cdot y - x \cdot x} \cdot \left(x \cdot x - y \cdot y\right) \]
    5. fmm-defN/A

      \[\leadsto \frac{\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)}{y \cdot y - x \cdot x} \cdot \left(\color{blue}{x} \cdot x - y \cdot y\right) \]
    6. *-commutativeN/A

      \[\leadsto \frac{\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot x\right)\right)}{y \cdot y - x \cdot x} \cdot \left(x \cdot x - y \cdot y\right) \]
    7. associate-*l/N/A

      \[\leadsto \frac{\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot x\right)\right) \cdot \left(x \cdot x - y \cdot y\right)}{\color{blue}{y \cdot y - x \cdot x}} \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{fma}\left(y, y \cdot \left(y \cdot y\right), \mathsf{neg}\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot x\right)\right) \cdot \left(x \cdot x - y \cdot y\right)\right), \color{blue}{\left(y \cdot y - x \cdot x\right)}\right) \]
  6. Applied egg-rr44.0%

    \[\leadsto \color{blue}{\frac{\left(y \cdot \left(y \cdot \left(y \cdot y\right)\right) - x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(x \cdot x - y \cdot y\right)}{y \cdot y - x \cdot x}} \]
  7. Step-by-step derivation
    1. associate-*l/N/A

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

      \[\leadsto \frac{\left(y \cdot y\right) \cdot \left(y \cdot y\right) - x \cdot \left(x \cdot \left(x \cdot x\right)\right)}{y \cdot y - x \cdot x} \cdot \left(x \cdot x - y \cdot y\right) \]
    3. associate-*r*N/A

      \[\leadsto \frac{\left(y \cdot y\right) \cdot \left(y \cdot y\right) - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{y \cdot y - x \cdot x} \cdot \left(x \cdot x - y \cdot y\right) \]
    4. flip-+N/A

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

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

      \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \frac{\left(x \cdot x\right) \cdot \left(x \cdot x\right) - \left(y \cdot y\right) \cdot \left(y \cdot y\right)}{\color{blue}{x \cdot x + y \cdot y}} \]
    7. associate-*r*N/A

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

      \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \frac{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}{x \cdot \color{blue}{x} + y \cdot y} \]
    9. clear-numN/A

      \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \frac{1}{\color{blue}{\frac{x \cdot x + y \cdot y}{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}}} \]
    10. un-div-invN/A

      \[\leadsto \frac{x \cdot x + y \cdot y}{\color{blue}{\frac{x \cdot x + y \cdot y}{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}}} \]
    11. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(x \cdot x + y \cdot y\right), \color{blue}{\left(\frac{x \cdot x + y \cdot y}{x \cdot \left(x \cdot \left(x \cdot x\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)}\right)}\right) \]
  8. Applied egg-rr99.8%

    \[\leadsto \color{blue}{\frac{x \cdot x + y \cdot y}{\frac{\frac{1}{x + y}}{x - y}}} \]
  9. Add Preprocessing

Alternative 11: 58.1% accurate, 29.3× speedup?

\[\begin{array}{l} \\ x \cdot \left(x \cdot \left(x \cdot x\right)\right) \end{array} \]
(FPCore (x y) :precision binary64 (* x (* x (* x x))))
double code(double x, double y) {
	return x * (x * (x * x));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = x * (x * (x * x))
end function
public static double code(double x, double y) {
	return x * (x * (x * x));
}
def code(x, y):
	return x * (x * (x * x))
function code(x, y)
	return Float64(x * Float64(x * Float64(x * x)))
end
function tmp = code(x, y)
	tmp = x * (x * (x * x));
end
code[x_, y_] := N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \left(x \cdot \left(x \cdot x\right)\right)
\end{array}
Derivation
  1. Initial program 83.6%

    \[{x}^{4} - {y}^{4} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. sqr-powN/A

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

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

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

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

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

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

      \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left({y}^{2}\right)\right) \]
    8. unpow2N/A

      \[\leadsto \left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \]
    9. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right) \cdot \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)} \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{fma}\left(x, x, \mathsf{neg}\left(y \cdot y\right)\right)\right), \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right)}\right) \]
  4. Applied egg-rr91.6%

    \[\leadsto \color{blue}{\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)} \]
  5. Taylor expanded in x around inf

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

      \[\leadsto {x}^{\left(2 \cdot \color{blue}{2}\right)} \]
    2. pow-sqrN/A

      \[\leadsto {x}^{2} \cdot \color{blue}{{x}^{2}} \]
    3. +-lft-identityN/A

      \[\leadsto {x}^{2} \cdot \left(0 + \color{blue}{{x}^{2}}\right) \]
    4. mul0-lftN/A

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

      \[\leadsto {x}^{2} \cdot \left(\left(-1 + 1\right) \cdot {y}^{2} + {x}^{2}\right) \]
    6. distribute-lft1-inN/A

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \left(x \cdot \left(0 \cdot {y}^{2} + {x}^{2}\right)\right) \]
    15. mul0-lftN/A

      \[\leadsto x \cdot \left(x \cdot \left(0 + {\color{blue}{x}}^{2}\right)\right) \]
    16. +-lft-identityN/A

      \[\leadsto x \cdot \left(x \cdot {x}^{\color{blue}{2}}\right) \]
    17. unpow2N/A

      \[\leadsto x \cdot \left(x \cdot \left(x \cdot \color{blue}{x}\right)\right) \]
    18. cube-multN/A

      \[\leadsto x \cdot {x}^{\color{blue}{3}} \]
    19. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left({x}^{3}\right)}\right) \]
    20. cube-multN/A

      \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right)\right) \]
    21. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot {x}^{\color{blue}{2}}\right)\right) \]
  7. Simplified58.3%

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

Reproduce

?
herbie shell --seed 2024150 
(FPCore (x y)
  :name "Radioactive exchange between two surfaces"
  :precision binary64
  (- (pow x 4.0) (pow y 4.0)))