Average Error: 0.0 → 0.0
Time: 11.3s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[\left(x \cdot x + x \cdot \left(2 \cdot y\right)\right) + y \cdot y\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
\left(x \cdot x + x \cdot \left(2 \cdot y\right)\right) + y \cdot y
double f(double x, double y) {
        double r18849540 = x;
        double r18849541 = r18849540 * r18849540;
        double r18849542 = 2.0;
        double r18849543 = r18849540 * r18849542;
        double r18849544 = y;
        double r18849545 = r18849543 * r18849544;
        double r18849546 = r18849541 + r18849545;
        double r18849547 = r18849544 * r18849544;
        double r18849548 = r18849546 + r18849547;
        return r18849548;
}

double f(double x, double y) {
        double r18849549 = x;
        double r18849550 = r18849549 * r18849549;
        double r18849551 = 2.0;
        double r18849552 = y;
        double r18849553 = r18849551 * r18849552;
        double r18849554 = r18849549 * r18849553;
        double r18849555 = r18849550 + r18849554;
        double r18849556 = r18849552 * r18849552;
        double r18849557 = r18849555 + r18849556;
        return r18849557;
}

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
\[x \cdot x + \left(y \cdot y + \left(x \cdot y\right) \cdot 2\right)\]

Derivation

  1. Initial program 0.0

    \[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
  2. Simplified0.0

    \[\leadsto \color{blue}{y \cdot y + x \cdot \left(x + y \cdot 2\right)}\]
  3. Using strategy rm
  4. Applied distribute-rgt-in0.0

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

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

Reproduce

herbie shell --seed 2019179 
(FPCore (x y)
  :name "Examples.Basics.ProofTests:f4 from sbv-4.4"

  :herbie-target
  (+ (* x x) (+ (* y y) (* (* x y) 2.0)))

  (+ (+ (* x x) (* (* x 2.0) y)) (* y y)))