Average Error: 13.6 → 1.2
Time: 1.1m
Precision: 64
Internal Precision: 832
\[wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\]
\[\frac{\frac{x}{e^{wj}}}{1 + wj} + \left({wj}^{4} + \left(\left(wj \cdot wj\right) \cdot \sqrt{1 - wj}\right) \cdot \sqrt{1 - wj}\right)\]

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.6
Target12.9
Herbie1.2
\[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. Using strategy rm
  3. Applied div-sub13.6

    \[\leadsto wj - \color{blue}{\left(\frac{wj \cdot e^{wj}}{e^{wj} + wj \cdot e^{wj}} - \frac{x}{e^{wj} + wj \cdot e^{wj}}\right)}\]
  4. Applied associate--r-7.1

    \[\leadsto \color{blue}{\left(wj - \frac{wj \cdot e^{wj}}{e^{wj} + wj \cdot e^{wj}}\right) + \frac{x}{e^{wj} + wj \cdot e^{wj}}}\]
  5. Applied simplify6.5

    \[\leadsto \color{blue}{\left(wj - \frac{wj}{wj + 1}\right)} + \frac{x}{e^{wj} + wj \cdot e^{wj}}\]
  6. Taylor expanded around 0 1.1

    \[\leadsto \color{blue}{\left(\left({wj}^{2} + {wj}^{4}\right) - {wj}^{3}\right)} + \frac{x}{e^{wj} + wj \cdot e^{wj}}\]
  7. Applied simplify1.1

    \[\leadsto \color{blue}{\frac{\frac{x}{e^{wj}}}{1 + wj} + \left({wj}^{4} + \left(wj \cdot wj\right) \cdot \left(1 - wj\right)\right)}\]
  8. Using strategy rm
  9. Applied add-sqr-sqrt1.2

    \[\leadsto \frac{\frac{x}{e^{wj}}}{1 + wj} + \left({wj}^{4} + \left(wj \cdot wj\right) \cdot \color{blue}{\left(\sqrt{1 - wj} \cdot \sqrt{1 - wj}\right)}\right)\]
  10. Applied associate-*r*1.2

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

Runtime

Time bar (total: 1.1m)Debug logProfile

herbie shell --seed 2019053 
(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))))))