Average Error: 0.1 → 0.1
Time: 5.3s
Precision: 64
\[\left(\left(x \cdot \log y - y\right) - z\right) + \log t\]
\[\left(\mathsf{fma}\left(x, \log y, -y\right) - z\right) + \log t\]
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\left(\mathsf{fma}\left(x, \log y, -y\right) - z\right) + \log t
double f(double x, double y, double z, double t) {
        double r111488 = x;
        double r111489 = y;
        double r111490 = log(r111489);
        double r111491 = r111488 * r111490;
        double r111492 = r111491 - r111489;
        double r111493 = z;
        double r111494 = r111492 - r111493;
        double r111495 = t;
        double r111496 = log(r111495);
        double r111497 = r111494 + r111496;
        return r111497;
}

double f(double x, double y, double z, double t) {
        double r111498 = x;
        double r111499 = y;
        double r111500 = log(r111499);
        double r111501 = -r111499;
        double r111502 = fma(r111498, r111500, r111501);
        double r111503 = z;
        double r111504 = r111502 - r111503;
        double r111505 = t;
        double r111506 = log(r111505);
        double r111507 = r111504 + r111506;
        return r111507;
}

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. Using strategy rm
  3. Applied fma-neg0.1

    \[\leadsto \left(\color{blue}{\mathsf{fma}\left(x, \log y, -y\right)} - z\right) + \log t\]
  4. Final simplification0.1

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

Reproduce

herbie shell --seed 2020018 +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)))