Average Error: 0.1 → 0.1
Time: 4.8s
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 r103855 = x;
        double r103856 = y;
        double r103857 = log(r103856);
        double r103858 = r103855 * r103857;
        double r103859 = r103858 - r103856;
        double r103860 = z;
        double r103861 = r103859 - r103860;
        double r103862 = t;
        double r103863 = log(r103862);
        double r103864 = r103861 + r103863;
        return r103864;
}

double f(double x, double y, double z, double t) {
        double r103865 = y;
        double r103866 = log(r103865);
        double r103867 = x;
        double r103868 = t;
        double r103869 = log(r103868);
        double r103870 = z;
        double r103871 = r103865 + r103870;
        double r103872 = r103869 - r103871;
        double r103873 = fma(r103866, r103867, r103872);
        return r103873;
}

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