Average Error: 5.2 → 5.2
Time: 11.9s
Precision: 64
\[x \cdot \left(1.0 + y \cdot y\right)\]
\[\left(1.0 + y \cdot y\right) \cdot x\]
x \cdot \left(1.0 + y \cdot y\right)
\left(1.0 + y \cdot y\right) \cdot x
double f(double x, double y) {
        double r27950392 = x;
        double r27950393 = 1.0;
        double r27950394 = y;
        double r27950395 = r27950394 * r27950394;
        double r27950396 = r27950393 + r27950395;
        double r27950397 = r27950392 * r27950396;
        return r27950397;
}

double f(double x, double y) {
        double r27950398 = 1.0;
        double r27950399 = y;
        double r27950400 = r27950399 * r27950399;
        double r27950401 = r27950398 + r27950400;
        double r27950402 = x;
        double r27950403 = r27950401 * r27950402;
        return r27950403;
}

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

Derivation

  1. Initial program 5.2

    \[x \cdot \left(1.0 + y \cdot y\right)\]
  2. Using strategy rm
  3. Applied *-commutative5.2

    \[\leadsto \color{blue}{\left(1.0 + y \cdot y\right) \cdot x}\]
  4. Final simplification5.2

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

Reproduce

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

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

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