wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\left(wj - \frac{wj}{{wj}^{3} + 1}\right) - \left(\left(wj \cdot wj - wj\right) \cdot \frac{wj}{{wj}^{3} + 1} - \frac{x}{\left(1 + wj\right) \cdot e^{wj}}\right)double f(double wj, double x) {
double r237115 = wj;
double r237116 = exp(r237115);
double r237117 = r237115 * r237116;
double r237118 = x;
double r237119 = r237117 - r237118;
double r237120 = r237116 + r237117;
double r237121 = r237119 / r237120;
double r237122 = r237115 - r237121;
return r237122;
}
double f(double wj, double x) {
double r237123 = wj;
double r237124 = 3.0;
double r237125 = pow(r237123, r237124);
double r237126 = 1.0;
double r237127 = r237125 + r237126;
double r237128 = r237123 / r237127;
double r237129 = r237123 - r237128;
double r237130 = r237123 * r237123;
double r237131 = r237130 - r237123;
double r237132 = r237131 * r237128;
double r237133 = x;
double r237134 = r237126 + r237123;
double r237135 = exp(r237123);
double r237136 = r237134 * r237135;
double r237137 = r237133 / r237136;
double r237138 = r237132 - r237137;
double r237139 = r237129 - r237138;
return r237139;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.4 |
|---|---|
| Target | 12.8 |
| Herbie | 0.1 |
Initial program 13.4
Simplified12.8
rmApplied div-sub12.8
Simplified12.8
rmApplied flip3-+12.8
Applied associate-/r/12.8
Simplified12.8
rmApplied distribute-lft-in12.8
Applied associate--l+12.8
Applied associate--r+0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020046 +o rules:numerics
(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))))))