Average Error: 0.1 → 0.1
Time: 2.9s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[{x}^{2} + \left(3 \cdot y\right) \cdot y\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
{x}^{2} + \left(3 \cdot y\right) \cdot y
double f(double x, double y) {
        double r519796 = x;
        double r519797 = r519796 * r519796;
        double r519798 = y;
        double r519799 = r519798 * r519798;
        double r519800 = r519797 + r519799;
        double r519801 = r519800 + r519799;
        double r519802 = r519801 + r519799;
        return r519802;
}

double f(double x, double y) {
        double r519803 = x;
        double r519804 = 2.0;
        double r519805 = pow(r519803, r519804);
        double r519806 = 3.0;
        double r519807 = y;
        double r519808 = r519806 * r519807;
        double r519809 = r519808 * r519807;
        double r519810 = r519805 + r519809;
        return r519810;
}

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. Taylor expanded around 0 0.1

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

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

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

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

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

Reproduce

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