Average Error: 0.1 → 0.1
Time: 13.4s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[y \cdot y + \left(y \cdot y + \left(x \cdot x + y \cdot y\right)\right)\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
y \cdot y + \left(y \cdot y + \left(x \cdot x + y \cdot y\right)\right)
double f(double x, double y) {
        double r22812768 = x;
        double r22812769 = r22812768 * r22812768;
        double r22812770 = y;
        double r22812771 = r22812770 * r22812770;
        double r22812772 = r22812769 + r22812771;
        double r22812773 = r22812772 + r22812771;
        double r22812774 = r22812773 + r22812771;
        return r22812774;
}

double f(double x, double y) {
        double r22812775 = y;
        double r22812776 = r22812775 * r22812775;
        double r22812777 = x;
        double r22812778 = r22812777 * r22812777;
        double r22812779 = r22812778 + r22812776;
        double r22812780 = r22812776 + r22812779;
        double r22812781 = r22812776 + r22812780;
        return r22812781;
}

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. Final simplification0.1

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

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, E"

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

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