but it doesn't. Probably because the first arg is -1.0, and not -1. I suspect we could modify the simplifier to treat -1.0 (or any other float that is equal to an integer) as -1.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Not sure I understand the problem.
Maxima always preserves exact symbolic expressions.
It only calculates floating-point approximations for floating-point arguments or when simplifying with the numer flag set.
This is not specific to the Lambert function:
What's happening is that float(generalized_lambert_w(-1,x)) becomes generalized_lambert_w(-1.0, float(x)) and the simplifier for generalized_lambert_w checks for the fixnum -1 so -1.0 is wrong. I think the fix should be straightforward.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I did not know that maxima required the numer flag to calculate my
equation. I naively assumed that running
float(generalized_lambert_w(-1,x)) would produce a float output as it
does in other cases.
I believed that the response to this bug report would be to modify the
documentation to confirm the need of numer to calculate a float
representation of the generalized_lambert_w. Since logging the bug,
there has been some suggestion that it would be possible to have
float(generalized_lambert_w(-1,x)) work as I initially thought it
should. If it is difficult to implement an evaluation of
geteralized_lambert_w(-1.0, float(x)) with -1.0 being converted to -1
to satisfy the check in the function, then a note in the docs would be
nice.
What's happening is that float(generalized_lambert_w(-1,x)) becomes generalized_lambert_w(-1.0, float(x)) and the simplifier for generalized_lambert_w checks for the fixnum -1 so -1.0 is wrong. I think the fix should be straightforward.
[bugs:#4156] generalized_lambert_w won't provide float solution
Status: open
Group: None
Created: Thu Jul 13, 2023 12:25 AM UTC by Chris Gorman
Last Updated: Thu Jul 13, 2023 02:22 PM UTC
Owner: David Billinghurst
When trying to compute a generalized_lambert_w solution for
Chris, no, you shouldn't have to use numer. I think Ray is fixing this problem.
Strictly speaking, I suppose generalized_lambert_w(<float>, ...) is wrong in some sense, since the first argument must be an integer, but it seems OK to accept a float which is an exact integer.</float>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yeah, this is just the way float works. It floats all the args and then calls the function again. Short of making float smarter to handle this function in a special way, I'm making generalized_lambert_w allow float/bfloat values that are integers to be treated as if they were integers.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yeah, this is just the way float works. It floats all the args and then calls the function again. Short of making float smarter to handle this function in a special way, I'm making generalized_lambert_w allow float/bfloat values that are integers to be treated as if they were integers.
[bugs:#4156] generalized_lambert_w won't provide float solution
Status: open
Group: None
Created: Thu Jul 13, 2023 12:25 AM UTC by Chris Gorman
Last Updated: Tue Jul 25, 2023 05:42 PM UTC
Owner: David Billinghurst
When trying to compute a generalized_lambert_w solution for
Let me try to finish my bug report here...
Sorry for the confusion.
When trying to compute a generalized_lambert_w solution for ...
I need to pass numer or use a float value for z to get a float solution. For example ...
doesn't work, but either ...
or ...
do work to find a float solution for Wm(z) for my example function.
Perhaps a note can be added to the user documentation describing how to properly manage this use case.
This works for me:
But I think
but it doesn't. Probably because the first arg is -1.0, and not -1. I suspect we could modify the simplifier to treat -1.0 (or any other float that is equal to an integer) as -1.
Not sure I understand the problem.
Maxima always preserves exact symbolic expressions.
It only calculates floating-point approximations for floating-point arguments or when simplifying with the numer flag set.
This is not specific to the Lambert function:
So I'm not sure what the problem is with Lambert.
What's happening is that
float(generalized_lambert_w(-1,x))becomesgeneralized_lambert_w(-1.0, float(x))and the simplifier forgeneralized_lambert_wchecks for the fixnum -1 so -1.0 is wrong. I think the fix should be straightforward.Hi Raymond and Stavros,
I did not know that maxima required the numer flag to calculate my
equation. I naively assumed that running
float(generalized_lambert_w(-1,x)) would produce a float output as it
does in other cases.
I believed that the response to this bug report would be to modify the
documentation to confirm the need of numer to calculate a float
representation of the generalized_lambert_w. Since logging the bug,
there has been some suggestion that it would be possible to have
float(generalized_lambert_w(-1,x)) work as I initially thought it
should. If it is difficult to implement an evaluation of
geteralized_lambert_w(-1.0, float(x)) with -1.0 being converted to -1
to satisfy the check in the function, then a note in the docs would be
nice.
Best regards,
Chris
On Tue, Jul 25, 2023 at 10:20 AM Raymond Toy rtoy@users.sourceforge.net wrote:
Related
Bugs:
#4156Chris, no, you shouldn't have to use numer. I think Ray is fixing this problem.
Strictly speaking, I suppose generalized_lambert_w(<float>, ...) is wrong in some sense, since the first argument must be an integer, but it seems OK to accept a float which is an exact integer.</float>
Yeah, this is just the way float works. It floats all the args and then calls the function again. Short of making float smarter to handle this function in a special way, I'm making generalized_lambert_w allow float/bfloat values that are integers to be treated as if they were integers.
Hi Raymond,
Great! Thanks.
Chris
On Tue, Jul 25, 2023 at 5:35 PM Raymond Toy rtoy@users.sourceforge.net wrote:
Related
Bugs:
#4156Fixed in commit [c293301]
Basically test if the k arg is numerically equal to an integer and use the integer value instead of the float value.