Average Error: 0.1 → 0.1
Time: 9.0s
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 r136848 = x;
        double r136849 = y;
        double r136850 = log(r136849);
        double r136851 = r136848 * r136850;
        double r136852 = r136851 - r136849;
        double r136853 = z;
        double r136854 = r136852 - r136853;
        double r136855 = t;
        double r136856 = log(r136855);
        double r136857 = r136854 + r136856;
        return r136857;
}

double f(double x, double y, double z, double t) {
        double r136858 = y;
        double r136859 = log(r136858);
        double r136860 = x;
        double r136861 = t;
        double r136862 = log(r136861);
        double r136863 = z;
        double r136864 = r136858 + r136863;
        double r136865 = r136862 - r136864;
        double r136866 = fma(r136859, r136860, r136865);
        return r136866;
}

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