Average Error: 0.1 → 0.1
Time: 34.9s
Precision: 64
\[\left(\left(x \cdot \log y - y\right) - z\right) + \log t\]
\[\left(\mathsf{fma}\left(\log y, x, \log t\right) - z\right) - y\]
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\left(\mathsf{fma}\left(\log y, x, \log t\right) - z\right) - y
double f(double x, double y, double z, double t) {
        double r5808957 = x;
        double r5808958 = y;
        double r5808959 = log(r5808958);
        double r5808960 = r5808957 * r5808959;
        double r5808961 = r5808960 - r5808958;
        double r5808962 = z;
        double r5808963 = r5808961 - r5808962;
        double r5808964 = t;
        double r5808965 = log(r5808964);
        double r5808966 = r5808963 + r5808965;
        return r5808966;
}

double f(double x, double y, double z, double t) {
        double r5808967 = y;
        double r5808968 = log(r5808967);
        double r5808969 = x;
        double r5808970 = t;
        double r5808971 = log(r5808970);
        double r5808972 = fma(r5808968, r5808969, r5808971);
        double r5808973 = z;
        double r5808974 = r5808972 - r5808973;
        double r5808975 = r5808974 - r5808967;
        return r5808975;
}

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}{\left(\mathsf{fma}\left(\log y, x, \log t\right) - z\right) - y}\]
  3. Final simplification0.1

    \[\leadsto \left(\mathsf{fma}\left(\log y, x, \log t\right) - z\right) - y\]

Reproduce

herbie shell --seed 2019164 +o rules:numerics
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A"
  (+ (- (- (* x (log y)) y) z) (log t)))