wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\frac{\frac{x}{wj \cdot wj - 1} \cdot \left(wj - 1\right)}{e^{wj}} + \left(\left({wj}^{4} + {wj}^{2}\right) - {wj}^{3}\right)double f(double wj, double x) {
double r198275 = wj;
double r198276 = exp(r198275);
double r198277 = r198275 * r198276;
double r198278 = x;
double r198279 = r198277 - r198278;
double r198280 = r198276 + r198277;
double r198281 = r198279 / r198280;
double r198282 = r198275 - r198281;
return r198282;
}
double f(double wj, double x) {
double r198283 = x;
double r198284 = wj;
double r198285 = r198284 * r198284;
double r198286 = 1.0;
double r198287 = r198285 - r198286;
double r198288 = r198283 / r198287;
double r198289 = r198284 - r198286;
double r198290 = r198288 * r198289;
double r198291 = exp(r198284);
double r198292 = r198290 / r198291;
double r198293 = 4.0;
double r198294 = pow(r198284, r198293);
double r198295 = 2.0;
double r198296 = pow(r198284, r198295);
double r198297 = r198294 + r198296;
double r198298 = 3.0;
double r198299 = pow(r198284, r198298);
double r198300 = r198297 - r198299;
double r198301 = r198292 + r198300;
return r198301;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.4 |
|---|---|
| Target | 12.7 |
| Herbie | 1.2 |
Initial program 13.4
Simplified12.7
rmApplied associate--l+6.9
Taylor expanded around 0 1.2
rmApplied flip-+1.2
Applied associate-/r/1.2
Simplified1.2
Final simplification1.2
herbie shell --seed 2020027
(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))))))