Skip to content

Feat/routes f polynomial eval iqr outlier reverse word order#951

Open
KevinMB0220 wants to merge 3 commits into
StreamFi-x:devfrom
KevinMB0220:feat/routes-f-polynomial-eval-iqr-outlier-reverse-word-order
Open

Feat/routes f polynomial eval iqr outlier reverse word order#951
KevinMB0220 wants to merge 3 commits into
StreamFi-x:devfrom
KevinMB0220:feat/routes-f-polynomial-eval-iqr-outlier-reverse-word-order

Conversation

@KevinMB0220
Copy link
Copy Markdown
Contributor

Description

This PR implements three new utility API endpoints with complete unit tests covering validation, edge cases, and algorithmic correctness.

Issues Addressed

  1. Polynomial Evaluator (feat(routes-f): polynomial evaluator #868)
    • Path: /api/routes-f/polynomial-eval
    • Method: POST
    • Request: { coefficients: number[], x: number | number[] }
    • Response: { results: number[] }
    • Algorithm: Uses Horner's method to evaluate polynomials efficiently.
  2. IQR Outlier Detection (feat(routes-f): IQR outlier detection #872)
    • Path: /api/routes-f/iqr-outlier
    • Method: POST
    • Request: { data: number[], multiplier?: number } (default 1.5)
    • Response: { q1: number, q3: number, iqr: number, lower_bound: number, upper_bound: number, outliers: number[] }
    • Algorithm: Linear quartile interpolation matching Excel's QUARTILE.INC / NumPy, calculating Interquartile Range (IQR) and identifying outliers.
  3. Reverse Word Order (feat(routesF): reverse word order #904)
    • Path: /api/routesF/reverse-word-order
    • Method: POST
    • Request: { text: string }
    • Response: { result: string }
    • Algorithm: Splitting text by any whitespace sequence (collapsing internal spaces/tabs), reversing order, and joining back with a single space.

Files Added

  • app/api/routes-f/polynomial-eval/route.ts - Polynomial evaluator logic & validation
  • app/api/routes-f/polynomial-eval/route.test.ts - Polynomial evaluation tests
  • app/api/routes-f/iqr-outlier/route.ts - IQR outlier computation logic & validation
  • app/api/routes-f/iqr-outlier/route.test.ts - IQR outlier detection tests
  • app/api/routesF/reverse-word-order/route.ts - Word order reversing logic & validation
  • app/api/routesF/reverse-word-order/route.test.ts - Word reversing tests

Verification Results

All unit tests pass successfully (31/31 tests):

node_modules/.bin/jest "routes-f/polynomial-eval" "routes-f/iqr-outlier" "routesF/reverse-word-order" --no-coverage --forceExit


PASS app/api/routesF/reverse-word-order/route.test.ts
PASS app/api/routes-f/polynomial-eval/route.test.ts
PASS app/api/routes-f/iqr-outlier/route.test.ts

Test Suites: 3 passed, 3 total
Tests:       31 passed, 31 total
Time:        1.574s


## Closes #872
## Closes #868
## Closes #904 

…mFi-x#868)

- POST /api/routes-f/polynomial-eval
- Accepts coefficients: number[] and x: number | number[]
- Computes polynomial value using Horner's method
- POST /api/routes-f/iqr-outlier
- Calculates Q1, Q3, IQR, bounds, and identifies outliers
- Supports custom multiplier (defaults to 1.5)
- POST /api/routesF/reverse-word-order
- Reverses word order in the given text input
- Collapses internal whitespace to single spaces and trims text
@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

@KevinMB0220 is attempting to deploy a commit to the david's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@KevinMB0220 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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 this pull request may close these issues.

1 participant