Average Error: 0.1 → 0.1
Time: 9.7s
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 r349393 = x;
        double r349394 = y;
        double r349395 = r349393 * r349394;
        double r349396 = z;
        double r349397 = r349396 * r349396;
        double r349398 = r349395 + r349397;
        double r349399 = r349398 + r349397;
        double r349400 = r349399 + r349397;
        return r349400;
}

double f(double x, double y, double z) {
        double r349401 = x;
        double r349402 = y;
        double r349403 = r349401 * r349402;
        double r349404 = 3.0;
        double r349405 = z;
        double r349406 = r349404 * r349405;
        double r349407 = r349406 * r349405;
        double r349408 = r349403 + r349407;
        return r349408;
}

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