Skip to main content
POST
/
quantlib
/
numerical
/
roots
/
newton
Find Root Using Newton's Method
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/numerical/roots/newton \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "func_name": "exp_minus_2",
  "x0": 1,
  "tol": 1e-12
}
'
{
  "success": true,
  "data": {
    "root": 0.6931471805599453,
    "iterations": 4,
    "converged": true
  }
}

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 function or 'custom_poly' for polynomial

Available options:
sin,
cos,
exp,
log,
exp_minus_2,
x2_minus_4,
custom_poly
Example:

"exp_minus_2"

x0
number
required

Initial guess for the root

Example:

1

tol
number
default:1e-12

Convergence tolerance

Example:

1e-12

poly_coeffs
number[]

Polynomial coefficients (only for custom_poly)

Example:
[-2, 0, 1]

Response

Successful Response

success
boolean
Example:

true

data
object