Average Error: 5.4 → 0.1
Time: 5.6s
Precision: 64
\[x \cdot \left(1 + y \cdot y\right)\]
\[1 \cdot x + y \cdot \left(y \cdot x\right)\]
x \cdot \left(1 + y \cdot y\right)
1 \cdot x + y \cdot \left(y \cdot x\right)
double f(double x, double y) {
        double r359468 = x;
        double r359469 = 1.0;
        double r359470 = y;
        double r359471 = r359470 * r359470;
        double r359472 = r359469 + r359471;
        double r359473 = r359468 * r359472;
        return r359473;
}

double f(double x, double y) {
        double r359474 = 1.0;
        double r359475 = x;
        double r359476 = r359474 * r359475;
        double r359477 = y;
        double r359478 = r359477 * r359475;
        double r359479 = r359477 * r359478;
        double r359480 = r359476 + r359479;
        return r359480;
}

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
Herbie0.1
\[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-rgt-in5.4

    \[\leadsto \color{blue}{1 \cdot x + \left(y \cdot y\right) \cdot x}\]
  4. Using strategy rm
  5. Applied associate-*l*0.1

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

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

Reproduce

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