Average Error: 0.1 → 0.1
Time: 6.6s
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 r10344550 = x;
        double r10344551 = y;
        double r10344552 = r10344550 * r10344551;
        double r10344553 = z;
        double r10344554 = r10344553 * r10344553;
        double r10344555 = r10344552 + r10344554;
        double r10344556 = r10344555 + r10344554;
        double r10344557 = r10344556 + r10344554;
        return r10344557;
}

double f(double x, double y, double z) {
        double r10344558 = z;
        double r10344559 = 3.0;
        double r10344560 = r10344558 * r10344559;
        double r10344561 = r10344558 * r10344560;
        double r10344562 = x;
        double r10344563 = y;
        double r10344564 = r10344562 * r10344563;
        double r10344565 = r10344561 + r10344564;
        return r10344565;
}

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

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

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

Reproduce

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

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

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