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

program hangs #3

Open
fred5678 opened this issue Feb 26, 2019 · 9 comments
Open

program hangs #3

fred5678 opened this issue Feb 26, 2019 · 9 comments

Comments

@fred5678
Copy link

The attached program seems to hang in k-loop at line #51. I can't find an error. If I change the value for alpha to 0.5 or 0.005 it terminates after four numbers. With 0.0005 it hangs. The 50 years old (1968 :-) correct output values have to be: 0.785398... 0.948059... 1.002279... 0.977048... and so on (29 values). The last value is 1.0.

prog3.txt

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Feb 26, 2019 via email

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Feb 26, 2019 via email

@fred5678
Copy link
Author

At the moment I can't verify the correctness of the algorithm, but
a. Is there no test on zero division?
b. The control print at the <= test gives
the following output:

0.7853981633 0.9480594489 1.002279877
0.2168817140 5.011399387e-13
le > ri 0.9770486166 1.006037784 1.006507522
4.227645209e-3 5.032537613e-13

The program hangs at ...e-3 > ...e-13?

prog3b.txt

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Feb 26, 2019 via email

@fred5678
Copy link
Author

I see it is a problem of very small numbers. How can I increase the accuracy of the runtime system?

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Feb 26, 2019 via email

@fred5678
Copy link
Author

(bulz[i]*bulz[i]/(bulz[k]*bulz[k])-1) = bi^2 / bk^2 -1

bk = 1 and bi >1 => bi^2 / bk^2 > 1

@fred5678
Copy link
Author

I got it. I have to declare the bulz-array as real! Thank you very much.

@JvanKatwijk
Copy link
Owner

JvanKatwijk commented Feb 26, 2019 via email

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

No branches or pull requests

2 participants