Average Error: 0.1 → 0.1
Time: 9.4s
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 r107559 = x;
        double r107560 = y;
        double r107561 = log(r107560);
        double r107562 = r107559 * r107561;
        double r107563 = r107562 - r107560;
        double r107564 = z;
        double r107565 = r107563 - r107564;
        double r107566 = t;
        double r107567 = log(r107566);
        double r107568 = r107565 + r107567;
        return r107568;
}

double f(double x, double y, double z, double t) {
        double r107569 = y;
        double r107570 = log(r107569);
        double r107571 = x;
        double r107572 = t;
        double r107573 = log(r107572);
        double r107574 = z;
        double r107575 = r107569 + r107574;
        double r107576 = r107573 - r107575;
        double r107577 = fma(r107570, r107571, r107576);
        return r107577;
}

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