Average Error: 5.1 → 0.1
Time: 12.9s
Precision: 64
\[x \cdot \left(1 + y \cdot y\right)\]
\[y \cdot \left(y \cdot x\right) + 1 \cdot x\]
x \cdot \left(1 + y \cdot y\right)
y \cdot \left(y \cdot x\right) + 1 \cdot x
double f(double x, double y) {
        double r21190412 = x;
        double r21190413 = 1.0;
        double r21190414 = y;
        double r21190415 = r21190414 * r21190414;
        double r21190416 = r21190413 + r21190415;
        double r21190417 = r21190412 * r21190416;
        return r21190417;
}

double f(double x, double y) {
        double r21190418 = y;
        double r21190419 = x;
        double r21190420 = r21190418 * r21190419;
        double r21190421 = r21190418 * r21190420;
        double r21190422 = 1.0;
        double r21190423 = r21190422 * r21190419;
        double r21190424 = r21190421 + r21190423;
        return r21190424;
}

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

Derivation

  1. Initial program 5.1

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

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

Reproduce

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

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

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