Average Error: 0.1 → 0.1
Time: 7.8s
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 r136729 = x;
        double r136730 = y;
        double r136731 = log(r136730);
        double r136732 = r136729 * r136731;
        double r136733 = r136732 - r136730;
        double r136734 = z;
        double r136735 = r136733 - r136734;
        double r136736 = t;
        double r136737 = log(r136736);
        double r136738 = r136735 + r136737;
        return r136738;
}

double f(double x, double y, double z, double t) {
        double r136739 = y;
        double r136740 = log(r136739);
        double r136741 = x;
        double r136742 = t;
        double r136743 = log(r136742);
        double r136744 = z;
        double r136745 = r136739 + r136744;
        double r136746 = r136743 - r136745;
        double r136747 = fma(r136740, r136741, r136746);
        return r136747;
}

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