Average Error: 0.0 → 0.0
Time: 2.1s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[x \cdot \left(2 \cdot y + x\right) + y \cdot y\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
x \cdot \left(2 \cdot y + x\right) + y \cdot y
double f(double x, double y) {
        double r606354 = x;
        double r606355 = r606354 * r606354;
        double r606356 = 2.0;
        double r606357 = r606354 * r606356;
        double r606358 = y;
        double r606359 = r606357 * r606358;
        double r606360 = r606355 + r606359;
        double r606361 = r606358 * r606358;
        double r606362 = r606360 + r606361;
        return r606362;
}

double f(double x, double y) {
        double r606363 = x;
        double r606364 = 2.0;
        double r606365 = y;
        double r606366 = r606364 * r606365;
        double r606367 = r606366 + r606363;
        double r606368 = r606363 * r606367;
        double r606369 = r606365 * r606365;
        double r606370 = r606368 + r606369;
        return r606370;
}

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. Taylor expanded around 0 0.0

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

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

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

Reproduce

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