Average Error: 0.1 → 0.1
Time: 13.3s
Precision: 64
\[\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z\]
\[z \cdot \left(z \cdot 3\right) + x \cdot y\]
\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z
z \cdot \left(z \cdot 3\right) + x \cdot y
double f(double x, double y, double z) {
        double r27010397 = x;
        double r27010398 = y;
        double r27010399 = r27010397 * r27010398;
        double r27010400 = z;
        double r27010401 = r27010400 * r27010400;
        double r27010402 = r27010399 + r27010401;
        double r27010403 = r27010402 + r27010401;
        double r27010404 = r27010403 + r27010401;
        return r27010404;
}

double f(double x, double y, double z) {
        double r27010405 = z;
        double r27010406 = 3.0;
        double r27010407 = r27010405 * r27010406;
        double r27010408 = r27010405 * r27010407;
        double r27010409 = x;
        double r27010410 = y;
        double r27010411 = r27010409 * r27010410;
        double r27010412 = r27010408 + r27010411;
        return r27010412;
}

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}{\left(z \cdot z\right) \cdot 3 + x \cdot y}\]
  3. Taylor expanded around 0 0.1

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

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

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

Reproduce

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