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 r209192 = wj;
double r209193 = exp(r209192);
double r209194 = r209192 * r209193;
double r209195 = x;
double r209196 = r209194 - r209195;
double r209197 = r209193 + r209194;
double r209198 = r209196 / r209197;
double r209199 = r209192 - r209198;
return r209199;
}
double f(double wj, double x) {
double r209200 = x;
double r209201 = wj;
double r209202 = 1.0;
double r209203 = r209201 + r209202;
double r209204 = r209200 / r209203;
double r209205 = exp(r209201);
double r209206 = r209204 / r209205;
double r209207 = 4.0;
double r209208 = pow(r209201, r209207);
double r209209 = 2.0;
double r209210 = pow(r209201, r209209);
double r209211 = r209208 + r209210;
double r209212 = 3.0;
double r209213 = pow(r209201, r209212);
double r209214 = r209211 - r209213;
double r209215 = r209206 + r209214;
return r209215;
}




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))))))