Average Error: 4.8 → 0.1
Time: 12.2s
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 r27384563 = x;
        double r27384564 = 1.0;
        double r27384565 = y;
        double r27384566 = r27384565 * r27384565;
        double r27384567 = r27384564 + r27384566;
        double r27384568 = r27384563 * r27384567;
        return r27384568;
}

double f(double x, double y) {
        double r27384569 = y;
        double r27384570 = x;
        double r27384571 = r27384569 * r27384570;
        double r27384572 = r27384569 * r27384571;
        double r27384573 = 1.0;
        double r27384574 = r27384573 * r27384570;
        double r27384575 = r27384572 + r27384574;
        return r27384575;
}

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

Derivation

  1. Initial program 4.8

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

    \[\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 2019164 
(FPCore (x y)
  :name "Numeric.Integration.TanhSinh:everywhere from integration-0.2.1"

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

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