Average Error: 0.1 → 0.1
Time: 29.6s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[x \cdot x + \left(3 \cdot y\right) \cdot y\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
x \cdot x + \left(3 \cdot y\right) \cdot y
double f(double x, double y) {
        double r255429 = x;
        double r255430 = r255429 * r255429;
        double r255431 = y;
        double r255432 = r255431 * r255431;
        double r255433 = r255430 + r255432;
        double r255434 = r255433 + r255432;
        double r255435 = r255434 + r255432;
        return r255435;
}

double f(double x, double y) {
        double r255436 = x;
        double r255437 = r255436 * r255436;
        double r255438 = 3.0;
        double r255439 = y;
        double r255440 = r255438 * r255439;
        double r255441 = r255440 * r255439;
        double r255442 = r255437 + r255441;
        return r255442;
}

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

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

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

Reproduce

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