Average Error: 0.0 → 0.0
Time: 4.1s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[x \cdot x + y \cdot \left(x \cdot 2 + y\right)\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
x \cdot x + y \cdot \left(x \cdot 2 + y\right)
double f(double x, double y) {
        double r770383 = x;
        double r770384 = r770383 * r770383;
        double r770385 = 2.0;
        double r770386 = r770383 * r770385;
        double r770387 = y;
        double r770388 = r770386 * r770387;
        double r770389 = r770384 + r770388;
        double r770390 = r770387 * r770387;
        double r770391 = r770389 + r770390;
        return r770391;
}

double f(double x, double y) {
        double r770392 = x;
        double r770393 = r770392 * r770392;
        double r770394 = y;
        double r770395 = 2.0;
        double r770396 = r770392 * r770395;
        double r770397 = r770396 + r770394;
        double r770398 = r770394 * r770397;
        double r770399 = r770393 + r770398;
        return r770399;
}

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. Using strategy rm
  3. Applied associate-+l+0.0

    \[\leadsto \color{blue}{x \cdot x + \left(\left(x \cdot 2\right) \cdot y + y \cdot y\right)}\]
  4. Simplified0.0

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

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

Reproduce

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

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

  (+ (+ (* x x) (* (* x 2) y)) (* y y)))