Average Error: 0.1 → 0.1
Time: 8.8s
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 r139174 = x;
        double r139175 = y;
        double r139176 = log(r139175);
        double r139177 = r139174 * r139176;
        double r139178 = r139177 - r139175;
        double r139179 = z;
        double r139180 = r139178 - r139179;
        double r139181 = t;
        double r139182 = log(r139181);
        double r139183 = r139180 + r139182;
        return r139183;
}

double f(double x, double y, double z, double t) {
        double r139184 = y;
        double r139185 = log(r139184);
        double r139186 = x;
        double r139187 = t;
        double r139188 = log(r139187);
        double r139189 = z;
        double r139190 = r139184 + r139189;
        double r139191 = r139188 - r139190;
        double r139192 = fma(r139185, r139186, r139191);
        return r139192;
}

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