Average Error: 0.0 → 0.0
Time: 5.7s
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 r614604 = 2.0;
        double r614605 = x;
        double r614606 = r614605 * r614605;
        double r614607 = y;
        double r614608 = r614605 * r614607;
        double r614609 = r614606 + r614608;
        double r614610 = r614604 * r614609;
        return r614610;
}

double f(double x, double y) {
        double r614611 = x;
        double r614612 = y;
        double r614613 = r614611 + r614612;
        double r614614 = r614611 * r614613;
        double r614615 = 2.0;
        double r614616 = r614614 * r614615;
        return r614616;
}

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

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

Reproduce

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