Average Error: 0.1 → 0.1
Time: 28.4s
Precision: 64
\[\left(\left(x \cdot \log y - y\right) - z\right) + \log t\]
\[\mathsf{fma}\left(x, \log y, \log t - \left(y + z\right)\right)\]
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\mathsf{fma}\left(x, \log y, \log t - \left(y + z\right)\right)
double f(double x, double y, double z, double t) {
        double r114648 = x;
        double r114649 = y;
        double r114650 = log(r114649);
        double r114651 = r114648 * r114650;
        double r114652 = r114651 - r114649;
        double r114653 = z;
        double r114654 = r114652 - r114653;
        double r114655 = t;
        double r114656 = log(r114655);
        double r114657 = r114654 + r114656;
        return r114657;
}

double f(double x, double y, double z, double t) {
        double r114658 = x;
        double r114659 = y;
        double r114660 = log(r114659);
        double r114661 = t;
        double r114662 = log(r114661);
        double r114663 = z;
        double r114664 = r114659 + r114663;
        double r114665 = r114662 - r114664;
        double r114666 = fma(r114658, r114660, r114665);
        return r114666;
}

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 - \left(y + z\right)\right)}\]
  3. Final simplification0.1

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

Reproduce

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