Average Error: 0.1 → 0.1
Time: 21.1s
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 r127959 = x;
        double r127960 = y;
        double r127961 = log(r127960);
        double r127962 = r127959 * r127961;
        double r127963 = r127962 - r127960;
        double r127964 = z;
        double r127965 = r127963 - r127964;
        double r127966 = t;
        double r127967 = log(r127966);
        double r127968 = r127965 + r127967;
        return r127968;
}

double f(double x, double y, double z, double t) {
        double r127969 = x;
        double r127970 = y;
        double r127971 = log(r127970);
        double r127972 = t;
        double r127973 = log(r127972);
        double r127974 = z;
        double r127975 = r127973 - r127974;
        double r127976 = fma(r127969, r127971, r127975);
        double r127977 = r127976 - r127970;
        return r127977;
}

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