Average Error: 0.1 → 0.1
Time: 8.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 r105670 = x;
        double r105671 = y;
        double r105672 = log(r105671);
        double r105673 = r105670 * r105672;
        double r105674 = r105673 - r105671;
        double r105675 = z;
        double r105676 = r105674 - r105675;
        double r105677 = t;
        double r105678 = log(r105677);
        double r105679 = r105676 + r105678;
        return r105679;
}

double f(double x, double y, double z, double t) {
        double r105680 = y;
        double r105681 = log(r105680);
        double r105682 = x;
        double r105683 = t;
        double r105684 = log(r105683);
        double r105685 = z;
        double r105686 = r105680 + r105685;
        double r105687 = r105684 - r105686;
        double r105688 = fma(r105681, r105682, r105687);
        return r105688;
}

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