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 r7184621 = x;
        double r7184622 = y;
        double r7184623 = log(r7184622);
        double r7184624 = r7184621 * r7184623;
        double r7184625 = r7184624 - r7184622;
        double r7184626 = z;
        double r7184627 = r7184625 - r7184626;
        double r7184628 = t;
        double r7184629 = log(r7184628);
        double r7184630 = r7184627 + r7184629;
        return r7184630;
}

double f(double x, double y, double z, double t) {
        double r7184631 = y;
        double r7184632 = log(r7184631);
        double r7184633 = x;
        double r7184634 = t;
        double r7184635 = log(r7184634);
        double r7184636 = fma(r7184632, r7184633, r7184635);
        double r7184637 = z;
        double r7184638 = r7184636 - r7184637;
        double r7184639 = r7184638 - r7184631;
        return r7184639;
}

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