No description
Find a file
2025-02-12 11:05:04 +01:00
src add handling of nonallocating functions, add plot option 2025-02-12 11:04:26 +01:00
test clean up 2025-02-12 11:04:31 +01:00
Project.toml bump version 2025-02-12 11:05:04 +01:00
README.md update README 2025-02-10 13:09:32 +01:00

TaylorTest

Simple package to check derivatives

Usage

  check(f, Jf, x[, constant_components]; f_kwargs...)

Returns true if Jf approximates the derivative/gradient/Jacobian of f at point x (along a random direction). f_kwargs are keywords arguments to be passed to f and Jf. constant_components is an optional Vector{Int} corresponding to components of the direction which should be set to zero, effectively ignoring the dependency of f on these components.

Examples

import TaylorTest

f = x -> cos(x)
Jf = x -> -sin(x)

TaylorTest.check(f, Jf, rand())

# [ Info: Approximation order ~ 1.0
# true