Average Error: 0.1 → 0.1
Time: 8.1s
Precision: 64
\[\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z\]
\[x \cdot y + z \cdot \left(z \cdot 3\right)\]
\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z
x \cdot y + z \cdot \left(z \cdot 3\right)
double f(double x, double y, double z) {
        double r344757 = x;
        double r344758 = y;
        double r344759 = r344757 * r344758;
        double r344760 = z;
        double r344761 = r344760 * r344760;
        double r344762 = r344759 + r344761;
        double r344763 = r344762 + r344761;
        double r344764 = r344763 + r344761;
        return r344764;
}

double f(double x, double y, double z) {
        double r344765 = x;
        double r344766 = y;
        double r344767 = r344765 * r344766;
        double r344768 = z;
        double r344769 = 3.0;
        double r344770 = r344768 * r344769;
        double r344771 = r344768 * r344770;
        double r344772 = r344767 + r344771;
        return r344772;
}

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 + \left(z \cdot z\right) \cdot 3}\]
  3. Using strategy rm
  4. Applied associate-*l*0.1

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

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

Reproduce

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