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 r356496 = wj;
double r356497 = exp(r356496);
double r356498 = r356496 * r356497;
double r356499 = x;
double r356500 = r356498 - r356499;
double r356501 = r356497 + r356498;
double r356502 = r356500 / r356501;
double r356503 = r356496 - r356502;
return r356503;
}
double f(double wj, double x) {
double r356504 = x;
double r356505 = wj;
double r356506 = 2.0;
double r356507 = pow(r356505, r356506);
double r356508 = r356504 + r356507;
double r356509 = r356505 * r356504;
double r356510 = r356506 * r356509;
double r356511 = r356508 - r356510;
return r356511;
}




Bits error versus wj




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