Average Error: 0.0 → 0.0
Time: 3.2s
Precision: 64
\[\left(x \cdot 2 + x \cdot x\right) + y \cdot y\]
\[\left(y \cdot y + 2 \cdot x\right) + x \cdot x\]
\left(x \cdot 2 + x \cdot x\right) + y \cdot y
\left(y \cdot y + 2 \cdot x\right) + x \cdot x
double f(double x, double y) {
        double r496022 = x;
        double r496023 = 2.0;
        double r496024 = r496022 * r496023;
        double r496025 = r496022 * r496022;
        double r496026 = r496024 + r496025;
        double r496027 = y;
        double r496028 = r496027 * r496027;
        double r496029 = r496026 + r496028;
        return r496029;
}

double f(double x, double y) {
        double r496030 = y;
        double r496031 = r496030 * r496030;
        double r496032 = 2.0;
        double r496033 = x;
        double r496034 = r496032 * r496033;
        double r496035 = r496031 + r496034;
        double r496036 = r496033 * r496033;
        double r496037 = r496035 + r496036;
        return r496037;
}

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. Using strategy rm
  4. Applied distribute-lft-in0.0

    \[\leadsto y \cdot y + \color{blue}{\left(x \cdot 2 + x \cdot x\right)}\]
  5. Applied associate-+r+0.0

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

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

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

Reproduce

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

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

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