Average Error: 0.1 → 0.1
Time: 3.0s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[\left(y \cdot \left(y + y\right) + {x}^{2}\right) + y \cdot y\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\left(y \cdot \left(y + y\right) + {x}^{2}\right) + y \cdot y
double f(double x, double y) {
        double r578528 = x;
        double r578529 = r578528 * r578528;
        double r578530 = y;
        double r578531 = r578530 * r578530;
        double r578532 = r578529 + r578531;
        double r578533 = r578532 + r578531;
        double r578534 = r578533 + r578531;
        return r578534;
}

double f(double x, double y) {
        double r578535 = y;
        double r578536 = r578535 + r578535;
        double r578537 = r578535 * r578536;
        double r578538 = x;
        double r578539 = 2.0;
        double r578540 = pow(r578538, r578539);
        double r578541 = r578537 + r578540;
        double r578542 = r578535 * r578535;
        double r578543 = r578541 + r578542;
        return r578543;
}

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 add-sqr-sqrt0.2

    \[\leadsto \color{blue}{\sqrt{\left(x \cdot x + y \cdot y\right) + y \cdot y} \cdot \sqrt{\left(x \cdot x + y \cdot y\right) + y \cdot y}} + y \cdot y\]
  4. Taylor expanded around 0 0.1

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

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

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

Reproduce

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