'use strict';

var back = require('./back.js');

const anticipate = (p) => p >= 1
    ? 1
    : (p *= 2) < 1
        ? 0.5 * back.backIn(p)
        : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));

exports.anticipate = anticipate;
