Average Error: 0.1 → 0.1
Time: 9.0s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[y \cdot \left(3 \cdot y\right) + x \cdot x\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
y \cdot \left(3 \cdot y\right) + x \cdot x
double f(double x, double y) {
        double r539767 = x;
        double r539768 = r539767 * r539767;
        double r539769 = y;
        double r539770 = r539769 * r539769;
        double r539771 = r539768 + r539770;
        double r539772 = r539771 + r539770;
        double r539773 = r539772 + r539770;
        return r539773;
}

double f(double x, double y) {
        double r539774 = y;
        double r539775 = 3.0;
        double r539776 = r539775 * r539774;
        double r539777 = r539774 * r539776;
        double r539778 = x;
        double r539779 = r539778 * r539778;
        double r539780 = r539777 + r539779;
        return r539780;
}

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. Taylor expanded around 0 0.1

    \[\leadsto \color{blue}{3 \cdot {y}^{2}} + x \cdot x\]
  4. Simplified0.1

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

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

Reproduce

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