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 r217350 = wj;
double r217351 = exp(r217350);
double r217352 = r217350 * r217351;
double r217353 = x;
double r217354 = r217352 - r217353;
double r217355 = r217351 + r217352;
double r217356 = r217354 / r217355;
double r217357 = r217350 - r217356;
return r217357;
}
double f(double wj, double x) {
double r217358 = x;
double r217359 = wj;
double r217360 = 1.0;
double r217361 = r217359 + r217360;
double r217362 = r217358 / r217361;
double r217363 = exp(r217359);
double r217364 = r217362 / r217363;
double r217365 = 4.0;
double r217366 = pow(r217359, r217365);
double r217367 = 2.0;
double r217368 = pow(r217359, r217367);
double r217369 = r217366 + r217368;
double r217370 = 3.0;
double r217371 = pow(r217359, r217370);
double r217372 = r217369 - r217371;
double r217373 = r217364 + r217372;
return r217373;
}




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))))))