Average Error: 0.1 → 0.1
Time: 7.6s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[x \cdot x + 3 \cdot \left(y \cdot y\right)\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
x \cdot x + 3 \cdot \left(y \cdot y\right)
double f(double x, double y) {
        double r319945 = x;
        double r319946 = r319945 * r319945;
        double r319947 = y;
        double r319948 = r319947 * r319947;
        double r319949 = r319946 + r319948;
        double r319950 = r319949 + r319948;
        double r319951 = r319950 + r319948;
        return r319951;
}

double f(double x, double y) {
        double r319952 = x;
        double r319953 = r319952 * r319952;
        double r319954 = 3.0;
        double r319955 = y;
        double r319956 = r319955 * r319955;
        double r319957 = r319954 * r319956;
        double r319958 = r319953 + r319957;
        return r319958;
}

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}{x \cdot x + 3 \cdot \left(y \cdot y\right)}\]
  3. Final simplification0.1

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

Reproduce

herbie shell --seed 2019305 
(FPCore (x y)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, E"
  :precision binary64

  :herbie-target
  (+ (* x x) (* y (+ y (+ y y))))

  (+ (+ (+ (* x x) (* y y)) (* y y)) (* y y)))