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 r11937262 = wj;
double r11937263 = exp(r11937262);
double r11937264 = r11937262 * r11937263;
double r11937265 = x;
double r11937266 = r11937264 - r11937265;
double r11937267 = r11937263 + r11937264;
double r11937268 = r11937266 / r11937267;
double r11937269 = r11937262 - r11937268;
return r11937269;
}
double f(double wj, double x) {
double r11937270 = wj;
double r11937271 = x;
double r11937272 = -2.0;
double r11937273 = r11937271 * r11937272;
double r11937274 = r11937270 + r11937273;
double r11937275 = r11937270 * r11937274;
double r11937276 = r11937275 + r11937271;
return r11937276;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.8 |
|---|---|
| Target | 13.2 |
| Herbie | 2.2 |
Initial program 13.8
Taylor expanded around 0 2.1
Simplified2.2
Final simplification2.2
herbie shell --seed 2019135
(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))))))