Average Error: 5.3 → 0.1
Time: 6.9s
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 r22460697 = x;
        double r22460698 = 1.0;
        double r22460699 = y;
        double r22460700 = r22460699 * r22460699;
        double r22460701 = r22460698 + r22460700;
        double r22460702 = r22460697 * r22460701;
        return r22460702;
}

double f(double x, double y) {
        double r22460703 = y;
        double r22460704 = x;
        double r22460705 = r22460703 * r22460704;
        double r22460706 = r22460703 * r22460705;
        double r22460707 = 1.0;
        double r22460708 = r22460704 * r22460707;
        double r22460709 = r22460706 + r22460708;
        return r22460709;
}

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-lft-in5.3

    \[\leadsto \color{blue}{x \cdot 1 + x \cdot \left(y \cdot y\right)}\]
  4. Taylor expanded around 0 5.3

    \[\leadsto x \cdot 1 + \color{blue}{x \cdot {y}^{2}}\]
  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 
(FPCore (x y)
  :name "Numeric.Integration.TanhSinh:everywhere from integration-0.2.1"

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

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