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 r10745775 = wj;
double r10745776 = exp(r10745775);
double r10745777 = r10745775 * r10745776;
double r10745778 = x;
double r10745779 = r10745777 - r10745778;
double r10745780 = r10745776 + r10745777;
double r10745781 = r10745779 / r10745780;
double r10745782 = r10745775 - r10745781;
return r10745782;
}
double f(double wj, double x) {
double r10745783 = x;
double r10745784 = wj;
double r10745785 = r10745784 * r10745784;
double r10745786 = r10745783 + r10745785;
double r10745787 = r10745784 * r10745783;
double r10745788 = -2.0;
double r10745789 = r10745787 * r10745788;
double r10745790 = r10745786 + r10745789;
return r10745790;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.7 |
|---|---|
| Target | 13.1 |
| Herbie | 2.1 |
Initial program 13.7
Taylor expanded around 0 2.1
Simplified2.1
Final simplification2.1
herbie shell --seed 2019179
(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))))))