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 r3059 = x;
        double r3060 = r3059 * r3059;
        double r3061 = 2.0;
        double r3062 = r3059 * r3061;
        double r3063 = y;
        double r3064 = r3062 * r3063;
        double r3065 = r3060 + r3064;
        double r3066 = r3063 * r3063;
        double r3067 = r3065 + r3066;
        return r3067;
}

double f(double x, double y) {
        double r3068 = x;
        double r3069 = r3068 * r3068;
        double r3070 = 2.0;
        double r3071 = r3068 * r3070;
        double r3072 = y;
        double r3073 = r3071 * r3072;
        double r3074 = r3069 + r3073;
        double r3075 = r3072 * r3072;
        double r3076 = r3074 + r3075;
        return r3076;
}

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