Warning: Cannot modify header information - headers already sent by (output started at /home/public/wp-content/themes/simplelin/functions.php:1) in /home/public/wp-includes/feed-rss2-comments.php on line 8
Comments on: Small sums of five roots of unity https://babarber.uk/583/small-sums-of-five-roots-of-unity/ mathematical storytelling Sun, 16 May 2021 17:46:48 +0000 hourly 1 https://wordpress.org/?v=5.9.2 By: babarber https://babarber.uk/583/small-sums-of-five-roots-of-unity/#comment-3553 Sun, 16 May 2021 17:46:48 +0000 https://babarber.uk/?p=583#comment-3553 In reply to Tomás Oliveira e Silva.

Yes, I should have paid closer attention to what I could achieve with doubles — I didn’t do much more than note that I’d have serious problems if the sums got below 10^{-15}, and as you point out it does get pretty close. I’m more relaxed about the output precision as the goal was to be able to read the values back if necessary, rather than a claim that all of the digits were correct.

I’m pleased someone’s checking my numbers, and will respond to your follow up email in the original post.

]]>
By: Tomás Oliveira e Silva https://babarber.uk/583/small-sums-of-five-roots-of-unity/#comment-3552 Thu, 13 May 2021 23:48:37 +0000 https://babarber.uk/?p=583#comment-3552 Hello Ben,

By using the double data type you have to pay attention to round-off errors. specially when the non-zero sum is very small. For example, for n=90681, your smallest non-zero sum has only one or two significant digits; the rest is garbage. Maybe %18.16f would have been better than %.16e, as only one, maybe two wrong digits would have been displayed.

Anyway, I’m in the middle of checking your results up to n=100000. My own program is about 4 times slower than yours, but it uses twice the precision (libqd-dev in GNU/linux), so round-off errors will not be a problem even for larger n. For each (n,a,b) I always check 8 cases. It appears that by making c=(u-v)/2 and d=(u+v)/2 and by working with u and v instead of c and d, it is easier to find the best (c,d) combination. Indeed, in those coordinates the shape of the squared error surface is particularly simple (to second order, two decoupled variables and squared error = sum of two one-dimensional parabolas).

I’l get back to you in a few days when the computations are finished. It would be interesting to go up to 1 million, but the cubic nature on the whole effort is not our friend (10^ 5 in 2.5 days in my 8-core laptop, 10^6 in 2500 days…)

Best regards,
TOS

]]>