Average Error: 0.0 → 0.0
Time: 8.8s
Precision: 64
\[\left(x + y\right) \cdot \left(x + y\right)\]
\[y \cdot y + \left(2 \cdot \left(x \cdot y\right) + x \cdot x\right)\]
\left(x + y\right) \cdot \left(x + y\right)
y \cdot y + \left(2 \cdot \left(x \cdot y\right) + x \cdot x\right)
double f(double x, double y) {
        double r46562002 = x;
        double r46562003 = y;
        double r46562004 = r46562002 + r46562003;
        double r46562005 = r46562004 * r46562004;
        return r46562005;
}

double f(double x, double y) {
        double r46562006 = y;
        double r46562007 = r46562006 * r46562006;
        double r46562008 = 2.0;
        double r46562009 = x;
        double r46562010 = r46562009 * r46562006;
        double r46562011 = r46562008 * r46562010;
        double r46562012 = r46562009 * r46562009;
        double r46562013 = r46562011 + r46562012;
        double r46562014 = r46562007 + r46562013;
        return r46562014;
}

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. Taylor expanded around 0 0.0

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

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

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

Reproduce

herbie shell --seed 2019174 
(FPCore (x y)
  :name "Examples.Basics.BasicTests:f3 from sbv-4.4"

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

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