Skip to content

Add product DFTs to gr_dft; make acb_dft a thin wrapper#2774

Open
fredrik-johansson wants to merge 2 commits into
flintlib:mainfrom
fredrik-johansson:dft2
Open

Add product DFTs to gr_dft; make acb_dft a thin wrapper#2774
fredrik-johansson wants to merge 2 commits into
flintlib:mainfrom
fredrik-johansson:dft2

Conversation

@fredrik-johansson

@fredrik-johansson fredrik-johansson commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

We change acb_dft to a thin wrapper around gr_dft for the main functions, removing obsolete algorithm functions. This makes acb_dft significantly faster (and probably more precise). The only significant functionality that was missing, acb_dft_prod, is also ported to gr_dft, and with it acb_dirichlet_dft.

@edgarcosta Would be great if you could test accuracy/speed of the new DFT code for the applications where you've been using it.

Also @Joel-Dahne maybe you are able to test this.

As a sanity check, this immediately speeds up vector evaluation of Dirichlet L-functions.

Old:

$ build/examples/lcentral --quiet --prec 32 1000000 1000000
cpu/wall(s): 1.939 1.939
virt/peak/rss/peak: 38.8 MB /  149 MB / 27.4 MB /  137 MB

New:

$ build/examples/lcentral --quiet --prec 32 1000000 1000000
cpu/wall(s): 0.692 0.693
virt/peak/rss/peak: 20.5 MB /  131 MB / 8.59 MB /  118 MB

Enclosures are also tighter. Old:

...
1000000,810547: [0.73711 +/- 7.86e-6] + [-0.68267 +/- 6.26e-6]*I
1000000,199219: [4.79556 +/- 4.50e-6] + [3.88048 +/- 5.39e-6]*I
1000000,976563: [1.49068 +/- 4.92e-6] + [1.27756 +/- 7.06e-6]*I

New:

...
1000000,810547: [0.737105 +/- 6.65e-7] + [-0.682667 +/- 7.97e-7]*I
1000000,199219: [4.79556 +/- 1.95e-6] + [3.880482 +/- 8.42e-7]*I
1000000,976563: [1.490678 +/- 8.34e-7] + [1.277564 +/- 6.90e-7]*I

@Joel-Dahne

Copy link
Copy Markdown
Contributor

This looks great! There were no problems wrapping it in Julia (though it needs some polishing to make it actually use friendly) and the performance seems to be very good! I made a quick comparison to GenericaFFT.jl and at 53 bits of precision it is about 50 times slower than Float64, which or more or less in line what I would expect. Compared to BigFloat at 256 bits of precision it is about 20 times faster, though GenericFFT is suffering a lot from not using mutable arithmetic with BigFloat. All tests were for the length 32768.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants