Polynomial division check
polynomial-division-check · version 1.0.0 · Numbers & math · free, no key needed
Check a claimed polynomial division A = BQ + R over exact rationals: remainder degree, quotient degree, coefficients.
Use when you need to: check a polynomial long division result · verify quotient and remainder of polynomial division · is this synthetic division correct.
Decide before calling
Read the versioned contract and the supported scope below. Reuse polynomial-division-check@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use polynomial-division-check@1.0.0 for check a polynomial long division result. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- check a polynomial long division result
- verify quotient and remainder of polynomial division
- is this synthetic division correct
- check that a polynomial divides another exactly
- validate remainder degree is less than divisor degree
- verify a = b times q plus r for polynomials
Not supported
- performing the division (supply the claimed quotient and remainder)
- division over finite fields or integers modulo m
- multivariate or pseudo-division conventions
- floating-point coefficients
Behavior
- Polynomials are canonical ascending coefficient arrays (entry k = coefficient of x^k, last entry nonzero, [] = zero) of exact rational strings (<= 40 characters), degree <= 64. Euclidean division over Q: A = BQ + R with R = 0 or deg R < deg B (Cohen 1993, s3.1.3; reference_version cohen-gtm138-1993-ch3).
- Divisor [] is not_computable. remainder may be omitted, which claims R = 0 (exact divisibility).
- Order: (1) R = 0 or deg R < deg B (remainder_degree_violation); (2) deg Q = deg A - deg B when deg A >= deg B, else Q = 0 (quotient_degree_violation, "-infinity" denotes the zero polynomial); (3) A = BQ + R compared from degree 0 upward (identity_mismatch, lowest disagreeing coefficient). first_discrepancy is {check, factor_index: null, degree, lhs, relation, rhs}.
- dividend_degree, divisor_degree, quotient_degree and remainder_degree are always returned (null for a zero or omitted polynomial).
Input
dividend(array of string, required): max items 65; each max length 40; each pattern^-?(0|[1-9][0-9]*)(/[1-9][0-9]*|\.[0-9]+)?$divisor(array of string, required): max items 65; each max length 40; each pattern^-?(0|[1-9][0-9]*)(/[1-9][0-9]*|\.[0-9]+)?$quotient(array of string, required): max items 65; each max length 40; each pattern^-?(0|[1-9][0-9]*)(/[1-9][0-9]*|\.[0-9]+)?$remainder(array of string, optional): max items 65; each max length 40; each pattern^-?(0|[1-9][0-9]*)(/[1-9][0-9]*|\.[0-9]+)?$
Output
valid(boolean, required)reason(one of "remainder_degree_violation", "quotient_degree_violation", "identity_mismatch", null, required)first_discrepancy(object or null, required)dividend_degree(integer or null, required): min 0divisor_degree(integer, required): min 0quotient_degree(integer or null, required): min 0remainder_degree(integer or null, required): min 0reference_version(constant "cohen-gtm138-1993-ch3", required)
Limits
- max degree: 64
- max number chars: 40
Example
Request input:
{
"dividend": [
"-4",
"0",
"-2",
"1"
],
"divisor": [
"-3",
"1"
],
"quotient": [
"3",
"1",
"1"
],
"remainder": [
"5"
]
}
Response:
{
"result": {
"valid": true,
"reason": null,
"first_discrepancy": null,
"dividend_degree": 3,
"divisor_degree": 1,
"quotient_degree": 2,
"remainder_degree": 0,
"reference_version": "cohen-gtm138-1993-ch3"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "polynomial-division-check",
"version": "1.0.0",
"input": {
"dividend": [
"-4",
"0",
"-2",
"1"
],
"divisor": [
"-3",
"1"
],
"quotient": [
"3",
"1",
"1"
],
"remainder": [
"5"
]
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/polynomial-division-check/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"dividend":["-4","0","-2","1"],"divisor":["-3","1"],"quotient":["3","1","1"],"remainder":["5"]}'
The machine-readable contract is at /v1/tools/polynomial-division-check/versions/1.0.0.
CLI
node cli.mjs run polynomial-division-check 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Linear residual check: Check a claimed residual r = b - A x (per component and/or its max norm) exactly for an approximate solution x.
- Lp primal feasibility check: Check that a claimed LP point satisfies x >= 0 and Ax <= b exactly; report the first violated bound or row.
- Polynomial identity check: Check a polynomial identity over exact rationals by expanding both sides; report the lowest disagreeing coefficient.
- Polynomial factorization check: Check a claimed factorization c * prod f_i^e_i of a rational polynomial: monic distinct factors, degrees, coefficients.
- Rational expression check: Check a claimed exact rational value of an integer/fraction expression; reports the true value and the difference.
- Regression coefficients check: Check claimed least-squares regression coefficients against exact samples; reports rank and the first mismatch.