Average Error: 0.0 → 0.0
Time: 8.1s
Precision: 64
\[\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y\]
\[y \cdot y + x \cdot \left(x + 2 \cdot y\right)\]
\left(x \cdot x + \left(x \cdot 2\right) \cdot y\right) + y \cdot y
y \cdot y + x \cdot \left(x + 2 \cdot y\right)
double f(double x, double y) {
        double r24850142 = x;
        double r24850143 = r24850142 * r24850142;
        double r24850144 = 2.0;
        double r24850145 = r24850142 * r24850144;
        double r24850146 = y;
        double r24850147 = r24850145 * r24850146;
        double r24850148 = r24850143 + r24850147;
        double r24850149 = r24850146 * r24850146;
        double r24850150 = r24850148 + r24850149;
        return r24850150;
}

double f(double x, double y) {
        double r24850151 = y;
        double r24850152 = r24850151 * r24850151;
        double r24850153 = x;
        double r24850154 = 2.0;
        double r24850155 = r24850154 * r24850151;
        double r24850156 = r24850153 + r24850155;
        double r24850157 = r24850153 * r24850156;
        double r24850158 = r24850152 + r24850157;
        return r24850158;
}

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(x + y \cdot 2\right)}\]
  3. Final simplification0.0

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

Reproduce

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

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

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