Average Error: 0.1 → 0.1
Time: 8.8s
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 r112115 = x;
        double r112116 = y;
        double r112117 = log(r112116);
        double r112118 = r112115 * r112117;
        double r112119 = r112118 - r112116;
        double r112120 = z;
        double r112121 = r112119 - r112120;
        double r112122 = t;
        double r112123 = log(r112122);
        double r112124 = r112121 + r112123;
        return r112124;
}

double f(double x, double y, double z, double t) {
        double r112125 = y;
        double r112126 = log(r112125);
        double r112127 = x;
        double r112128 = t;
        double r112129 = log(r112128);
        double r112130 = z;
        double r112131 = r112125 + r112130;
        double r112132 = r112129 - r112131;
        double r112133 = fma(r112126, r112127, r112132);
        return r112133;
}

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