Average Error: 0.0 → 0.0
Time: 7.6s
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 r24460709 = 2.0;
        double r24460710 = x;
        double r24460711 = r24460710 * r24460710;
        double r24460712 = y;
        double r24460713 = r24460710 * r24460712;
        double r24460714 = r24460711 + r24460713;
        double r24460715 = r24460709 * r24460714;
        return r24460715;
}

double f(double x, double y) {
        double r24460716 = x;
        double r24460717 = y;
        double r24460718 = r24460716 + r24460717;
        double r24460719 = 2.0;
        double r24460720 = r24460719 * r24460716;
        double r24460721 = r24460718 * r24460720;
        return r24460721;
}

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