Average Error: 0.1 → 0.1
Time: 8.2s
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 r129459 = x;
        double r129460 = y;
        double r129461 = log(r129460);
        double r129462 = r129459 * r129461;
        double r129463 = r129462 - r129460;
        double r129464 = z;
        double r129465 = r129463 - r129464;
        double r129466 = t;
        double r129467 = log(r129466);
        double r129468 = r129465 + r129467;
        return r129468;
}

double f(double x, double y, double z, double t) {
        double r129469 = y;
        double r129470 = log(r129469);
        double r129471 = x;
        double r129472 = t;
        double r129473 = log(r129472);
        double r129474 = z;
        double r129475 = r129469 + r129474;
        double r129476 = r129473 - r129475;
        double r129477 = fma(r129470, r129471, r129476);
        return r129477;
}

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