Average Error: 0.1 → 0.1
Time: 28.6s
Precision: 64
\[\left(\left(x \cdot \log y - y\right) - z\right) + \log t\]
\[\mathsf{fma}\left(x, \log y, \log t - \left(y + z\right)\right)\]
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\mathsf{fma}\left(x, \log y, \log t - \left(y + z\right)\right)
double f(double x, double y, double z, double t) {
        double r5821263 = x;
        double r5821264 = y;
        double r5821265 = log(r5821264);
        double r5821266 = r5821263 * r5821265;
        double r5821267 = r5821266 - r5821264;
        double r5821268 = z;
        double r5821269 = r5821267 - r5821268;
        double r5821270 = t;
        double r5821271 = log(r5821270);
        double r5821272 = r5821269 + r5821271;
        return r5821272;
}

double f(double x, double y, double z, double t) {
        double r5821273 = x;
        double r5821274 = y;
        double r5821275 = log(r5821274);
        double r5821276 = t;
        double r5821277 = log(r5821276);
        double r5821278 = z;
        double r5821279 = r5821274 + r5821278;
        double r5821280 = r5821277 - r5821279;
        double r5821281 = fma(r5821273, r5821275, r5821280);
        return r5821281;
}

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 - \left(y + z\right)\right)}\]
  3. Final simplification0.1

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

Reproduce

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