Average Error: 0.0 → 0.0
Time: 24.7s
Precision: 64
\[\left(x + y\right) \cdot \left(x + y\right)\]
\[\left(y \cdot x + y \cdot x\right) + \left(x \cdot x + y \cdot y\right)\]
\left(x + y\right) \cdot \left(x + y\right)
\left(y \cdot x + y \cdot x\right) + \left(x \cdot x + y \cdot y\right)
double f(double x, double y) {
        double r28403144 = x;
        double r28403145 = y;
        double r28403146 = r28403144 + r28403145;
        double r28403147 = r28403146 * r28403146;
        return r28403147;
}

double f(double x, double y) {
        double r28403148 = y;
        double r28403149 = x;
        double r28403150 = r28403148 * r28403149;
        double r28403151 = r28403150 + r28403150;
        double r28403152 = r28403149 * r28403149;
        double r28403153 = r28403148 * r28403148;
        double r28403154 = r28403152 + r28403153;
        double r28403155 = r28403151 + r28403154;
        return r28403155;
}

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}{{x}^{2} + \left({y}^{2} + 2 \cdot \left(x \cdot y\right)\right)}\]
  3. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019200 
(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)))