This seems to tell us that your spline tau_of_x_spline is declared constant. How is your spline declared, i.e. is it declared as

`Spline tau_of_x_spline{"tau"};`

in the header file?

Here is a simple test code to check that it works:

`// Make xarray = 0.0, ...., 1.0`

Vector xarray = Utils::linspace(0.0,1.0,100);

// Make the function y = e^x

Vector yarray = exp(xarray);

// Spline it

Spline f(xarray,yarray);

// Try to find the value where e^x = e^0.5

double value = Utils::binary_search_for_value(f,std::exp(0.5));

std::cout << "exp(x) = exp(0.5) when x = " << value << "\n";

If this works then there is something with how your spline is declared.

If something is declared const, but needs to be used in a non-const way then one can cheat and remove the const-ness of it, e.g. in the example above

`...`

const Spline f(xarray,yarray);

...

double value = Utils::binary_search_for_value( const_cast<Spline&>(f), std::exp(0.5));