Average Error: 0.0 → 0.0
Time: 5.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 r310840 = x;
        double r310841 = r310840 * r310840;
        double r310842 = 2.0;
        double r310843 = r310840 * r310842;
        double r310844 = y;
        double r310845 = r310843 * r310844;
        double r310846 = r310841 + r310845;
        double r310847 = r310844 * r310844;
        double r310848 = r310846 + r310847;
        return r310848;
}

double f(double x, double y) {
        double r310849 = y;
        double r310850 = r310849 * r310849;
        double r310851 = x;
        double r310852 = 2.0;
        double r310853 = r310852 * r310849;
        double r310854 = r310851 + r310853;
        double r310855 = r310851 * r310854;
        double r310856 = r310850 + r310855;
        return r310856;
}

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