Average Error: 0.1 → 0.1
Time: 19.9s
Precision: 64
\[\left(\left(x \cdot \log y - y\right) - z\right) + \log t\]
\[\mathsf{fma}\left(x, \log y, \log t\right) - \left(z + y\right)\]
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\mathsf{fma}\left(x, \log y, \log t\right) - \left(z + y\right)
double f(double x, double y, double z, double t) {
        double r73883 = x;
        double r73884 = y;
        double r73885 = log(r73884);
        double r73886 = r73883 * r73885;
        double r73887 = r73886 - r73884;
        double r73888 = z;
        double r73889 = r73887 - r73888;
        double r73890 = t;
        double r73891 = log(r73890);
        double r73892 = r73889 + r73891;
        return r73892;
}

double f(double x, double y, double z, double t) {
        double r73893 = x;
        double r73894 = y;
        double r73895 = log(r73894);
        double r73896 = t;
        double r73897 = log(r73896);
        double r73898 = fma(r73893, r73895, r73897);
        double r73899 = z;
        double r73900 = r73899 + r73894;
        double r73901 = r73898 - r73900;
        return r73901;
}

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. Using strategy rm
  4. Applied *-un-lft-identity0.1

    \[\leadsto \mathsf{fma}\left(x, \log y, \log t - z\right) - \color{blue}{1 \cdot y}\]
  5. Applied *-un-lft-identity0.1

    \[\leadsto \color{blue}{1 \cdot \mathsf{fma}\left(x, \log y, \log t - z\right)} - 1 \cdot y\]
  6. Applied distribute-lft-out--0.1

    \[\leadsto \color{blue}{1 \cdot \left(\mathsf{fma}\left(x, \log y, \log t - z\right) - y\right)}\]
  7. Simplified0.1

    \[\leadsto 1 \cdot \color{blue}{\left(\mathsf{fma}\left(x, \log y, \log t\right) - \left(z + y\right)\right)}\]
  8. Using strategy rm
  9. Applied *-un-lft-identity0.1

    \[\leadsto 1 \cdot \color{blue}{\left(1 \cdot \left(\mathsf{fma}\left(x, \log y, \log t\right) - \left(z + y\right)\right)\right)}\]
  10. Final simplification0.1

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

Reproduce

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