Average Error: 0.1 → 0.1
Time: 11.9s
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 r21626877 = x;
        double r21626878 = r21626877 * r21626877;
        double r21626879 = y;
        double r21626880 = r21626879 * r21626879;
        double r21626881 = r21626878 + r21626880;
        double r21626882 = r21626881 + r21626880;
        double r21626883 = r21626882 + r21626880;
        return r21626883;
}

double f(double x, double y) {
        double r21626884 = y;
        double r21626885 = r21626884 * r21626884;
        double r21626886 = x;
        double r21626887 = r21626886 * r21626886;
        double r21626888 = r21626887 + r21626885;
        double r21626889 = r21626885 + r21626888;
        double r21626890 = r21626885 + r21626889;
        return r21626890;
}

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 2019192 +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)))