Average Error: 0.1 → 0.1
Time: 9.2s
Precision: 64
\[\left(\left(x \cdot \log y - y\right) - z\right) + \log t\]
\[\mathsf{fma}\left(\log y, x, \log t - \left(y + z\right)\right)\]
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\mathsf{fma}\left(\log y, x, \log t - \left(y + z\right)\right)
double f(double x, double y, double z, double t) {
        double r92954 = x;
        double r92955 = y;
        double r92956 = log(r92955);
        double r92957 = r92954 * r92956;
        double r92958 = r92957 - r92955;
        double r92959 = z;
        double r92960 = r92958 - r92959;
        double r92961 = t;
        double r92962 = log(r92961);
        double r92963 = r92960 + r92962;
        return r92963;
}

double f(double x, double y, double z, double t) {
        double r92964 = y;
        double r92965 = log(r92964);
        double r92966 = x;
        double r92967 = t;
        double r92968 = log(r92967);
        double r92969 = z;
        double r92970 = r92964 + r92969;
        double r92971 = r92968 - r92970;
        double r92972 = fma(r92965, r92966, r92971);
        return r92972;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Initial program 0.1

    \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t\]
  2. Simplified0.1

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

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

Reproduce

herbie shell --seed 2019362 +o rules:numerics
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A"
  :precision binary64
  (+ (- (- (* x (log y)) y) z) (log t)))