Average Error: 0.0 → 0.0
Time: 4.8s
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 r10686661 = 2.0;
        double r10686662 = x;
        double r10686663 = r10686662 * r10686662;
        double r10686664 = y;
        double r10686665 = r10686662 * r10686664;
        double r10686666 = r10686663 + r10686665;
        double r10686667 = r10686661 * r10686666;
        return r10686667;
}

double f(double x, double y) {
        double r10686668 = x;
        double r10686669 = 2.0;
        double r10686670 = r10686668 * r10686669;
        double r10686671 = r10686668 * r10686670;
        double r10686672 = y;
        double r10686673 = r10686672 * r10686670;
        double r10686674 = r10686671 + r10686673;
        return r10686674;
}

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