Average Error: 0.0 → 0.0
Time: 4.9s
Precision: 64
\[2 \cdot \left(x \cdot x + x \cdot y\right)\]
\[\left(x \cdot \left(x + y\right)\right) \cdot 2\]
2 \cdot \left(x \cdot x + x \cdot y\right)
\left(x \cdot \left(x + y\right)\right) \cdot 2
double f(double x, double y) {
        double r317229 = 2.0;
        double r317230 = x;
        double r317231 = r317230 * r317230;
        double r317232 = y;
        double r317233 = r317230 * r317232;
        double r317234 = r317231 + r317233;
        double r317235 = r317229 * r317234;
        return r317235;
}

double f(double x, double y) {
        double r317236 = x;
        double r317237 = y;
        double r317238 = r317236 + r317237;
        double r317239 = r317236 * r317238;
        double r317240 = 2.0;
        double r317241 = r317239 * r317240;
        return r317241;
}

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.0
Target0.0
Herbie0.0
\[\left(x \cdot 2\right) \cdot \left(x + y\right)\]

Derivation

  1. Initial program 0.0

    \[2 \cdot \left(x \cdot x + x \cdot y\right)\]
  2. Final simplification0.0

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

Reproduce

herbie shell --seed 2019294 
(FPCore (x y)
  :name "Linear.Matrix:fromQuaternion from linear-1.19.1.3, B"
  :precision binary64

  :herbie-target
  (* (* x 2) (+ x y))

  (* 2 (+ (* x x) (* x y))))