Average Error: 0.0 → 0.0
Time: 6.8s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[y \cdot y + x \cdot \left(x + 2 \cdot y\right)\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
y \cdot y + x \cdot \left(x + 2 \cdot y\right)
double f(double x, double y) {
        double r31847675 = x;
        double r31847676 = r31847675 * r31847675;
        double r31847677 = 2.0;
        double r31847678 = r31847675 * r31847677;
        double r31847679 = y;
        double r31847680 = r31847678 * r31847679;
        double r31847681 = r31847676 + r31847680;
        double r31847682 = r31847679 * r31847679;
        double r31847683 = r31847681 + r31847682;
        return r31847683;
}

double f(double x, double y) {
        double r31847684 = y;
        double r31847685 = r31847684 * r31847684;
        double r31847686 = x;
        double r31847687 = 2.0;
        double r31847688 = r31847687 * r31847684;
        double r31847689 = r31847686 + r31847688;
        double r31847690 = r31847686 * r31847689;
        double r31847691 = r31847685 + r31847690;
        return r31847691;
}

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

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

Reproduce

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