Radioactive exchange between two surfaces

Percentage Accurate: 85.6% → 99.8%
Time: 3.6s
Alternatives: 5
Speedup: 13.7×

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 5 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.6% 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: 99.8% accurate, 13.7× speedup?

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

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

    \[{x}^{4} - {y}^{4} \]
  2. Step-by-step derivation
    1. sqr-pow88.2%

      \[\leadsto \color{blue}{{x}^{\left(\frac{4}{2}\right)} \cdot {x}^{\left(\frac{4}{2}\right)}} - {y}^{4} \]
    2. sqr-pow88.1%

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

      \[\leadsto \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right)} \]
    4. metadata-eval95.1%

      \[\leadsto \left({x}^{\color{blue}{2}} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
    5. pow295.1%

      \[\leadsto \left(\color{blue}{x \cdot x} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
    6. metadata-eval95.1%

      \[\leadsto \left(x \cdot x + {y}^{\color{blue}{2}}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
    7. pow295.1%

      \[\leadsto \left(x \cdot x + \color{blue}{y \cdot y}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
    8. metadata-eval95.1%

      \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left({x}^{\color{blue}{2}} - {y}^{\left(\frac{4}{2}\right)}\right) \]
    9. pow295.1%

      \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(\color{blue}{x \cdot x} - {y}^{\left(\frac{4}{2}\right)}\right) \]
    10. metadata-eval95.1%

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

      \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(x \cdot x - \color{blue}{y \cdot y}\right) \]
  3. Applied egg-rr95.1%

    \[\leadsto \color{blue}{\left(x \cdot x + y \cdot y\right) \cdot \left(x \cdot x - y \cdot y\right)} \]
  4. Step-by-step derivation
    1. difference-of-squares99.8%

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

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

    \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \color{blue}{\left(\left(x - y\right) \cdot \left(x + y\right)\right)} \]
  6. Final simplification99.8%

    \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(\left(x - y\right) \cdot \left(x + y\right)\right) \]

Alternative 2: 73.5% accurate, 13.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.45 \cdot 10^{-86}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(x \cdot x + y \cdot y\right)\\

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

\mathbf{else}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \left(y \cdot \left(-y\right)\right)\\


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

    1. Initial program 91.6%

      \[{x}^{4} - {y}^{4} \]
    2. Step-by-step derivation
      1. sqr-pow91.5%

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

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

        \[\leadsto \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right)} \]
      4. metadata-eval96.5%

        \[\leadsto \left({x}^{\color{blue}{2}} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      5. pow296.5%

        \[\leadsto \left(\color{blue}{x \cdot x} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      6. metadata-eval96.5%

        \[\leadsto \left(x \cdot x + {y}^{\color{blue}{2}}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      7. pow296.5%

        \[\leadsto \left(x \cdot x + \color{blue}{y \cdot y}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      8. metadata-eval96.5%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left({x}^{\color{blue}{2}} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      9. pow296.5%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(\color{blue}{x \cdot x} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      10. metadata-eval96.5%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(x \cdot x - {y}^{\color{blue}{2}}\right) \]
      11. pow296.5%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(x \cdot x - \color{blue}{y \cdot y}\right) \]
    3. Applied egg-rr96.5%

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

      \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \color{blue}{{x}^{2}} \]
    5. Step-by-step derivation
      1. unpow263.2%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \color{blue}{\left(x \cdot x\right)} \]
    6. Simplified63.2%

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

    if 2.44999999999999986e-86 < y < 3.69999999999999978e149

    1. Initial program 90.9%

      \[{x}^{4} - {y}^{4} \]
    2. Step-by-step derivation
      1. sqr-pow90.9%

        \[\leadsto \color{blue}{{x}^{\left(\frac{4}{2}\right)} \cdot {x}^{\left(\frac{4}{2}\right)}} - {y}^{4} \]
      2. sqr-pow90.6%

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

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

        \[\leadsto \left({x}^{\color{blue}{2}} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      5. pow299.7%

        \[\leadsto \left(\color{blue}{x \cdot x} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      6. metadata-eval99.7%

        \[\leadsto \left(x \cdot x + {y}^{\color{blue}{2}}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      7. pow299.7%

        \[\leadsto \left(x \cdot x + \color{blue}{y \cdot y}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      8. metadata-eval99.7%

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

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(\color{blue}{x \cdot x} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      10. metadata-eval99.7%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(x \cdot x - {y}^{\color{blue}{2}}\right) \]
      11. pow299.7%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(x \cdot x - \color{blue}{y \cdot y}\right) \]
    3. Applied egg-rr99.7%

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

      \[\leadsto \color{blue}{{y}^{2}} \cdot \left(x \cdot x - y \cdot y\right) \]
    5. Step-by-step derivation
      1. unpow288.4%

        \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot \left(x \cdot x - y \cdot y\right) \]
    6. Simplified88.4%

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

    if 3.69999999999999978e149 < y

    1. Initial program 67.6%

      \[{x}^{4} - {y}^{4} \]
    2. Step-by-step derivation
      1. sqr-pow67.6%

        \[\leadsto \color{blue}{{x}^{\left(\frac{4}{2}\right)} \cdot {x}^{\left(\frac{4}{2}\right)}} - {y}^{4} \]
      2. sqr-pow67.6%

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

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

        \[\leadsto \left({x}^{\color{blue}{2}} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      5. pow282.4%

        \[\leadsto \left(\color{blue}{x \cdot x} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      6. metadata-eval82.4%

        \[\leadsto \left(x \cdot x + {y}^{\color{blue}{2}}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      7. pow282.4%

        \[\leadsto \left(x \cdot x + \color{blue}{y \cdot y}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      8. metadata-eval82.4%

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

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(\color{blue}{x \cdot x} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      10. metadata-eval82.4%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(x \cdot x - {y}^{\color{blue}{2}}\right) \]
      11. pow282.4%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(x \cdot x - \color{blue}{y \cdot y}\right) \]
    3. Applied egg-rr82.4%

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

      \[\leadsto \color{blue}{{y}^{2}} \cdot \left(x \cdot x - y \cdot y\right) \]
    5. Step-by-step derivation
      1. unpow282.4%

        \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot \left(x \cdot x - y \cdot y\right) \]
    6. Simplified82.4%

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

      \[\leadsto \left(y \cdot y\right) \cdot \color{blue}{\left(-1 \cdot {y}^{2}\right)} \]
    8. Step-by-step derivation
      1. unpow291.2%

        \[\leadsto \left(y \cdot y\right) \cdot \left(-1 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
      2. mul-1-neg91.2%

        \[\leadsto \left(y \cdot y\right) \cdot \color{blue}{\left(-y \cdot y\right)} \]
      3. distribute-rgt-neg-out91.2%

        \[\leadsto \left(y \cdot y\right) \cdot \color{blue}{\left(y \cdot \left(-y\right)\right)} \]
    9. Simplified91.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.45 \cdot 10^{-86}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(x \cdot x + y \cdot y\right)\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{+149}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(x \cdot x - y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(y \cdot \left(-y\right)\right)\\ \end{array} \]

Alternative 3: 70.7% accurate, 15.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{+153}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(x \cdot x - y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(y \cdot y\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x 5e+153) (* (* y y) (- (* x x) (* y y))) (* (* x x) (* y y))))
double code(double x, double y) {
	double tmp;
	if (x <= 5e+153) {
		tmp = (y * y) * ((x * x) - (y * y));
	} else {
		tmp = (x * x) * (y * y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= 5d+153) then
        tmp = (y * y) * ((x * x) - (y * y))
    else
        tmp = (x * x) * (y * y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= 5e+153) {
		tmp = (y * y) * ((x * x) - (y * y));
	} else {
		tmp = (x * x) * (y * y);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= 5e+153:
		tmp = (y * y) * ((x * x) - (y * y))
	else:
		tmp = (x * x) * (y * y)
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= 5e+153)
		tmp = Float64(Float64(y * y) * Float64(Float64(x * x) - Float64(y * y)));
	else
		tmp = Float64(Float64(x * x) * Float64(y * y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= 5e+153)
		tmp = (y * y) * ((x * x) - (y * y));
	else
		tmp = (x * x) * (y * y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, 5e+153], N[(N[(y * y), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] - N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{+153}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \left(x \cdot x - y \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(y \cdot y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 5.00000000000000018e153

    1. Initial program 89.8%

      \[{x}^{4} - {y}^{4} \]
    2. Step-by-step derivation
      1. sqr-pow89.8%

        \[\leadsto \color{blue}{{x}^{\left(\frac{4}{2}\right)} \cdot {x}^{\left(\frac{4}{2}\right)}} - {y}^{4} \]
      2. sqr-pow89.6%

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

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

        \[\leadsto \left({x}^{\color{blue}{2}} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      5. pow296.4%

        \[\leadsto \left(\color{blue}{x \cdot x} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      6. metadata-eval96.4%

        \[\leadsto \left(x \cdot x + {y}^{\color{blue}{2}}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      7. pow296.4%

        \[\leadsto \left(x \cdot x + \color{blue}{y \cdot y}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      8. metadata-eval96.4%

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

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(\color{blue}{x \cdot x} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      10. metadata-eval96.4%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(x \cdot x - {y}^{\color{blue}{2}}\right) \]
      11. pow296.4%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(x \cdot x - \color{blue}{y \cdot y}\right) \]
    3. Applied egg-rr96.4%

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

      \[\leadsto \color{blue}{{y}^{2}} \cdot \left(x \cdot x - y \cdot y\right) \]
    5. Step-by-step derivation
      1. unpow272.1%

        \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot \left(x \cdot x - y \cdot y\right) \]
    6. Simplified72.1%

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

    if 5.00000000000000018e153 < x

    1. Initial program 70.0%

      \[{x}^{4} - {y}^{4} \]
    2. Step-by-step derivation
      1. sqr-pow70.0%

        \[\leadsto \color{blue}{{x}^{\left(\frac{4}{2}\right)} \cdot {x}^{\left(\frac{4}{2}\right)}} - {y}^{4} \]
      2. sqr-pow70.0%

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

        \[\leadsto \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right)} \]
      4. metadata-eval80.0%

        \[\leadsto \left({x}^{\color{blue}{2}} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      5. pow280.0%

        \[\leadsto \left(\color{blue}{x \cdot x} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      6. metadata-eval80.0%

        \[\leadsto \left(x \cdot x + {y}^{\color{blue}{2}}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      7. pow280.0%

        \[\leadsto \left(x \cdot x + \color{blue}{y \cdot y}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      8. metadata-eval80.0%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left({x}^{\color{blue}{2}} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      9. pow280.0%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(\color{blue}{x \cdot x} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      10. metadata-eval80.0%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(x \cdot x - {y}^{\color{blue}{2}}\right) \]
      11. pow280.0%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(x \cdot x - \color{blue}{y \cdot y}\right) \]
    3. Applied egg-rr80.0%

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

      \[\leadsto \color{blue}{{y}^{2}} \cdot \left(x \cdot x - y \cdot y\right) \]
    5. Step-by-step derivation
      1. unpow245.0%

        \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot \left(x \cdot x - y \cdot y\right) \]
    6. Simplified45.0%

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

      \[\leadsto \color{blue}{{y}^{2} \cdot {x}^{2}} \]
    8. Step-by-step derivation
      1. unpow260.0%

        \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot {x}^{2} \]
      2. unpow260.0%

        \[\leadsto \left(y \cdot y\right) \cdot \color{blue}{\left(x \cdot x\right)} \]
    9. Simplified60.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{+153}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(x \cdot x - y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(y \cdot y\right)\\ \end{array} \]

Alternative 4: 63.2% accurate, 20.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1.3 \cdot 10^{+135}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(y \cdot \left(-y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(y \cdot y\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x 1.3e+135) (* (* y y) (* y (- y))) (* (* x x) (* y y))))
double code(double x, double y) {
	double tmp;
	if (x <= 1.3e+135) {
		tmp = (y * y) * (y * -y);
	} else {
		tmp = (x * x) * (y * y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= 1.3d+135) then
        tmp = (y * y) * (y * -y)
    else
        tmp = (x * x) * (y * y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= 1.3e+135) {
		tmp = (y * y) * (y * -y);
	} else {
		tmp = (x * x) * (y * y);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= 1.3e+135:
		tmp = (y * y) * (y * -y)
	else:
		tmp = (x * x) * (y * y)
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= 1.3e+135)
		tmp = Float64(Float64(y * y) * Float64(y * Float64(-y)));
	else
		tmp = Float64(Float64(x * x) * Float64(y * y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= 1.3e+135)
		tmp = (y * y) * (y * -y);
	else
		tmp = (x * x) * (y * y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, 1.3e+135], N[(N[(y * y), $MachinePrecision] * N[(y * (-y)), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.3 \cdot 10^{+135}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \left(y \cdot \left(-y\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(y \cdot y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.3e135

    1. Initial program 90.7%

      \[{x}^{4} - {y}^{4} \]
    2. Step-by-step derivation
      1. sqr-pow90.7%

        \[\leadsto \color{blue}{{x}^{\left(\frac{4}{2}\right)} \cdot {x}^{\left(\frac{4}{2}\right)}} - {y}^{4} \]
      2. sqr-pow90.6%

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

        \[\leadsto \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right)} \]
      4. metadata-eval96.3%

        \[\leadsto \left({x}^{\color{blue}{2}} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      5. pow296.3%

        \[\leadsto \left(\color{blue}{x \cdot x} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      6. metadata-eval96.3%

        \[\leadsto \left(x \cdot x + {y}^{\color{blue}{2}}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      7. pow296.3%

        \[\leadsto \left(x \cdot x + \color{blue}{y \cdot y}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      8. metadata-eval96.3%

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

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(\color{blue}{x \cdot x} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      10. metadata-eval96.3%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(x \cdot x - {y}^{\color{blue}{2}}\right) \]
      11. pow296.3%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(x \cdot x - \color{blue}{y \cdot y}\right) \]
    3. Applied egg-rr96.3%

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

      \[\leadsto \color{blue}{{y}^{2}} \cdot \left(x \cdot x - y \cdot y\right) \]
    5. Step-by-step derivation
      1. unpow272.7%

        \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot \left(x \cdot x - y \cdot y\right) \]
    6. Simplified72.7%

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

      \[\leadsto \left(y \cdot y\right) \cdot \color{blue}{\left(-1 \cdot {y}^{2}\right)} \]
    8. Step-by-step derivation
      1. unpow266.6%

        \[\leadsto \left(y \cdot y\right) \cdot \left(-1 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
      2. mul-1-neg66.6%

        \[\leadsto \left(y \cdot y\right) \cdot \color{blue}{\left(-y \cdot y\right)} \]
      3. distribute-rgt-neg-out66.6%

        \[\leadsto \left(y \cdot y\right) \cdot \color{blue}{\left(y \cdot \left(-y\right)\right)} \]
    9. Simplified66.6%

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

    if 1.3e135 < x

    1. Initial program 69.0%

      \[{x}^{4} - {y}^{4} \]
    2. Step-by-step derivation
      1. sqr-pow69.0%

        \[\leadsto \color{blue}{{x}^{\left(\frac{4}{2}\right)} \cdot {x}^{\left(\frac{4}{2}\right)}} - {y}^{4} \]
      2. sqr-pow69.0%

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

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

        \[\leadsto \left({x}^{\color{blue}{2}} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      5. pow286.2%

        \[\leadsto \left(\color{blue}{x \cdot x} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      6. metadata-eval86.2%

        \[\leadsto \left(x \cdot x + {y}^{\color{blue}{2}}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      7. pow286.2%

        \[\leadsto \left(x \cdot x + \color{blue}{y \cdot y}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      8. metadata-eval86.2%

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

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(\color{blue}{x \cdot x} - {y}^{\left(\frac{4}{2}\right)}\right) \]
      10. metadata-eval86.2%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(x \cdot x - {y}^{\color{blue}{2}}\right) \]
      11. pow286.2%

        \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(x \cdot x - \color{blue}{y \cdot y}\right) \]
    3. Applied egg-rr86.2%

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

      \[\leadsto \color{blue}{{y}^{2}} \cdot \left(x \cdot x - y \cdot y\right) \]
    5. Step-by-step derivation
      1. unpow248.7%

        \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot \left(x \cdot x - y \cdot y\right) \]
    6. Simplified48.7%

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

      \[\leadsto \color{blue}{{y}^{2} \cdot {x}^{2}} \]
    8. Step-by-step derivation
      1. unpow248.7%

        \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot {x}^{2} \]
      2. unpow248.7%

        \[\leadsto \left(y \cdot y\right) \cdot \color{blue}{\left(x \cdot x\right)} \]
    9. Simplified48.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.3 \cdot 10^{+135}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(y \cdot \left(-y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(y \cdot y\right)\\ \end{array} \]

Alternative 5: 32.8% accurate, 29.3× speedup?

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

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

    \[{x}^{4} - {y}^{4} \]
  2. Step-by-step derivation
    1. sqr-pow88.2%

      \[\leadsto \color{blue}{{x}^{\left(\frac{4}{2}\right)} \cdot {x}^{\left(\frac{4}{2}\right)}} - {y}^{4} \]
    2. sqr-pow88.1%

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

      \[\leadsto \color{blue}{\left({x}^{\left(\frac{4}{2}\right)} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right)} \]
    4. metadata-eval95.1%

      \[\leadsto \left({x}^{\color{blue}{2}} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
    5. pow295.1%

      \[\leadsto \left(\color{blue}{x \cdot x} + {y}^{\left(\frac{4}{2}\right)}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
    6. metadata-eval95.1%

      \[\leadsto \left(x \cdot x + {y}^{\color{blue}{2}}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
    7. pow295.1%

      \[\leadsto \left(x \cdot x + \color{blue}{y \cdot y}\right) \cdot \left({x}^{\left(\frac{4}{2}\right)} - {y}^{\left(\frac{4}{2}\right)}\right) \]
    8. metadata-eval95.1%

      \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left({x}^{\color{blue}{2}} - {y}^{\left(\frac{4}{2}\right)}\right) \]
    9. pow295.1%

      \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(\color{blue}{x \cdot x} - {y}^{\left(\frac{4}{2}\right)}\right) \]
    10. metadata-eval95.1%

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

      \[\leadsto \left(x \cdot x + y \cdot y\right) \cdot \left(x \cdot x - \color{blue}{y \cdot y}\right) \]
  3. Applied egg-rr95.1%

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

    \[\leadsto \color{blue}{{y}^{2}} \cdot \left(x \cdot x - y \cdot y\right) \]
  5. Step-by-step derivation
    1. unpow270.0%

      \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot \left(x \cdot x - y \cdot y\right) \]
  6. Simplified70.0%

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

    \[\leadsto \color{blue}{{y}^{2} \cdot {x}^{2}} \]
  8. Step-by-step derivation
    1. unpow228.7%

      \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot {x}^{2} \]
    2. unpow228.7%

      \[\leadsto \left(y \cdot y\right) \cdot \color{blue}{\left(x \cdot x\right)} \]
  9. Simplified28.7%

    \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot \left(x \cdot x\right)} \]
  10. Final simplification28.7%

    \[\leadsto \left(x \cdot x\right) \cdot \left(y \cdot y\right) \]

Reproduce

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