Average Error: 0.0 → 0.0
Time: 8.7s
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 r29885768 = 2.0;
        double r29885769 = x;
        double r29885770 = r29885769 * r29885769;
        double r29885771 = y;
        double r29885772 = r29885769 * r29885771;
        double r29885773 = r29885770 + r29885772;
        double r29885774 = r29885768 * r29885773;
        return r29885774;
}

double f(double x, double y) {
        double r29885775 = x;
        double r29885776 = y;
        double r29885777 = r29885775 + r29885776;
        double r29885778 = 2.0;
        double r29885779 = r29885778 * r29885775;
        double r29885780 = r29885777 * r29885779;
        return r29885780;
}

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