Average Error: 0.0 → 0.0
Time: 14.4s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[x \cdot x + y \cdot \left(x \cdot 2 + y\right)\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
x \cdot x + y \cdot \left(x \cdot 2 + y\right)
double f(double x, double y) {
        double r1171140 = x;
        double r1171141 = r1171140 * r1171140;
        double r1171142 = 2.0;
        double r1171143 = r1171140 * r1171142;
        double r1171144 = y;
        double r1171145 = r1171143 * r1171144;
        double r1171146 = r1171141 + r1171145;
        double r1171147 = r1171144 * r1171144;
        double r1171148 = r1171146 + r1171147;
        return r1171148;
}

double f(double x, double y) {
        double r1171149 = x;
        double r1171150 = r1171149 * r1171149;
        double r1171151 = y;
        double r1171152 = 2.0;
        double r1171153 = r1171149 * r1171152;
        double r1171154 = r1171153 + r1171151;
        double r1171155 = r1171151 * r1171154;
        double r1171156 = r1171150 + r1171155;
        return r1171156;
}

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. Using strategy rm
  3. Applied associate-+l+0.0

    \[\leadsto \color{blue}{x \cdot x + \left(\left(x \cdot 2\right) \cdot y + y \cdot y\right)}\]
  4. Simplified0.0

    \[\leadsto x \cdot x + \color{blue}{y \cdot \left(x \cdot 2 + y\right)}\]
  5. Final simplification0.0

    \[\leadsto x \cdot x + y \cdot \left(x \cdot 2 + y\right)\]

Reproduce

herbie shell --seed 2019303 
(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)))