wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\left(\left(1 - wj\right) + wj \cdot wj\right) \cdot \frac{\frac{x}{e^{wj}}}{1 + {wj}^{3}} - \left({wj}^{3} - \left({wj}^{4} + {wj}^{2}\right)\right)double f(double wj, double x) {
double r472460 = wj;
double r472461 = exp(r472460);
double r472462 = r472460 * r472461;
double r472463 = x;
double r472464 = r472462 - r472463;
double r472465 = r472461 + r472462;
double r472466 = r472464 / r472465;
double r472467 = r472460 - r472466;
return r472467;
}
double f(double wj, double x) {
double r472468 = 1.0;
double r472469 = wj;
double r472470 = r472468 - r472469;
double r472471 = r472469 * r472469;
double r472472 = r472470 + r472471;
double r472473 = x;
double r472474 = exp(r472469);
double r472475 = r472473 / r472474;
double r472476 = 3.0;
double r472477 = pow(r472469, r472476);
double r472478 = r472468 + r472477;
double r472479 = r472475 / r472478;
double r472480 = r472472 * r472479;
double r472481 = 4.0;
double r472482 = pow(r472469, r472481);
double r472483 = 2.0;
double r472484 = pow(r472469, r472483);
double r472485 = r472482 + r472484;
double r472486 = r472477 - r472485;
double r472487 = r472480 - r472486;
return r472487;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.4 |
|---|---|
| Target | 12.8 |
| Herbie | 1.0 |
Initial program 13.4
Simplified12.9
rmApplied div-sub12.8
Applied associate-+l-6.7
Taylor expanded around 0 1.0
rmApplied flip3-+1.0
Applied associate-/r/1.0
Simplified1.0
Final simplification1.0
herbie shell --seed 2020042
(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))))))