Average Error: 0.0 → 0.0
Time: 11.1s
Precision: 64
\[2.0 \cdot \left(x \cdot x + x \cdot y\right)\]
\[x \cdot \left(x \cdot 2.0\right) + y \cdot \left(x \cdot 2.0\right)\]
2.0 \cdot \left(x \cdot x + x \cdot y\right)
x \cdot \left(x \cdot 2.0\right) + y \cdot \left(x \cdot 2.0\right)
double f(double x, double y) {
        double r38297490 = 2.0;
        double r38297491 = x;
        double r38297492 = r38297491 * r38297491;
        double r38297493 = y;
        double r38297494 = r38297491 * r38297493;
        double r38297495 = r38297492 + r38297494;
        double r38297496 = r38297490 * r38297495;
        return r38297496;
}

double f(double x, double y) {
        double r38297497 = x;
        double r38297498 = 2.0;
        double r38297499 = r38297497 * r38297498;
        double r38297500 = r38297497 * r38297499;
        double r38297501 = y;
        double r38297502 = r38297501 * r38297499;
        double r38297503 = r38297500 + r38297502;
        return r38297503;
}

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. Using strategy rm
  4. Applied distribute-rgt-in0.0

    \[\leadsto \color{blue}{x \cdot \left(2.0 \cdot x\right) + y \cdot \left(2.0 \cdot x\right)}\]
  5. Final simplification0.0

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

Reproduce

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