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 r150434 = wj;
double r150435 = exp(r150434);
double r150436 = r150434 * r150435;
double r150437 = x;
double r150438 = r150436 - r150437;
double r150439 = r150435 + r150436;
double r150440 = r150438 / r150439;
double r150441 = r150434 - r150440;
return r150441;
}
double f(double wj, double x) {
double r150442 = x;
double r150443 = wj;
double r150444 = 2.0;
double r150445 = pow(r150443, r150444);
double r150446 = r150442 + r150445;
double r150447 = r150443 * r150442;
double r150448 = r150444 * r150447;
double r150449 = r150446 - r150448;
return r150449;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.7 |
|---|---|
| Target | 13.2 |
| Herbie | 2.0 |
Initial program 13.7
Simplified13.2
Taylor expanded around 0 2.0
Final simplification2.0
herbie shell --seed 2020033 +o rules:numerics
(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))))))