Average Error: 0.1 → 0.1
Time: 20.3s
Precision: 64
\[\left(x \cdot \log y - z\right) - y\]
\[\mathsf{fma}\left(\log \left(\sqrt{y}\right), x, \left(\log \left(\sqrt{y}\right) \cdot x - z\right) - y\right)\]
\left(x \cdot \log y - z\right) - y
\mathsf{fma}\left(\log \left(\sqrt{y}\right), x, \left(\log \left(\sqrt{y}\right) \cdot x - z\right) - y\right)
double f(double x, double y, double z) {
        double r1173488 = x;
        double r1173489 = y;
        double r1173490 = log(r1173489);
        double r1173491 = r1173488 * r1173490;
        double r1173492 = z;
        double r1173493 = r1173491 - r1173492;
        double r1173494 = r1173493 - r1173489;
        return r1173494;
}

double f(double x, double y, double z) {
        double r1173495 = y;
        double r1173496 = sqrt(r1173495);
        double r1173497 = log(r1173496);
        double r1173498 = x;
        double r1173499 = r1173497 * r1173498;
        double r1173500 = z;
        double r1173501 = r1173499 - r1173500;
        double r1173502 = r1173501 - r1173495;
        double r1173503 = fma(r1173497, r1173498, r1173502);
        return r1173503;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Initial program 0.1

    \[\left(x \cdot \log y - z\right) - y\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt0.1

    \[\leadsto \left(x \cdot \log \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} - z\right) - y\]
  4. Applied log-prod0.1

    \[\leadsto \left(x \cdot \color{blue}{\left(\log \left(\sqrt{y}\right) + \log \left(\sqrt{y}\right)\right)} - z\right) - y\]
  5. Applied distribute-rgt-in0.1

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

    \[\leadsto \color{blue}{\left(\log \left(\sqrt{y}\right) \cdot x + \left(\log \left(\sqrt{y}\right) \cdot x - z\right)\right)} - y\]
  7. Applied associate--l+0.1

    \[\leadsto \color{blue}{\log \left(\sqrt{y}\right) \cdot x + \left(\left(\log \left(\sqrt{y}\right) \cdot x - z\right) - y\right)}\]
  8. Using strategy rm
  9. Applied fma-def0.1

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

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

Reproduce

herbie shell --seed 2019162 +o rules:numerics
(FPCore (x y z)
  :name "Statistics.Distribution.Poisson:$clogProbability from math-functions-0.1.5.2"
  (- (- (* x (log y)) z) y))