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 r128839 = x;
        double r128840 = y;
        double r128841 = log(r128840);
        double r128842 = r128839 * r128841;
        double r128843 = r128842 - r128840;
        double r128844 = z;
        double r128845 = r128843 - r128844;
        double r128846 = t;
        double r128847 = log(r128846);
        double r128848 = r128845 + r128847;
        return r128848;
}

double f(double x, double y, double z, double t) {
        double r128849 = y;
        double r128850 = log(r128849);
        double r128851 = x;
        double r128852 = t;
        double r128853 = log(r128852);
        double r128854 = z;
        double r128855 = r128849 + r128854;
        double r128856 = r128853 - r128855;
        double r128857 = fma(r128850, r128851, r128856);
        return r128857;
}

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