Average Error: 0.0 → 0.0
Time: 8.8s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[\left(x \cdot x + x \cdot \left(2 \cdot y\right)\right) + y \cdot y\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
\left(x \cdot x + x \cdot \left(2 \cdot y\right)\right) + y \cdot y
double f(double x, double y) {
        double r420296 = x;
        double r420297 = r420296 * r420296;
        double r420298 = 2.0;
        double r420299 = r420296 * r420298;
        double r420300 = y;
        double r420301 = r420299 * r420300;
        double r420302 = r420297 + r420301;
        double r420303 = r420300 * r420300;
        double r420304 = r420302 + r420303;
        return r420304;
}

double f(double x, double y) {
        double r420305 = x;
        double r420306 = r420305 * r420305;
        double r420307 = 2.0;
        double r420308 = y;
        double r420309 = r420307 * r420308;
        double r420310 = r420305 * r420309;
        double r420311 = r420306 + r420310;
        double r420312 = r420308 * r420308;
        double r420313 = r420311 + r420312;
        return r420313;
}

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. Using strategy rm
  4. Applied distribute-lft-in0.0

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

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

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

Reproduce

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