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 r11316892 = wj;
double r11316893 = exp(r11316892);
double r11316894 = r11316892 * r11316893;
double r11316895 = x;
double r11316896 = r11316894 - r11316895;
double r11316897 = r11316893 + r11316894;
double r11316898 = r11316896 / r11316897;
double r11316899 = r11316892 - r11316898;
return r11316899;
}
double f(double wj, double x) {
double r11316900 = wj;
double r11316901 = r11316900 * r11316900;
double r11316902 = x;
double r11316903 = r11316900 + r11316900;
double r11316904 = r11316902 * r11316903;
double r11316905 = r11316901 - r11316904;
double r11316906 = r11316905 + r11316902;
return r11316906;
}




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