Average Error: 0.0 → 0.0
Time: 7.3s
Precision: 64
\[2.0 \cdot \left(x \cdot x + x \cdot y\right)\]
\[\left(x + y\right) \cdot \left(2.0 \cdot x\right)\]
2.0 \cdot \left(x \cdot x + x \cdot y\right)
\left(x + y\right) \cdot \left(2.0 \cdot x\right)
double f(double x, double y) {
        double r26809692 = 2.0;
        double r26809693 = x;
        double r26809694 = r26809693 * r26809693;
        double r26809695 = y;
        double r26809696 = r26809693 * r26809695;
        double r26809697 = r26809694 + r26809696;
        double r26809698 = r26809692 * r26809697;
        return r26809698;
}

double f(double x, double y) {
        double r26809699 = x;
        double r26809700 = y;
        double r26809701 = r26809699 + r26809700;
        double r26809702 = 2.0;
        double r26809703 = r26809702 * r26809699;
        double r26809704 = r26809701 * r26809703;
        return r26809704;
}

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

Derivation

  1. Initial program 0.0

    \[2.0 \cdot \left(x \cdot x + x \cdot y\right)\]
  2. Simplified0.0

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

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

Reproduce

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