Average Error: 0.1 → 0.1
Time: 16.9s
Precision: 64
\[\left(x \cdot \log y - z\right) - y\]
\[\left(-y\right) + \mathsf{fma}\left(x, \log y, -z\right)\]
\left(x \cdot \log y - z\right) - y
\left(-y\right) + \mathsf{fma}\left(x, \log y, -z\right)
double f(double x, double y, double z) {
        double r22886 = x;
        double r22887 = y;
        double r22888 = log(r22887);
        double r22889 = r22886 * r22888;
        double r22890 = z;
        double r22891 = r22889 - r22890;
        double r22892 = r22891 - r22887;
        return r22892;
}

double f(double x, double y, double z) {
        double r22893 = y;
        double r22894 = -r22893;
        double r22895 = x;
        double r22896 = log(r22893);
        double r22897 = z;
        double r22898 = -r22897;
        double r22899 = fma(r22895, r22896, r22898);
        double r22900 = r22894 + r22899;
        return r22900;
}

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(0 - y\right)}\]
  7. Final simplification0.1

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

Reproduce

herbie shell --seed 2019303 +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))