Average Error: 0.1 → 0.1
Time: 3.0s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[3 \cdot \left(y \cdot y\right) + x \cdot x\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
3 \cdot \left(y \cdot y\right) + x \cdot x
double f(double x, double y) {
        double r588414 = x;
        double r588415 = r588414 * r588414;
        double r588416 = y;
        double r588417 = r588416 * r588416;
        double r588418 = r588415 + r588417;
        double r588419 = r588418 + r588417;
        double r588420 = r588419 + r588417;
        return r588420;
}

double f(double x, double y) {
        double r588421 = 3.0;
        double r588422 = y;
        double r588423 = r588422 * r588422;
        double r588424 = r588421 * r588423;
        double r588425 = x;
        double r588426 = r588425 * r588425;
        double r588427 = r588424 + r588426;
        return r588427;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0.1
Herbie0.1
\[x \cdot x + y \cdot \left(y + \left(y + y\right)\right)\]

Derivation

  1. Initial program 0.1

    \[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
  2. Simplified0.1

    \[\leadsto \color{blue}{3 \cdot \left(y \cdot y\right) + x \cdot x}\]
  3. Final simplification0.1

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

Reproduce

herbie shell --seed 2020020 
(FPCore (x y)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, E"
  :precision binary64

  :herbie-target
  (+ (* x x) (* y (+ y (+ y y))))

  (+ (+ (+ (* x x) (* y y)) (* y y)) (* y y)))