Average Error: 0.1 → 0.1
Time: 9.2s
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 r112490 = x;
        double r112491 = y;
        double r112492 = log(r112491);
        double r112493 = r112490 * r112492;
        double r112494 = r112493 - r112491;
        double r112495 = z;
        double r112496 = r112494 - r112495;
        double r112497 = t;
        double r112498 = log(r112497);
        double r112499 = r112496 + r112498;
        return r112499;
}

double f(double x, double y, double z, double t) {
        double r112500 = y;
        double r112501 = log(r112500);
        double r112502 = x;
        double r112503 = t;
        double r112504 = log(r112503);
        double r112505 = z;
        double r112506 = r112500 + r112505;
        double r112507 = r112504 - r112506;
        double r112508 = fma(r112501, r112502, r112507);
        return r112508;
}

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