Average Error: 0.1 → 0.1
Time: 1.2m
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 r7075828 = x;
        double r7075829 = y;
        double r7075830 = log(r7075829);
        double r7075831 = r7075828 * r7075830;
        double r7075832 = r7075831 - r7075829;
        double r7075833 = z;
        double r7075834 = r7075832 - r7075833;
        double r7075835 = t;
        double r7075836 = log(r7075835);
        double r7075837 = r7075834 + r7075836;
        return r7075837;
}

double f(double x, double y, double z, double t) {
        double r7075838 = y;
        double r7075839 = log(r7075838);
        double r7075840 = x;
        double r7075841 = t;
        double r7075842 = log(r7075841);
        double r7075843 = fma(r7075839, r7075840, r7075842);
        double r7075844 = z;
        double r7075845 = r7075843 - r7075844;
        double r7075846 = r7075845 - r7075838;
        return r7075846;
}

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