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 r416758 = wj;
double r416759 = exp(r416758);
double r416760 = r416758 * r416759;
double r416761 = x;
double r416762 = r416760 - r416761;
double r416763 = r416759 + r416760;
double r416764 = r416762 / r416763;
double r416765 = r416758 - r416764;
return r416765;
}
double f(double wj, double x) {
double r416766 = x;
double r416767 = wj;
double r416768 = 1.0;
double r416769 = r416767 + r416768;
double r416770 = r416766 / r416769;
double r416771 = exp(r416767);
double r416772 = r416770 / r416771;
double r416773 = 4.0;
double r416774 = pow(r416767, r416773);
double r416775 = 2.0;
double r416776 = pow(r416767, r416775);
double r416777 = r416774 + r416776;
double r416778 = 3.0;
double r416779 = pow(r416767, r416778);
double r416780 = r416777 - r416779;
double r416781 = r416772 + r416780;
return r416781;
}




Bits error versus wj




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