Average Error: 0.1 → 0.1
Time: 9.8s
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 r19721419 = x;
        double r19721420 = r19721419 * r19721419;
        double r19721421 = y;
        double r19721422 = r19721421 * r19721421;
        double r19721423 = r19721420 + r19721422;
        double r19721424 = r19721423 + r19721422;
        double r19721425 = r19721424 + r19721422;
        return r19721425;
}

double f(double x, double y) {
        double r19721426 = 3.0;
        double r19721427 = y;
        double r19721428 = r19721427 * r19721427;
        double r19721429 = r19721426 * r19721428;
        double r19721430 = x;
        double r19721431 = r19721430 * r19721430;
        double r19721432 = r19721429 + r19721431;
        return r19721432;
}

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. Final simplification0.1

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

Reproduce

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