Average Error: 0.1 → 0.1
Time: 10.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 r472 = x;
        double r473 = y;
        double r474 = log(r473);
        double r475 = r472 * r474;
        double r476 = r475 - r473;
        double r477 = z;
        double r478 = r476 - r477;
        double r479 = t;
        double r480 = log(r479);
        double r481 = r478 + r480;
        return r481;
}

double f(double x, double y, double z, double t) {
        double r482 = y;
        double r483 = log(r482);
        double r484 = x;
        double r485 = t;
        double r486 = log(r485);
        double r487 = z;
        double r488 = r482 + r487;
        double r489 = r486 - r488;
        double r490 = fma(r483, r484, r489);
        return r490;
}

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