Average Error: 0.1 → 0.1
Time: 3.3s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[\left(x \cdot x + y \cdot \left(y + y\right)\right) + y \cdot y\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\left(x \cdot x + y \cdot \left(y + y\right)\right) + y \cdot y
double f(double x, double y) {
        double r472724 = x;
        double r472725 = r472724 * r472724;
        double r472726 = y;
        double r472727 = r472726 * r472726;
        double r472728 = r472725 + r472727;
        double r472729 = r472728 + r472727;
        double r472730 = r472729 + r472727;
        return r472730;
}

double f(double x, double y) {
        double r472731 = x;
        double r472732 = r472731 * r472731;
        double r472733 = y;
        double r472734 = r472733 + r472733;
        double r472735 = r472733 * r472734;
        double r472736 = r472732 + r472735;
        double r472737 = r472733 * r472733;
        double r472738 = r472736 + r472737;
        return r472738;
}

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. Using strategy rm
  3. Applied associate-+l+0.1

    \[\leadsto \color{blue}{\left(x \cdot x + \left(y \cdot y + y \cdot y\right)\right)} + y \cdot y\]
  4. Simplified0.1

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

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

Reproduce

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