B2G/gecko/browser/components/tabview/modules/utils.jsm
//  - (bool) smooth? If true, a smooth tanh-based function will be used instead of the linear.
(bool) smooth. If true, a smooth tanh-based function will be used instead of the linear.
( bool ) smooth . If true a smooth tanh - based function will be used instead of the linear .
function Range_proportion(value, smooth) {
    if (value <= this.min)
      return 0;
    if (this.max <= value)
      return 1;
    var proportion = (value - this.min) / this.extent;
    if (smooth) {
      let tanh = function tanh(x) {
        var e = Math.exp(x);
        return (e - 1/e) / (e + 1/e);
      };
      return .5 - .5 * tanh(2 - 4 * proportion);
    }
    return proportion;
  }
function Range_proportion ( value , smooth ) { if ( value <= this . min ) return 0 ; if ( this . max <= value ) return 1 ; var proportion = ( value - this . min ) / this . extent ; if ( smooth ) { let tanh = function tanh ( x ) { var e = Math . exp ( x ) ; return ( e - 1 / e ) / ( e + 1 / e ) ; } ; return .5 - .5 * tanh ( 2 - 4 * proportion ) ; } return proportion ; }
(bool) smooth?
( bool ) smooth?
// The ease function ".5+.5*Math.tanh(4*x-2)" is a pretty // little graph. It goes from near 0 at x=0 to near 1 at x=1 // smoothly and beautifully. // http://www.wolframalpha.com/input/?i=.5+%2B+.5+*+tanh%28%284+*+x%29+-+2%29