Average Error: 0.0 → 0.0
Time: 4.6s
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 r33229928 = x;
        double r33229929 = r33229928 * r33229928;
        double r33229930 = 2.0;
        double r33229931 = r33229928 * r33229930;
        double r33229932 = y;
        double r33229933 = r33229931 * r33229932;
        double r33229934 = r33229929 + r33229933;
        double r33229935 = r33229932 * r33229932;
        double r33229936 = r33229934 + r33229935;
        return r33229936;
}

double f(double x, double y) {
        double r33229937 = y;
        double r33229938 = r33229937 * r33229937;
        double r33229939 = x;
        double r33229940 = 2.0;
        double r33229941 = r33229940 * r33229937;
        double r33229942 = r33229939 + r33229941;
        double r33229943 = r33229939 * r33229942;
        double r33229944 = r33229938 + r33229943;
        return r33229944;
}

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 2019171 
(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)))