Average Error: 0.1 → 0.1
Time: 9.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 r120548 = x;
        double r120549 = y;
        double r120550 = log(r120549);
        double r120551 = r120548 * r120550;
        double r120552 = r120551 - r120549;
        double r120553 = z;
        double r120554 = r120552 - r120553;
        double r120555 = t;
        double r120556 = log(r120555);
        double r120557 = r120554 + r120556;
        return r120557;
}

double f(double x, double y, double z, double t) {
        double r120558 = y;
        double r120559 = log(r120558);
        double r120560 = x;
        double r120561 = t;
        double r120562 = log(r120561);
        double r120563 = z;
        double r120564 = r120558 + r120563;
        double r120565 = r120562 - r120564;
        double r120566 = fma(r120559, r120560, r120565);
        return r120566;
}

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