Average Error: 0.0 → 0.0
Time: 4.3s
Precision: 64
\[\left(x + y\right) \cdot \left(x + y\right)\]
\[\left(x + y\right) \cdot \left(x + y\right)\]
\left(x + y\right) \cdot \left(x + y\right)
\left(x + y\right) \cdot \left(x + y\right)
double f(double x, double y) {
        double r538550 = x;
        double r538551 = y;
        double r538552 = r538550 + r538551;
        double r538553 = r538552 * r538552;
        return r538553;
}

double f(double x, double y) {
        double r538554 = x;
        double r538555 = y;
        double r538556 = r538554 + r538555;
        double r538557 = r538556 * r538556;
        return r538557;
}

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 + 2 \cdot \left(y \cdot x\right)\right)\]

Derivation

  1. Initial program 0.0

    \[\left(x + y\right) \cdot \left(x + y\right)\]
  2. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019196 +o rules:numerics
(FPCore (x y)
  :name "Examples.Basics.BasicTests:f3 from sbv-4.4"

  :herbie-target
  (+ (* x x) (+ (* y y) (* 2.0 (* y x))))

  (* (+ x y) (+ x y)))