Average Error: 0.1 → 0.1
Time: 10.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 r25493025 = x;
        double r25493026 = r25493025 * r25493025;
        double r25493027 = y;
        double r25493028 = r25493027 * r25493027;
        double r25493029 = r25493026 + r25493028;
        double r25493030 = r25493029 + r25493028;
        double r25493031 = r25493030 + r25493028;
        return r25493031;
}

double f(double x, double y) {
        double r25493032 = 3.0;
        double r25493033 = y;
        double r25493034 = r25493033 * r25493033;
        double r25493035 = r25493032 * r25493034;
        double r25493036 = x;
        double r25493037 = r25493036 * r25493036;
        double r25493038 = r25493035 + r25493037;
        return r25493038;
}

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