Average Error: 13.7 → 1.9
Time: 28.4s
Precision: 64
Internal Precision: 832
\[wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\]
\[(\left(-2\right) \cdot \left(x \cdot wj\right) + \left((wj \cdot wj + x)_*\right))_*\]

Error

Bits error versus wj

Bits error versus x

Target

Original13.7
Target13.2
Herbie1.9
\[wj - \left(\frac{wj}{wj + 1} - \frac{x}{e^{wj} + wj \cdot e^{wj}}\right)\]

Derivation

  1. Initial program 13.7

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

    \[\leadsto \frac{(\left(e^{wj}\right) \cdot \left(-wj\right) + x)_*}{(\left(e^{wj}\right) \cdot wj + \left(e^{wj}\right))_*} + wj\]
  3. Taylor expanded around 0 1.9

    \[\leadsto \color{blue}{\left({wj}^{2} + x\right) - 2 \cdot \left(x \cdot wj\right)}\]
  4. Simplified1.9

    \[\leadsto \color{blue}{(\left(-2\right) \cdot \left(x \cdot wj\right) + \left((wj \cdot wj + x)_*\right))_*}\]
  5. Final simplification1.9

    \[\leadsto (\left(-2\right) \cdot \left(x \cdot wj\right) + \left((wj \cdot wj + x)_*\right))_*\]

Runtime

Time bar (total: 28.4s)Debug logProfile

herbie shell --seed 2018220 +o rules:numerics
(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))))))