Average Error: 0.1 → 0.1
Time: 7.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 r121541 = x;
        double r121542 = y;
        double r121543 = log(r121542);
        double r121544 = r121541 * r121543;
        double r121545 = r121544 - r121542;
        double r121546 = z;
        double r121547 = r121545 - r121546;
        double r121548 = t;
        double r121549 = log(r121548);
        double r121550 = r121547 + r121549;
        return r121550;
}

double f(double x, double y, double z, double t) {
        double r121551 = y;
        double r121552 = log(r121551);
        double r121553 = x;
        double r121554 = t;
        double r121555 = log(r121554);
        double r121556 = z;
        double r121557 = r121551 + r121556;
        double r121558 = r121555 - r121557;
        double r121559 = fma(r121552, r121553, r121558);
        return r121559;
}

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