#11888: Sage is missing the lambert_w function
----------------------------------------------------------------------------------+
Reporter: benjaminfjones
| Owner: burcin
Type: defect
| Status: needs_work
Priority: minor
| Milestone: sage-5.0
Component: symbolics
| Keywords: lambert_w symbolics conversion maxima sd35.5
Work_issues:
| Upstream: N/A
Reviewer: Keshav Kini, Karl-Dieter Crisman, Fredrik Johansson, Burcin
Erocal | Author: Benjamin Jones
Merged:
| Dependencies: #9130
----------------------------------------------------------------------------------+
Changes (by burcin):
* status: needs_review => needs_work
Comment:
I have one more comment. Sorry for multiple emails.
You should check if the parent is `RDF` or `CDF` using `is`, not `==`. In
this context, `parent` is an argument to the `_evalf_()` method, which
overrides the `parent()` function imported from `sage.structure.coerce`. I
suggest naming the argument `parent_d` instead of `parent`. Then you can
do:
{{{
R = parent_d or parent(z)
if R is float or R is complex or R is RDF or R is CDF:
import scipy.special
return scipy.special.lambertw(z, n)
else:
import mpmath
return mpmath_utils.call(mpmath.lambertw, z, n, parent=parent)
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11888#comment:29>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.