Average Error: 0.0 → 0.0
Time: 9.5s
Precision: 64
\[\left(x + y\right) \cdot \left(x + y\right)\]
\[\left(x \cdot x + 2 \cdot \left(x \cdot y\right)\right) + y \cdot y\]
\left(x + y\right) \cdot \left(x + y\right)
\left(x \cdot x + 2 \cdot \left(x \cdot y\right)\right) + y \cdot y
double f(double x, double y) {
        double r115977219 = x;
        double r115977220 = y;
        double r115977221 = r115977219 + r115977220;
        double r115977222 = r115977221 * r115977221;
        return r115977222;
}

double f(double x, double y) {
        double r115977223 = x;
        double r115977224 = r115977223 * r115977223;
        double r115977225 = 2.0;
        double r115977226 = y;
        double r115977227 = r115977223 * r115977226;
        double r115977228 = r115977225 * r115977227;
        double r115977229 = r115977224 + r115977228;
        double r115977230 = r115977226 * r115977226;
        double r115977231 = r115977229 + r115977230;
        return r115977231;
}

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

    \[\leadsto \color{blue}{\left(x + y\right) \cdot x + \left(x + y\right) \cdot y}\]
  4. Taylor expanded around 0 0.0

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

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

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

Reproduce

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