Average Error: 0.1 → 0.2
Time: 14.5s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[\left(x \cdot x + y \cdot y\right) + \sqrt{2 \cdot {y}^{2}} \cdot \sqrt{2 \cdot {y}^{2}}\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\left(x \cdot x + y \cdot y\right) + \sqrt{2 \cdot {y}^{2}} \cdot \sqrt{2 \cdot {y}^{2}}
double f(double x, double y) {
        double r321435 = x;
        double r321436 = r321435 * r321435;
        double r321437 = y;
        double r321438 = r321437 * r321437;
        double r321439 = r321436 + r321438;
        double r321440 = r321439 + r321438;
        double r321441 = r321440 + r321438;
        return r321441;
}

double f(double x, double y) {
        double r321442 = x;
        double r321443 = r321442 * r321442;
        double r321444 = y;
        double r321445 = r321444 * r321444;
        double r321446 = r321443 + r321445;
        double r321447 = 2.0;
        double r321448 = pow(r321444, r321447);
        double r321449 = r321447 * r321448;
        double r321450 = sqrt(r321449);
        double r321451 = r321450 * r321450;
        double r321452 = r321446 + r321451;
        return r321452;
}

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.2
\[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}{2 \cdot {y}^{2}}\]
  5. Using strategy rm
  6. Applied add-sqr-sqrt0.2

    \[\leadsto \left(x \cdot x + y \cdot y\right) + \color{blue}{\sqrt{2 \cdot {y}^{2}} \cdot \sqrt{2 \cdot {y}^{2}}}\]
  7. Final simplification0.2

    \[\leadsto \left(x \cdot x + y \cdot y\right) + \sqrt{2 \cdot {y}^{2}} \cdot \sqrt{2 \cdot {y}^{2}}\]

Reproduce

herbie shell --seed 2019323 
(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)))