Average Error: 0.1 → 0.1
Time: 7.9s
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 r133296 = x;
        double r133297 = y;
        double r133298 = log(r133297);
        double r133299 = r133296 * r133298;
        double r133300 = r133299 - r133297;
        double r133301 = z;
        double r133302 = r133300 - r133301;
        double r133303 = t;
        double r133304 = log(r133303);
        double r133305 = r133302 + r133304;
        return r133305;
}

double f(double x, double y, double z, double t) {
        double r133306 = y;
        double r133307 = log(r133306);
        double r133308 = x;
        double r133309 = t;
        double r133310 = log(r133309);
        double r133311 = z;
        double r133312 = r133306 + r133311;
        double r133313 = r133310 - r133312;
        double r133314 = fma(r133307, r133308, r133313);
        return r133314;
}

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