Average Error: 0.0 → 0.0
Time: 3.7s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[y \cdot \left(y + 2 \cdot x\right) + x \cdot x\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
y \cdot \left(y + 2 \cdot x\right) + x \cdot x
double f(double x, double y) {
        double r764148 = x;
        double r764149 = r764148 * r764148;
        double r764150 = 2.0;
        double r764151 = r764148 * r764150;
        double r764152 = y;
        double r764153 = r764151 * r764152;
        double r764154 = r764149 + r764153;
        double r764155 = r764152 * r764152;
        double r764156 = r764154 + r764155;
        return r764156;
}

double f(double x, double y) {
        double r764157 = y;
        double r764158 = 2.0;
        double r764159 = x;
        double r764160 = r764158 * r764159;
        double r764161 = r764157 + r764160;
        double r764162 = r764157 * r764161;
        double r764163 = r764159 * r764159;
        double r764164 = r764162 + r764163;
        return r764164;
}

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 + \left(x \cdot y\right) \cdot 2\right)\]

Derivation

  1. Initial program 0.0

    \[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
  2. Simplified0.0

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

    \[\leadsto y \cdot y + \color{blue}{\left(x \cdot \left(2 \cdot y\right) + x \cdot x\right)}\]
  5. Applied associate-+r+0.0

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

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

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

Reproduce

herbie shell --seed 2020046 
(FPCore (x y)
  :name "Examples.Basics.ProofTests:f4 from sbv-4.4"
  :precision binary64

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

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