Skip to main content
POST
/
quantlib
/
numerical
/
differentiation
/
gradient
Compute Numerical Gradient
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/numerical/differentiation/gradient \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "func_name": "rosenbrock",
  "x": [
    1,
    1
  ],
  "h": 1e-7,
  "method": "forward"
}
'
{
  "success": true,
  "data": {
    "function": "rosenbrock",
    "x": [
      1,
      1
    ],
    "gradient": [
      0,
      0
    ]
  }
}

Authorizations

X-API-Key
string
header
required

API key for authentication. Get your key at https://finceptbackend.share.zrok.io/auth/register

Body

application/json
func_name
enum<string>
required

Built-in multi-variable function name

Available options:
rosenbrock,
sphere,
rastrigin,
quadratic
Example:

"rosenbrock"

x
number[]
required

Point at which to evaluate the gradient (vector of coordinates)

Example:
[1, 1]
h
number
default:1e-7

Step size for finite difference

Example:

1e-7

method
enum<string>
default:forward

Finite difference method

Available options:
forward,
central
Example:

"forward"

Response

Successful Response

success
boolean
Example:

true

data
object