Average Error: 5.4 → 0.1
Time: 16.7s
Precision: 64
\[x \cdot \left(1 + y \cdot y\right)\]
\[y \cdot \left(y \cdot x\right) + x \cdot 1\]
x \cdot \left(1 + y \cdot y\right)
y \cdot \left(y \cdot x\right) + x \cdot 1
double f(double x, double y) {
        double r389558 = x;
        double r389559 = 1.0;
        double r389560 = y;
        double r389561 = r389560 * r389560;
        double r389562 = r389559 + r389561;
        double r389563 = r389558 * r389562;
        return r389563;
}

double f(double x, double y) {
        double r389564 = y;
        double r389565 = x;
        double r389566 = r389564 * r389565;
        double r389567 = r389564 * r389566;
        double r389568 = 1.0;
        double r389569 = r389565 * r389568;
        double r389570 = r389567 + r389569;
        return r389570;
}

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. Simplified5.4

    \[\leadsto \color{blue}{x \cdot 1} + \left(y \cdot y\right) \cdot x\]
  5. Simplified0.1

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

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

Reproduce

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

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

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