Average Error: 0.1 → 0.1
Time: 9.1s
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 r131275 = x;
        double r131276 = y;
        double r131277 = log(r131276);
        double r131278 = r131275 * r131277;
        double r131279 = r131278 - r131276;
        double r131280 = z;
        double r131281 = r131279 - r131280;
        double r131282 = t;
        double r131283 = log(r131282);
        double r131284 = r131281 + r131283;
        return r131284;
}

double f(double x, double y, double z, double t) {
        double r131285 = y;
        double r131286 = log(r131285);
        double r131287 = x;
        double r131288 = t;
        double r131289 = log(r131288);
        double r131290 = z;
        double r131291 = r131285 + r131290;
        double r131292 = r131289 - r131291;
        double r131293 = fma(r131286, r131287, r131292);
        return r131293;
}

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