Average Error: 0.1 → 0.1
Time: 9.5s
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 r148360 = x;
        double r148361 = y;
        double r148362 = log(r148361);
        double r148363 = r148360 * r148362;
        double r148364 = r148363 - r148361;
        double r148365 = z;
        double r148366 = r148364 - r148365;
        double r148367 = t;
        double r148368 = log(r148367);
        double r148369 = r148366 + r148368;
        return r148369;
}

double f(double x, double y, double z, double t) {
        double r148370 = y;
        double r148371 = log(r148370);
        double r148372 = x;
        double r148373 = t;
        double r148374 = log(r148373);
        double r148375 = z;
        double r148376 = r148370 + r148375;
        double r148377 = r148374 - r148376;
        double r148378 = fma(r148371, r148372, r148377);
        return r148378;
}

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