{ } Raw JSON

bundles / scipy 1.17.1 / scipy / optimize / _numdiff / _compute_absolute_step

function

scipy.optimize._numdiff:_compute_absolute_step

source: /scipy/optimize/_numdiff.py :147

Signature

def   _compute_absolute_step ( rel_step x0 f0 method )

Summary

Computes an absolute step from a relative step for finite difference calculation.

Parameters

rel_step: None or array-like

Relative step for the finite difference calculation

x0 : np.ndarray

Parameter vector

f0 : np.ndarray or scalar
method : {'2-point', '3-point', 'cs'}

Returns

h : float

The absolute step size

Notes

h will always be np.float64. However, if x0 or f0 are smaller floating point dtypes (e.g. np.float32), then the absolute step size will be calculated from the smallest floating point size.

Aliases

  • scipy.optimize._numdiff._compute_absolute_step