Function that computes the cost (objective function value) for general optimization. Takes parameter vector and returns scalar cost value.
Note: Uses Float64Array for parameter vector to ensure 64-bit floating-point precision and better performance in numerical computations.
Function that computes the cost (objective function value) for general optimization. Takes parameter vector and returns scalar cost value.
Note: Uses Float64Array for parameter vector to ensure 64-bit floating-point precision and better performance in numerical computations.