Average Error: 0.1 → 0.1
Time: 2.6s
Precision: 64
\[\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z\]
\[\left(x \cdot y + z \cdot z\right) + z \cdot \left(z + z\right)\]
\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z
\left(x \cdot y + z \cdot z\right) + z \cdot \left(z + z\right)
double f(double x, double y, double z) {
        double r510240 = x;
        double r510241 = y;
        double r510242 = r510240 * r510241;
        double r510243 = z;
        double r510244 = r510243 * r510243;
        double r510245 = r510242 + r510244;
        double r510246 = r510245 + r510244;
        double r510247 = r510246 + r510244;
        return r510247;
}

double f(double x, double y, double z) {
        double r510248 = x;
        double r510249 = y;
        double r510250 = r510248 * r510249;
        double r510251 = z;
        double r510252 = r510251 * r510251;
        double r510253 = r510250 + r510252;
        double r510254 = r510251 + r510251;
        double r510255 = r510251 * r510254;
        double r510256 = r510253 + r510255;
        return r510256;
}

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. Using strategy rm
  3. Applied associate-+l+0.1

    \[\leadsto \color{blue}{\left(x \cdot y + z \cdot z\right) + \left(z \cdot z + z \cdot z\right)}\]
  4. Simplified0.1

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

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

Reproduce

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

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

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