Average Error: 0.1 → 0.1
Time: 8.9s
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 r97158 = x;
        double r97159 = y;
        double r97160 = log(r97159);
        double r97161 = r97158 * r97160;
        double r97162 = r97161 - r97159;
        double r97163 = z;
        double r97164 = r97162 - r97163;
        double r97165 = t;
        double r97166 = log(r97165);
        double r97167 = r97164 + r97166;
        return r97167;
}

double f(double x, double y, double z, double t) {
        double r97168 = y;
        double r97169 = log(r97168);
        double r97170 = x;
        double r97171 = t;
        double r97172 = log(r97171);
        double r97173 = z;
        double r97174 = r97168 + r97173;
        double r97175 = r97172 - r97174;
        double r97176 = fma(r97169, r97170, r97175);
        return r97176;
}

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