Average Error: 0.0 → 0.0
Time: 12.2s
Precision: 64
\[\left(x + y\right) \cdot \left(x + y\right)\]
\[\left(x \cdot y + x \cdot y\right) + \left(x \cdot x + y \cdot y\right)\]
\left(x + y\right) \cdot \left(x + y\right)
\left(x \cdot y + x \cdot y\right) + \left(x \cdot x + y \cdot y\right)
double f(double x, double y) {
        double r34435474 = x;
        double r34435475 = y;
        double r34435476 = r34435474 + r34435475;
        double r34435477 = r34435476 * r34435476;
        return r34435477;
}

double f(double x, double y) {
        double r34435478 = x;
        double r34435479 = y;
        double r34435480 = r34435478 * r34435479;
        double r34435481 = r34435480 + r34435480;
        double r34435482 = r34435478 * r34435478;
        double r34435483 = r34435479 * r34435479;
        double r34435484 = r34435482 + r34435483;
        double r34435485 = r34435481 + r34435484;
        return r34435485;
}

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

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

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

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

Reproduce

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