Average Error: 5.2 → 0.1
Time: 14.0s
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 r26117093 = x;
        double r26117094 = 1.0;
        double r26117095 = y;
        double r26117096 = r26117095 * r26117095;
        double r26117097 = r26117094 + r26117096;
        double r26117098 = r26117093 * r26117097;
        return r26117098;
}

double f(double x, double y) {
        double r26117099 = y;
        double r26117100 = x;
        double r26117101 = r26117099 * r26117100;
        double r26117102 = r26117099 * r26117101;
        double r26117103 = 1.0;
        double r26117104 = r26117103 * r26117100;
        double r26117105 = r26117102 + r26117104;
        return r26117105;
}

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

Derivation

  1. Initial program 5.2

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

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

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

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