Average Error: 0.1 → 0.1
Time: 12.6s
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 r24620909 = x;
        double r24620910 = r24620909 * r24620909;
        double r24620911 = y;
        double r24620912 = r24620911 * r24620911;
        double r24620913 = r24620910 + r24620912;
        double r24620914 = r24620913 + r24620912;
        double r24620915 = r24620914 + r24620912;
        return r24620915;
}

double f(double x, double y) {
        double r24620916 = y;
        double r24620917 = r24620916 * r24620916;
        double r24620918 = x;
        double r24620919 = r24620918 * r24620918;
        double r24620920 = r24620919 + r24620917;
        double r24620921 = r24620917 + r24620920;
        double r24620922 = r24620917 + r24620921;
        return r24620922;
}

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