Average Error: 0.1 → 0.1
Time: 12.3s
Precision: 64
\[\left(\left(x \cdot \log y - y\right) - z\right) + \log t\]
\[\mathsf{fma}\left(\log y, x, \log t\right) - \left(y + z\right)\]
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\mathsf{fma}\left(\log y, x, \log t\right) - \left(y + z\right)
double f(double x, double y, double z, double t) {
        double r102184 = x;
        double r102185 = y;
        double r102186 = log(r102185);
        double r102187 = r102184 * r102186;
        double r102188 = r102187 - r102185;
        double r102189 = z;
        double r102190 = r102188 - r102189;
        double r102191 = t;
        double r102192 = log(r102191);
        double r102193 = r102190 + r102192;
        return r102193;
}

double f(double x, double y, double z, double t) {
        double r102194 = y;
        double r102195 = log(r102194);
        double r102196 = x;
        double r102197 = t;
        double r102198 = log(r102197);
        double r102199 = fma(r102195, r102196, r102198);
        double r102200 = z;
        double r102201 = r102194 + r102200;
        double r102202 = r102199 - r102201;
        return r102202;
}

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\right) - \left(y + z\right)}\]
  3. Final simplification0.1

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

Reproduce

herbie shell --seed 2020047 +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)))