Average Error: 0.1 → 0.1
Time: 16.3s
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 r23831150 = x;
        double r23831151 = r23831150 * r23831150;
        double r23831152 = y;
        double r23831153 = r23831152 * r23831152;
        double r23831154 = r23831151 + r23831153;
        double r23831155 = r23831154 + r23831153;
        double r23831156 = r23831155 + r23831153;
        return r23831156;
}

double f(double x, double y) {
        double r23831157 = 3.0;
        double r23831158 = y;
        double r23831159 = r23831158 * r23831158;
        double r23831160 = r23831157 * r23831159;
        double r23831161 = x;
        double r23831162 = r23831161 * r23831161;
        double r23831163 = r23831160 + r23831162;
        return r23831163;
}

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