Average Error: 0.0 → 0.0
Time: 8.4s
Precision: 64
\[2 \cdot \left(x \cdot x + x \cdot y\right)\]
\[x \cdot \left(x \cdot 2\right) + y \cdot \left(x \cdot 2\right)\]
2 \cdot \left(x \cdot x + x \cdot y\right)
x \cdot \left(x \cdot 2\right) + y \cdot \left(x \cdot 2\right)
double f(double x, double y) {
        double r25119640 = 2.0;
        double r25119641 = x;
        double r25119642 = r25119641 * r25119641;
        double r25119643 = y;
        double r25119644 = r25119641 * r25119643;
        double r25119645 = r25119642 + r25119644;
        double r25119646 = r25119640 * r25119645;
        return r25119646;
}

double f(double x, double y) {
        double r25119647 = x;
        double r25119648 = 2.0;
        double r25119649 = r25119647 * r25119648;
        double r25119650 = r25119647 * r25119649;
        double r25119651 = y;
        double r25119652 = r25119651 * r25119649;
        double r25119653 = r25119650 + r25119652;
        return r25119653;
}

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

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

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

Reproduce

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