wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\left(\left(1 - wj\right) + wj \cdot wj\right) \cdot \frac{\frac{x}{e^{wj}}}{1 + {wj}^{3}} - \left({wj}^{3} - \left({wj}^{4} + {wj}^{2}\right)\right)double f(double wj, double x) {
double r592105 = wj;
double r592106 = exp(r592105);
double r592107 = r592105 * r592106;
double r592108 = x;
double r592109 = r592107 - r592108;
double r592110 = r592106 + r592107;
double r592111 = r592109 / r592110;
double r592112 = r592105 - r592111;
return r592112;
}
double f(double wj, double x) {
double r592113 = 1.0;
double r592114 = wj;
double r592115 = r592113 - r592114;
double r592116 = r592114 * r592114;
double r592117 = r592115 + r592116;
double r592118 = x;
double r592119 = exp(r592114);
double r592120 = r592118 / r592119;
double r592121 = 3.0;
double r592122 = pow(r592114, r592121);
double r592123 = r592113 + r592122;
double r592124 = r592120 / r592123;
double r592125 = r592117 * r592124;
double r592126 = 4.0;
double r592127 = pow(r592114, r592126);
double r592128 = 2.0;
double r592129 = pow(r592114, r592128);
double r592130 = r592127 + r592129;
double r592131 = r592122 - r592130;
double r592132 = r592125 - r592131;
return r592132;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.4 |
|---|---|
| Target | 12.8 |
| Herbie | 1.0 |
Initial program 13.4
Simplified12.9
rmApplied div-sub12.8
Applied associate-+l-6.7
Taylor expanded around 0 1.0
rmApplied flip3-+1.0
Applied associate-/r/1.0
Simplified1.0
Final simplification1.0
herbie shell --seed 2020042
(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))))))