Average Error: 0.1 → 0.1
Time: 8.7s
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 r87334 = x;
        double r87335 = y;
        double r87336 = log(r87335);
        double r87337 = r87334 * r87336;
        double r87338 = r87337 - r87335;
        double r87339 = z;
        double r87340 = r87338 - r87339;
        double r87341 = t;
        double r87342 = log(r87341);
        double r87343 = r87340 + r87342;
        return r87343;
}

double f(double x, double y, double z, double t) {
        double r87344 = y;
        double r87345 = log(r87344);
        double r87346 = x;
        double r87347 = t;
        double r87348 = log(r87347);
        double r87349 = z;
        double r87350 = r87344 + r87349;
        double r87351 = r87348 - r87350;
        double r87352 = fma(r87345, r87346, r87351);
        return r87352;
}

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