Cody

Problem 42848. Lambert's W

Solution 2667299

Submitted on 8 Jul 2020 by Ramesh Kumar V
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
A = 1; x = LambertW(A); A_correct = x*exp(x); assert(abs(A_correct/A-1)<1e-5)

x0 = 1 x = 0.6839 e = -0.3161 x0 = 0.6839 x = 0.5775 e = -0.1557 x0 = 0.5775 x = 0.5672 e = -0.0177 x0 = 0.5672 x = 0.5671 e = -1.5239e-04 x0 = 0.5671 x = 0.5671 e = -1.0792e-08 x0 = 0.5671 x = 0.5671 e = -1.9576e-16 y = 0.5671

2   Pass
A = 6.8; x = LambertW(A); A_correct = x*exp(x); assert(abs(A_correct/A-1)<1e-5)

x0 = 1 x = 1.7508 e = 0.7508 x0 = 1.7508 x = 1.5436 e = -0.1184 x0 = 1.5436 x = 1.5078 e = -0.0232 x0 = 1.5078 x = 1.5069 e = -6.1133e-04 x0 = 1.5069 x = 1.5069 e = -3.9470e-07 x0 = 1.5069 x = 1.5069 e = -1.6430e-13 y = 1.5069

3   Pass
A = 14; x = LambertW(A); A_correct = x*exp(x); assert(abs(A_correct/A-1)<1e-5)

x0 = 1 x = 3.0752 e = 2.0752 x0 = 3.0752 x = 2.4792 e = -0.1938 x0 = 2.4792 x = 2.1039 e = -0.1514 x0 = 2.1039 x = 1.9763 e = -0.0607 x0 = 1.9763 x = 1.9641 e = -0.0061 x0 = 1.9641 x = 1.9640 e = -5.0403e-05 x0 = 1.9640 x = 1.9640 e = -3.3371e-09 x0 = 1.9640 x = 1.9640 e = 0 y = 1.9640

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!