Average Error: 5.4 → 5.4
Time: 7.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 r299668 = x;
        double r299669 = 1.0;
        double r299670 = y;
        double r299671 = r299670 * r299670;
        double r299672 = r299669 + r299671;
        double r299673 = r299668 * r299672;
        return r299673;
}

double f(double x, double y) {
        double r299674 = x;
        double r299675 = y;
        double r299676 = r299675 * r299675;
        double r299677 = 1.0;
        double r299678 = r299676 + r299677;
        double r299679 = r299674 * r299678;
        return r299679;
}

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

Derivation

  1. Initial program 5.4

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

    \[\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.4

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

Reproduce

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