Average Error: 0.1 → 0.1
Time: 7.9s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[x \cdot x + \left(y \cdot y\right) \cdot 3\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
x \cdot x + \left(y \cdot y\right) \cdot 3
double f(double x, double y) {
        double r24977523 = x;
        double r24977524 = r24977523 * r24977523;
        double r24977525 = y;
        double r24977526 = r24977525 * r24977525;
        double r24977527 = r24977524 + r24977526;
        double r24977528 = r24977527 + r24977526;
        double r24977529 = r24977528 + r24977526;
        return r24977529;
}

double f(double x, double y) {
        double r24977530 = x;
        double r24977531 = r24977530 * r24977530;
        double r24977532 = y;
        double r24977533 = r24977532 * r24977532;
        double r24977534 = 3.0;
        double r24977535 = r24977533 * r24977534;
        double r24977536 = r24977531 + r24977535;
        return r24977536;
}

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}{\left(y \cdot y\right) \cdot 3 + x \cdot x}\]
  3. Using strategy rm
  4. Applied +-commutative0.1

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

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

Reproduce

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

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

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