From Rump in a 1983 paper

Percentage Accurate: 18.8% → 100.0%
Time: 11.4s
Alternatives: 5
Speedup: 9.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

Alternative 1: 100.0% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(2 - y \cdot y, y \cdot y, \left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right)\right) \end{array} \]
(FPCore (x y)
 :precision binary64
 (fma (- 2.0 (* y y)) (* y y) (* (* x x) (* (* x x) 9.0))))
double code(double x, double y) {
	return fma((2.0 - (y * y)), (y * y), ((x * x) * ((x * x) * 9.0)));
}
function code(x, y)
	return fma(Float64(2.0 - Float64(y * y)), Float64(y * y), Float64(Float64(x * x) * Float64(Float64(x * x) * 9.0)))
end
code[x_, y_] := N[(N[(2.0 - N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(y * y), $MachinePrecision] + N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \left({y}^{\left(2 \cdot 2\right)} - 2 \cdot \left(y \cdot y\right)\right)\right) \]
    14. pow-powN/A

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right) - \color{blue}{2} \cdot \left(y \cdot y\right)\right)\right) \]
    17. distribute-rgt-out--N/A

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \color{blue}{\left(y \cdot y - 2\right)}\right)\right)\right) \]
    21. sub-negN/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \left(y \cdot y + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right)\right) \]
    22. +-lowering-+.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\left(y \cdot y\right), \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right)\right) \]
    23. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, y\right), \left(\mathsf{neg}\left(\color{blue}{2}\right)\right)\right)\right)\right)\right) \]
    24. metadata-eval3.1%

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

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

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

      \[\leadsto 9 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) + \left(\mathsf{neg}\left(\left(y \cdot y\right) \cdot \left(y \cdot y + -2\right)\right)\right) \]
    3. distribute-rgt-neg-outN/A

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

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

      \[\leadsto \left(\mathsf{neg}\left(\left(y \cdot y + -2\right)\right)\right) \cdot \left(y \cdot y\right) + \color{blue}{9} \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \]
    6. accelerator-lowering-fma.f64N/A

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

      \[\leadsto \mathsf{fma.f64}\left(\left(\mathsf{neg}\left(\left(-2 + y \cdot y\right)\right)\right), \left(y \cdot y\right), \left(9 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)\right) \]
    8. distribute-neg-inN/A

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

      \[\leadsto \mathsf{fma.f64}\left(\left(2 + \left(\mathsf{neg}\left(y \cdot y\right)\right)\right), \left(y \cdot y\right), \left(9 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)\right) \]
    10. sub-negN/A

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

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

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

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

      \[\leadsto \mathsf{fma.f64}\left(\mathsf{\_.f64}\left(2, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, y\right), \left(\left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot 9\right)\right) \]
    15. associate-*r*N/A

      \[\leadsto \mathsf{fma.f64}\left(\mathsf{\_.f64}\left(2, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, y\right), \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9\right)\right) \]
    16. associate-*l*N/A

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

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

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

      \[\leadsto \mathsf{fma.f64}\left(\mathsf{\_.f64}\left(2, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\left(x \cdot x\right), 9\right)\right)\right) \]
    20. *-lowering-*.f64100.0%

      \[\leadsto \mathsf{fma.f64}\left(\mathsf{\_.f64}\left(2, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right)\right) \]
  6. Applied egg-rr100.0%

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

Alternative 2: 21.2% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(y \cdot y\right)\\ t_1 := y \cdot t\_0\\ t_2 := \left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right)\\ \frac{\left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 4\right) + \left(t\_2 - t\_1\right) \cdot \left(t\_1 - t\_2\right)}{2 \cdot \left(y \cdot y\right) + \frac{\left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)\right) \cdot -81 + t\_0 \cdot \left(y \cdot t\_1\right)}{t\_1}} \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* y (* y y))) (t_1 (* y t_0)) (t_2 (* (* x x) (* (* x x) 9.0))))
   (/
    (+ (* (* y y) (* (* y y) 4.0)) (* (- t_2 t_1) (- t_1 t_2)))
    (+
     (* 2.0 (* y y))
     (/
      (+
       (* (* (* x x) (* (* x x) (* x (* x (* x x))))) -81.0)
       (* t_0 (* y t_1)))
      t_1)))))
double code(double x, double y) {
	double t_0 = y * (y * y);
	double t_1 = y * t_0;
	double t_2 = (x * x) * ((x * x) * 9.0);
	return (((y * y) * ((y * y) * 4.0)) + ((t_2 - t_1) * (t_1 - t_2))) / ((2.0 * (y * y)) + (((((x * x) * ((x * x) * (x * (x * (x * x))))) * -81.0) + (t_0 * (y * t_1))) / t_1));
}
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
    t_0 = y * (y * y)
    t_1 = y * t_0
    t_2 = (x * x) * ((x * x) * 9.0d0)
    code = (((y * y) * ((y * y) * 4.0d0)) + ((t_2 - t_1) * (t_1 - t_2))) / ((2.0d0 * (y * y)) + (((((x * x) * ((x * x) * (x * (x * (x * x))))) * (-81.0d0)) + (t_0 * (y * t_1))) / t_1))
end function
public static double code(double x, double y) {
	double t_0 = y * (y * y);
	double t_1 = y * t_0;
	double t_2 = (x * x) * ((x * x) * 9.0);
	return (((y * y) * ((y * y) * 4.0)) + ((t_2 - t_1) * (t_1 - t_2))) / ((2.0 * (y * y)) + (((((x * x) * ((x * x) * (x * (x * (x * x))))) * -81.0) + (t_0 * (y * t_1))) / t_1));
}
def code(x, y):
	t_0 = y * (y * y)
	t_1 = y * t_0
	t_2 = (x * x) * ((x * x) * 9.0)
	return (((y * y) * ((y * y) * 4.0)) + ((t_2 - t_1) * (t_1 - t_2))) / ((2.0 * (y * y)) + (((((x * x) * ((x * x) * (x * (x * (x * x))))) * -81.0) + (t_0 * (y * t_1))) / t_1))
function code(x, y)
	t_0 = Float64(y * Float64(y * y))
	t_1 = Float64(y * t_0)
	t_2 = Float64(Float64(x * x) * Float64(Float64(x * x) * 9.0))
	return Float64(Float64(Float64(Float64(y * y) * Float64(Float64(y * y) * 4.0)) + Float64(Float64(t_2 - t_1) * Float64(t_1 - t_2))) / Float64(Float64(2.0 * Float64(y * y)) + Float64(Float64(Float64(Float64(Float64(x * x) * Float64(Float64(x * x) * Float64(x * Float64(x * Float64(x * x))))) * -81.0) + Float64(t_0 * Float64(y * t_1))) / t_1)))
end
function tmp = code(x, y)
	t_0 = y * (y * y);
	t_1 = y * t_0;
	t_2 = (x * x) * ((x * x) * 9.0);
	tmp = (((y * y) * ((y * y) * 4.0)) + ((t_2 - t_1) * (t_1 - t_2))) / ((2.0 * (y * y)) + (((((x * x) * ((x * x) * (x * (x * (x * x))))) * -81.0) + (t_0 * (y * t_1))) / t_1));
end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - t$95$1), $MachinePrecision] * N[(t$95$1 - t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -81.0), $MachinePrecision] + N[(t$95$0 * N[(y * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \left({y}^{\left(2 \cdot 2\right)} - 2 \cdot \left(y \cdot y\right)\right)\right) \]
    14. pow-powN/A

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right) - \color{blue}{2} \cdot \left(y \cdot y\right)\right)\right) \]
    17. distribute-rgt-out--N/A

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \color{blue}{\left(y \cdot y - 2\right)}\right)\right)\right) \]
    21. sub-negN/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \left(y \cdot y + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right)\right) \]
    22. +-lowering-+.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\left(y \cdot y\right), \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right)\right) \]
    23. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, y\right), \left(\mathsf{neg}\left(\color{blue}{2}\right)\right)\right)\right)\right)\right) \]
    24. metadata-eval3.1%

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

    \[\leadsto \color{blue}{9 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) - y \cdot \left(y \cdot \left(y \cdot y + -2\right)\right)} \]
  5. Step-by-step derivation
    1. distribute-lft-inN/A

      \[\leadsto 9 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right) + \color{blue}{y \cdot -2}\right) \]
    2. distribute-lft-inN/A

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

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

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

      \[\leadsto \left(9 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot y\right) \cdot -2\right)\right)} \]
    6. +-commutativeN/A

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(\left(y \cdot y\right) \cdot -2\right)\right) \cdot \left(\mathsf{neg}\left(\left(y \cdot y\right) \cdot -2\right)\right) - \left(9 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right) \cdot \left(9 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right), \color{blue}{\left(\left(\mathsf{neg}\left(\left(y \cdot y\right) \cdot -2\right)\right) - \left(9 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)}\right) \]
  6. Applied egg-rr18.8%

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

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

    \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 2\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right)\right), -81\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \color{blue}{\left(-1 \cdot {y}^{4}\right)}\right)\right)\right) \]
  9. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 2\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right)\right), -81\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \left(\mathsf{neg}\left({y}^{4}\right)\right)\right)\right)\right) \]
    2. neg-sub0N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 2\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right)\right), -81\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \left(0 - \color{blue}{{y}^{4}}\right)\right)\right)\right) \]
    3. --lowering--.f64N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 2\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right)\right), -81\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \left({y}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right)\right)\right) \]
    5. pow-sqrN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 2\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right)\right), -81\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \left({y}^{2} \cdot \color{blue}{{y}^{2}}\right)\right)\right)\right)\right) \]
    6. unpow2N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 2\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right)\right), -81\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \left(y \cdot \color{blue}{\left(y \cdot {y}^{2}\right)}\right)\right)\right)\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 2\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right)\right), -81\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(y, \color{blue}{\left(y \cdot {y}^{2}\right)}\right)\right)\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 2\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right)\right), -81\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \color{blue}{\left({y}^{2}\right)}\right)\right)\right)\right)\right)\right) \]
    10. unpow2N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 4\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), 9\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), 2\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right)\right), -81\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right)\right)\right)\right)\right)\right) \]
  10. Simplified21.2%

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

    \[\leadsto \frac{\left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 4\right) + \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right) \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right) - \left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right)\right)}{2 \cdot \left(y \cdot y\right) + \frac{\left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)\right) \cdot -81 + \left(y \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)}{y \cdot \left(y \cdot \left(y \cdot y\right)\right)}} \]
  12. Add Preprocessing

Alternative 3: 18.8% accurate, 3.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \left(y \cdot \left(y \cdot y\right)\right)\\ t_1 := \left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right)\\ t_2 := t\_0 - t\_1\\ \frac{\left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 4\right) + \left(t\_1 - t\_0\right) \cdot t\_2}{2 \cdot \left(y \cdot y\right) + t\_2} \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* y (* y (* y y))))
        (t_1 (* (* x x) (* (* x x) 9.0)))
        (t_2 (- t_0 t_1)))
   (/
    (+ (* (* y y) (* (* y y) 4.0)) (* (- t_1 t_0) t_2))
    (+ (* 2.0 (* y y)) t_2))))
double code(double x, double y) {
	double t_0 = y * (y * (y * y));
	double t_1 = (x * x) * ((x * x) * 9.0);
	double t_2 = t_0 - t_1;
	return (((y * y) * ((y * y) * 4.0)) + ((t_1 - t_0) * t_2)) / ((2.0 * (y * y)) + t_2);
}
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
    t_0 = y * (y * (y * y))
    t_1 = (x * x) * ((x * x) * 9.0d0)
    t_2 = t_0 - t_1
    code = (((y * y) * ((y * y) * 4.0d0)) + ((t_1 - t_0) * t_2)) / ((2.0d0 * (y * y)) + t_2)
end function
public static double code(double x, double y) {
	double t_0 = y * (y * (y * y));
	double t_1 = (x * x) * ((x * x) * 9.0);
	double t_2 = t_0 - t_1;
	return (((y * y) * ((y * y) * 4.0)) + ((t_1 - t_0) * t_2)) / ((2.0 * (y * y)) + t_2);
}
def code(x, y):
	t_0 = y * (y * (y * y))
	t_1 = (x * x) * ((x * x) * 9.0)
	t_2 = t_0 - t_1
	return (((y * y) * ((y * y) * 4.0)) + ((t_1 - t_0) * t_2)) / ((2.0 * (y * y)) + t_2)
function code(x, y)
	t_0 = Float64(y * Float64(y * Float64(y * y)))
	t_1 = Float64(Float64(x * x) * Float64(Float64(x * x) * 9.0))
	t_2 = Float64(t_0 - t_1)
	return Float64(Float64(Float64(Float64(y * y) * Float64(Float64(y * y) * 4.0)) + Float64(Float64(t_1 - t_0) * t_2)) / Float64(Float64(2.0 * Float64(y * y)) + t_2))
end
function tmp = code(x, y)
	t_0 = y * (y * (y * y));
	t_1 = (x * x) * ((x * x) * 9.0);
	t_2 = t_0 - t_1;
	tmp = (((y * y) * ((y * y) * 4.0)) + ((t_1 - t_0) * t_2)) / ((2.0 * (y * y)) + t_2);
end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - t$95$1), $MachinePrecision]}, N[(N[(N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - t$95$0), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] / N[(N[(2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \left({y}^{\left(2 \cdot 2\right)} - 2 \cdot \left(y \cdot y\right)\right)\right) \]
    14. pow-powN/A

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right) - \color{blue}{2} \cdot \left(y \cdot y\right)\right)\right) \]
    17. distribute-rgt-out--N/A

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \color{blue}{\left(y \cdot y - 2\right)}\right)\right)\right) \]
    21. sub-negN/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \left(y \cdot y + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right)\right) \]
    22. +-lowering-+.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\left(y \cdot y\right), \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right)\right) \]
    23. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(9, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, y\right), \left(\mathsf{neg}\left(\color{blue}{2}\right)\right)\right)\right)\right)\right) \]
    24. metadata-eval3.1%

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

    \[\leadsto \color{blue}{9 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) - y \cdot \left(y \cdot \left(y \cdot y + -2\right)\right)} \]
  5. Step-by-step derivation
    1. distribute-lft-inN/A

      \[\leadsto 9 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right) + \color{blue}{y \cdot -2}\right) \]
    2. distribute-lft-inN/A

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

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

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

      \[\leadsto \left(9 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(\left(y \cdot y\right) \cdot -2\right)\right)} \]
    6. +-commutativeN/A

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(\left(y \cdot y\right) \cdot -2\right)\right) \cdot \left(\mathsf{neg}\left(\left(y \cdot y\right) \cdot -2\right)\right) - \left(9 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right) \cdot \left(9 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right), \color{blue}{\left(\left(\mathsf{neg}\left(\left(y \cdot y\right) \cdot -2\right)\right) - \left(9 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)}\right) \]
  6. Applied egg-rr18.8%

    \[\leadsto \color{blue}{\frac{\left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 4\right) - \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)}{\left(y \cdot y\right) \cdot 2 - \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)}} \]
  7. Final simplification18.8%

    \[\leadsto \frac{\left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 4\right) + \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right) - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right) \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right) - \left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right)\right)}{2 \cdot \left(y \cdot y\right) + \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right) - \left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right)\right)} \]
  8. Add Preprocessing

Alternative 4: 18.8% accurate, 9.3× speedup?

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

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

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

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

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

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

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

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

Alternative 5: 11.1% accurate, 42.6× speedup?

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

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

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

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

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

      \[\leadsto 2 \cdot {y}^{2} - {y}^{2} \cdot \color{blue}{{y}^{2}} \]
    3. distribute-rgt-out--N/A

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

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

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

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

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

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

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

      \[\leadsto {y}^{2} \cdot \left({y}^{2} \cdot \left(2 \cdot \frac{1}{{y}^{2}} + \left(\mathsf{neg}\left(1\right)\right)\right)\right) \]
    11. sub-negN/A

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \left({y}^{2} \cdot \left(2 \cdot \frac{1}{{y}^{2}} + -1\right)\right)\right) \]
    19. distribute-rgt-inN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \left(\left(2 \cdot \frac{1}{{y}^{2}}\right) \cdot {y}^{2} + \color{blue}{-1 \cdot {y}^{2}}\right)\right) \]
  5. Simplified1.5%

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

    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \color{blue}{2}\right) \]
  7. Step-by-step derivation
    1. Simplified11.1%

      \[\leadsto \left(y \cdot y\right) \cdot \color{blue}{2} \]
    2. Final simplification11.1%

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

    Reproduce

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