Average Error: 13.5 → 1.0
Time: 20.8s
Precision: 64
Internal Precision: 832
\[wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\]
\[\left(\left({wj}^{2} + {wj}^{4}\right) - {wj}^{3}\right) + \frac{x}{\left(wj + 1\right) \cdot e^{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

Original13.5
Target12.9
Herbie1.0
\[wj - \left(\frac{wj}{wj + 1} - \frac{x}{e^{wj} + wj \cdot e^{wj}}\right)\]

Derivation

  1. Initial program 13.5

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

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

    \[\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/1.0

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

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

Runtime

Time bar (total: 20.8s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes1.01.00.11.00%
herbie shell --seed 2018295 
(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))))))