<commit_before>package ru.r2cloud.jradio.util;

public class MathUtils {

	public static final float FIVE_BIT_RESOLUTION = (float) (1 / Math.pow(2.0, 5));
	public static final float FOUR_BIT_RESOLUTION = (float) (1 / Math.pow(2.0, 4));
	public static final float THIRTEEN_BIT_RESOLUTION = (float) (1 / Math.pow(2.0, 13));

	private static final double ONE_AND_HALF_PI = 3 * Math.PI / 2;
	private static final double HALF_PI = Math.PI / 2;
	private static final float TAU = 2.0f * 3.14159265358979323846f;
	private static final float TWO_TO_THE_31 = 2147483648.0f;
	private static final int WORDBITS = 32;
	private static final int NBITS = 10;

	private static final double TAN_MAP_RES = 0.003921569;
	private static final int TAN_MAP_SIZE = 255;

	public static float branchlessClip(float x, float clip) {
		float x1 = Math.abs(x + clip);
		float x2 = Math.abs(x - clip);
		x1 -= x2;
		return (float) 0.5 * x1;
	}

	public static int floatToFixed(float x) {
		// Fold x into -PI to PI.
		int d = (int) Math.floor(x / TAU + 0.5);
		x -= d * TAU;
		// And convert to an integer.
		return (int) (x * TWO_TO_THE_31 / Math.PI);
	}

	public static void sincos(int x, float[] complex) {
		long ux = x & 0xFFFFFFFFL;
		int sin_index = (int)(ux >> (WORDBITS - NBITS));
		complex[1] = SINE_TABLE[sin_index][0] * (ux >> 1) + SINE_TABLE[sin_index][1];

		ux = x + 0x40000000;
		int cos_index = (int)(ux >> (WORDBITS - NBITS));
		complex[0] = SINE_TABLE[cos_index][0] * (ux >> 1) + SINE_TABLE[cos_index][1];

		return;
	}

	/**
	 * Least Common Multiple
	 * 
	 * @param number1
	 * @param number2<commit_msg>fixing code smells<commit_after>package ru.r2cloud.jradio.util;

public class MathUtils {

	public static final float FIVE_BIT_RESOLUTION = (float) (1 / Math.pow(2.0, 5));
	public static final float FOUR_BIT_RESOLUTION = (float) (1 / Math.pow(2.0, 4));
	public static final float THIRTEEN_BIT_RESOLUTION = (float) (1 / Math.pow(2.0, 13));

	private static final double ONE_AND_HALF_PI = 3 * Math.PI / 2;
	private static final double HALF_PI = Math.PI / 2;
	private static final float TAU = 2.0f * 3.14159265358979323846f;
	private static final float TWO_TO_THE_31 = 2147483648.0f;
	private static final int WORDBITS = 32;
	private static final int NBITS = 10;

	private static final double TAN_MAP_RES = 0.003921569;
	private static final int TAN_MAP_SIZE = 255;

	public static float branchlessClip(float x, float clip) {
		float x1 = Math.abs(x + clip);
		float x2 = Math.abs(x - clip);
		x1 -= x2;
		return (float) 0.5 * x1;
	}

	public static int floatToFixed(float x) {
		// Fold x into -PI to PI.
		int d = (int) Math.floor(x / TAU + 0.5);
		x -= d * TAU;
		// And convert to an integer.
		return (int) (x * TWO_TO_THE_31 / Math.PI);
	}

	public static void sincos(int x, float[] complex) {
		long ux = x & 0xFFFFFFFFL;
		int sin_index = (int)(ux >> (WORDBITS - NBITS));
		complex[1] = SINE_TABLE[sin_index][0] * (ux >> 1) + SINE_TABLE[sin_index][1];

		ux = x + 0x40000000L;
		int cos_index = (int)(ux >> (WORDBITS - NBITS));
		complex[0] = SINE_TABLE[cos_index][0] * (ux >> 1) + SINE_TABLE[cos_index][1];

		return;
	}

	/**
	 * Least Common Multiple
	 * 
	 * @param number1
	 * @param number2
{'fraction_non_alphanumeric': 0.13078848560700876, 'fraction_numerical': 0.06320400500625782, 'mean_word_length': 3.5606276747503567, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '7053910', 'n_tokens_mistral': 1408, 'n_tokens_neox': 1212, 'n_words': 355}