wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\frac{\frac{x}{wj + 1}}{e^{wj}} + \left(\left({wj}^{4} + {wj}^{2}\right) - {wj}^{3}\right)double f(double wj, double x) {
double r266133 = wj;
double r266134 = exp(r266133);
double r266135 = r266133 * r266134;
double r266136 = x;
double r266137 = r266135 - r266136;
double r266138 = r266134 + r266135;
double r266139 = r266137 / r266138;
double r266140 = r266133 - r266139;
return r266140;
}
double f(double wj, double x) {
double r266141 = x;
double r266142 = wj;
double r266143 = 1.0;
double r266144 = r266142 + r266143;
double r266145 = r266141 / r266144;
double r266146 = exp(r266142);
double r266147 = r266145 / r266146;
double r266148 = 4.0;
double r266149 = pow(r266142, r266148);
double r266150 = 2.0;
double r266151 = pow(r266142, r266150);
double r266152 = r266149 + r266151;
double r266153 = 3.0;
double r266154 = pow(r266142, r266153);
double r266155 = r266152 - r266154;
double r266156 = r266147 + r266155;
return r266156;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.5 |
|---|---|
| Target | 12.8 |
| Herbie | 1.1 |
Initial program 13.5
Simplified12.8
rmApplied associate--l+6.6
Taylor expanded around 0 1.1
Final simplification1.1
herbie shell --seed 2020060
(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))))))