Average Error: 5.4 → 5.4
Time: 7.8s
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 r355982 = x;
        double r355983 = 1.0;
        double r355984 = y;
        double r355985 = r355984 * r355984;
        double r355986 = r355983 + r355985;
        double r355987 = r355982 * r355986;
        return r355987;
}

double f(double x, double y) {
        double r355988 = x;
        double r355989 = y;
        double r355990 = r355989 * r355989;
        double r355991 = 1.0;
        double r355992 = r355990 + r355991;
        double r355993 = r355988 * r355992;
        return r355993;
}

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 2019294 
(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))))