Average Error: 0.0 → 0.0
Time: 9.1s
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 r23489688 = 2.0;
        double r23489689 = x;
        double r23489690 = r23489689 * r23489689;
        double r23489691 = y;
        double r23489692 = r23489689 * r23489691;
        double r23489693 = r23489690 + r23489692;
        double r23489694 = r23489688 * r23489693;
        return r23489694;
}

double f(double x, double y) {
        double r23489695 = x;
        double r23489696 = y;
        double r23489697 = r23489695 + r23489696;
        double r23489698 = 2.0;
        double r23489699 = r23489698 * r23489695;
        double r23489700 = r23489697 * r23489699;
        return r23489700;
}

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