Average Error: 0.1 → 0.1
Time: 8.0s
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 r107726 = x;
        double r107727 = y;
        double r107728 = log(r107727);
        double r107729 = r107726 * r107728;
        double r107730 = r107729 - r107727;
        double r107731 = z;
        double r107732 = r107730 - r107731;
        double r107733 = t;
        double r107734 = log(r107733);
        double r107735 = r107732 + r107734;
        return r107735;
}

double f(double x, double y, double z, double t) {
        double r107736 = y;
        double r107737 = log(r107736);
        double r107738 = x;
        double r107739 = t;
        double r107740 = log(r107739);
        double r107741 = z;
        double r107742 = r107736 + r107741;
        double r107743 = r107740 - r107742;
        double r107744 = fma(r107737, r107738, r107743);
        return r107744;
}

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