Average Error: 0.0 → 0.0
Time: 39.6s
Precision: 64
\[2 \cdot \left(x \cdot x + x \cdot y\right)\]
\[\left(y + x\right) \cdot \left(2 \cdot x\right)\]
2 \cdot \left(x \cdot x + x \cdot y\right)
\left(y + x\right) \cdot \left(2 \cdot x\right)
double f(double x, double y) {
        double r28834387 = 2.0;
        double r28834388 = x;
        double r28834389 = r28834388 * r28834388;
        double r28834390 = y;
        double r28834391 = r28834388 * r28834390;
        double r28834392 = r28834389 + r28834391;
        double r28834393 = r28834387 * r28834392;
        return r28834393;
}

double f(double x, double y) {
        double r28834394 = y;
        double r28834395 = x;
        double r28834396 = r28834394 + r28834395;
        double r28834397 = 2.0;
        double r28834398 = r28834397 * r28834395;
        double r28834399 = r28834396 * r28834398;
        return r28834399;
}

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. Simplified0.0

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

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

Reproduce

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

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

  (* 2.0 (+ (* x x) (* x y))))