<commit_before>#ifndef HMLIB_ODEINT_INTERFERE_BOUNDARY_INC
#
namespace hmLib {
	namespace odeint {
		

		template<typename state_type_>
		struct sigmoid_boundary_diff{
			template<typename functor>
			double sigmoid_zero_boundary(double x, functor dx, double boundary_error, double abs_error) {
				if (boundary_error < x)return dx(x);

				double v = dx(boundary_error);
				double dv = (dx(boundary_error + abs_error) - dx(boundary_error - abs_error)) / (2 * abs_error);

				double vk = v * 2;
				double va = dv * 4 / (vk + std::numeric_limits<double>::min());

				if (v>0) {
					//				double ans = vk / (1 + std::exp(-va*(x - boundary_error)));
					return vk / (1 + std::exp(-va*(x - boundary_error)));
				}

				double ba = std::log(1 / boundary_error + 1) / boundary_error;
				double bk = -(vk / (1 + std::exp(-va*(0.0 - boundary_error)))) / (0.5 - (1 / (1 + std::exp(ba*(boundary_error)))));
				double bv = -bk / (1 + std::exp(ba*boundary_error));

				//			double ans = vk / (1 + std::exp(-va*(x - boundary_error))) + bk / (1 + std::exp(ba*x)) + bv;

				return vk / (1 + std::exp(-va*(x - boundary_error))) + bk / (1 + std::exp(ba*x)) + bv;
			}
		};
		struct float_lower_boundary {
			using state_type = double;
		private:
			state_type val;
			bool prev;
		public:
			float_lower_boundary(const state_type& val_) :val(val_) {}
			float_lower_boundary(state_type&& val_) :val(val_) {}
		public:
			void ready(const state_type& x) { prev = check(x); }
			bool valid_step(const state_type& x)const { return prev || !check(x); }
			bool validate(const state_type& x, state_type& vx) const {
				if (check(x)) {
					vx = val;
					return true;<commit_msg>Fix boundary<commit_after>#ifndef HMLIB_ODEINT_INTERFERE_BOUNDARY_INC
#
namespace hmLib {
	namespace odeint {
		struct bounadry_diff_mode {
			struct always{};
			struct step_base{};
			struct never {};
		};
		template<typename state_type_>
		struct sigmoid_boundary_diff{
			template<typename functor>
			double sigmoid_zero_boundary(double x, functor dx, double boundary_error, double abs_error) {
				if (boundary_error < x)return dx(x);

				double v = dx(boundary_error);
				double dv = (dx(boundary_error + abs_error) - dx(boundary_error - abs_error)) / (2 * abs_error);

				double vk = v * 2;
				double va = dv * 4 / (vk + std::numeric_limits<double>::min());

				if (v>0) {
					//				double ans = vk / (1 + std::exp(-va*(x - boundary_error)));
					return vk / (1 + std::exp(-va*(x - boundary_error)));
				}

				double ba = std::log(1 / boundary_error + 1) / boundary_error;
				double bk = -(vk / (1 + std::exp(-va*(0.0 - boundary_error)))) / (0.5 - (1 / (1 + std::exp(ba*(boundary_error)))));
				double bv = -bk / (1 + std::exp(ba*boundary_error));

				//			double ans = vk / (1 + std::exp(-va*(x - boundary_error))) + bk / (1 + std::exp(ba*x)) + bv;

				return vk / (1 + std::exp(-va*(x - boundary_error))) + bk / (1 + std::exp(ba*x)) + bv;
			}
		};
		template<typename diff_type_,typename diff_mode_>
		struct float_lower_boundary {
			using state_type = double;
		private:
			state_type val;
			bool prev;
		public:
			float_lower_boundary(const state_type& val_) :val(val_) {}
			float_lower_boundary(state_type&& val_) :val(val_) {}
		public:
			void ready(const state_type& x) { prev = check(x); }
			bool valid_step(const state_type& x)const { return prev || !check(x); }
			bool validate(const state_type& x, state_type& vx) const {
				if (check(x)) {
					vx = val;
					return true;
{'fraction_non_alphanumeric': 0.15934539190353145, 'fraction_numerical': 0.011484352569623888, 'mean_word_length': 3.3495630461922596, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1757213', 'n_tokens_mistral': 1500, 'n_tokens_neox': 1251, 'n_words': 299}