| Alternative 1 | |
|---|---|
| Error | 57.8 |
| Cost | 6656 |
\[9 \cdot {x}^{4}
\]
(FPCore (x y) :precision binary64 (- (* 9.0 (pow x 4.0)) (* (* y y) (- (* y y) 2.0))))
(FPCore (x y) :precision binary64 (- (* y (+ y y)) (+ (* y (* (* y y) y)) (* (pow x 4.0) -9.0))))
double code(double x, double y) {
return (9.0 * pow(x, 4.0)) - ((y * y) * ((y * y) - 2.0));
}
double code(double x, double y) {
return (y * (y + y)) - ((y * ((y * y) * y)) + (pow(x, 4.0) * -9.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (9.0d0 * (x ** 4.0d0)) - ((y * y) * ((y * y) - 2.0d0))
end function
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y * (y + y)) - ((y * ((y * y) * y)) + ((x ** 4.0d0) * (-9.0d0)))
end function
public static double code(double x, double y) {
return (9.0 * Math.pow(x, 4.0)) - ((y * y) * ((y * y) - 2.0));
}
public static double code(double x, double y) {
return (y * (y + y)) - ((y * ((y * y) * y)) + (Math.pow(x, 4.0) * -9.0));
}
def code(x, y): return (9.0 * math.pow(x, 4.0)) - ((y * y) * ((y * y) - 2.0))
def code(x, y): return (y * (y + y)) - ((y * ((y * y) * y)) + (math.pow(x, 4.0) * -9.0))
function code(x, y) return Float64(Float64(9.0 * (x ^ 4.0)) - Float64(Float64(y * y) * Float64(Float64(y * y) - 2.0))) end
function code(x, y) return Float64(Float64(y * Float64(y + y)) - Float64(Float64(y * Float64(Float64(y * y) * y)) + Float64((x ^ 4.0) * -9.0))) end
function tmp = code(x, y) tmp = (9.0 * (x ^ 4.0)) - ((y * y) * ((y * y) - 2.0)); end
function tmp = code(x, y) tmp = (y * (y + y)) - ((y * ((y * y) * y)) + ((x ^ 4.0) * -9.0)); end
code[x_, y_] := N[(N[(9.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] - N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(N[(y * N[(y + y), $MachinePrecision]), $MachinePrecision] - N[(N[(y * N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] + N[(N[Power[x, 4.0], $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
9 \cdot {x}^{4} - \left(y \cdot y\right) \cdot \left(y \cdot y - 2\right)
y \cdot \left(y + y\right) - \left(y \cdot \left(\left(y \cdot y\right) \cdot y\right) + {x}^{4} \cdot -9\right)
Results
Initial program 62.0
Applied egg-rr52.0
Simplified52.0
[Start]52.0 | \[ y \cdot y + \left(y \cdot y - \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right) + {x}^{4} \cdot -9\right)\right)
\] |
|---|---|
rational_best_oopsla_all_46_json_45_simplify-108 [=>]52.0 | \[ \color{blue}{\left(y \cdot y + y \cdot y\right) - \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right) + {x}^{4} \cdot -9\right)}
\] |
rational_best_oopsla_all_46_json_45_simplify-37 [<=]52.0 | \[ \color{blue}{y \cdot \left(y + y\right)} - \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right) + {x}^{4} \cdot -9\right)
\] |
rational_best_oopsla_all_46_json_45_simplify-7 [=>]52.0 | \[ y \cdot \left(y + y\right) - \left(\color{blue}{y \cdot \left(\left(y \cdot y\right) \cdot y\right)} + {x}^{4} \cdot -9\right)
\] |
Final simplification52.0
| Alternative 1 | |
|---|---|
| Error | 57.8 |
| Cost | 6656 |
| Alternative 2 | |
|---|---|
| Error | 63.0 |
| Cost | 6592 |
herbie shell --seed 2023090
(FPCore (x y)
:name "From Rump in a 1983 paper, rewritten"
:precision binary64
:pre (and (== x 10864.0) (== y 18817.0))
(- (* 9.0 (pow x 4.0)) (* (* y y) (- (* y y) 2.0))))