Average Error: 0.1 → 0.1
Time: 23.4s
Precision: 64
\[\left(\left(x \cdot \log y - y\right) - z\right) + \log t\]
\[\mathsf{fma}\left(x, \log y, \log t - z\right) - y\]
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\mathsf{fma}\left(x, \log y, \log t - z\right) - y
double f(double x, double y, double z, double t) {
        double r91972 = x;
        double r91973 = y;
        double r91974 = log(r91973);
        double r91975 = r91972 * r91974;
        double r91976 = r91975 - r91973;
        double r91977 = z;
        double r91978 = r91976 - r91977;
        double r91979 = t;
        double r91980 = log(r91979);
        double r91981 = r91978 + r91980;
        return r91981;
}

double f(double x, double y, double z, double t) {
        double r91982 = x;
        double r91983 = y;
        double r91984 = log(r91983);
        double r91985 = t;
        double r91986 = log(r91985);
        double r91987 = z;
        double r91988 = r91986 - r91987;
        double r91989 = fma(r91982, r91984, r91988);
        double r91990 = r91989 - r91983;
        return r91990;
}

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(x, \log y, \log t - z\right) - y}\]
  3. Final simplification0.1

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

Reproduce

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