Average Error: 0.1 → 0.1
Time: 8.3s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[y \cdot \left(y \cdot 3\right) + x \cdot x\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
y \cdot \left(y \cdot 3\right) + x \cdot x
double f(double x, double y) {
        double r427529 = x;
        double r427530 = r427529 * r427529;
        double r427531 = y;
        double r427532 = r427531 * r427531;
        double r427533 = r427530 + r427532;
        double r427534 = r427533 + r427532;
        double r427535 = r427534 + r427532;
        return r427535;
}

double f(double x, double y) {
        double r427536 = y;
        double r427537 = 3.0;
        double r427538 = r427536 * r427537;
        double r427539 = r427536 * r427538;
        double r427540 = x;
        double r427541 = r427540 * r427540;
        double r427542 = r427539 + r427541;
        return r427542;
}

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 associate-*l*0.1

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

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

Reproduce

herbie shell --seed 2019196 
(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)))