# HP Forums

Full Version: Lambert W-1 function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a "HP PRIME" calculation program that calculates the lower branch of the Lambert W function: W-1?

see the magenta portion of the graph[attachment=9525]
(06-04-2021 01:36 PM)robmio Wrote: [ -> ]Is there a "HP PRIME" calculation program that calculates the lower branch of the Lambert W function: W-1?

see the magenta portion of the graph

Search on Lambertw in the hp prime software library. That program can return both branch's
Edit: example lmb(-0.1) returns [−3.57715206396,−0.111832559159]
A good guess for e^W(x,-1) is 2*x^2 ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ , where x = [-1/e, 0]

We can setup Newton's method to get e^W(x,-1):

> X := −0.1
> 2*X*X ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → 0.02
> (X+Ans)/(1+LN(Ans)), then Enter, Enter, Enter ...

2.74723104353ᴇ−2
2.79535734165ᴇ−2
2.79551995963ᴇ−2
2.79551996147ᴇ−2 ﻿ ﻿ ﻿ // = e^W(-0.1,-1)

> LN(Ans), or X/Ans
−3.57715206396 ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ // = W(-0.1,-1)

Or, Newton's method straight for W(x,-1), solving f(w) = w + ln(w/x) = 0

> LN(2*X*X) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → −3.91202300543
> LN(e*X/Ans)*Ans/(Ans+1), then Enter, Enter, Enter ...

−3.58237415547
−3.57715353929
−3.57715206396 ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ // = W(-0.1,-1)
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :