Average Error: 0.0 → 0.0
Time: 8.3s
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 r29039015 = x;
        double r29039016 = r29039015 * r29039015;
        double r29039017 = 2.0;
        double r29039018 = r29039015 * r29039017;
        double r29039019 = y;
        double r29039020 = r29039018 * r29039019;
        double r29039021 = r29039016 + r29039020;
        double r29039022 = r29039019 * r29039019;
        double r29039023 = r29039021 + r29039022;
        return r29039023;
}

double f(double x, double y) {
        double r29039024 = y;
        double r29039025 = r29039024 * r29039024;
        double r29039026 = x;
        double r29039027 = 2.0;
        double r29039028 = r29039027 * r29039024;
        double r29039029 = r29039026 + r29039028;
        double r29039030 = r29039026 * r29039029;
        double r29039031 = r29039025 + r29039030;
        return r29039031;
}

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