Average Error: 0.1 → 0.1
Time: 4.1s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
double f(double x, double y) {
        double r503713 = x;
        double r503714 = r503713 * r503713;
        double r503715 = y;
        double r503716 = r503715 * r503715;
        double r503717 = r503714 + r503716;
        double r503718 = r503717 + r503716;
        double r503719 = r503718 + r503716;
        return r503719;
}

double f(double x, double y) {
        double r503720 = x;
        double r503721 = r503720 * r503720;
        double r503722 = y;
        double r503723 = r503722 * r503722;
        double r503724 = r503721 + r503723;
        double r503725 = r503724 + r503723;
        double r503726 = r503725 + r503723;
        return r503726;
}

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. Final simplification0.1

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

Reproduce

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