Skip to content
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

Complex Multiplication uses more multiplications than necessary #13

Open
jm2118 opened this issue Oct 8, 2017 · 3 comments
Open

Complex Multiplication uses more multiplications than necessary #13

jm2118 opened this issue Oct 8, 2017 · 3 comments

Comments

@jm2118
Copy link

jm2118 commented Oct 8, 2017

(a + ib)(c + id) = (ac - bd) + (bc + ad)i
(bc + ad) = (a+b)(c+d) - ac - bd

@Morwenn
Copy link
Owner

Morwenn commented Oct 8, 2017

I reckon that you're right, but would that make any difference for such a library which is meant to be used at compile-time (and only at compile-time)? If not, I'd rather keep the naive albeit obvious formula which is currently used.

It could be interesting if the proposed formula somehow avoids precision loss for floating point numbers though, or if it is somehow less likely to overflow.

@ChrisKitching
Copy link
Contributor

It could be interesting if the proposed formula somehow avoids precision loss for floating point numbers though, or if it is somehow less likely to overflow.

Faster compile times are also nice to have especially in the kinds of bonkers template-heavy programs that are likely to be using your library.

@Morwenn
Copy link
Owner

Morwenn commented Aug 2, 2018

But does the change even make a significant difference in compile times?

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

No branches or pull requests

3 participants