Average Error: 0.1 → 0.1
Time: 12.3s
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 r18215882 = x;
        double r18215883 = r18215882 * r18215882;
        double r18215884 = y;
        double r18215885 = r18215884 * r18215884;
        double r18215886 = r18215883 + r18215885;
        double r18215887 = r18215886 + r18215885;
        double r18215888 = r18215887 + r18215885;
        return r18215888;
}

double f(double x, double y) {
        double r18215889 = y;
        double r18215890 = r18215889 * r18215889;
        double r18215891 = x;
        double r18215892 = r18215891 * r18215891;
        double r18215893 = r18215892 + r18215890;
        double r18215894 = r18215890 + r18215893;
        double r18215895 = r18215890 + r18215894;
        return r18215895;
}

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