Average Error: 0.1 → 0.1
Time: 30.9s
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 r5389164 = x;
        double r5389165 = y;
        double r5389166 = log(r5389165);
        double r5389167 = r5389164 * r5389166;
        double r5389168 = r5389167 - r5389165;
        double r5389169 = z;
        double r5389170 = r5389168 - r5389169;
        double r5389171 = t;
        double r5389172 = log(r5389171);
        double r5389173 = r5389170 + r5389172;
        return r5389173;
}

double f(double x, double y, double z, double t) {
        double r5389174 = y;
        double r5389175 = log(r5389174);
        double r5389176 = x;
        double r5389177 = t;
        double r5389178 = log(r5389177);
        double r5389179 = fma(r5389175, r5389176, r5389178);
        double r5389180 = z;
        double r5389181 = r5389179 - r5389180;
        double r5389182 = r5389181 - r5389174;
        return r5389182;
}

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