Average Error: 0.1 → 0.1
Time: 11.1s
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 r23040292 = x;
        double r23040293 = r23040292 * r23040292;
        double r23040294 = y;
        double r23040295 = r23040294 * r23040294;
        double r23040296 = r23040293 + r23040295;
        double r23040297 = r23040296 + r23040295;
        double r23040298 = r23040297 + r23040295;
        return r23040298;
}

double f(double x, double y) {
        double r23040299 = 3.0;
        double r23040300 = y;
        double r23040301 = r23040300 * r23040300;
        double r23040302 = r23040299 * r23040301;
        double r23040303 = x;
        double r23040304 = r23040303 * r23040303;
        double r23040305 = r23040302 + r23040304;
        return r23040305;
}

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