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 r10214302 = wj;
double r10214303 = exp(r10214302);
double r10214304 = r10214302 * r10214303;
double r10214305 = x;
double r10214306 = r10214304 - r10214305;
double r10214307 = r10214303 + r10214304;
double r10214308 = r10214306 / r10214307;
double r10214309 = r10214302 - r10214308;
return r10214309;
}
double f(double wj, double x) {
double r10214310 = x;
double r10214311 = wj;
double r10214312 = r10214311 * r10214311;
double r10214313 = r10214310 + r10214312;
double r10214314 = r10214311 * r10214310;
double r10214315 = -2.0;
double r10214316 = r10214314 * r10214315;
double r10214317 = r10214313 + r10214316;
return r10214317;
}




Bits error versus wj




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