Average Error: 0.0 → 0.0
Time: 2.4s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
double f(double x, double y) {
        double r580541 = x;
        double r580542 = r580541 * r580541;
        double r580543 = 2.0;
        double r580544 = r580541 * r580543;
        double r580545 = y;
        double r580546 = r580544 * r580545;
        double r580547 = r580542 + r580546;
        double r580548 = r580545 * r580545;
        double r580549 = r580547 + r580548;
        return r580549;
}

double f(double x, double y) {
        double r580550 = x;
        double r580551 = r580550 * r580550;
        double r580552 = 2.0;
        double r580553 = r580550 * r580552;
        double r580554 = y;
        double r580555 = r580553 * r580554;
        double r580556 = r580551 + r580555;
        double r580557 = r580554 * r580554;
        double r580558 = r580556 + r580557;
        return r580558;
}

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. Final simplification0.0

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

Reproduce

herbie shell --seed 2020021 +o rules:numerics
(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)))