Average Error: 5.3 → 0.1
Time: 6.5s
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 r985846 = x;
        double r985847 = 1.0;
        double r985848 = y;
        double r985849 = r985848 * r985848;
        double r985850 = r985847 + r985849;
        double r985851 = r985846 * r985850;
        return r985851;
}

double f(double x, double y) {
        double r985852 = y;
        double r985853 = x;
        double r985854 = r985852 * r985853;
        double r985855 = r985852 * r985854;
        double r985856 = 1.0;
        double r985857 = r985853 * r985856;
        double r985858 = r985855 + r985857;
        return r985858;
}

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. Simplified0.1

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

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

Reproduce

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

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

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