julia> using LinearAlgebra
julia> f(A, x) = begin
B = copy(A)
B[[CartesianIndex(i, i) for i in 1:7]] .-= [(x + 2*i) ^ 2 for i in -3:3]
det(B)
end
julia> using Roots
julia> A = rand(7, 7);
julia> @btime find_zero(x -> f(A, x), (-1, 1))
123.304 μs (2347 allocations: 135.73 KiB)
-0.8062169304571464