wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\left(x + wj \cdot wj\right) + \left(wj \cdot x\right) \cdot -2
double f(double wj, double x) {
double r9392373 = wj;
double r9392374 = exp(r9392373);
double r9392375 = r9392373 * r9392374;
double r9392376 = x;
double r9392377 = r9392375 - r9392376;
double r9392378 = r9392374 + r9392375;
double r9392379 = r9392377 / r9392378;
double r9392380 = r9392373 - r9392379;
return r9392380;
}
double f(double wj, double x) {
double r9392381 = x;
double r9392382 = wj;
double r9392383 = r9392382 * r9392382;
double r9392384 = r9392381 + r9392383;
double r9392385 = r9392382 * r9392381;
double r9392386 = -2.0;
double r9392387 = r9392385 * r9392386;
double r9392388 = r9392384 + r9392387;
return r9392388;
}




Bits error versus wj




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