Average Error: 0.1 → 0.1
Time: 11.4s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[3 \cdot \left(y \cdot y\right) + x \cdot x\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
3 \cdot \left(y \cdot y\right) + x \cdot x
double f(double x, double y) {
        double r22819260 = x;
        double r22819261 = r22819260 * r22819260;
        double r22819262 = y;
        double r22819263 = r22819262 * r22819262;
        double r22819264 = r22819261 + r22819263;
        double r22819265 = r22819264 + r22819263;
        double r22819266 = r22819265 + r22819263;
        return r22819266;
}

double f(double x, double y) {
        double r22819267 = 3.0;
        double r22819268 = y;
        double r22819269 = r22819268 * r22819268;
        double r22819270 = r22819267 * r22819269;
        double r22819271 = x;
        double r22819272 = r22819271 * r22819271;
        double r22819273 = r22819270 + r22819272;
        return r22819273;
}

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. Simplified0.1

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

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

Reproduce

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