Average Error: 0.1 → 0.1
Time: 13.2s
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 r378078 = x;
        double r378079 = r378078 * r378078;
        double r378080 = y;
        double r378081 = r378080 * r378080;
        double r378082 = r378079 + r378081;
        double r378083 = r378082 + r378081;
        double r378084 = r378083 + r378081;
        return r378084;
}

double f(double x, double y) {
        double r378085 = x;
        double r378086 = r378085 * r378085;
        double r378087 = 3.0;
        double r378088 = y;
        double r378089 = r378088 * r378088;
        double r378090 = r378087 * r378089;
        double r378091 = r378086 + r378090;
        return r378091;
}

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