Average Error: 0.1 → 0.1
Time: 36.2s
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 r11117805 = x;
        double r11117806 = y;
        double r11117807 = log(r11117806);
        double r11117808 = r11117805 * r11117807;
        double r11117809 = r11117808 - r11117806;
        double r11117810 = z;
        double r11117811 = r11117809 - r11117810;
        double r11117812 = t;
        double r11117813 = log(r11117812);
        double r11117814 = r11117811 + r11117813;
        return r11117814;
}

double f(double x, double y, double z, double t) {
        double r11117815 = y;
        double r11117816 = log(r11117815);
        double r11117817 = x;
        double r11117818 = t;
        double r11117819 = log(r11117818);
        double r11117820 = fma(r11117816, r11117817, r11117819);
        double r11117821 = z;
        double r11117822 = r11117820 - r11117821;
        double r11117823 = r11117822 - r11117815;
        return r11117823;
}

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