Skip to content
This repository has been archived by the owner on Nov 21, 2017. It is now read-only.

update prime.c and primesmp.c #116

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

Kagre
Copy link

@Kagre Kagre commented Jun 15, 2016

I think these updates should be ok, but I'm going to need someone with gcc to try and compile them to confirm.

- I don't have gcc, so I'm not too sure how well this'll compile
- I used McDougall/Wotherspoon Newton-Raphson Method because I wasn't quite sure how to code the inline assembler equivalent
` _asm {
    fild i
    fsqrt
}`
- mostly revised for the odd j, and because i wanted to try and code `sqrt(i)`
split McDougall to run once/first, then Raphson thereafter
less opps, same diff.
@ohnx
Copy link
Contributor

ohnx commented Jun 16, 2016

Hi there!

I'm working on compiling the program right now, but I'm having some issues 😝

I'll get back to you once I can confirm - but this program does compile.

@ohnx
Copy link
Contributor

ohnx commented Jun 16, 2016

It works, but it actually seems to be a bit slower than the current version (not sure since I just tested it by hand, I didn't actually time it).

Also, maybe you should try squashing your commits so that there aren't 10 1-line changes 😄 (@IanSeyler can also use this)

@Kagre
Copy link
Author

Kagre commented Jun 16, 2016

sorry still a bit new to the community, is it still possible to squash these via the website now that i've done a pull request? or do i need to check them out again to another branch squash them via commandline and redo the request?

also note the multi-threaded version is likely to be slower overall, because the original skipped over the processes==3 step. but it seems odd to me that the updated algo runs slower since it reduces the loop count by roughly a half...

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

Successfully merging this pull request may close these issues.

2 participants