-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New formula has overflow error #6
Comments
That's odd, because that should always result in a number between 0 and -0.5. Hmmm. Maybe it's the "x^(x/4)' bit that's overflowing? I'll look into it. |
So, I did this:
and got this:
First of all, what damned system has a station 4.2 MILLION ls away from the entry point? Secondly, now I need to decide which of two options to use, those being:
Thoughts? |
4.2m ls, pshaw, that's nothing. Hutton Orbital in Proxima Centaurii is 6,784,404 ls! Over a 40 minute trip (I've yet to do it). Converting the penalty into logs would look like:
However, in this case, using logs doesn't really help, since log(Max(Double) is a hair over 709.78 and Hutton orbital would require
This should work and return the -0.5 for large numbers like Hutton Orbital without overflowing, If you haven't tried it by tonight, I will. Thanks! |
Changed cap to 709.78 since we're not actually calculating Lambert W_0 but the exponentiation of capped dist. Not tghat it really matters, that's all going to be -0.5 anyway, we just need to make sure Python doesn't see a number it doesn't like. if you wanted to use try, you'd probably want:
Which is faster, try:except or the min? |
Your math is off. (-1 + 1 / (x + 1) ** ((x + 1) / 4)) / 2 != (1 / exp(0.25 * (x + 1) * log(x + 1)) - 1) * 0.5 |
My math is correct when you take into account that the FooPlot website has an |
Even after fixing the exponentiation, I get the following error in the test case:
Possibly solved by going to logs. Will look into it if not fixed by this evening.
The text was updated successfully, but these errors were encountered: