{"id":17149398,"url":"https://github.com/yairchu/quartic","last_synced_at":"2025-08-03T00:34:41.549Z","repository":{"id":64942085,"uuid":"2684236","full_name":"yairchu/quartic","owner":"yairchu","description":"Solve Quartic equations. Implementations in C, Haskell, and Python","archived":false,"fork":false,"pushed_at":"2023-06-12T09:04:16.000Z","size":35,"stargazers_count":9,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T11:49:07.886Z","etag":null,"topics":["math","polynomials"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yairchu.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2011-10-31T22:50:56.000Z","updated_at":"2024-03-22T17:06:41.000Z","dependencies_parsed_at":"2025-04-13T11:52:48.141Z","dependency_job_id":null,"html_url":"https://github.com/yairchu/quartic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yairchu/quartic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairchu%2Fquartic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairchu%2Fquartic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairchu%2Fquartic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairchu%2Fquartic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yairchu","download_url":"https://codeload.github.com/yairchu/quartic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yairchu%2Fquartic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264476717,"owners_count":23614560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["math","polynomials"],"created_at":"2024-10-14T21:33:03.997Z","updated_at":"2025-07-09T14:37:57.606Z","avatar_url":"https://github.com/yairchu.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quartic\n\nSolve Quartic equations (4th degree polynomials) in C, Haskell, and Python.\n\nLicense: BSD.\n\n(Also solves cubic, quadratic, and linear equations)\n\nThe implementations are very close in their structure/design.\nNaturally, the Haskell and Python implementations are much shorter than the C implementation.\n\n## C implementation\n\nThere's one implementation for complex numbers, and another for real numbers (`double`), which only finds real roots.\n\n## Haskell implementation\n\nThis implementation is generic and should work for finite fields too (I think).\n\n### Note about Cubic equations\n\nThe solving of cubic equations only finds one root.\nFinding all three roots for `Complex Double`s isn't hard but I wanted to keep the code generic.\n\nFor that a type-class providing primitive roots of unity would be required.\nThe class providing the primitive square root of unity, `(-1)`, exists in Haskell and it is `Floating`, but here we would need a primitive cubic root of unity..\n\n## Python implementation\n\nNumpy already has a built-in roots function, so this implementation isn't necessary.\nIt was only made for comparison with the others.\nAlso consider https://github.com/NKrvavica/fqs if you require a faster implementation than numpy.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyairchu%2Fquartic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyairchu%2Fquartic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyairchu%2Fquartic/lists"}