A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by misho » Mon Feb 08, 2016 3:29 pm
I came to a point in my project (spaceflight dynamics) where I really need to work with double precision. I have spacecraft orbiting around the planet, and when I apply thrusters to manoeuvre among them, I see them moving in discrete "jumps", which I can only attribute to lack of precision. Their orbital positions are to the order of 300 km above earth surface which itself has 6371 km radius (total size of the space "box" roughly 6700km), and their movements should be calculated to within 0.001 of a meter, which I think is at the limit of a single precision calculations.
I found a few posts where users are asking about the status of double precision functionality. I am able to compile my own libraries, and I tried compiling newton.lib using _NEWTON_USE_DOUBLE, but that only gives numerous errors across other components. Fixing this is something I would definitely not dare to embark on

So - is there any hope of implementation of double precision in the latest Newton Dynamics library package? Thanks!
Misho
-
misho
-
- Posts: 675
- Joined: Tue May 04, 2010 10:13 am
by Julio Jerez » Tue Feb 09, 2016 3:30 pm
let me complete the vehicle and I will add the double precision, I estimated by the end of this week.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by misho » Tue Feb 09, 2016 3:37 pm
Thank you so much, Julio!
Misho
-
misho
-
- Posts: 675
- Joined: Tue May 04, 2010 10:13 am
by pHySiQuE » Tue Feb 09, 2016 11:49 pm
I'm probably about a year away from implementing this, but I look forward to it.

BTW, the vegetation stuff I wrote with Newton is on the cover of Game Engine Gems 3. The technique is described in the chapter I wrote:
http://www.amazon.com/dp/1498755658/?tag=terathon-20
-
pHySiQuE
-
- Posts: 608
- Joined: Fri Sep 02, 2011 9:54 pm
by misho » Wed Feb 10, 2016 4:17 am
Amazing work, sir - but I have to admit that I don't have the book... how does vegetation employ Newton Dynamics?
Misho
-
misho
-
- Posts: 675
- Joined: Tue May 04, 2010 10:13 am
by misho » Tue Feb 16, 2016 8:43 pm
Hi Julio, et al.
I was wondering if you had a chance looking at the double precision over the weekend? Please let me know!
Thanks,
Misho
-
misho
-
- Posts: 675
- Joined: Tue May 04, 2010 10:13 am
by Julio Jerez » Wed Feb 17, 2016 7:22 am
still working on it, it will be by next Saturday.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by misho » Wed Feb 17, 2016 2:29 pm
Good stuff! Thanks!
Misho
-
misho
-
- Posts: 675
- Joined: Tue May 04, 2010 10:13 am
by misho » Wed Feb 17, 2016 2:45 pm
Just so I understand,
You will enable the current github Newton library to use
- Code: Select all
#define dFloat double
when a preprocessor define _NEWTON_USE_DOUBLE is used, correct?
Misho
-
misho
-
- Posts: 675
- Joined: Tue May 04, 2010 10:13 am
by Julio Jerez » Wed Feb 17, 2016 2:59 pm
the problem is that I have to review that dgVector and dgMatrix, there has being some function added that where no duplicated. also there are some funtions that take implicit dgFloat64 and some dgFloat32 so I have to put #ifdef around those so that only the double is active
I will also make the dgVector SSE2
if this works I mat decide to make the double the default. now that all platforms support double there is not reason why no move to that mode only.
It save lot of shenanigan with precision lost, specially in the collision code.
I am wrapping the vehicle and then I will do that.
If is goes well Newton 3,15 will be double precision only.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by misho » Wed Feb 17, 2016 3:03 pm
Excellent, thanks!
Misho
-
misho
-
- Posts: 675
- Joined: Tue May 04, 2010 10:13 am
by JoeJ » Thu Feb 18, 2016 3:53 am
Julio Jerez wrote:If is goes well Newton 3,15 will be double precision only.
"only" - meaning removing single precision support?
Halfing performance and doubling memory even for cases where additional precision isn't necessary?
-

JoeJ
-
- Posts: 1489
- Joined: Tue Dec 21, 2010 6:18 pm
by Julio Jerez » Thu Feb 18, 2016 9:24 am
yes maybe not a good idea yet.
But I am finding that the performance difference is that that great, the memory is a real concern, but with memory almost ten time what is used to be just for of five year ago maybe this is not a big issue either.
The biggest issue is the bandwidth, this is what in fact make the code slower, since moving memory around has not increased in he hardware side.
so maybe you are right and keeping the float and double is still a good idea.
One possible solution could be having all calculation use double by memory saving using floats.
this is still an idea on the air, nothing definite yet
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Stucuk » Thu Feb 18, 2016 11:09 am
Wouldn't you need to keep single precision for support with Phones/etc? Even if most PC's won't have issues i would bet alot of phones use old hardware.
-

Stucuk
-
- Posts: 801
- Joined: Sat Mar 12, 2005 3:54 pm
- Location: Scotland
-
by Julio Jerez » Thu Feb 18, 2016 11:30 am
I think all phone device use double precision now. but like I said maybe that was not a good idea.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 1 guest