Average Error: 0.1 → 0.1
Time: 4.7s
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 r526241 = x;
        double r526242 = r526241 * r526241;
        double r526243 = y;
        double r526244 = r526243 * r526243;
        double r526245 = r526242 + r526244;
        double r526246 = r526245 + r526244;
        double r526247 = r526246 + r526244;
        return r526247;
}

double f(double x, double y) {
        double r526248 = x;
        double r526249 = r526248 * r526248;
        double r526250 = y;
        double r526251 = r526250 * r526250;
        double r526252 = r526249 + r526251;
        double r526253 = r526252 + r526251;
        double r526254 = r526253 + r526251;
        return r526254;
}

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 2020021 +o rules:numerics
(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)))