Average Error: 0.1 → 0.1
Time: 10.2s
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 r27335093 = x;
        double r27335094 = y;
        double r27335095 = r27335093 * r27335094;
        double r27335096 = z;
        double r27335097 = r27335096 * r27335096;
        double r27335098 = r27335095 + r27335097;
        double r27335099 = r27335098 + r27335097;
        double r27335100 = r27335099 + r27335097;
        return r27335100;
}

double f(double x, double y, double z) {
        double r27335101 = x;
        double r27335102 = y;
        double r27335103 = r27335101 * r27335102;
        double r27335104 = z;
        double r27335105 = 3.0;
        double r27335106 = r27335104 * r27335105;
        double r27335107 = r27335104 * r27335106;
        double r27335108 = r27335103 + r27335107;
        return r27335108;
}

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