wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\left(wj \cdot wj - x \cdot \left(wj + wj\right)\right) + x
double f(double wj, double x) {
double r11597383 = wj;
double r11597384 = exp(r11597383);
double r11597385 = r11597383 * r11597384;
double r11597386 = x;
double r11597387 = r11597385 - r11597386;
double r11597388 = r11597384 + r11597385;
double r11597389 = r11597387 / r11597388;
double r11597390 = r11597383 - r11597389;
return r11597390;
}
double f(double wj, double x) {
double r11597391 = wj;
double r11597392 = r11597391 * r11597391;
double r11597393 = x;
double r11597394 = r11597391 + r11597391;
double r11597395 = r11597393 * r11597394;
double r11597396 = r11597392 - r11597395;
double r11597397 = r11597396 + r11597393;
return r11597397;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.9 |
|---|---|
| Target | 13.3 |
| Herbie | 2.2 |
Initial program 13.9
Taylor expanded around 0 2.2
Simplified2.2
Final simplification2.2
herbie shell --seed 2019162
(FPCore (wj x)
:name "Jmat.Real.lambertw, newton loop step"
:herbie-target
(- wj (- (/ wj (+ wj 1)) (/ x (+ (exp wj) (* wj (exp wj))))))
(- wj (/ (- (* wj (exp wj)) x) (+ (exp wj) (* wj (exp wj))))))