Average Error: 5.2 → 5.2
Time: 14.4s
Precision: 64
\[x \cdot \left(1.0 + y \cdot y\right)\]
\[\left(1.0 + y \cdot y\right) \cdot x\]
x \cdot \left(1.0 + y \cdot y\right)
\left(1.0 + y \cdot y\right) \cdot x
double f(double x, double y) {
        double r33433802 = x;
        double r33433803 = 1.0;
        double r33433804 = y;
        double r33433805 = r33433804 * r33433804;
        double r33433806 = r33433803 + r33433805;
        double r33433807 = r33433802 * r33433806;
        return r33433807;
}

double f(double x, double y) {
        double r33433808 = 1.0;
        double r33433809 = y;
        double r33433810 = r33433809 * r33433809;
        double r33433811 = r33433808 + r33433810;
        double r33433812 = x;
        double r33433813 = r33433811 * r33433812;
        return r33433813;
}

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

Derivation

  1. Initial program 5.2

    \[x \cdot \left(1.0 + y \cdot y\right)\]
  2. Using strategy rm
  3. Applied *-commutative5.2

    \[\leadsto \color{blue}{\left(1.0 + y \cdot y\right) \cdot x}\]
  4. Final simplification5.2

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

Reproduce

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

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

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