Average Error: 0.1 → 0.1
Time: 13.0s
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 r95511 = x;
        double r95512 = y;
        double r95513 = log(r95512);
        double r95514 = r95511 * r95513;
        double r95515 = r95514 - r95512;
        double r95516 = z;
        double r95517 = r95515 - r95516;
        double r95518 = t;
        double r95519 = log(r95518);
        double r95520 = r95517 + r95519;
        return r95520;
}

double f(double x, double y, double z, double t) {
        double r95521 = y;
        double r95522 = log(r95521);
        double r95523 = x;
        double r95524 = t;
        double r95525 = log(r95524);
        double r95526 = fma(r95522, r95523, r95525);
        double r95527 = z;
        double r95528 = r95521 + r95527;
        double r95529 = r95526 - r95528;
        return r95529;
}

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