Average Error: 0.0 → 0.0
Time: 9.1s
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 r29554823 = x;
        double r29554824 = y;
        double r29554825 = r29554823 + r29554824;
        double r29554826 = r29554825 * r29554825;
        return r29554826;
}

double f(double x, double y) {
        double r29554827 = x;
        double r29554828 = y;
        double r29554829 = r29554828 + r29554827;
        double r29554830 = r29554827 * r29554829;
        double r29554831 = r29554829 * r29554828;
        double r29554832 = r29554830 + r29554831;
        return r29554832;
}

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 2019168 
(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)))