Average Error: 0.1 → 0.1
Time: 16.6s
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 r26545908 = x;
        double r26545909 = r26545908 * r26545908;
        double r26545910 = y;
        double r26545911 = r26545910 * r26545910;
        double r26545912 = r26545909 + r26545911;
        double r26545913 = r26545912 + r26545911;
        double r26545914 = r26545913 + r26545911;
        return r26545914;
}

double f(double x, double y) {
        double r26545915 = 3.0;
        double r26545916 = y;
        double r26545917 = r26545916 * r26545916;
        double r26545918 = r26545915 * r26545917;
        double r26545919 = x;
        double r26545920 = r26545919 * r26545919;
        double r26545921 = r26545918 + r26545920;
        return r26545921;
}

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