Average Error: 0.0 → 0.0
Time: 10.4s
Precision: 64
\[\left(x \cdot 2 + x \cdot x\right) + y \cdot y\]
\[y \cdot y + \left(2 + x\right) \cdot x\]
\left(x \cdot 2 + x \cdot x\right) + y \cdot y
y \cdot y + \left(2 + x\right) \cdot x
double f(double x, double y) {
        double r322275 = x;
        double r322276 = 2.0;
        double r322277 = r322275 * r322276;
        double r322278 = r322275 * r322275;
        double r322279 = r322277 + r322278;
        double r322280 = y;
        double r322281 = r322280 * r322280;
        double r322282 = r322279 + r322281;
        return r322282;
}

double f(double x, double y) {
        double r322283 = y;
        double r322284 = r322283 * r322283;
        double r322285 = 2.0;
        double r322286 = x;
        double r322287 = r322285 + r322286;
        double r322288 = r322287 * r322286;
        double r322289 = r322284 + r322288;
        return r322289;
}

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

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

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

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