Average Error: 0.0 → 0.0
Time: 11.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 r27573669 = 2.0;
        double r27573670 = x;
        double r27573671 = r27573670 * r27573670;
        double r27573672 = y;
        double r27573673 = r27573670 * r27573672;
        double r27573674 = r27573671 + r27573673;
        double r27573675 = r27573669 * r27573674;
        return r27573675;
}

double f(double x, double y) {
        double r27573676 = x;
        double r27573677 = y;
        double r27573678 = r27573676 + r27573677;
        double r27573679 = 2.0;
        double r27573680 = r27573679 * r27573676;
        double r27573681 = r27573678 * r27573680;
        return r27573681;
}

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