Average Error: 0.0 → 0.0
Time: 2.8s
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 r431171 = 2.0;
        double r431172 = x;
        double r431173 = r431172 * r431172;
        double r431174 = y;
        double r431175 = r431172 * r431174;
        double r431176 = r431173 + r431175;
        double r431177 = r431171 * r431176;
        return r431177;
}

double f(double x, double y) {
        double r431178 = x;
        double r431179 = y;
        double r431180 = r431178 + r431179;
        double r431181 = 2.0;
        double r431182 = r431181 * r431178;
        double r431183 = r431180 * r431182;
        return r431183;
}

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 2019195 
(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))))