Average Error: 0.0 → 0.0
Time: 3.4s
Precision: 64
\[\left(x + y\right) \cdot \left(x + y\right)\]
\[x \cdot \left(y + x\right) + \left(y + x\right) \cdot y\]
\left(x + y\right) \cdot \left(x + y\right)
x \cdot \left(y + x\right) + \left(y + x\right) \cdot y
double f(double x, double y) {
        double r10851108 = x;
        double r10851109 = y;
        double r10851110 = r10851108 + r10851109;
        double r10851111 = r10851110 * r10851110;
        return r10851111;
}

double f(double x, double y) {
        double r10851112 = x;
        double r10851113 = y;
        double r10851114 = r10851113 + r10851112;
        double r10851115 = r10851112 * r10851114;
        double r10851116 = r10851114 * r10851113;
        double r10851117 = r10851115 + r10851116;
        return r10851117;
}

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. Final simplification0.0

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

Reproduce

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

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

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