Average Error: 5.4 → 5.4
Time: 2.4s
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 r287976 = x;
        double r287977 = 1.0;
        double r287978 = y;
        double r287979 = r287978 * r287978;
        double r287980 = r287977 + r287979;
        double r287981 = r287976 * r287980;
        return r287981;
}

double f(double x, double y) {
        double r287982 = x;
        double r287983 = y;
        double r287984 = r287983 * r287983;
        double r287985 = 1.0;
        double r287986 = r287984 + r287985;
        double r287987 = r287982 * r287986;
        return r287987;
}

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.3

    \[\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 2019304 
(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))))