Average Error: 0.1 → 0.1
Time: 24.0s
Precision: 64
\[\left(\left(x \cdot \log y - y\right) - z\right) + \log t\]
\[\mathsf{fma}\left(x, \log y, \log t - z\right) - y\]
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\mathsf{fma}\left(x, \log y, \log t - z\right) - y
double f(double x, double y, double z, double t) {
        double r85592 = x;
        double r85593 = y;
        double r85594 = log(r85593);
        double r85595 = r85592 * r85594;
        double r85596 = r85595 - r85593;
        double r85597 = z;
        double r85598 = r85596 - r85597;
        double r85599 = t;
        double r85600 = log(r85599);
        double r85601 = r85598 + r85600;
        return r85601;
}

double f(double x, double y, double z, double t) {
        double r85602 = x;
        double r85603 = y;
        double r85604 = log(r85603);
        double r85605 = t;
        double r85606 = log(r85605);
        double r85607 = z;
        double r85608 = r85606 - r85607;
        double r85609 = fma(r85602, r85604, r85608);
        double r85610 = r85609 - r85603;
        return r85610;
}

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. Final simplification0.1

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

Reproduce

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