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 r241365 = wj;
double r241366 = exp(r241365);
double r241367 = r241365 * r241366;
double r241368 = x;
double r241369 = r241367 - r241368;
double r241370 = r241366 + r241367;
double r241371 = r241369 / r241370;
double r241372 = r241365 - r241371;
return r241372;
}
double f(double wj, double x) {
double r241373 = x;
double r241374 = wj;
double r241375 = 1.0;
double r241376 = r241374 + r241375;
double r241377 = r241373 / r241376;
double r241378 = exp(r241374);
double r241379 = r241377 / r241378;
double r241380 = 4.0;
double r241381 = pow(r241374, r241380);
double r241382 = 2.0;
double r241383 = pow(r241374, r241382);
double r241384 = r241381 + r241383;
double r241385 = 3.0;
double r241386 = pow(r241374, r241385);
double r241387 = r241384 - r241386;
double r241388 = r241379 + r241387;
return r241388;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.6 |
|---|---|
| Target | 13.0 |
| Herbie | 1.1 |
Initial program 13.6
Simplified13.0
rmApplied associate--l+6.9
Taylor expanded around 0 1.1
Final simplification1.1
herbie shell --seed 2020057
(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))))))