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 r13120694 = wj;
double r13120695 = exp(r13120694);
double r13120696 = r13120694 * r13120695;
double r13120697 = x;
double r13120698 = r13120696 - r13120697;
double r13120699 = r13120695 + r13120696;
double r13120700 = r13120698 / r13120699;
double r13120701 = r13120694 - r13120700;
return r13120701;
}
double f(double wj, double x) {
double r13120702 = x;
double r13120703 = wj;
double r13120704 = r13120703 * r13120703;
double r13120705 = r13120702 + r13120704;
double r13120706 = r13120703 * r13120702;
double r13120707 = -2.0;
double r13120708 = r13120706 * r13120707;
double r13120709 = r13120705 + r13120708;
return r13120709;
}




Bits error versus wj




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