lambertw, all branches
|
01-25-2024, 04:13 PM
Post: #51
|
|||
|
|||
RE: lambertw, all branches
Quote:With signed-zero, arg(z) + arg(conj(z)) = 0 Without signed-zero, above might not hold. If a is negative real, conj(a) returns itself, we get sum = pi + pi ≠0 In this case, this does not hold either: Wk(a) = conj(W-k(conj(a))) One way to get sum=0 is to to use ±eps for ±0 (★) p2> z = mpc("-1E-330", "1E-9999") p2> W(z, -1) (-766.494908744112 - 1.00130634441663e-9669j) p2> conj(W(conj(z), 1)) (-766.494908744112 - 1.00130634441663e-9669j) p2> W(z, 1) (-766.494942472642 + 6.2913931263013j) p2> conj(W(conj(z), -1)) (-766.494942472642 + 6.2913931263013j) (★) with eps hack, we may get into another ugly situation. What if eps underflowed to zero? Then, the sign is lost! Luckily, mpmath (by design) will not overflow/underflow. https://mpmath.org/doc/current/technical.html Wrote:Mpmath uses arbitrary precision integers for both the mantissa and the exponent, Still, I think better solution is to properly add signed-zero to mpmath. fredrik-johansson Wrote:Should negative zero (-0) be supported? It is virtually supported already; the object 'fnzero' is defined in libmpf.py (though not used anywhere). It just needs to be supported in standard operations, and elsewhere "x ==fzero" needs to be replaced with something else so that -0 is not forwarded to places where it shouldn't go ... |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)