<commit_before>package org.joml;

/**
 * Provides basic interpolation functions.
 * 
 * @author <NAME>
 */
public class Interpolate {

    /**
     * Interpolates between the given two values with their associated tangens
     * using hermite interpolation.
     * 
     * @param v0
     *            the first value
     * @param t0
     *            the tangent of the first value
     * @param v1
     *            the second value
     * @param t1
     *            the tangent of the second value
     * @param t
     *            the interpolation parameter, within <tt>[0..1]</tt>
     * @return the interpolated value
     */
    public static double hermite(double v0, double t0, double v1, double t1, double t) {
        double t2 = t * t;
        double t3 = t2 * t;
        double result;
        if (t == 0.0)
            result = v0;
        else if (t == 1.0)
            result = v1;
        else
            result = (2.0 * v0 - 2.0 * v1 + t1 + t0) * t3 + (3.0 * v1 - 3.0 * v0 - 2.0 * t0 - t1) * t2 + t0 * t + v0;
        return (float) result;
    }

    /**
     * Uses hermite interpolation with zero tangents to produce smooth values
     * between <code>v1</code> and <code>v2</code> based on the value of
     * <code>t</code>.
     * 
     * @param v1
     * @param v2
     * @param t
     *            the interpolation parameter, within <tt>[0..1]</tt>
     * @return the interpolated value
     */
    public static double smoothStep(double v1, double v2, double t) {
        double result = t > 1.0 ? 1.0 : (t < 0.0 ? 0.0 : t);
        result = hermite(v1, 0.0, v2, 0.0, result);
        return result;
    }

}<commit_msg>Don't cast to float<commit_after>package org.joml;

/**
 * Provides basic interpolation functions.
 * 
 * @author <NAME>
 */
public class Interpolate {

    /**
     * Interpolates between the given two values with their associated tangens
     * using hermite interpolation.
     * 
     * @param v0
     *            the first value
     * @param t0
     *            the tangent of the first value
     * @param v1
     *            the second value
     * @param t1
     *            the tangent of the second value
     * @param t
     *            the interpolation parameter, within <tt>[0..1]</tt>
     * @return the interpolated value
     */
    public static double hermite(double v0, double t0, double v1, double t1, double t) {
        double t2 = t * t;
        double t3 = t2 * t;
        double result;
        if (t == 0.0)
            result = v0;
        else if (t == 1.0)
            result = v1;
        else
            result = (2.0 * v0 - 2.0 * v1 + t1 + t0) * t3 + (3.0 * v1 - 3.0 * v0 - 2.0 * t0 - t1) * t2 + t0 * t + v0;
        return result;
    }

    /**
     * Uses hermite interpolation with zero tangents to produce smooth values
     * between <code>v1</code> and <code>v2</code> based on the value of
     * <code>t</code>.
     * 
     * @param v1
     * @param v2
     * @param t
     *            the interpolation parameter, within <tt>[0..1]</tt>
     * @return the interpolated value
     */
    public static double smoothStep(double v1, double v2, double t) {
        double result = t > 1.0 ? 1.0 : (t < 0.0 ? 0.0 : t);
        result = hermite(v1, 0.0, v2, 0.0, result);
        return result;
    }

}
{'fraction_non_alphanumeric': 0.11484848484848485, 'fraction_numerical': 0.038181818181818185, 'mean_word_length': 1.6219221604447975, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '6934145', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1074, 'n_words': 360}