Average Error: 0.1 → 0.1
Time: 20.5s
Precision: 64
\[\left(\left(x \cdot \log y - y\right) - z\right) + \log t\]
\[\mathsf{fma}\left(x, \log y, \log t - z\right) - y\]
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\mathsf{fma}\left(x, \log y, \log t - z\right) - y
double f(double x, double y, double z, double t) {
        double r102479 = x;
        double r102480 = y;
        double r102481 = log(r102480);
        double r102482 = r102479 * r102481;
        double r102483 = r102482 - r102480;
        double r102484 = z;
        double r102485 = r102483 - r102484;
        double r102486 = t;
        double r102487 = log(r102486);
        double r102488 = r102485 + r102487;
        return r102488;
}

double f(double x, double y, double z, double t) {
        double r102489 = x;
        double r102490 = y;
        double r102491 = log(r102490);
        double r102492 = t;
        double r102493 = log(r102492);
        double r102494 = z;
        double r102495 = r102493 - r102494;
        double r102496 = fma(r102489, r102491, r102495);
        double r102497 = r102496 - r102490;
        return r102497;
}

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

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

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