Average Error: 0.1 → 0.1
Time: 4.3s
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 r18979 = x;
        double r18980 = y;
        double r18981 = log(r18980);
        double r18982 = r18979 * r18981;
        double r18983 = z;
        double r18984 = r18982 - r18983;
        double r18985 = r18984 - r18980;
        return r18985;
}

double f(double x, double y, double z) {
        double r18986 = x;
        double r18987 = y;
        double r18988 = log(r18987);
        double r18989 = z;
        double r18990 = 1.0;
        double r18991 = r18989 * r18990;
        double r18992 = -r18991;
        double r18993 = fma(r18986, r18988, r18992);
        double r18994 = -r18989;
        double r18995 = r18989 - r18987;
        double r18996 = r18994 + r18995;
        double r18997 = r18993 + r18996;
        return r18997;
}

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