Average Error: 14.0 → 0.9
Time: 55.9s
Precision: 64
Internal Precision: 128
\[wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\]
\[\left(\left({wj}^{4} - {wj}^{3}\right) + {wj}^{2}\right) + \frac{\frac{x}{e^{wj}}}{1 + wj}\]

Error

Bits error versus wj

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original14.0
Target13.5
Herbie0.9
\[wj - \left(\frac{wj}{wj + 1} - \frac{x}{e^{wj} + wj \cdot e^{wj}}\right)\]

Derivation

  1. Initial program 14.0

    \[wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\]
  2. Initial simplification6.9

    \[\leadsto \left(wj - \frac{wj}{wj + 1}\right) + \frac{\frac{x}{e^{wj}}}{wj + 1}\]
  3. Taylor expanded around 0 0.9

    \[\leadsto \color{blue}{\left(\left({wj}^{2} + {wj}^{4}\right) - {wj}^{3}\right)} + \frac{\frac{x}{e^{wj}}}{wj + 1}\]
  4. Using strategy rm
  5. Applied associate--l+0.9

    \[\leadsto \color{blue}{\left({wj}^{2} + \left({wj}^{4} - {wj}^{3}\right)\right)} + \frac{\frac{x}{e^{wj}}}{wj + 1}\]
  6. Final simplification0.9

    \[\leadsto \left(\left({wj}^{4} - {wj}^{3}\right) + {wj}^{2}\right) + \frac{\frac{x}{e^{wj}}}{1 + wj}\]

Runtime

Time bar (total: 55.9s)Debug logProfile

herbie shell --seed 2018346 
(FPCore (wj x)
  :name "Jmat.Real.lambertw, newton loop step"

  :herbie-target
  (- wj (- (/ wj (+ wj 1)) (/ x (+ (exp wj) (* wj (exp wj))))))

  (- wj (/ (- (* wj (exp wj)) x) (+ (exp wj) (* wj (exp wj))))))