Average Error: 0.1 → 0.1
Time: 2.7s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[x \cdot x + \left(3 \cdot y\right) \cdot y\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
x \cdot x + \left(3 \cdot y\right) \cdot y
double f(double x, double y) {
        double r553195 = x;
        double r553196 = r553195 * r553195;
        double r553197 = y;
        double r553198 = r553197 * r553197;
        double r553199 = r553196 + r553198;
        double r553200 = r553199 + r553198;
        double r553201 = r553200 + r553198;
        return r553201;
}

double f(double x, double y) {
        double r553202 = x;
        double r553203 = r553202 * r553202;
        double r553204 = 3.0;
        double r553205 = y;
        double r553206 = r553204 * r553205;
        double r553207 = r553206 * r553205;
        double r553208 = r553203 + r553207;
        return r553208;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0.1
Herbie0.1
\[x \cdot x + y \cdot \left(y + \left(y + y\right)\right)\]

Derivation

  1. Initial program 0.1

    \[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
  2. Using strategy rm
  3. Applied associate-+l+0.1

    \[\leadsto \color{blue}{\left(x \cdot x + y \cdot y\right) + \left(y \cdot y + y \cdot y\right)}\]
  4. Simplified0.1

    \[\leadsto \left(x \cdot x + y \cdot y\right) + \color{blue}{y \cdot \left(y + y\right)}\]
  5. Using strategy rm
  6. Applied associate-+l+0.1

    \[\leadsto \color{blue}{x \cdot x + \left(y \cdot y + y \cdot \left(y + y\right)\right)}\]
  7. Simplified0.1

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

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

Reproduce

herbie shell --seed 2019362 
(FPCore (x y)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, E"
  :precision binary64

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

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