Average Error: 0.0 → 0.0
Time: 5.3s
Precision: 64
\[2 \cdot \left(x \cdot x + x \cdot y\right)\]
\[\left(x \cdot x + y \cdot x\right) \cdot 2\]
2 \cdot \left(x \cdot x + x \cdot y\right)
\left(x \cdot x + y \cdot x\right) \cdot 2
double f(double x, double y) {
        double r409108 = 2.0;
        double r409109 = x;
        double r409110 = r409109 * r409109;
        double r409111 = y;
        double r409112 = r409109 * r409111;
        double r409113 = r409110 + r409112;
        double r409114 = r409108 * r409113;
        return r409114;
}

double f(double x, double y) {
        double r409115 = x;
        double r409116 = r409115 * r409115;
        double r409117 = y;
        double r409118 = r409117 * r409115;
        double r409119 = r409116 + r409118;
        double r409120 = 2.0;
        double r409121 = r409119 * r409120;
        return r409121;
}

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. Final simplification0.0

    \[\leadsto \left(x \cdot x + y \cdot x\right) \cdot 2\]

Reproduce

herbie shell --seed 2019194 
(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))))