Average Error: 0.1 → 0.1
Time: 9.3s
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 r120383 = x;
        double r120384 = y;
        double r120385 = log(r120384);
        double r120386 = r120383 * r120385;
        double r120387 = r120386 - r120384;
        double r120388 = z;
        double r120389 = r120387 - r120388;
        double r120390 = t;
        double r120391 = log(r120390);
        double r120392 = r120389 + r120391;
        return r120392;
}

double f(double x, double y, double z, double t) {
        double r120393 = y;
        double r120394 = log(r120393);
        double r120395 = x;
        double r120396 = t;
        double r120397 = log(r120396);
        double r120398 = z;
        double r120399 = r120393 + r120398;
        double r120400 = r120397 - r120399;
        double r120401 = fma(r120394, r120395, r120400);
        return r120401;
}

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