Average Error: 4.9 → 0.1
Time: 10.4s
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 r442157 = x;
        double r442158 = 1.0;
        double r442159 = y;
        double r442160 = r442159 * r442159;
        double r442161 = r442158 + r442160;
        double r442162 = r442157 * r442161;
        return r442162;
}

double f(double x, double y) {
        double r442163 = y;
        double r442164 = x;
        double r442165 = r442163 * r442164;
        double r442166 = r442163 * r442165;
        double r442167 = 1.0;
        double r442168 = r442164 * r442167;
        double r442169 = r442166 + r442168;
        return r442169;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original4.9
Target0.1
Herbie0.1
\[x + \left(x \cdot y\right) \cdot y\]

Derivation

  1. Initial program 4.9

    \[x \cdot \left(1 + y \cdot y\right)\]
  2. Using strategy rm
  3. Applied distribute-rgt-in4.9

    \[\leadsto \color{blue}{1 \cdot x + \left(y \cdot y\right) \cdot x}\]
  4. Simplified4.9

    \[\leadsto \color{blue}{x \cdot 1} + \left(y \cdot y\right) \cdot x\]
  5. Simplified0.1

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

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

Reproduce

herbie shell --seed 2019194 +o rules:numerics
(FPCore (x y)
  :name "Numeric.Integration.TanhSinh:everywhere from integration-0.2.1"

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

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