Rump's expression from Stadtherr's award speech

Percentage Accurate: 9.2% → 9.3%
Time: 13.5s
Alternatives: 6
Speedup: 7.0×

Specification

?
\[x = 77617 \land y = 33096\]
\[\begin{array}{l} \\ -0.8273960599468214 \end{array} \]
(FPCore (x y) :precision binary64 -0.8273960599468214)
double code(double x, double y) {
	return -0.8273960599468214;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = -0.8273960599468214d0
end function
public static double code(double x, double y) {
	return -0.8273960599468214;
}
def code(x, y):
	return -0.8273960599468214
function code(x, y)
	return -0.8273960599468214
end
function tmp = code(x, y)
	tmp = -0.8273960599468214;
end
code[x_, y_] := -0.8273960599468214
\begin{array}{l}

\\
-0.8273960599468214
\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 6 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: 9.2% accurate, 1.0× speedup?

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

\\
\left(\left(333.75 \cdot {y}^{6} + \left(x \cdot x\right) \cdot \left(\left(\left(\left(\left(\left(11 \cdot x\right) \cdot x\right) \cdot y\right) \cdot y - {y}^{6}\right) - 121 \cdot {y}^{4}\right) - 2\right)\right) + 5.5 \cdot {y}^{8}\right) + \frac{x}{2 \cdot y}
\end{array}

Alternative 1: 9.3% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(y \cdot y\right) \cdot \left(y \cdot y\right)\\ t_1 := y \cdot \left(y \cdot \left(\left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 333.75\right) + \left(y \cdot y\right) \cdot \left(t\_0 \cdot 5.5\right)\right)\right)\\ \mathsf{fma}\left(\left(\frac{x}{y} \cdot \frac{x}{y}\right) \cdot 0.25 - t\_1 \cdot t\_1, \frac{1}{x \cdot \frac{0.5}{y} - t\_1}, \left(x \cdot x\right) \cdot \left(-2 + \left(y \cdot y\right) \cdot \left(\left(x \cdot \left(x \cdot 11\right) - t\_0\right) + y \cdot \left(y \cdot -121\right)\right)\right)\right) \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (* y y) (* y y)))
        (t_1
         (*
          y
          (* y (+ (* (* y y) (* (* y y) 333.75)) (* (* y y) (* t_0 5.5)))))))
   (fma
    (- (* (* (/ x y) (/ x y)) 0.25) (* t_1 t_1))
    (/ 1.0 (- (* x (/ 0.5 y)) t_1))
    (*
     (* x x)
     (+ -2.0 (* (* y y) (+ (- (* x (* x 11.0)) t_0) (* y (* y -121.0)))))))))
double code(double x, double y) {
	double t_0 = (y * y) * (y * y);
	double t_1 = y * (y * (((y * y) * ((y * y) * 333.75)) + ((y * y) * (t_0 * 5.5))));
	return fma(((((x / y) * (x / y)) * 0.25) - (t_1 * t_1)), (1.0 / ((x * (0.5 / y)) - t_1)), ((x * x) * (-2.0 + ((y * y) * (((x * (x * 11.0)) - t_0) + (y * (y * -121.0)))))));
}
function code(x, y)
	t_0 = Float64(Float64(y * y) * Float64(y * y))
	t_1 = Float64(y * Float64(y * Float64(Float64(Float64(y * y) * Float64(Float64(y * y) * 333.75)) + Float64(Float64(y * y) * Float64(t_0 * 5.5)))))
	return fma(Float64(Float64(Float64(Float64(x / y) * Float64(x / y)) * 0.25) - Float64(t_1 * t_1)), Float64(1.0 / Float64(Float64(x * Float64(0.5 / y)) - t_1)), Float64(Float64(x * x) * Float64(-2.0 + Float64(Float64(y * y) * Float64(Float64(Float64(x * Float64(x * 11.0)) - t_0) + Float64(y * Float64(y * -121.0)))))))
end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(y * N[(N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 333.75), $MachinePrecision]), $MachinePrecision] + N[(N[(y * y), $MachinePrecision] * N[(t$95$0 * 5.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision] - N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(x * N[(0.5 / y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(x * x), $MachinePrecision] * N[(-2.0 + N[(N[(y * y), $MachinePrecision] * N[(N[(N[(x * N[(x * 11.0), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] + N[(y * N[(y * -121.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(y \cdot y\right) \cdot \left(y \cdot y\right)\\
t_1 := y \cdot \left(y \cdot \left(\left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 333.75\right) + \left(y \cdot y\right) \cdot \left(t\_0 \cdot 5.5\right)\right)\right)\\
\mathsf{fma}\left(\left(\frac{x}{y} \cdot \frac{x}{y}\right) \cdot 0.25 - t\_1 \cdot t\_1, \frac{1}{x \cdot \frac{0.5}{y} - t\_1}, \left(x \cdot x\right) \cdot \left(-2 + \left(y \cdot y\right) \cdot \left(\left(x \cdot \left(x \cdot 11\right) - t\_0\right) + y \cdot \left(y \cdot -121\right)\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 9.2%

    \[\left(\left(333.75 \cdot {y}^{6} + \left(x \cdot x\right) \cdot \left(\left(\left(\left(\left(\left(11 \cdot x\right) \cdot x\right) \cdot y\right) \cdot y - {y}^{6}\right) - 121 \cdot {y}^{4}\right) - 2\right)\right) + 5.5 \cdot {y}^{8}\right) + \frac{x}{2 \cdot y} \]
  2. Applied egg-rr0

    \[\leadsto expr\]
  3. Applied egg-rr0

    \[\leadsto expr\]
  4. Applied egg-rr0

    \[\leadsto expr\]
  5. Add Preprocessing

Alternative 2: 9.3% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(y \cdot y\right) \cdot \left(y \cdot y\right)\\ \left(\frac{x}{y \cdot 2} + 333.75 \cdot \left(t\_0 \cdot \left(y \cdot y\right)\right)\right) + \mathsf{fma}\left(x \cdot \left(-2 + y \cdot \left(y \cdot \left(\left(x \cdot x\right) \cdot 11 - \left(y \cdot y\right) \cdot \left(y \cdot y - -121\right)\right)\right)\right), x, t\_0 \cdot \left(y \cdot \left(y \cdot \left(y \cdot \left(y \cdot 5.5\right)\right)\right)\right)\right) \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (* y y) (* y y))))
   (+
    (+ (/ x (* y 2.0)) (* 333.75 (* t_0 (* y y))))
    (fma
     (*
      x
      (+ -2.0 (* y (* y (- (* (* x x) 11.0) (* (* y y) (- (* y y) -121.0)))))))
     x
     (* t_0 (* y (* y (* y (* y 5.5)))))))))
double code(double x, double y) {
	double t_0 = (y * y) * (y * y);
	return ((x / (y * 2.0)) + (333.75 * (t_0 * (y * y)))) + fma((x * (-2.0 + (y * (y * (((x * x) * 11.0) - ((y * y) * ((y * y) - -121.0))))))), x, (t_0 * (y * (y * (y * (y * 5.5))))));
}
function code(x, y)
	t_0 = Float64(Float64(y * y) * Float64(y * y))
	return Float64(Float64(Float64(x / Float64(y * 2.0)) + Float64(333.75 * Float64(t_0 * Float64(y * y)))) + fma(Float64(x * Float64(-2.0 + Float64(y * Float64(y * Float64(Float64(Float64(x * x) * 11.0) - Float64(Float64(y * y) * Float64(Float64(y * y) - -121.0))))))), x, Float64(t_0 * Float64(y * Float64(y * Float64(y * Float64(y * 5.5)))))))
end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(x / N[(y * 2.0), $MachinePrecision]), $MachinePrecision] + N[(333.75 * N[(t$95$0 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x * N[(-2.0 + N[(y * N[(y * N[(N[(N[(x * x), $MachinePrecision] * 11.0), $MachinePrecision] - N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] - -121.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x + N[(t$95$0 * N[(y * N[(y * N[(y * N[(y * 5.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(y \cdot y\right) \cdot \left(y \cdot y\right)\\
\left(\frac{x}{y \cdot 2} + 333.75 \cdot \left(t\_0 \cdot \left(y \cdot y\right)\right)\right) + \mathsf{fma}\left(x \cdot \left(-2 + y \cdot \left(y \cdot \left(\left(x \cdot x\right) \cdot 11 - \left(y \cdot y\right) \cdot \left(y \cdot y - -121\right)\right)\right)\right), x, t\_0 \cdot \left(y \cdot \left(y \cdot \left(y \cdot \left(y \cdot 5.5\right)\right)\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 9.2%

    \[\left(\left(333.75 \cdot {y}^{6} + \left(x \cdot x\right) \cdot \left(\left(\left(\left(\left(\left(11 \cdot x\right) \cdot x\right) \cdot y\right) \cdot y - {y}^{6}\right) - 121 \cdot {y}^{4}\right) - 2\right)\right) + 5.5 \cdot {y}^{8}\right) + \frac{x}{2 \cdot y} \]
  2. Applied egg-rr0

    \[\leadsto expr\]
  3. Applied egg-rr0

    \[\leadsto expr\]
  4. Applied egg-rr0

    \[\leadsto expr\]
  5. Applied egg-rr0

    \[\leadsto expr\]
  6. Add Preprocessing

Alternative 3: 9.2% accurate, 7.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(y \cdot y\right) \cdot \left(y \cdot y\right)\\ \left(\frac{x}{y \cdot 2} + 333.75 \cdot \left(t\_0 \cdot \left(y \cdot y\right)\right)\right) + \left(t\_0 \cdot \left(y \cdot \left(y \cdot \left(y \cdot \left(y \cdot 5.5\right)\right)\right)\right) + \left(x \cdot x\right) \cdot \left(-2 + y \cdot \left(y \cdot \left(\left(x \cdot x\right) \cdot 11 - \left(y \cdot y\right) \cdot \left(y \cdot y - -121\right)\right)\right)\right)\right) \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (* y y) (* y y))))
   (+
    (+ (/ x (* y 2.0)) (* 333.75 (* t_0 (* y y))))
    (+
     (* t_0 (* y (* y (* y (* y 5.5)))))
     (*
      (* x x)
      (+
       -2.0
       (* y (* y (- (* (* x x) 11.0) (* (* y y) (- (* y y) -121.0)))))))))))
double code(double x, double y) {
	double t_0 = (y * y) * (y * y);
	return ((x / (y * 2.0)) + (333.75 * (t_0 * (y * y)))) + ((t_0 * (y * (y * (y * (y * 5.5))))) + ((x * x) * (-2.0 + (y * (y * (((x * x) * 11.0) - ((y * y) * ((y * y) - -121.0))))))));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    t_0 = (y * y) * (y * y)
    code = ((x / (y * 2.0d0)) + (333.75d0 * (t_0 * (y * y)))) + ((t_0 * (y * (y * (y * (y * 5.5d0))))) + ((x * x) * ((-2.0d0) + (y * (y * (((x * x) * 11.0d0) - ((y * y) * ((y * y) - (-121.0d0)))))))))
end function
public static double code(double x, double y) {
	double t_0 = (y * y) * (y * y);
	return ((x / (y * 2.0)) + (333.75 * (t_0 * (y * y)))) + ((t_0 * (y * (y * (y * (y * 5.5))))) + ((x * x) * (-2.0 + (y * (y * (((x * x) * 11.0) - ((y * y) * ((y * y) - -121.0))))))));
}
def code(x, y):
	t_0 = (y * y) * (y * y)
	return ((x / (y * 2.0)) + (333.75 * (t_0 * (y * y)))) + ((t_0 * (y * (y * (y * (y * 5.5))))) + ((x * x) * (-2.0 + (y * (y * (((x * x) * 11.0) - ((y * y) * ((y * y) - -121.0))))))))
function code(x, y)
	t_0 = Float64(Float64(y * y) * Float64(y * y))
	return Float64(Float64(Float64(x / Float64(y * 2.0)) + Float64(333.75 * Float64(t_0 * Float64(y * y)))) + Float64(Float64(t_0 * Float64(y * Float64(y * Float64(y * Float64(y * 5.5))))) + Float64(Float64(x * x) * Float64(-2.0 + Float64(y * Float64(y * Float64(Float64(Float64(x * x) * 11.0) - Float64(Float64(y * y) * Float64(Float64(y * y) - -121.0)))))))))
end
function tmp = code(x, y)
	t_0 = (y * y) * (y * y);
	tmp = ((x / (y * 2.0)) + (333.75 * (t_0 * (y * y)))) + ((t_0 * (y * (y * (y * (y * 5.5))))) + ((x * x) * (-2.0 + (y * (y * (((x * x) * 11.0) - ((y * y) * ((y * y) - -121.0))))))));
end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(x / N[(y * 2.0), $MachinePrecision]), $MachinePrecision] + N[(333.75 * N[(t$95$0 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * N[(y * N[(y * N[(y * N[(y * 5.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x * x), $MachinePrecision] * N[(-2.0 + N[(y * N[(y * N[(N[(N[(x * x), $MachinePrecision] * 11.0), $MachinePrecision] - N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] - -121.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(y \cdot y\right) \cdot \left(y \cdot y\right)\\
\left(\frac{x}{y \cdot 2} + 333.75 \cdot \left(t\_0 \cdot \left(y \cdot y\right)\right)\right) + \left(t\_0 \cdot \left(y \cdot \left(y \cdot \left(y \cdot \left(y \cdot 5.5\right)\right)\right)\right) + \left(x \cdot x\right) \cdot \left(-2 + y \cdot \left(y \cdot \left(\left(x \cdot x\right) \cdot 11 - \left(y \cdot y\right) \cdot \left(y \cdot y - -121\right)\right)\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 9.2%

    \[\left(\left(333.75 \cdot {y}^{6} + \left(x \cdot x\right) \cdot \left(\left(\left(\left(\left(\left(11 \cdot x\right) \cdot x\right) \cdot y\right) \cdot y - {y}^{6}\right) - 121 \cdot {y}^{4}\right) - 2\right)\right) + 5.5 \cdot {y}^{8}\right) + \frac{x}{2 \cdot y} \]
  2. Applied egg-rr0

    \[\leadsto expr\]
  3. Applied egg-rr0

    \[\leadsto expr\]
  4. Applied egg-rr0

    \[\leadsto expr\]
  5. Applied egg-rr0

    \[\leadsto expr\]
  6. Add Preprocessing

Alternative 4: 3.1% accurate, 7.2× speedup?

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

\\
\left(\left(y \cdot y\right) \cdot \left(y \cdot \left(y \cdot \left(\left(y \cdot y\right) \cdot 333.75\right)\right)\right) + x \cdot \left(x \cdot \left(-2 + y \cdot \left(y \cdot \left(\left(x \cdot x\right) \cdot 11 - \left(y \cdot y\right) \cdot \left(y \cdot y - -121\right)\right)\right)\right) + \frac{0.5}{y}\right)\right) + \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \left(y \cdot \left(y \cdot \left(y \cdot \left(y \cdot 5.5\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 9.2%

    \[\left(\left(333.75 \cdot {y}^{6} + \left(x \cdot x\right) \cdot \left(\left(\left(\left(\left(\left(11 \cdot x\right) \cdot x\right) \cdot y\right) \cdot y - {y}^{6}\right) - 121 \cdot {y}^{4}\right) - 2\right)\right) + 5.5 \cdot {y}^{8}\right) + \frac{x}{2 \cdot y} \]
  2. Applied egg-rr0

    \[\leadsto expr\]
  3. Applied egg-rr0

    \[\leadsto expr\]
  4. Applied egg-rr0

    \[\leadsto expr\]
  5. Applied egg-rr0

    \[\leadsto expr\]
  6. Add Preprocessing

Alternative 5: 1.5% accurate, 8.0× speedup?

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

\\
x \cdot \left(x \cdot -2\right) + \left(\left(\left(x \cdot x\right) \cdot 11 - \left(y \cdot y\right) \cdot \left(y \cdot y - -121\right)\right) \cdot \left(\left(y \cdot y\right) \cdot \left(x \cdot x\right)\right) + \left(x \cdot \frac{0.5}{y} + \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \left(\left(y \cdot y\right) \cdot \left(333.75 + y \cdot \left(y \cdot 5.5\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 9.2%

    \[\left(\left(333.75 \cdot {y}^{6} + \left(x \cdot x\right) \cdot \left(\left(\left(\left(\left(\left(11 \cdot x\right) \cdot x\right) \cdot y\right) \cdot y - {y}^{6}\right) - 121 \cdot {y}^{4}\right) - 2\right)\right) + 5.5 \cdot {y}^{8}\right) + \frac{x}{2 \cdot y} \]
  2. Applied egg-rr0

    \[\leadsto expr\]
  3. Applied egg-rr0

    \[\leadsto expr\]
  4. Applied egg-rr0

    \[\leadsto expr\]
  5. Applied egg-rr0

    \[\leadsto expr\]
  6. Add Preprocessing

Alternative 6: 1.5% accurate, 9.0× speedup?

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

\\
\left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \left(\left(y \cdot y\right) \cdot \left(333.75 + y \cdot \left(y \cdot 5.5\right)\right)\right) + x \cdot \left(x \cdot \left(-2 + y \cdot \left(y \cdot \left(\left(x \cdot x\right) \cdot 11 - \left(y \cdot y\right) \cdot \left(y \cdot y - -121\right)\right)\right)\right) + \frac{0.5}{y}\right)
\end{array}
Derivation
  1. Initial program 9.2%

    \[\left(\left(333.75 \cdot {y}^{6} + \left(x \cdot x\right) \cdot \left(\left(\left(\left(\left(\left(11 \cdot x\right) \cdot x\right) \cdot y\right) \cdot y - {y}^{6}\right) - 121 \cdot {y}^{4}\right) - 2\right)\right) + 5.5 \cdot {y}^{8}\right) + \frac{x}{2 \cdot y} \]
  2. Applied egg-rr0

    \[\leadsto expr\]
  3. Applied egg-rr0

    \[\leadsto expr\]
  4. Applied egg-rr0

    \[\leadsto expr\]
  5. Applied egg-rr0

    \[\leadsto expr\]
  6. Add Preprocessing

Reproduce

?
herbie shell --seed 2024103 
(FPCore (x y)
  :name "Rump's expression from Stadtherr's award speech"
  :precision binary64
  :pre (and (== x 77617.0) (== y 33096.0))
  (+ (+ (+ (* 333.75 (pow y 6.0)) (* (* x x) (- (- (- (* (* (* (* 11.0 x) x) y) y) (pow y 6.0)) (* 121.0 (pow y 4.0))) 2.0))) (* 5.5 (pow y 8.0))) (/ x (* 2.0 y))))