Average Error: 0.1 → 0.1
Time: 8.3s
Precision: 64
\[\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z\]
\[x \cdot y + \left(3 \cdot z\right) \cdot z\]
\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z
x \cdot y + \left(3 \cdot z\right) \cdot z
double f(double x, double y, double z) {
        double r431690 = x;
        double r431691 = y;
        double r431692 = r431690 * r431691;
        double r431693 = z;
        double r431694 = r431693 * r431693;
        double r431695 = r431692 + r431694;
        double r431696 = r431695 + r431694;
        double r431697 = r431696 + r431694;
        return r431697;
}

double f(double x, double y, double z) {
        double r431698 = x;
        double r431699 = y;
        double r431700 = r431698 * r431699;
        double r431701 = 3.0;
        double r431702 = z;
        double r431703 = r431701 * r431702;
        double r431704 = r431703 * r431702;
        double r431705 = r431700 + r431704;
        return r431705;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0.1
Herbie0.1
\[\left(3 \cdot z\right) \cdot z + y \cdot x\]

Derivation

  1. Initial program 0.1

    \[\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z\]
  2. Simplified0.1

    \[\leadsto \color{blue}{x \cdot y + 3 \cdot \left(z \cdot z\right)}\]
  3. Using strategy rm
  4. Applied associate-*r*0.1

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

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

Reproduce

herbie shell --seed 2019198 
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, A"

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

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