Average Error: 0.1 → 0.1
Time: 56.8s
Precision: 64
\[\left(\left(x \cdot \log y - y\right) - z\right) + \log t\]
\[\left(\mathsf{fma}\left(\log y, x, \log t\right) - z\right) - y\]
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\left(\mathsf{fma}\left(\log y, x, \log t\right) - z\right) - y
double f(double x, double y, double z, double t) {
        double r10002466 = x;
        double r10002467 = y;
        double r10002468 = log(r10002467);
        double r10002469 = r10002466 * r10002468;
        double r10002470 = r10002469 - r10002467;
        double r10002471 = z;
        double r10002472 = r10002470 - r10002471;
        double r10002473 = t;
        double r10002474 = log(r10002473);
        double r10002475 = r10002472 + r10002474;
        return r10002475;
}

double f(double x, double y, double z, double t) {
        double r10002476 = y;
        double r10002477 = log(r10002476);
        double r10002478 = x;
        double r10002479 = t;
        double r10002480 = log(r10002479);
        double r10002481 = fma(r10002477, r10002478, r10002480);
        double r10002482 = z;
        double r10002483 = r10002481 - r10002482;
        double r10002484 = r10002483 - r10002476;
        return r10002484;
}

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

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

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(FPCore (x y z t)
  :name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A"
  (+ (- (- (* x (log y)) y) z) (log t)))