Rational simplify
rational-simplify · version 1.0.0 · Numbers & math · free, no key needed
Reduce a numerator/denominator pair to lowest terms with the sign normalized onto the numerator.
Use when you need to: rational simplify · simplify fraction · reduce fraction to lowest terms.
Decide before calling
Read the versioned contract and the supported scope below. Reuse rational-simplify@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 rational-simplify@1.0.0 for rational simplify. 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
- rational simplify
- simplify fraction
- reduce fraction to lowest terms
- normalize rational sign
Not supported
- decimal simplify
- continued fractions
- mixed numbers
Behavior
- Input is an object with canonical integer-string numerator and denominator fields.
- Unlike rational-add and rational-multiply, the denominator may be negative; only 0 is rejected.
- Inputs may use -0 on either field, which is canonicalized to 0 before evaluation.
- The output is numerator / gcd(|numerator|,|denominator|) over denominator / gcd(...), with the sign moved entirely onto the numerator.
- Zero is always returned as numerator 0 over denominator 1, regardless of the input denominator sign.
- Each input and output numerator and denominator may have at most 1000 digits excluding sign.
Input
numerator(string, required): max length 1001denominator(string, required): max length 1001
Output
numerator(string, required)denominator(string, required)
Limits
- max digits: 1000
Example
Request input:
{
"numerator": "-8",
"denominator": "-12"
}
Response:
{
"result": {
"numerator": "2",
"denominator": "3"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "rational-simplify",
"version": "1.0.0",
"input": {
"numerator": "-8",
"denominator": "-12"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/rational-simplify/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"numerator":"-8","denominator":"-12"}'
The machine-readable contract is at /v1/tools/rational-simplify/versions/1.0.0.
CLI
node cli.mjs run rational-simplify 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Mixed number to rational: Convert a mixed number (sign, whole part, proper-fraction numerator and denominator) into a single reduced rational.
- Rational power: Raise a rational number to an integer exponent and return the exact reduced result.
- Rational to mixed number: Convert a rational number into a sign, whole part, and proper-fraction numerator/denominator.
- Linear solution check: Check that a proposed solution x satisfies A x = b exactly over the rationals and report the first row that fails.
- Rational equation check: Check a chained claim like 1/2 + 1/3 = 5/6 < 1 exactly; returns the first false relation or division by zero.
- Rational expression check: Check a claimed exact rational value of an integer/fraction expression; reports the true value and the difference.