Average Error: 0.0 → 0.0
Time: 1.4s
Precision: 64
\[\left(\frac{x}{2} + \frac{y}{2}\right) + \frac{z}{2}\]
\[\left(\frac{x}{2} + \frac{y}{2}\right) + \frac{z}{2}\]
\left(\frac{x}{2} + \frac{y}{2}\right) + \frac{z}{2}
\left(\frac{x}{2} + \frac{y}{2}\right) + \frac{z}{2}
double f(double x, double y, double z) {
        double r699164 = x;
        double r699165 = 2.0;
        double r699166 = r699164 / r699165;
        double r699167 = y;
        double r699168 = r699167 / r699165;
        double r699169 = r699166 + r699168;
        double r699170 = z;
        double r699171 = r699170 / r699165;
        double r699172 = r699169 + r699171;
        return r699172;
}

double f(double x, double y, double z) {
        double r699173 = x;
        double r699174 = 2.0;
        double r699175 = r699173 / r699174;
        double r699176 = y;
        double r699177 = r699176 / r699174;
        double r699178 = r699175 + r699177;
        double r699179 = z;
        double r699180 = r699179 / r699174;
        double r699181 = r699178 + r699180;
        return r699181;
}

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

Derivation

  1. Initial program 0.0

    \[\left(\frac{x}{2} + \frac{y}{2}\right) + \frac{z}{2}\]
  2. Final simplification0.0

    \[\leadsto \left(\frac{x}{2} + \frac{y}{2}\right) + \frac{z}{2}\]

Reproduce

herbie shell --seed 1 
(FPCore (x y z)
  :name "x/2 + y/2 + z/2"
  :precision binary64
  (+ (+ (/ x 2) (/ y 2)) (/ z 2)))