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

typedef kv::interval<double> itv;

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

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

	std::cout << kv::defint_newtoncotes(Func(), itv(-1), itv(1), 2, 20) << "\n";
	std::cout << kv::defint_newtoncotes(Func(), itv(-1), itv(1), 6, 0) << "\n";
}
