Average Error: 0.1 → 0.1
Time: 22.8s
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 r92902 = x;
        double r92903 = y;
        double r92904 = log(r92903);
        double r92905 = r92902 * r92904;
        double r92906 = r92905 - r92903;
        double r92907 = z;
        double r92908 = r92906 - r92907;
        double r92909 = t;
        double r92910 = log(r92909);
        double r92911 = r92908 + r92910;
        return r92911;
}

double f(double x, double y, double z, double t) {
        double r92912 = x;
        double r92913 = y;
        double r92914 = log(r92913);
        double r92915 = t;
        double r92916 = log(r92915);
        double r92917 = z;
        double r92918 = r92916 - r92917;
        double r92919 = fma(r92912, r92914, r92918);
        double r92920 = r92919 - r92913;
        return r92920;
}

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