Average Error: 5.3 → 0.1
Time: 5.3s
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 r284591 = x;
        double r284592 = 1.0;
        double r284593 = y;
        double r284594 = r284593 * r284593;
        double r284595 = r284592 + r284594;
        double r284596 = r284591 * r284595;
        return r284596;
}

double f(double x, double y) {
        double r284597 = y;
        double r284598 = x;
        double r284599 = r284597 * r284598;
        double r284600 = r284597 * r284599;
        double r284601 = 1.0;
        double r284602 = r284598 * r284601;
        double r284603 = r284600 + r284602;
        return r284603;
}

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

Derivation

  1. Initial program 5.3

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

    \[\leadsto \color{blue}{1 \cdot x + \left(y \cdot y\right) \cdot x}\]
  4. Simplified5.3

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

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

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

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y)
  :name "Numeric.Integration.TanhSinh:everywhere from integration-0.2.1"

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

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