Average Error: 0.1 → 0.1
Time: 15.2s
Precision: 64
\[\left(\left(x \cdot \log y - y\right) - z\right) + \log t\]
\[\log t + \left(-\mathsf{fma}\left(x, -\log y, y + z\right)\right)\]
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\log t + \left(-\mathsf{fma}\left(x, -\log y, y + z\right)\right)
double f(double x, double y, double z, double t) {
        double r1630354 = x;
        double r1630355 = y;
        double r1630356 = log(r1630355);
        double r1630357 = r1630354 * r1630356;
        double r1630358 = r1630357 - r1630355;
        double r1630359 = z;
        double r1630360 = r1630358 - r1630359;
        double r1630361 = t;
        double r1630362 = log(r1630361);
        double r1630363 = r1630360 + r1630362;
        return r1630363;
}

double f(double x, double y, double z, double t) {
        double r1630364 = t;
        double r1630365 = log(r1630364);
        double r1630366 = x;
        double r1630367 = y;
        double r1630368 = log(r1630367);
        double r1630369 = -r1630368;
        double r1630370 = z;
        double r1630371 = r1630367 + r1630370;
        double r1630372 = fma(r1630366, r1630369, r1630371);
        double r1630373 = -r1630372;
        double r1630374 = r1630365 + r1630373;
        return r1630374;
}

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. Taylor expanded around inf 0.1

    \[\leadsto \color{blue}{\left(-\left(x \cdot \log \left(\frac{1}{y}\right) + \left(z + y\right)\right)\right)} + \log t\]
  3. Simplified0.1

    \[\leadsto \color{blue}{\left(-\mathsf{fma}\left(x, -\log y, y + z\right)\right)} + \log t\]
  4. Final simplification0.1

    \[\leadsto \log t + \left(-\mathsf{fma}\left(x, -\log y, y + z\right)\right)\]

Reproduce

herbie shell --seed 2019156 +o rules:numerics
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A"
  (+ (- (- (* x (log y)) y) z) (log t)))