Average Error: 0.0 → 0.0
Time: 4.8s
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 r506067 = x;
        double r506068 = r506067 * r506067;
        double r506069 = 2.0;
        double r506070 = r506067 * r506069;
        double r506071 = y;
        double r506072 = r506070 * r506071;
        double r506073 = r506068 + r506072;
        double r506074 = r506071 * r506071;
        double r506075 = r506073 + r506074;
        return r506075;
}

double f(double x, double y) {
        double r506076 = x;
        double r506077 = r506076 * r506076;
        double r506078 = 2.0;
        double r506079 = r506076 * r506078;
        double r506080 = y;
        double r506081 = r506079 * r506080;
        double r506082 = r506077 + r506081;
        double r506083 = r506080 * r506080;
        double r506084 = r506082 + r506083;
        return r506084;
}

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 2019209 +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)))