Average Error: 5.1 → 0.1
Time: 17.3s
Precision: 64
\[x \cdot \left(1 + y \cdot y\right)\]
\[y \cdot \left(y \cdot x\right) + x \cdot 1\]
x \cdot \left(1 + y \cdot y\right)
y \cdot \left(y \cdot x\right) + x \cdot 1
double f(double x, double y) {
        double r24793121 = x;
        double r24793122 = 1.0;
        double r24793123 = y;
        double r24793124 = r24793123 * r24793123;
        double r24793125 = r24793122 + r24793124;
        double r24793126 = r24793121 * r24793125;
        return r24793126;
}

double f(double x, double y) {
        double r24793127 = y;
        double r24793128 = x;
        double r24793129 = r24793127 * r24793128;
        double r24793130 = r24793127 * r24793129;
        double r24793131 = 1.0;
        double r24793132 = r24793128 * r24793131;
        double r24793133 = r24793130 + r24793132;
        return r24793133;
}

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.1
Target0.1
Herbie0.1
\[x + \left(x \cdot y\right) \cdot y\]

Derivation

  1. Initial program 5.1

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

    \[\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 simplification0.1

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

Reproduce

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

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

  (* x (+ 1.0 (* y y))))