wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\frac{\frac{x}{e^{wj}}}{wj + 1} - \left({wj}^{3} - \left({wj}^{4} + {wj}^{2}\right)\right)double f(double wj, double x) {
double r247415 = wj;
double r247416 = exp(r247415);
double r247417 = r247415 * r247416;
double r247418 = x;
double r247419 = r247417 - r247418;
double r247420 = r247416 + r247417;
double r247421 = r247419 / r247420;
double r247422 = r247415 - r247421;
return r247422;
}
double f(double wj, double x) {
double r247423 = x;
double r247424 = wj;
double r247425 = exp(r247424);
double r247426 = r247423 / r247425;
double r247427 = 1.0;
double r247428 = r247424 + r247427;
double r247429 = r247426 / r247428;
double r247430 = 3.0;
double r247431 = pow(r247424, r247430);
double r247432 = 4.0;
double r247433 = pow(r247424, r247432);
double r247434 = 2.0;
double r247435 = pow(r247424, r247434);
double r247436 = r247433 + r247435;
double r247437 = r247431 - r247436;
double r247438 = r247429 - r247437;
return r247438;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.8 |
|---|---|
| Target | 13.3 |
| Herbie | 1.0 |
Initial program 13.8
Simplified13.3
rmApplied div-sub13.3
Applied associate-+l-6.9
Taylor expanded around 0 1.0
Final simplification1.0
herbie shell --seed 2020047
(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))))))