Average Error: 0.0 → 0.0
Time: 11.2s
Precision: 64
\[\left(x \cdot 2 + x \cdot x\right) + y \cdot y\]
\[y \cdot y + x \cdot \left(2 + x\right)\]
\left(x \cdot 2 + x \cdot x\right) + y \cdot y
y \cdot y + x \cdot \left(2 + x\right)
double f(double x, double y) {
        double r306131 = x;
        double r306132 = 2.0;
        double r306133 = r306131 * r306132;
        double r306134 = r306131 * r306131;
        double r306135 = r306133 + r306134;
        double r306136 = y;
        double r306137 = r306136 * r306136;
        double r306138 = r306135 + r306137;
        return r306138;
}

double f(double x, double y) {
        double r306139 = y;
        double r306140 = r306139 * r306139;
        double r306141 = x;
        double r306142 = 2.0;
        double r306143 = r306142 + r306141;
        double r306144 = r306141 * r306143;
        double r306145 = r306140 + r306144;
        return r306145;
}

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. Using strategy rm
  3. Applied associate-+l+0.0

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

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

Reproduce

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