Average Error: 5.4 → 0.1
Time: 12.1s
Precision: 64
\[x \cdot \left(1.0 + y \cdot y\right)\]
\[y \cdot \left(y \cdot x\right) + 1.0 \cdot x\]
x \cdot \left(1.0 + y \cdot y\right)
y \cdot \left(y \cdot x\right) + 1.0 \cdot x
double f(double x, double y) {
        double r22373592 = x;
        double r22373593 = 1.0;
        double r22373594 = y;
        double r22373595 = r22373594 * r22373594;
        double r22373596 = r22373593 + r22373595;
        double r22373597 = r22373592 * r22373596;
        return r22373597;
}

double f(double x, double y) {
        double r22373598 = y;
        double r22373599 = x;
        double r22373600 = r22373598 * r22373599;
        double r22373601 = r22373598 * r22373600;
        double r22373602 = 1.0;
        double r22373603 = r22373602 * r22373599;
        double r22373604 = r22373601 + r22373603;
        return r22373604;
}

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.0 + y \cdot y\right)\]
  2. Using strategy rm
  3. Applied distribute-rgt-in5.4

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

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

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

Reproduce

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

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

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