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

Is there a reason quadratic-solutions only provides real solutions? #21

Closed
dieggsy opened this issue Feb 24, 2019 · 4 comments · Fixed by #22
Closed

Is there a reason quadratic-solutions only provides real solutions? #21

dieggsy opened this issue Feb 24, 2019 · 4 comments · Fixed by #22

Comments

@dieggsy
Copy link
Contributor

dieggsy commented Feb 24, 2019

Why not quadratic-solutions providing all solutions, including complex, and quadratic-real-solutions, quadratic-real-natural-solutions, etc. or something like that?

@dieggsy dieggsy changed the title Is there a reason quadratic-solutions only provide real solutions? Is there a reason quadratic-solutions only provides real solutions? Feb 24, 2019
@soegaard
Copy link
Member

No reason, apart from nobody requesting that feature.

Also I see that the naïve solution formula is used [1].
Are you interested in adding quadratic-complex-solutions
and in the process maybe switch to the better formulas [2]?

[1] https://github.com/racket/math/blob/master/math-lib/math/private/number-theory/quadratic.rkt#L19
[2] https://people.csail.mit.edu/bkph/articles/Quadratics.pdf

@soegaard
Copy link
Member

dieggsy added a commit to dieggsy/math that referenced this issue Feb 24, 2019
- Also switch to potentially more numerically stable quadratic formulas
- Closes racket#21
@dieggsy
Copy link
Contributor Author

dieggsy commented Feb 24, 2019

@soegaard I forget where this comes from, I once implemented this in chicken scheme, and I think is supposed to be more numerically stable, as well as accepting complex coefficients.

I think the source was a book titled something like "modern computer algebra", but I can't seem to find it at the moment.

EDIT: The book is "Numerical recipes: the art of scientific computing"

@dieggsy
Copy link
Contributor Author

dieggsy commented Feb 24, 2019

Looking over it again, I think my formula is the same as your PDF, except the check for which formula to use extends to complex numbers as well.

dieggsy added a commit to dieggsy/math that referenced this issue Feb 24, 2019
- Also switch to potentially more numerically stable quadratic formulas
- Closes racket#21
dieggsy added a commit to dieggsy/math that referenced this issue Feb 24, 2019
- Also switch to potentially more numerically stable quadratic formulas
- Closes racket#21
dieggsy added a commit to dieggsy/math that referenced this issue Feb 24, 2019
- Also switch to potentially more numerically stable quadratic formulas
- Closes racket#21
dieggsy added a commit to dieggsy/math that referenced this issue Feb 24, 2019
- Also switch to potentially more numerically stable quadratic formulas
- Closes racket#21
dieggsy added a commit to dieggsy/math that referenced this issue Feb 24, 2019
- Also switch to potentially more numerically stable quadratic formulas
- Closes racket#21
dieggsy added a commit to dieggsy/math that referenced this issue Feb 24, 2019
- Also switch to potentially more numerically stable quadratic formulas
- Closes racket#21
dieggsy added a commit to dieggsy/math that referenced this issue Feb 24, 2019
- Also switch to potentially more numerically stable quadratic formulas
- Closes racket#21
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 a pull request may close this issue.

2 participants