Average Error: 0.0 → 0.1
Time: 17.4s
Precision: 64
\[e^{\left(x + y \cdot \log y\right) - z}\]
\[{\left(e^{\sqrt[3]{\left(\mathsf{fma}\left(y, \log y, x - z\right) \cdot \mathsf{fma}\left(y, \log y, x - z\right)\right) \cdot \left(27 \cdot \mathsf{fma}\left(y, \log y, x - z\right)\right)}}\right)}^{\frac{1}{3}}\]
e^{\left(x + y \cdot \log y\right) - z}
{\left(e^{\sqrt[3]{\left(\mathsf{fma}\left(y, \log y, x - z\right) \cdot \mathsf{fma}\left(y, \log y, x - z\right)\right) \cdot \left(27 \cdot \mathsf{fma}\left(y, \log y, x - z\right)\right)}}\right)}^{\frac{1}{3}}
double f(double x, double y, double z) {
        double r11976104 = x;
        double r11976105 = y;
        double r11976106 = log(r11976105);
        double r11976107 = r11976105 * r11976106;
        double r11976108 = r11976104 + r11976107;
        double r11976109 = z;
        double r11976110 = r11976108 - r11976109;
        double r11976111 = exp(r11976110);
        return r11976111;
}

double f(double x, double y, double z) {
        double r11976112 = y;
        double r11976113 = log(r11976112);
        double r11976114 = x;
        double r11976115 = z;
        double r11976116 = r11976114 - r11976115;
        double r11976117 = fma(r11976112, r11976113, r11976116);
        double r11976118 = r11976117 * r11976117;
        double r11976119 = 27.0;
        double r11976120 = r11976119 * r11976117;
        double r11976121 = r11976118 * r11976120;
        double r11976122 = cbrt(r11976121);
        double r11976123 = exp(r11976122);
        double r11976124 = 0.3333333333333333;
        double r11976125 = pow(r11976123, r11976124);
        return r11976125;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original0.0
Target0.0
Herbie0.1
\[e^{\left(x - z\right) + \log y \cdot y}\]

Derivation

  1. Initial program 0.0

    \[e^{\left(x + y \cdot \log y\right) - z}\]
  2. Simplified0.0

    \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log y, y, x - z\right)}}\]
  3. Using strategy rm
  4. Applied expm1-log1p-u0.0

    \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(e^{\mathsf{fma}\left(\log y, y, x - z\right)}\right)\right)}\]
  5. Using strategy rm
  6. Applied add-cbrt-cube0.1

    \[\leadsto \color{blue}{\sqrt[3]{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(e^{\mathsf{fma}\left(\log y, y, x - z\right)}\right)\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(e^{\mathsf{fma}\left(\log y, y, x - z\right)}\right)\right)\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(e^{\mathsf{fma}\left(\log y, y, x - z\right)}\right)\right)}}\]
  7. Simplified0.1

    \[\leadsto \sqrt[3]{\color{blue}{e^{3 \cdot \mathsf{fma}\left(\log y, y, x - z\right)}}}\]
  8. Using strategy rm
  9. Applied pow1/30.1

    \[\leadsto \color{blue}{{\left(e^{3 \cdot \mathsf{fma}\left(\log y, y, x - z\right)}\right)}^{\frac{1}{3}}}\]
  10. Using strategy rm
  11. Applied add-cbrt-cube0.1

    \[\leadsto {\left(e^{3 \cdot \color{blue}{\sqrt[3]{\left(\mathsf{fma}\left(\log y, y, x - z\right) \cdot \mathsf{fma}\left(\log y, y, x - z\right)\right) \cdot \mathsf{fma}\left(\log y, y, x - z\right)}}}\right)}^{\frac{1}{3}}\]
  12. Applied add-cbrt-cube0.1

    \[\leadsto {\left(e^{\color{blue}{\sqrt[3]{\left(3 \cdot 3\right) \cdot 3}} \cdot \sqrt[3]{\left(\mathsf{fma}\left(\log y, y, x - z\right) \cdot \mathsf{fma}\left(\log y, y, x - z\right)\right) \cdot \mathsf{fma}\left(\log y, y, x - z\right)}}\right)}^{\frac{1}{3}}\]
  13. Applied cbrt-unprod0.1

    \[\leadsto {\left(e^{\color{blue}{\sqrt[3]{\left(\left(3 \cdot 3\right) \cdot 3\right) \cdot \left(\left(\mathsf{fma}\left(\log y, y, x - z\right) \cdot \mathsf{fma}\left(\log y, y, x - z\right)\right) \cdot \mathsf{fma}\left(\log y, y, x - z\right)\right)}}}\right)}^{\frac{1}{3}}\]
  14. Simplified0.1

    \[\leadsto {\left(e^{\sqrt[3]{\color{blue}{\left(\mathsf{fma}\left(y, \log y, x - z\right) \cdot \mathsf{fma}\left(y, \log y, x - z\right)\right) \cdot \left(27 \cdot \mathsf{fma}\left(y, \log y, x - z\right)\right)}}}\right)}^{\frac{1}{3}}\]
  15. Final simplification0.1

    \[\leadsto {\left(e^{\sqrt[3]{\left(\mathsf{fma}\left(y, \log y, x - z\right) \cdot \mathsf{fma}\left(y, \log y, x - z\right)\right) \cdot \left(27 \cdot \mathsf{fma}\left(y, \log y, x - z\right)\right)}}\right)}^{\frac{1}{3}}\]

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y z)
  :name "Statistics.Distribution.Poisson.Internal:probability from math-functions-0.1.5.2"

  :herbie-target
  (exp (+ (- x z) (* (log y) y)))

  (exp (- (+ x (* y (log y))) z)))