Average Error: 0.1 → 0.1
Time: 3.5s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[\left(y \cdot y + \left(x \cdot x + y \cdot y\right)\right) + y \cdot y\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\left(y \cdot y + \left(x \cdot x + y \cdot y\right)\right) + y \cdot y
double f(double x, double y) {
        double r465095 = x;
        double r465096 = r465095 * r465095;
        double r465097 = y;
        double r465098 = r465097 * r465097;
        double r465099 = r465096 + r465098;
        double r465100 = r465099 + r465098;
        double r465101 = r465100 + r465098;
        return r465101;
}

double f(double x, double y) {
        double r465102 = y;
        double r465103 = r465102 * r465102;
        double r465104 = x;
        double r465105 = r465104 * r465104;
        double r465106 = r465105 + r465103;
        double r465107 = r465103 + r465106;
        double r465108 = r465107 + r465103;
        return r465108;
}

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. Using strategy rm
  3. Applied +-commutative0.1

    \[\leadsto \color{blue}{\left(y \cdot y + \left(x \cdot x + y \cdot y\right)\right)} + y \cdot y\]
  4. Final simplification0.1

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

Reproduce

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