Average Error: 0.0 → 0.0
Time: 2.0s
Precision: 64
\[\left(x + y\right) \cdot \left(x + y\right)\]
\[\left({x}^{2} + x \cdot y\right) + \left(x \cdot y + {y}^{2}\right)\]
\left(x + y\right) \cdot \left(x + y\right)
\left({x}^{2} + x \cdot y\right) + \left(x \cdot y + {y}^{2}\right)
double f(double x, double y) {
        double r624137 = x;
        double r624138 = y;
        double r624139 = r624137 + r624138;
        double r624140 = r624139 * r624139;
        return r624140;
}

double f(double x, double y) {
        double r624141 = x;
        double r624142 = 2.0;
        double r624143 = pow(r624141, r624142);
        double r624144 = y;
        double r624145 = r624141 * r624144;
        double r624146 = r624143 + r624145;
        double r624147 = pow(r624144, r624142);
        double r624148 = r624145 + r624147;
        double r624149 = r624146 + r624148;
        return r624149;
}

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. Simplified0.0

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

    \[\leadsto x \cdot \left(x + y\right) + \color{blue}{y \cdot \left(x + y\right)}\]
  6. Using strategy rm
  7. Applied distribute-lft-in0.0

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

    \[\leadsto \left(\color{blue}{{x}^{2}} + x \cdot y\right) + y \cdot \left(x + y\right)\]
  9. Using strategy rm
  10. Applied distribute-lft-in0.0

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

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

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

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

Reproduce

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

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

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