Average Error: 0.0 → 0.0
Time: 5.3s
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 r19595578 = 2.0;
        double r19595579 = x;
        double r19595580 = r19595579 * r19595579;
        double r19595581 = y;
        double r19595582 = r19595579 * r19595581;
        double r19595583 = r19595580 + r19595582;
        double r19595584 = r19595578 * r19595583;
        return r19595584;
}

double f(double x, double y) {
        double r19595585 = x;
        double r19595586 = y;
        double r19595587 = r19595585 + r19595586;
        double r19595588 = 2.0;
        double r19595589 = r19595588 * r19595585;
        double r19595590 = r19595587 * r19595589;
        return r19595590;
}

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