Average Error: 0.1 → 0.1
Time: 8.2s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[y \cdot \left(y \cdot 3\right) + x \cdot x\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
y \cdot \left(y \cdot 3\right) + x \cdot x
double f(double x, double y) {
        double r28634212 = x;
        double r28634213 = r28634212 * r28634212;
        double r28634214 = y;
        double r28634215 = r28634214 * r28634214;
        double r28634216 = r28634213 + r28634215;
        double r28634217 = r28634216 + r28634215;
        double r28634218 = r28634217 + r28634215;
        return r28634218;
}

double f(double x, double y) {
        double r28634219 = y;
        double r28634220 = 3.0;
        double r28634221 = r28634219 * r28634220;
        double r28634222 = r28634219 * r28634221;
        double r28634223 = x;
        double r28634224 = r28634223 * r28634223;
        double r28634225 = r28634222 + r28634224;
        return r28634225;
}

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}{\left(y \cdot y\right) \cdot 3 + x \cdot x}\]
  3. Using strategy rm
  4. Applied associate-*l*0.1

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

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

Reproduce

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