Average Error: 0.1 → 0.1
Time: 20.1s
Precision: 64
\[\left(\left(x \cdot \log y - y\right) - z\right) + \log t\]
\[\mathsf{fma}\left(x, \log y, \log \left(\sqrt{t}\right) + \left(\log \left(\sqrt{t}\right) - z\right)\right) - y\]
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\mathsf{fma}\left(x, \log y, \log \left(\sqrt{t}\right) + \left(\log \left(\sqrt{t}\right) - z\right)\right) - y
double f(double x, double y, double z, double t) {
        double r173263 = x;
        double r173264 = y;
        double r173265 = log(r173264);
        double r173266 = r173263 * r173265;
        double r173267 = r173266 - r173264;
        double r173268 = z;
        double r173269 = r173267 - r173268;
        double r173270 = t;
        double r173271 = log(r173270);
        double r173272 = r173269 + r173271;
        return r173272;
}

double f(double x, double y, double z, double t) {
        double r173273 = x;
        double r173274 = y;
        double r173275 = log(r173274);
        double r173276 = t;
        double r173277 = sqrt(r173276);
        double r173278 = log(r173277);
        double r173279 = z;
        double r173280 = r173278 - r173279;
        double r173281 = r173278 + r173280;
        double r173282 = fma(r173273, r173275, r173281);
        double r173283 = r173282 - r173274;
        return r173283;
}

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. Using strategy rm
  4. Applied add-sqr-sqrt0.1

    \[\leadsto \mathsf{fma}\left(x, \log y, \log \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} - z\right) - y\]
  5. Applied log-prod0.1

    \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{\left(\log \left(\sqrt{t}\right) + \log \left(\sqrt{t}\right)\right)} - z\right) - y\]
  6. Applied associate--l+0.1

    \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{\log \left(\sqrt{t}\right) + \left(\log \left(\sqrt{t}\right) - z\right)}\right) - y\]
  7. Final simplification0.1

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

Reproduce

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