Average Error: 0.0 → 0.0
Time: 3.2s
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 r730028 = x;
        double r730029 = r730028 * r730028;
        double r730030 = 2.0;
        double r730031 = r730028 * r730030;
        double r730032 = y;
        double r730033 = r730031 * r730032;
        double r730034 = r730029 + r730033;
        double r730035 = r730032 * r730032;
        double r730036 = r730034 + r730035;
        return r730036;
}

double f(double x, double y) {
        double r730037 = x;
        double r730038 = r730037 * r730037;
        double r730039 = 2.0;
        double r730040 = r730037 * r730039;
        double r730041 = y;
        double r730042 = r730040 * r730041;
        double r730043 = r730038 + r730042;
        double r730044 = r730041 * r730041;
        double r730045 = r730043 + r730044;
        return r730045;
}

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