wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}wj \cdot \left(wj + x \cdot -2\right) + x
double f(double wj, double x) {
double r60271459 = wj;
double r60271460 = exp(r60271459);
double r60271461 = r60271459 * r60271460;
double r60271462 = x;
double r60271463 = r60271461 - r60271462;
double r60271464 = r60271460 + r60271461;
double r60271465 = r60271463 / r60271464;
double r60271466 = r60271459 - r60271465;
return r60271466;
}
double f(double wj, double x) {
double r60271467 = wj;
double r60271468 = x;
double r60271469 = -2.0;
double r60271470 = r60271468 * r60271469;
double r60271471 = r60271467 + r60271470;
double r60271472 = r60271467 * r60271471;
double r60271473 = r60271472 + r60271468;
return r60271473;
}




Bits error versus wj




Bits error versus x
Results
| Original | 14.1 |
|---|---|
| Target | 13.5 |
| Herbie | 2.3 |
Initial program 14.1
Taylor expanded around 0 2.3
Simplified2.3
Final simplification2.3
herbie shell --seed 2019125
(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))))))