Average Error: 0.1 → 0.1
Time: 23.1s
Precision: 64
\[\left(x \cdot \log y - z\right) - y\]
\[\mathsf{fma}\left(x, \log y, -z\right) - y\]
\left(x \cdot \log y - z\right) - y
\mathsf{fma}\left(x, \log y, -z\right) - y
double f(double x, double y, double z) {
        double r754778 = x;
        double r754779 = y;
        double r754780 = log(r754779);
        double r754781 = r754778 * r754780;
        double r754782 = z;
        double r754783 = r754781 - r754782;
        double r754784 = r754783 - r754779;
        return r754784;
}

double f(double x, double y, double z) {
        double r754785 = x;
        double r754786 = y;
        double r754787 = log(r754786);
        double r754788 = z;
        double r754789 = -r754788;
        double r754790 = fma(r754785, r754787, r754789);
        double r754791 = r754790 - r754786;
        return r754791;
}

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 fma-neg0.1

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

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

Reproduce

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