Skip to main content
Glama
agmonetti

mathmethods-mcp

by agmonetti

finite_differences

Approximate first and second derivatives of a function at a point using forward, backward, and central differences, and compare each numerical result against the exact SymPy derivative to assess error.

Instructions

Approximate the first and second derivatives of f(x) at x with finite differences.

Computes forward, backward and central differences for the first derivative, plus the central second derivative, and compares each against the exact derivative from SymPy.

Args: func_str: Math expression in x. x_val: Point where the derivative is evaluated. h: Step size (small, positive). precision: Rounding digits.

Returns: Dict with the exact and numerical derivatives and their errors.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hNo
x_valYes
func_strYes
precisionNo

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/agmonetti/mathmethods-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server