wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\frac{\frac{x}{wj + 1}}{e^{wj}} + \left(\left({wj}^{4} + {wj}^{2}\right) - {wj}^{3}\right)double f(double wj, double x) {
double r372590 = wj;
double r372591 = exp(r372590);
double r372592 = r372590 * r372591;
double r372593 = x;
double r372594 = r372592 - r372593;
double r372595 = r372591 + r372592;
double r372596 = r372594 / r372595;
double r372597 = r372590 - r372596;
return r372597;
}
double f(double wj, double x) {
double r372598 = x;
double r372599 = wj;
double r372600 = 1.0;
double r372601 = r372599 + r372600;
double r372602 = r372598 / r372601;
double r372603 = exp(r372599);
double r372604 = r372602 / r372603;
double r372605 = 4.0;
double r372606 = pow(r372599, r372605);
double r372607 = 2.0;
double r372608 = pow(r372599, r372607);
double r372609 = r372606 + r372608;
double r372610 = 3.0;
double r372611 = pow(r372599, r372610);
double r372612 = r372609 - r372611;
double r372613 = r372604 + r372612;
return r372613;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.8 |
|---|---|
| Target | 13.2 |
| Herbie | 0.9 |
Initial program 13.8
Simplified13.2
rmApplied associate--l+6.9
Taylor expanded around 0 0.9
Final simplification0.9
herbie shell --seed 2020056
(FPCore (wj x)
:name "Jmat.Real.lambertw, newton loop step"
:precision binary64
:herbie-target
(- wj (- (/ wj (+ wj 1)) (/ x (+ (exp wj) (* wj (exp wj))))))
(- wj (/ (- (* wj (exp wj)) x) (+ (exp wj) (* wj (exp wj))))))