arguiot / arguiot/TheoremJS

Finding polynomial roots is limited to only the first 4 values of the polynomial

Open
#54 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
931
Forks
31
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
When using findRoot, it is impossible to find the root of a polynomial with more than 4 elements, so (ax^3 + bx^2 + cx + d).

**To Reproduce**
Steps to reproduce the behavior:
1. Use the function on a polynomial with more than 4 coefficients/numbers (t.polynomial(1, 6, -8, -6))

**Expected behavior**
The roots should be gotten.

**Screenshots / Output**
the output is simply undefined or an empty array

**NodeJS (please complete the following information):**
- OS: [e.g. macOS 10.14] Linux ( Ubuntu 20.04 )
- Node version [e.g. v8.11.3] Node 18
- Version [e.g. v1.0] latest (1.2.0)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with Node 18 and TheoremJS 1.2.0 using findRoot and t.polynomial(1, 6, -8, -6). Trace the findRoot entry point and polynomial handling until the coefficient limit is identified; done means roots are returned for polynomials with more than four coefficients instead of undefined or an empty array.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.