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

BUG - Cardano's solution returns wrong answer #4

Closed
miladsade96 opened this issue Jun 13, 2020 · 5 comments
Closed

BUG - Cardano's solution returns wrong answer #4

miladsade96 opened this issue Jun 13, 2020 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@miladsade96
Copy link
Owner

miladsade96 commented Jun 13, 2020

For a_1 = 1, a_2 = 2, a_3 = 3 ,
it should print
x_1 = -1.27568
z_2 = 0.13784 + i * 1.52731
z_3 = 0.13784 - i * 1.52731
But it prints
x_1 = -2.58565688
z_2 = ( 0.792838216 , -2.33903098 )
z_3 = ( 0.792719483 , 2.33903098 )

I think the error might be at sign section of code:
https://github.com/EverLookNeverSee/FCS/blob/acb60b0728226dfd4508fa420787b606294a74ba/src/numerical%20methods/Exercise_14.f90#L36

@miladsade96 miladsade96 added bug Something isn't working help wanted Extra attention is needed labels Jun 13, 2020
@miladsade96
Copy link
Owner Author

@LKedward Do you have any idea about this?

@LKedward
Copy link

Hi @everlookneversee , I've been through the code and run it on my computer and I can't find any mistake with respect to the formulae you are referencing .
(As you point out, the code still doesn't return the correct result with sign(1.0,R).)

i.e. I believe you have implemented the formulae correctly, so I wonder whether there's a mistake in the formulae?
Unfortunately I can't verify the formulae since I can't find a reference online that formulates Cardano's method in the same way as here - I would recommend either verifying the formulae from another source or working off a different set of formulae.

@miladsade96
Copy link
Owner Author

Hi @everlookneversee , I've been through the code and run it on my computer and I can't find any mistake with respect to the formulae you are referencing .
(As you point out, the code still doesn't return the correct result with sign(1.0,R).)

i.e. I believe you have implemented the formulae correctly, so I wonder whether there's a mistake in the formulae?
Unfortunately I can't verify the formulae since I can't find a reference online that formulates Cardano's method in the same way as here - I would recommend either verifying the formulae from another source or working off a different set of formulae.

Thank you very much

@miladsade96
Copy link
Owner Author

@LKedward
I found solution below and would like to use it:
Screenshot_20200613_172111

@miladsade96
Copy link
Owner Author

Solved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants