Average Error: 0.0 → 0.0
Time: 10.7s
Precision: 64
\[\left(x \cdot 2 + x \cdot x\right) + y \cdot y\]
\[x \cdot \left(2 + x\right) + y \cdot y\]
\left(x \cdot 2 + x \cdot x\right) + y \cdot y
x \cdot \left(2 + x\right) + y \cdot y
double f(double x, double y) {
        double r26634330 = x;
        double r26634331 = 2.0;
        double r26634332 = r26634330 * r26634331;
        double r26634333 = r26634330 * r26634330;
        double r26634334 = r26634332 + r26634333;
        double r26634335 = y;
        double r26634336 = r26634335 * r26634335;
        double r26634337 = r26634334 + r26634336;
        return r26634337;
}

double f(double x, double y) {
        double r26634338 = x;
        double r26634339 = 2.0;
        double r26634340 = r26634339 + r26634338;
        double r26634341 = r26634338 * r26634340;
        double r26634342 = y;
        double r26634343 = r26634342 * r26634342;
        double r26634344 = r26634341 + r26634343;
        return r26634344;
}

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

Derivation

  1. Initial program 0.0

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

    \[\leadsto \color{blue}{y \cdot y + x \cdot \left(2 + x\right)}\]
  3. Taylor expanded around 0 0.0

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

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

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

Reproduce

herbie shell --seed 2019179 
(FPCore (x y)
  :name "Numeric.Log:$clog1p from log-domain-0.10.2.1, A"

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

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