Average Error: 5.7 → 5.7
Time: 4.2s
Precision: 64
\[x \cdot \left(1 + y \cdot y\right)\]
\[x \cdot \left(y \cdot y + 1\right)\]
x \cdot \left(1 + y \cdot y\right)
x \cdot \left(y \cdot y + 1\right)
double f(double x, double y) {
        double r323094 = x;
        double r323095 = 1.0;
        double r323096 = y;
        double r323097 = r323096 * r323096;
        double r323098 = r323095 + r323097;
        double r323099 = r323094 * r323098;
        return r323099;
}

double f(double x, double y) {
        double r323100 = x;
        double r323101 = y;
        double r323102 = r323101 * r323101;
        double r323103 = 1.0;
        double r323104 = r323102 + r323103;
        double r323105 = r323100 * r323104;
        return r323105;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original5.7
Target0.1
Herbie5.7
\[x + \left(x \cdot y\right) \cdot y\]

Derivation

  1. Initial program 5.7

    \[x \cdot \left(1 + y \cdot y\right)\]
  2. Using strategy rm
  3. Applied distribute-lft-in5.7

    \[\leadsto \color{blue}{x \cdot 1 + x \cdot \left(y \cdot y\right)}\]
  4. Using strategy rm
  5. Applied associate-*r*0.1

    \[\leadsto x \cdot 1 + \color{blue}{\left(x \cdot y\right) \cdot y}\]
  6. Final simplification5.7

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

Reproduce

herbie shell --seed 2019308 
(FPCore (x y)
  :name "Numeric.Integration.TanhSinh:everywhere from integration-0.2.1"
  :precision binary64

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

  (* x (+ 1 (* y y))))