Average Error: 0.0 → 0.0
Time: 848.0ms
Precision: 64
\[\left(\frac{x}{2} + y \cdot x\right) + z\]
\[\mathsf{fma}\left(x, y, z + \frac{x}{2}\right)\]
\left(\frac{x}{2} + y \cdot x\right) + z
\mathsf{fma}\left(x, y, z + \frac{x}{2}\right)
double f(double x, double y, double z) {
        double r211757 = x;
        double r211758 = 2.0;
        double r211759 = r211757 / r211758;
        double r211760 = y;
        double r211761 = r211760 * r211757;
        double r211762 = r211759 + r211761;
        double r211763 = z;
        double r211764 = r211762 + r211763;
        return r211764;
}

double f(double x, double y, double z) {
        double r211765 = x;
        double r211766 = y;
        double r211767 = z;
        double r211768 = 2.0;
        double r211769 = r211765 / r211768;
        double r211770 = r211767 + r211769;
        double r211771 = fma(r211765, r211766, r211770);
        return r211771;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Initial program 0.0

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z\right) + \frac{x}{2}}\]
  3. Using strategy rm
  4. Applied fma-udef0.0

    \[\leadsto \color{blue}{\left(x \cdot y + z\right)} + \frac{x}{2}\]
  5. Applied associate-+l+0.0

    \[\leadsto \color{blue}{x \cdot y + \left(z + \frac{x}{2}\right)}\]
  6. Using strategy rm
  7. Applied fma-def0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z + \frac{x}{2}\right)}\]
  8. Final simplification0.0

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

Reproduce

herbie shell --seed 2020001 +o rules:numerics
(FPCore (x y z)
  :name "Data.Histogram.Bin.BinF:$cfromIndex from histogram-fill-0.8.4.1"
  :precision binary64
  (+ (+ (/ x 2) (* y x)) z))