Average Error: 0.0 → 0.0
Time: 6.5s
Precision: 64
\[2 \cdot \left(x \cdot x + x \cdot y\right)\]
\[\left(x + y\right) \cdot \left(2 \cdot x\right)\]
2 \cdot \left(x \cdot x + x \cdot y\right)
\left(x + y\right) \cdot \left(2 \cdot x\right)
double f(double x, double y) {
        double r35320995 = 2.0;
        double r35320996 = x;
        double r35320997 = r35320996 * r35320996;
        double r35320998 = y;
        double r35320999 = r35320996 * r35320998;
        double r35321000 = r35320997 + r35320999;
        double r35321001 = r35320995 * r35321000;
        return r35321001;
}

double f(double x, double y) {
        double r35321002 = x;
        double r35321003 = y;
        double r35321004 = r35321002 + r35321003;
        double r35321005 = 2.0;
        double r35321006 = r35321005 * r35321002;
        double r35321007 = r35321004 * r35321006;
        return r35321007;
}

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

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

Reproduce

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