Average Error: 0.1 → 0.1
Time: 25.5s
Precision: 64
\[\left(\left(x \cdot \log y - y\right) - z\right) + \log t\]
\[\mathsf{fma}\left(x, \log y, \log t - z\right) - y\]
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\mathsf{fma}\left(x, \log y, \log t - z\right) - y
double f(double x, double y, double z, double t) {
        double r69857 = x;
        double r69858 = y;
        double r69859 = log(r69858);
        double r69860 = r69857 * r69859;
        double r69861 = r69860 - r69858;
        double r69862 = z;
        double r69863 = r69861 - r69862;
        double r69864 = t;
        double r69865 = log(r69864);
        double r69866 = r69863 + r69865;
        return r69866;
}

double f(double x, double y, double z, double t) {
        double r69867 = x;
        double r69868 = y;
        double r69869 = log(r69868);
        double r69870 = t;
        double r69871 = log(r69870);
        double r69872 = z;
        double r69873 = r69871 - r69872;
        double r69874 = fma(r69867, r69869, r69873);
        double r69875 = r69874 - r69868;
        return r69875;
}

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

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

Reproduce

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