Average Error: 0.1 → 0.1
Time: 4.2s
Precision: 64
\[\left(x \cdot \log y - z\right) - y\]
\[\mathsf{fma}\left(x, \log y, -z \cdot 1\right) + \left(\left(-z\right) + \left(z - y\right)\right)\]
\left(x \cdot \log y - z\right) - y
\mathsf{fma}\left(x, \log y, -z \cdot 1\right) + \left(\left(-z\right) + \left(z - y\right)\right)
double f(double x, double y, double z) {
        double r17635 = x;
        double r17636 = y;
        double r17637 = log(r17636);
        double r17638 = r17635 * r17637;
        double r17639 = z;
        double r17640 = r17638 - r17639;
        double r17641 = r17640 - r17636;
        return r17641;
}

double f(double x, double y, double z) {
        double r17642 = x;
        double r17643 = y;
        double r17644 = log(r17643);
        double r17645 = z;
        double r17646 = 1.0;
        double r17647 = r17645 * r17646;
        double r17648 = -r17647;
        double r17649 = fma(r17642, r17644, r17648);
        double r17650 = -r17645;
        double r17651 = r17645 - r17643;
        double r17652 = r17650 + r17651;
        double r17653 = r17649 + r17652;
        return r17653;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Initial program 0.1

    \[\left(x \cdot \log y - z\right) - y\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.1

    \[\leadsto \left(x \cdot \log y - \color{blue}{1 \cdot z}\right) - y\]
  4. Applied prod-diff0.1

    \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, \log y, -z \cdot 1\right) + \mathsf{fma}\left(-z, 1, z \cdot 1\right)\right)} - y\]
  5. Applied associate--l+0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, -z \cdot 1\right) + \left(\mathsf{fma}\left(-z, 1, z \cdot 1\right) - y\right)}\]
  6. Simplified0.1

    \[\leadsto \mathsf{fma}\left(x, \log y, -z \cdot 1\right) + \color{blue}{\left(\left(-z\right) + \left(z - y\right)\right)}\]
  7. Final simplification0.1

    \[\leadsto \mathsf{fma}\left(x, \log y, -z \cdot 1\right) + \left(\left(-z\right) + \left(z - y\right)\right)\]

Reproduce

herbie shell --seed 2020021 +o rules:numerics
(FPCore (x y z)
  :name "Statistics.Distribution.Poisson:$clogProbability from math-functions-0.1.5.2"
  :precision binary64
  (- (- (* x (log y)) z) y))