Average Error: 0.1 → 0.1
Time: 10.9s
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 r448257 = x;
        double r448258 = r448257 * r448257;
        double r448259 = y;
        double r448260 = r448259 * r448259;
        double r448261 = r448258 + r448260;
        double r448262 = r448261 + r448260;
        double r448263 = r448262 + r448260;
        return r448263;
}

double f(double x, double y) {
        double r448264 = 3.0;
        double r448265 = y;
        double r448266 = r448265 * r448265;
        double r448267 = r448264 * r448266;
        double r448268 = x;
        double r448269 = r448268 * r448268;
        double r448270 = r448267 + r448269;
        return r448270;
}

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}{3 \cdot \left(y \cdot y\right) + x \cdot x}\]
  3. Final simplification0.1

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

Reproduce

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