Average Error: 0.1 → 0.1
Time: 23.0s
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 r58341 = x;
        double r58342 = y;
        double r58343 = log(r58342);
        double r58344 = r58341 * r58343;
        double r58345 = r58344 - r58342;
        double r58346 = z;
        double r58347 = r58345 - r58346;
        double r58348 = t;
        double r58349 = log(r58348);
        double r58350 = r58347 + r58349;
        return r58350;
}

double f(double x, double y, double z, double t) {
        double r58351 = x;
        double r58352 = y;
        double r58353 = log(r58352);
        double r58354 = t;
        double r58355 = log(r58354);
        double r58356 = z;
        double r58357 = r58355 - r58356;
        double r58358 = fma(r58351, r58353, r58357);
        double r58359 = r58358 - r58352;
        return r58359;
}

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