#include <iostream>
#include <kv/defint-singular.hpp>

typedef kv::interval<double> itv;

struct RemSing {
	template <class T> T operator()(const T& x) {
		return x * x / (1 - cos(x));
	}
};

struct RemSing_s {
	template <class T> T operator()(const T& x) {
		return div_reduce(x * x, 1 - cos(x), 2);
	}
};

int main() {
	std::cout.precision(17);

	std::cout<< kv::defint_singular_autostep(RemSing(), RemSing_s(), (itv)0., (itv)1., 12) << "\n";
}
