Average Error: 0.0 → 0.0
Time: 3.8s
Precision: 64
\[2.0 \cdot \left(x \cdot x + x \cdot y\right)\]
\[\left(2.0 \cdot x\right) \cdot \left(y + x\right)\]
2.0 \cdot \left(x \cdot x + x \cdot y\right)
\left(2.0 \cdot x\right) \cdot \left(y + x\right)
double f(double x, double y) {
        double r9075115 = 2.0;
        double r9075116 = x;
        double r9075117 = r9075116 * r9075116;
        double r9075118 = y;
        double r9075119 = r9075116 * r9075118;
        double r9075120 = r9075117 + r9075119;
        double r9075121 = r9075115 * r9075120;
        return r9075121;
}

double f(double x, double y) {
        double r9075122 = 2.0;
        double r9075123 = x;
        double r9075124 = r9075122 * r9075123;
        double r9075125 = y;
        double r9075126 = r9075125 + r9075123;
        double r9075127 = r9075124 * r9075126;
        return r9075127;
}

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(x + y\right) \cdot \left(2.0 \cdot x\right)}\]
  3. Final simplification0.0

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

Reproduce

herbie shell --seed 2019156 +o rules:numerics
(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))))