Not applicable
Jan 19, 2016
12:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 19, 2016
12:43 AM
Hi there,
I am developing a 3axis drive using XMC 1100. For that I need to calculate the sqrt and possibly other functions. Dave does not recognize "sqrt()". Is there a library for math functions and how can I use it whihin Dave?
thanks for your reply.
I am developing a 3axis drive using XMC 1100. For that I need to calculate the sqrt and possibly other functions. Dave does not recognize "sqrt()". Is there a library for math functions and how can I use it whihin Dave?
thanks for your reply.
- Tags:
- IFX
8 Replies
Not applicable
Jan 19, 2016
01:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 19, 2016
01:07 AM
Hello,
do you include math.h in your source and the lib m in your link? I'm running math functions on the XMC 4500 and it's running fine.
BTW: Why do you use sqrt()? It's double and last long. Maybe you try the float version sqrtf() and include the implicit double warning -Wdouble-promotion
in your compiler switches to be aware that there is a cast to double which may eat up time.
Kind regards
Kurt
do you include math.h in your source and the lib m in your link? I'm running math functions on the XMC 4500 and it's running fine.
BTW: Why do you use sqrt()? It's double and last long. Maybe you try the float version sqrtf() and include the implicit double warning -Wdouble-promotion
in your compiler switches to be aware that there is a cast to double which may eat up time.
Kind regards
Kurt
Not applicable
Jan 19, 2016
01:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 19, 2016
01:59 AM
thanks a lot,
Your hint took me to the Dave Development internet site. I found a release note that indicates that this math app is not suitable for XMC1100. Anyway I will try and see how far I get.
kind regards,
Felix
Your hint took me to the Dave Development internet site. I found a release note that indicates that this math app is not suitable for XMC1100. Anyway I will try and see how far I get.
kind regards,
Felix
Not applicable
Jan 19, 2016
09:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 19, 2016
09:45 AM
Hi Felix,
maybe you download fdlibm or glibc as source code, extract the required modules and add these files as source to your project.
With this you have the option to use float or double representation and react proper to the type of arguments(float integer ecc.)
Kind regards
Kurt
maybe you download fdlibm or glibc as source code, extract the required modules and add these files as source to your project.
With this you have the option to use float or double representation and react proper to the type of arguments(float integer ecc.)
Kind regards
Kurt
Not applicable
Jan 19, 2016
11:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 19, 2016
11:37 AM
You could always implement a sqrt() using the Newton-Raphson method. The only problem is, the Newton-Raphson method involves a divide. Perhaps an XMC1300 would be more appropriate as it provides divide capability. There are plenty of integer sqrt() options available.
Not applicable
Jan 21, 2016
12:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 21, 2016
12:35 AM
Hi Kurt and smays,
I have now implemented the Newton method which is certainly better than the Heron method which I considered first. Thanks for your comment
Kurt, where can I find fdlibm or glibc? thanks
Felix
I have now implemented the Newton method which is certainly better than the Heron method which I considered first. Thanks for your comment
Kurt, where can I find fdlibm or glibc? thanks
Felix
Not applicable
Jan 21, 2016
12:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 21, 2016
12:21 PM
I have now implemented the Newton method
Cool!!! By the way, are you still working with the 1100 (XMC1100)? If so, do you have a feel for how long the divide takes?
Steve.
Not applicable
Jan 21, 2016
12:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 21, 2016
12:43 PM
Hi Felix
fdlibm : http://www.netlib.org/fdlibm/
gclib: https://www.gnu.org/software/libc/
Kind regards
Kurt
fdlibm : http://www.netlib.org/fdlibm/
gclib: https://www.gnu.org/software/libc/
Kind regards
Kurt
Not applicable
Jan 21, 2016
01:05 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 21, 2016
01:05 PM
thanks for the fdlibm and libc references.
I do not yet know yet, how long the devide will take, so I appreciated the hint with the Newton method.
Nevertheless, I can offload calculation and download readily processed data, so that workload can be removed from the XMC1100 if needed.
kind regards,
Felix
I do not yet know yet, how long the devide will take, so I appreciated the hint with the Newton method.
Nevertheless, I can offload calculation and download readily processed data, so that workload can be removed from the XMC1100 if needed.
kind regards,
Felix