wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\left(wj \cdot wj + x\right) - \left(wj + wj\right) \cdot x
double f(double wj, double x) {
double r10928959 = wj;
double r10928960 = exp(r10928959);
double r10928961 = r10928959 * r10928960;
double r10928962 = x;
double r10928963 = r10928961 - r10928962;
double r10928964 = r10928960 + r10928961;
double r10928965 = r10928963 / r10928964;
double r10928966 = r10928959 - r10928965;
return r10928966;
}
double f(double wj, double x) {
double r10928967 = wj;
double r10928968 = r10928967 * r10928967;
double r10928969 = x;
double r10928970 = r10928968 + r10928969;
double r10928971 = r10928967 + r10928967;
double r10928972 = r10928971 * r10928969;
double r10928973 = r10928970 - r10928972;
return r10928973;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.3 |
|---|---|
| Target | 12.7 |
| Herbie | 2.2 |
Initial program 13.3
Taylor expanded around 0 2.2
Simplified2.2
Final simplification2.2
herbie shell --seed 2019158
(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))))))