Average Error: 0.1 → 0.1
Time: 2.4s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[{x}^{2} + 3 \cdot {y}^{2}\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
{x}^{2} + 3 \cdot {y}^{2}
double f(double x, double y) {
        double r531638 = x;
        double r531639 = r531638 * r531638;
        double r531640 = y;
        double r531641 = r531640 * r531640;
        double r531642 = r531639 + r531641;
        double r531643 = r531642 + r531641;
        double r531644 = r531643 + r531641;
        return r531644;
}

double f(double x, double y) {
        double r531645 = x;
        double r531646 = 2.0;
        double r531647 = pow(r531645, r531646);
        double r531648 = 3.0;
        double r531649 = y;
        double r531650 = pow(r531649, r531646);
        double r531651 = r531648 * r531650;
        double r531652 = r531647 + r531651;
        return r531652;
}

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. Simplified0.1

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

    \[\leadsto \color{blue}{{x}^{2} + 3 \cdot {y}^{2}}\]
  4. Final simplification0.1

    \[\leadsto {x}^{2} + 3 \cdot {y}^{2}\]

Reproduce

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