Average Error: 0.1 → 0.1
Time: 8.0s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[3 \cdot \left(y \cdot y\right) + x \cdot x\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
3 \cdot \left(y \cdot y\right) + x \cdot x
double f(double x, double y) {
        double r337272 = x;
        double r337273 = r337272 * r337272;
        double r337274 = y;
        double r337275 = r337274 * r337274;
        double r337276 = r337273 + r337275;
        double r337277 = r337276 + r337275;
        double r337278 = r337277 + r337275;
        return r337278;
}

double f(double x, double y) {
        double r337279 = 3.0;
        double r337280 = y;
        double r337281 = r337280 * r337280;
        double r337282 = r337279 * r337281;
        double r337283 = x;
        double r337284 = r337283 * r337283;
        double r337285 = r337282 + r337284;
        return r337285;
}

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 pow10.1

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

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

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)))