Average Error: 0.1 → 0.1
Time: 29.0s
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 r4805437 = x;
        double r4805438 = y;
        double r4805439 = log(r4805438);
        double r4805440 = r4805437 * r4805439;
        double r4805441 = r4805440 - r4805438;
        double r4805442 = z;
        double r4805443 = r4805441 - r4805442;
        double r4805444 = t;
        double r4805445 = log(r4805444);
        double r4805446 = r4805443 + r4805445;
        return r4805446;
}

double f(double x, double y, double z, double t) {
        double r4805447 = y;
        double r4805448 = log(r4805447);
        double r4805449 = x;
        double r4805450 = t;
        double r4805451 = log(r4805450);
        double r4805452 = fma(r4805448, r4805449, r4805451);
        double r4805453 = z;
        double r4805454 = r4805452 - r4805453;
        double r4805455 = r4805454 - r4805447;
        return r4805455;
}

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