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

Error

Bits error versus wj

Bits error versus x

Target

Original13.6
Target13.0
Herbie2.1
\[wj - \left(\frac{wj}{wj + 1} - \frac{x}{e^{wj} + wj \cdot e^{wj}}\right)\]

Derivation

  1. Initial program 13.6

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

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

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

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

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

Runtime

Time bar (total: 19.1s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes2.12.10.31.80%
herbie shell --seed 2018286 +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))))))