Average Error: 5.4 → 0.1
Time: 6.6s
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 r28707124 = x;
        double r28707125 = 1.0;
        double r28707126 = y;
        double r28707127 = r28707126 * r28707126;
        double r28707128 = r28707125 + r28707127;
        double r28707129 = r28707124 * r28707128;
        return r28707129;
}

double f(double x, double y) {
        double r28707130 = y;
        double r28707131 = x;
        double r28707132 = r28707130 * r28707131;
        double r28707133 = r28707130 * r28707132;
        double r28707134 = 1.0;
        double r28707135 = r28707134 * r28707131;
        double r28707136 = r28707133 + r28707135;
        return r28707136;
}

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 add-sqr-sqrt5.5

    \[\leadsto x \cdot \color{blue}{\left(\sqrt{1 + y \cdot y} \cdot \sqrt{1 + y \cdot y}\right)}\]
  4. Applied add-sqr-sqrt34.6

    \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \left(\sqrt{1 + y \cdot y} \cdot \sqrt{1 + y \cdot y}\right)\]
  5. Applied unswap-sqr34.6

    \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{1 + y \cdot y}\right) \cdot \left(\sqrt{x} \cdot \sqrt{1 + y \cdot y}\right)}\]
  6. Taylor expanded around inf 5.4

    \[\leadsto \color{blue}{1 \cdot x + x \cdot {y}^{2}}\]
  7. Simplified0.1

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

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

Reproduce

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

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

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