wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\left(x + {wj}^{2}\right) - 2 \cdot \left(wj \cdot x\right)double f(double wj, double x) {
double r187811 = wj;
double r187812 = exp(r187811);
double r187813 = r187811 * r187812;
double r187814 = x;
double r187815 = r187813 - r187814;
double r187816 = r187812 + r187813;
double r187817 = r187815 / r187816;
double r187818 = r187811 - r187817;
return r187818;
}
double f(double wj, double x) {
double r187819 = x;
double r187820 = wj;
double r187821 = 2.0;
double r187822 = pow(r187820, r187821);
double r187823 = r187819 + r187822;
double r187824 = r187820 * r187819;
double r187825 = r187821 * r187824;
double r187826 = r187823 - r187825;
return r187826;
}




Bits error versus wj




Bits error versus x
Results
| Original | 14.3 |
|---|---|
| Target | 13.6 |
| Herbie | 2.2 |
Initial program 14.3
Simplified13.6
Taylor expanded around 0 2.2
Final simplification2.2
herbie shell --seed 2020036
(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))))))