x \cdot 0.5 + y \cdot \left(\left(1.0 - z\right) + \log z\right)
\mathsf{fma}\left(x, 0.5, y \cdot \left(1.0 - z\right) + \left(\left(y + y\right) \cdot \log \left(\sqrt[3]{z}\right) + \log \left(\sqrt[3]{z}\right) \cdot y\right)\right)double f(double x, double y, double z) {
double r10505645 = x;
double r10505646 = 0.5;
double r10505647 = r10505645 * r10505646;
double r10505648 = y;
double r10505649 = 1.0;
double r10505650 = z;
double r10505651 = r10505649 - r10505650;
double r10505652 = log(r10505650);
double r10505653 = r10505651 + r10505652;
double r10505654 = r10505648 * r10505653;
double r10505655 = r10505647 + r10505654;
return r10505655;
}
double f(double x, double y, double z) {
double r10505656 = x;
double r10505657 = 0.5;
double r10505658 = y;
double r10505659 = 1.0;
double r10505660 = z;
double r10505661 = r10505659 - r10505660;
double r10505662 = r10505658 * r10505661;
double r10505663 = r10505658 + r10505658;
double r10505664 = cbrt(r10505660);
double r10505665 = log(r10505664);
double r10505666 = r10505663 * r10505665;
double r10505667 = r10505665 * r10505658;
double r10505668 = r10505666 + r10505667;
double r10505669 = r10505662 + r10505668;
double r10505670 = fma(r10505656, r10505657, r10505669);
return r10505670;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 0.1
Simplified0.1
rmApplied add-cube-cbrt0.1
Applied log-prod0.1
Applied associate--r+0.1
Simplified0.1
Taylor expanded around 0 0.2
Simplified0.1
rmApplied distribute-lft-in0.1
rmApplied add-cube-cbrt0.1
Applied log-prod0.1
Applied distribute-lft-in0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019168 +o rules:numerics
(FPCore (x y z)
:name "System.Random.MWC.Distributions:gamma from mwc-random-0.13.3.2"
:herbie-target
(- (+ y (* 0.5 x)) (* y (- z (log z))))
(+ (* x 0.5) (* y (+ (- 1.0 z) (log z)))))