Average Error: 5.3 → 0.1
Time: 8.1s
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 r315013 = x;
        double r315014 = 1.0;
        double r315015 = y;
        double r315016 = r315015 * r315015;
        double r315017 = r315014 + r315016;
        double r315018 = r315013 * r315017;
        return r315018;
}

double f(double x, double y) {
        double r315019 = y;
        double r315020 = x;
        double r315021 = r315019 * r315020;
        double r315022 = r315019 * r315021;
        double r315023 = 1.0;
        double r315024 = r315020 * r315023;
        double r315025 = r315022 + r315024;
        return r315025;
}

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 2019179 +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))))