diff --git a/include/random b/include/random
index 1a680ff..adefa8b 100644
--- a/include/random
+++ b/include/random
@@ -1552,7 +1552,82 @@
 };
 
 template<class RealType = double>
-    class piecewise_linear_distribution;
+class piecewise_linear_distribution
+{
+    // types
+    typedef RealType result_type;
+
+    class param_type
+    {
+    public:
+        typedef piecewise_linear_distribution distribution_type;
+
+        param_type();
+        template<class InputIteratorB, class InputIteratorW>
+            param_type(InputIteratorB firstB, InputIteratorB lastB,
+                       InputIteratorW firstW);
+        template<class UnaryOperation>
+            param_type(initializer_list<result_type> bl, UnaryOperation fw);
+        template<class UnaryOperation>
+            param_type(size_t nw, result_type xmin, result_type xmax,
+                       UnaryOperation fw);
+
+        vector<result_type> intervals() const;
+        vector<double> densities() const;
+
+        friend bool operator==(const param_type& x, const param_type& y);
+        friend bool operator!=(const param_type& x, const param_type& y);
+    };
+
+    // constructor and reset functions
+    piecewise_linear_distribution();
+    template<class InputIteratorB, class InputIteratorW>
+        piecewise_linear_distribution(InputIteratorB firstB,
+                                      InputIteratorB lastB,
+                                      InputIteratorW firstW);
+        
+    template<class UnaryOperation>
+        piecewise_linear_distribution(initializer_list<result_type> bl,
+                                      UnaryOperation fw);
+
+    template<class UnaryOperation>
+        piecewise_linear_distribution(size_t nw, result_type xmin,
+                                      result_type xmax, UnaryOperation fw);
+
+    explicit piecewise_linear_distribution(const param_type& parm);
+    void reset();
+
+    // generating functions
+    template<class URNG> result_type operator()(URNG& g);
+    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
+
+    // property functions
+    vector<result_type> intervals() const;
+    vector<double> densities() const;
+
+    param_type param() const;
+    void param(const param_type& parm);
+
+    result_type min() const;
+    result_type max() const;
+
+    friend bool operator==(const piecewise_linear_distribution& x,
+                           const piecewise_linear_distribution& y);
+    friend bool operator!=(const piecewise_linear_distribution& x,
+                           const piecewise_linear_distribution& y);
+
+    template <class charT, class traits>
+    friend
+    basic_ostream<charT, traits>&
+    operator<<(basic_ostream<charT, traits>& os,
+               const piecewise_linear_distribution& x);
+    
+    template <class charT, class traits>
+    friend
+    basic_istream<charT, traits>&
+    operator>>(basic_istream<charT, traits>& is,
+               piecewise_linear_distribution& x);
+};
 
 } // std
 */
@@ -5772,7 +5847,8 @@
 template<class _RealType>
 piecewise_constant_distribution<_RealType>::param_type::param_type()
     : __b_(2),
-      __densities_(1, 1.0)
+      __densities_(1, 1.0),
+      __areas_(1, 0.0)
 {
     __b_[1] = 1;
 }
@@ -5789,6 +5865,7 @@
         __b_[0] = 0;
         __b_[1] = 1;
         __densities_.assign(1, 1.0);
+        __areas_.assign(1, 0.0);
     }
     else
     {
@@ -5811,6 +5888,7 @@
         __b_[0] = 0;
         __b_[1] = 1;
         __densities_.assign(1, 1.0);
+        __areas_.assign(1, 0.0);
     }
     else
     {
@@ -5910,6 +5988,301 @@
     return __is;
 }
 
+// piecewise_linear_distribution
+
+template<class _RealType = double>
+class piecewise_linear_distribution
+{
+public:
+    // types
+    typedef _RealType result_type;
+
+    class param_type
+    {
+        typedef typename common_type<double, result_type>::type __area_type;
+        vector<result_type> __b_;
+        vector<double> __densities_;
+        vector<__area_type> __areas_;
+    public:
+        typedef piecewise_linear_distribution distribution_type;
+
+        param_type();
+        template<class _InputIteratorB, class _InputIteratorW>
+            param_type(_InputIteratorB __fB, _InputIteratorB __lB,
+                       _InputIteratorW __fW);
+        template<class _UnaryOperation>
+            param_type(initializer_list<result_type> __bl, _UnaryOperation __fw);
+        template<class _UnaryOperation>
+            param_type(size_t __nw, result_type __xmin, result_type __xmax,
+                       _UnaryOperation __fw);
+
+        vector<result_type> intervals() const {return __b_;}
+        vector<double> densities() const {return __densities_;}
+
+        friend bool operator==(const param_type& __x, const param_type& __y)
+            {return __x.__densities_ == __y.__densities_ && __x.__b_ == __y.__b_;}
+        friend bool operator!=(const param_type& __x, const param_type& __y)
+            {return !(__x == __y);}
+
+    private:
+        void __init();
+
+        friend class piecewise_linear_distribution;
+
+        template <class _CharT, class _Traits, class _RT>
+        friend
+        basic_ostream<_CharT, _Traits>&
+        operator<<(basic_ostream<_CharT, _Traits>& __os,
+                   const piecewise_linear_distribution<_RT>& __x);
+        
+        template <class _CharT, class _Traits, class _RT>
+        friend
+        basic_istream<_CharT, _Traits>&
+        operator>>(basic_istream<_CharT, _Traits>& __is,
+                   piecewise_linear_distribution<_RT>& __x);
+    };
+
+private:
+    param_type __p_;
+
+public:
+    // constructor and reset functions
+    piecewise_linear_distribution() {}
+    template<class _InputIteratorB, class _InputIteratorW>
+        piecewise_linear_distribution(_InputIteratorB __fB,
+                                      _InputIteratorB __lB,
+                                      _InputIteratorW __fW)
+        : __p_(__fB, __lB, __fW) {}
+        
+    template<class _UnaryOperation>
+        piecewise_linear_distribution(initializer_list<result_type> __bl,
+                                      _UnaryOperation __fw)
+        : __p_(__bl, __fw) {}
+
+    template<class _UnaryOperation>
+        piecewise_linear_distribution(size_t __nw, result_type __xmin,
+                                      result_type __xmax, _UnaryOperation __fw)
+        : __p_(__nw, __xmin, __xmax, __fw) {}
+
+    explicit piecewise_linear_distribution(const param_type& __p)
+        : __p_(__p) {}
+
+    void reset() {}
+
+    // generating functions
+    template<class _URNG> result_type operator()(_URNG& __g)
+        {return (*this)(__g, __p_);}
+    template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p);
+
+    // property functions
+    vector<result_type> intervals() const {return __p_.intervals();}
+    vector<double> densities() const {return __p_.densities();}
+
+    param_type param() const {return __p_;}
+    void param(const param_type& __p) {__p_ = __p;}
+
+    result_type min() const {return __p_.__b_.front();}
+    result_type max() const {return __p_.__b_.back();}
+
+    friend bool operator==(const piecewise_linear_distribution& __x,
+                           const piecewise_linear_distribution& __y)
+        {return __x.__p_ == __y.__p_;}
+    friend bool operator!=(const piecewise_linear_distribution& __x,
+                           const piecewise_linear_distribution& __y)
+        {return !(__x == __y);}
+
+    template <class _CharT, class _Traits, class _RT>
+    friend
+    basic_ostream<_CharT, _Traits>&
+    operator<<(basic_ostream<_CharT, _Traits>& __os,
+               const piecewise_linear_distribution<_RT>& __x);
+    
+    template <class _CharT, class _Traits, class _RT>
+    friend
+    basic_istream<_CharT, _Traits>&
+    operator>>(basic_istream<_CharT, _Traits>& __is,
+               piecewise_linear_distribution<_RT>& __x);
+};
+
+template<class _RealType>
+void
+piecewise_linear_distribution<_RealType>::param_type::__init()
+{
+    __areas_.assign(__densities_.size() - 1, __area_type());
+    __area_type _S = 0;
+    for (size_t __i = 0; __i < __areas_.size(); ++__i)
+    {
+        __areas_[__i] = (__densities_[__i+1] + __densities_[__i]) *
+                        (__b_[__i+1] - __b_[__i]) * .5;
+        _S += __areas_[__i];
+    }
+    for (size_t __i = __areas_.size(); __i > 1;)
+    {
+        --__i;
+        __areas_[__i] = __areas_[__i-1] / _S;
+    }
+    __areas_[0] = 0;
+    for (size_t __i = 1; __i < __areas_.size(); ++__i)
+        __areas_[__i] += __areas_[__i-1];
+    for (size_t __i = 0; __i < __densities_.size(); ++__i)
+        __densities_[__i] /= _S;
+}
+
+template<class _RealType>
+piecewise_linear_distribution<_RealType>::param_type::param_type()
+    : __b_(2),
+      __densities_(2, 1.0),
+      __areas_(1, 0.0)
+{
+    __b_[1] = 1;
+}
+
+template<class _RealType>
+template<class _InputIteratorB, class _InputIteratorW>
+piecewise_linear_distribution<_RealType>::param_type::param_type(
+        _InputIteratorB __fB, _InputIteratorB __lB, _InputIteratorW __fW)
+    : __b_(__fB, __lB)
+{
+    if (__b_.size() < 2)
+    {
+        __b_.resize(2);
+        __b_[0] = 0;
+        __b_[1] = 1;
+        __densities_.assign(2, 1.0);
+        __areas_.assign(1, 0.0);
+    }
+    else
+    {
+        __densities_.reserve(__b_.size());
+        for (size_t __i = 0; __i < __b_.size(); ++__i, ++__fW)
+            __densities_.push_back(*__fW);
+        __init();
+    }
+}
+
+template<class _RealType>
+template<class _UnaryOperation>
+piecewise_linear_distribution<_RealType>::param_type::param_type(
+        initializer_list<result_type> __bl, _UnaryOperation __fw)
+    : __b_(__bl.begin(), __bl.end())
+{
+    if (__b_.size() < 2)
+    {
+        __b_.resize(2);
+        __b_[0] = 0;
+        __b_[1] = 1;
+        __densities_.assign(2, 1.0);
+        __areas_.assign(1, 0.0);
+    }
+    else
+    {
+        __densities_.reserve(__b_.size());
+        for (size_t __i = 0; __i < __b_.size(); ++__i)
+            __densities_.push_back(__fw(__b_[__i]));
+        __init();
+    }
+}
+
+template<class _RealType>
+template<class _UnaryOperation>
+piecewise_linear_distribution<_RealType>::param_type::param_type(
+        size_t __nw, result_type __xmin, result_type __xmax, _UnaryOperation __fw)
+    : __b_(__nw == 0 ? 2 : __nw + 1)
+{
+    size_t __n = __b_.size() - 1;
+    result_type __d = (__xmax - __xmin) / __n;
+    __densities_.reserve(__b_.size());
+    for (size_t __i = 0; __i < __n; ++__i)
+    {
+        __b_[__i] = __xmin + __i * __d;
+        __densities_.push_back(__fw(__b_[__i]));
+    }
+    __b_[__n] = __xmax;
+    __densities_.push_back(__fw(__b_[__n]));
+    __init();
+}
+
+template<class _RealType>
+template<class _URNG>
+_RealType
+piecewise_linear_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
+{
+    typedef uniform_real_distribution<result_type> _Gen;
+    result_type __u = _Gen()(__g);
+    ptrdiff_t __k = _STD::upper_bound(__p.__areas_.begin(), __p.__areas_.end(),
+                               static_cast<double>(__u)) - __p.__areas_.begin() - 1;
+    __u -= __p.__areas_[__k];
+    const double __dk = __p.__densities_[__k];
+    const double __dk1 = __p.__densities_[__k+1];
+    const double __deltad = __dk1 - __dk;
+    const result_type __bk = __p.__b_[__k];
+    if (__deltad == 0)
+        return static_cast<result_type>(__u / __dk + __bk);
+    const result_type __bk1 = __p.__b_[__k+1];
+    const result_type __deltab = __bk1 - __bk;
+    return static_cast<result_type>((__bk * __dk1 - __bk1 * __dk + 
+        _STD::sqrt(__deltab * (__deltab * __dk * __dk + 2 * __deltad * __u))) /
+        __deltad);
+}
+
+template <class _CharT, class _Traits, class _RT>
+basic_ostream<_CharT, _Traits>&
+operator<<(basic_ostream<_CharT, _Traits>& __os,
+           const piecewise_linear_distribution<_RT>& __x)
+{
+    __save_flags<_CharT, _Traits> _(__os);
+    __os.flags(ios_base::dec | ios_base::left | ios_base::fixed |
+               ios_base::scientific);
+    _CharT __sp = __os.widen(' ');
+    __os.fill(__sp);
+    size_t __n = __x.__p_.__b_.size();
+    __os << __n;
+    for (size_t __i = 0; __i < __n; ++__i)
+        __os << __sp << __x.__p_.__b_[__i];
+    __n = __x.__p_.__densities_.size();
+    __os << __sp << __n;
+    for (size_t __i = 0; __i < __n; ++__i)
+        __os << __sp << __x.__p_.__densities_[__i];
+    __n = __x.__p_.__areas_.size();
+    __os << __sp << __n;
+    for (size_t __i = 0; __i < __n; ++__i)
+        __os << __sp << __x.__p_.__areas_[__i];
+    return __os;
+}
+
+template <class _CharT, class _Traits, class _RT>
+basic_istream<_CharT, _Traits>&
+operator>>(basic_istream<_CharT, _Traits>& __is,
+           piecewise_linear_distribution<_RT>& __x)
+{
+    typedef piecewise_linear_distribution<_RT> _Eng;
+    typedef typename _Eng::result_type result_type;
+    typedef typename _Eng::param_type param_type;
+    typedef typename param_type::__area_type __area_type;
+    __save_flags<_CharT, _Traits> _(__is);
+    __is.flags(ios_base::dec | ios_base::skipws);
+    size_t __n;
+    __is >> __n;
+    vector<result_type> __b(__n);
+    for (size_t __i = 0; __i < __n; ++__i)
+        __is >> __b[__i];
+    __is >> __n;
+    vector<double> __densities(__n);
+    for (size_t __i = 0; __i < __n; ++__i)
+        __is >> __densities[__i];
+    __is >> __n;
+    vector<__area_type> __areas(__n);
+    for (size_t __i = 0; __i < __n; ++__i)
+        __is >> __areas[__i];
+    if (!__is.fail())
+    {
+        swap(__x.__p_.__b_, __b);
+        swap(__x.__p_.__densities_, __densities);
+        swap(__x.__p_.__areas_, __areas);
+    }
+    return __is;
+}
+
 _LIBCPP_END_NAMESPACE_STD
 
 #endif  // _LIBCPP_RANDOM
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/assign.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/assign.pass.cpp
new file mode 100644
index 0000000..77b6923
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/assign.pass.cpp
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// piecewise_linear_distribution& operator=(const piecewise_linear_distribution&);
+
+#include <random>
+#include <cassert>
+
+void
+test1()
+{
+    typedef std::piecewise_linear_distribution<> D;
+    double p[] = {2, 4, 1, 8, 3};
+    double b[] = {2, 4, 5, 8, 9};
+    D d1(b, b+5, p);
+    D d2;
+    assert(d1 != d2);
+    d2 = d1;
+    assert(d1 == d2);
+}
+
+int main()
+{
+    test1();
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/copy.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/copy.pass.cpp
new file mode 100644
index 0000000..3bc165f
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/copy.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// piecewise_linear_distribution(const piecewise_linear_distribution&);
+
+#include <random>
+#include <cassert>
+
+void
+test1()
+{
+    typedef std::piecewise_linear_distribution<> D;
+    double p[] = {2, 4, 1, 8, 2};
+    double b[] = {2, 4, 5, 8, 9};
+    D d1(b, b+5, p);
+    D d2 = d1;
+    assert(d1 == d2);
+}
+
+int main()
+{
+    test1();
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_default.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_default.pass.cpp
new file mode 100644
index 0000000..ca0b775
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_default.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// piecewise_linear_distribution(initializer_list<double> wl);
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        D d;
+        std::vector<double> iv = d.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 0);
+        assert(iv[1] == 1);
+        std::vector<double> dn = d.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 1);
+        assert(dn[1] == 1);
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_func.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_func.pass.cpp
new file mode 100644
index 0000000..fed6f56
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_func.pass.cpp
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// template<class UnaryOperation>
+//     piecewise_linear_distribution(size_t nw, result_type xmin,
+//                                     result_type xmax, UnaryOperation fw);
+
+#include <iostream>
+
+#include <random>
+#include <cassert>
+
+double fw(double x)
+{
+    return 2*x;
+}
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        D d(0, 0, 1, fw);
+        std::vector<double> iv = d.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 0);
+        assert(iv[1] == 1);
+        std::vector<double> dn = d.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 0);
+        assert(dn[1] == 2);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        D d(1, 10, 12, fw);
+        std::vector<double> iv = d.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 10);
+        assert(iv[1] == 12);
+        std::vector<double> dn = d.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 20./44);
+        assert(dn[1] == 24./44);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        D d(2, 6, 14, fw);
+        std::vector<double> iv = d.intervals();
+        assert(iv.size() == 3);
+        assert(iv[0] == 6);
+        assert(iv[1] == 10);
+        assert(iv[2] == 14);
+        std::vector<double> dn = d.densities();
+        assert(dn.size() == 3);
+        assert(dn[0] == 0.075);
+        assert(dn[1] == 0.125);
+        assert(dn[2] == 0.175);
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_init_func.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_init_func.pass.cpp
new file mode 100644
index 0000000..77aab01
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_init_func.pass.cpp
@@ -0,0 +1,82 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// piecewise_linear_distribution(initializer_list<result_type> bl,
+//                                 UnaryOperation fw);
+
+#include <iostream>
+
+#include <random>
+#include <cassert>
+
+double f(double x)
+{
+    return x*2;
+}
+
+int main()
+{
+#ifdef _LIBCPP_MOVE
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        D d({}, f);
+        std::vector<double> iv = d.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 0);
+        assert(iv[1] == 1);
+        std::vector<double> dn = d.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 1);
+        assert(dn[1] == 1);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        D d({12}, f);
+        std::vector<double> iv = d.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 0);
+        assert(iv[1] == 1);
+        std::vector<double> dn = d.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 1);
+        assert(dn[1] == 1);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        D d({10, 12}, f);
+        std::vector<double> iv = d.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 10);
+        assert(iv[1] == 12);
+        std::vector<double> dn = d.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 20./44);
+        assert(dn[1] == 24./44);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        D d({6, 10, 14}, f);
+        std::vector<double> iv = d.intervals();
+        assert(iv.size() == 3);
+        assert(iv[0] == 6);
+        assert(iv[1] == 10);
+        assert(iv[2] == 14);
+        std::vector<double> dn = d.densities();
+        assert(dn.size() == 3);
+        assert(dn[0] == 0.075);
+        assert(dn[1] == 0.125);
+        assert(dn[2] == 0.175);
+    }
+#endif
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_iterator.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_iterator.pass.cpp
new file mode 100644
index 0000000..89ba21a
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_iterator.pass.cpp
@@ -0,0 +1,101 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// template<class InputIterator>
+//     piecewise_linear_distribution(InputIteratorB firstB,
+//                                     InputIteratorB lastB,
+//                                     InputIteratorW firstW);
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        double b[] = {10};
+        double p[] = {12};
+        D d(b, b, p);
+        std::vector<double> iv = d.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 0);
+        assert(iv[1] == 1);
+        std::vector<double> dn = d.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 1);
+        assert(dn[1] == 1);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        double b[] = {10};
+        double p[] = {12};
+        D d(b, b+1, p);
+        std::vector<double> iv = d.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 0);
+        assert(iv[1] == 1);
+        std::vector<double> dn = d.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 1);
+        assert(dn[1] == 1);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        double b[] = {10, 15};
+        double p[] = {20, 20};
+        D d(b, b+2, p);
+        std::vector<double> iv = d.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 10);
+        assert(iv[1] == 15);
+        std::vector<double> dn = d.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 1/5.);
+        assert(dn[1] == 1/5.);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        double b[] = {10, 15, 16};
+        double p[] = {.25, .75, .25};
+        D d(b, b+3, p);
+        std::vector<double> iv = d.intervals();
+        assert(iv.size() == 3);
+        assert(iv[0] == 10);
+        assert(iv[1] == 15);
+        assert(iv[2] == 16);
+        std::vector<double> dn = d.densities();
+        assert(dn.size() == 3);
+        assert(dn[0] == .25/3);
+        assert(dn[1] == .75/3);
+        assert(dn[2] == .25/3);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {0, 1, 1, 0};
+        D d(b, b+4, p);
+        std::vector<double> iv = d.intervals();
+        assert(iv.size() == 4);
+        assert(iv[0] == 10);
+        assert(iv[1] == 14);
+        assert(iv[2] == 16);
+        assert(iv[3] == 17);
+        std::vector<double> dn = d.densities();
+        assert(dn.size() == 4);
+        assert(dn[0] == 0);
+        assert(dn[1] == 1/4.5);
+        assert(dn[2] == 1/4.5);
+        assert(dn[3] == 0);
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_param.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_param.pass.cpp
new file mode 100644
index 0000000..1eb4926
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_param.pass.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// explicit piecewise_linear_distribution(const param_type& parm);
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {25, 62.5, 12.5, 0};
+        P pa(b, b+4, p);
+        D d(pa);
+        std::vector<double> iv = d.intervals();
+        assert(iv.size() == 4);
+        assert(iv[0] == 10);
+        assert(iv[1] == 14);
+        assert(iv[2] == 16);
+        assert(iv[3] == 17);
+        std::vector<double> dn = d.densities();
+        assert(dn.size() == 4);
+        assert(dn[0] == 25/256.25);
+        assert(dn[1] == 62.5/256.25);
+        assert(dn[2] == 12.5/256.25);
+        assert(dn[3] == 0);
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eq.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eq.pass.cpp
new file mode 100644
index 0000000..b394cd8
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eq.pass.cpp
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// bool operator=(const piecewise_linear_distribution& x,
+//                const piecewise_linear_distribution& y);
+// bool operator!(const piecewise_linear_distribution& x,
+//                const piecewise_linear_distribution& y);
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        D d1;
+        D d2;
+        assert(d1 == d2);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {25, 62.5, 12.5, 1};
+        D d1(b, b+4, p);
+        D d2(b, b+4, p);
+        assert(d1 == d2);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {25, 62.5, 12.5, 0};
+        D d1(b, b+4, p);
+        D d2;
+        assert(d1 != d2);
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
new file mode 100644
index 0000000..ce884a8
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
@@ -0,0 +1,341 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// template<class _URNG> result_type operator()(_URNG& g);
+
+#include <iostream>
+
+#include <random>
+#include <vector>
+#include <iterator>
+#include <numeric>
+#include <cassert>
+
+template <class T>
+inline
+T
+sqr(T x)
+{
+    return x*x;
+}
+
+double
+f(double x, double a, double m, double b, double c)
+{
+    return a + m*(sqr(x) - sqr(b))/2 + c*(x-b);
+}
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        typedef std::mt19937_64 G;
+        G g;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {0, 1, 1, 0};
+        const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+        D d(b, b+Np+1, p);
+        const int N = 1000000;
+        std::vector<D::result_type> u;
+        for (int i = 0; i < N; ++i)
+        {
+            D::result_type v = d(g);
+            assert(d.min() <= v && v < d.max());
+            u.push_back(v);
+        }
+        std::sort(u.begin(), u.end());
+        int kp = -1;
+        double a;
+        double m;
+        double bk;
+        double c;
+        std::vector<double> areas(Np);
+        double S = 0;
+        for (int i = 0; i < areas.size(); ++i)
+        {
+            areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
+            S += areas[i];
+        }
+        for (int i = 0; i < areas.size(); ++i)
+            areas[i] /= S;
+        for (int i = 0; i < Np+1; ++i)
+            p[i] /= S;
+        for (int i = 0; i < N; ++i)
+        {
+            int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
+            if (k != kp)
+            {
+                a = 0;
+                for (int j = 0; j < k; ++j)
+                    a += areas[j];
+                m = (p[k+1] - p[k]) / (b[k+1] - b[k]);
+                bk = b[k];
+                c = (b[k+1]*p[k] - b[k]*p[k+1]) / (b[k+1] - b[k]);
+                kp = k;
+            }
+            assert(std::abs(f(u[i], a, m, bk, c) - double(i)/N) < .001);
+        }
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        typedef std::mt19937_64 G;
+        G g;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {0, 0, 1, 0};
+        const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+        D d(b, b+Np+1, p);
+        const int N = 1000000;
+        std::vector<D::result_type> u;
+        for (int i = 0; i < N; ++i)
+        {
+            D::result_type v = d(g);
+            assert(d.min() <= v && v < d.max());
+            u.push_back(v);
+        }
+        std::sort(u.begin(), u.end());
+        int kp = -1;
+        double a;
+        double m;
+        double bk;
+        double c;
+        std::vector<double> areas(Np);
+        double S = 0;
+        for (int i = 0; i < areas.size(); ++i)
+        {
+            areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
+            S += areas[i];
+        }
+        for (int i = 0; i < areas.size(); ++i)
+            areas[i] /= S;
+        for (int i = 0; i < Np+1; ++i)
+            p[i] /= S;
+        for (int i = 0; i < N; ++i)
+        {
+            int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
+            if (k != kp)
+            {
+                a = 0;
+                for (int j = 0; j < k; ++j)
+                    a += areas[j];
+                m = (p[k+1] - p[k]) / (b[k+1] - b[k]);
+                bk = b[k];
+                c = (b[k+1]*p[k] - b[k]*p[k+1]) / (b[k+1] - b[k]);
+                kp = k;
+            }
+            assert(std::abs(f(u[i], a, m, bk, c) - double(i)/N) < .001);
+        }
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        typedef std::mt19937_64 G;
+        G g;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {1, 0, 0, 0};
+        const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+        D d(b, b+Np+1, p);
+        const int N = 1000000;
+        std::vector<D::result_type> u;
+        for (int i = 0; i < N; ++i)
+        {
+            D::result_type v = d(g);
+            assert(d.min() <= v && v < d.max());
+            u.push_back(v);
+        }
+        std::sort(u.begin(), u.end());
+        int kp = -1;
+        double a;
+        double m;
+        double bk;
+        double c;
+        std::vector<double> areas(Np);
+        double S = 0;
+        for (int i = 0; i < areas.size(); ++i)
+        {
+            areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
+            S += areas[i];
+        }
+        for (int i = 0; i < areas.size(); ++i)
+            areas[i] /= S;
+        for (int i = 0; i < Np+1; ++i)
+            p[i] /= S;
+        for (int i = 0; i < N; ++i)
+        {
+            int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
+            if (k != kp)
+            {
+                a = 0;
+                for (int j = 0; j < k; ++j)
+                    a += areas[j];
+                m = (p[k+1] - p[k]) / (b[k+1] - b[k]);
+                bk = b[k];
+                c = (b[k+1]*p[k] - b[k]*p[k+1]) / (b[k+1] - b[k]);
+                kp = k;
+            }
+            assert(std::abs(f(u[i], a, m, bk, c) - double(i)/N) < .001);
+        }
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        typedef std::mt19937_64 G;
+        G g;
+        double b[] = {10, 14, 16};
+        double p[] = {0, 1, 0};
+        const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+        D d(b, b+Np+1, p);
+        const int N = 1000000;
+        std::vector<D::result_type> u;
+        for (int i = 0; i < N; ++i)
+        {
+            D::result_type v = d(g);
+            assert(d.min() <= v && v < d.max());
+            u.push_back(v);
+        }
+        std::sort(u.begin(), u.end());
+        int kp = -1;
+        double a;
+        double m;
+        double bk;
+        double c;
+        std::vector<double> areas(Np);
+        double S = 0;
+        for (int i = 0; i < areas.size(); ++i)
+        {
+            areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
+            S += areas[i];
+        }
+        for (int i = 0; i < areas.size(); ++i)
+            areas[i] /= S;
+        for (int i = 0; i < Np+1; ++i)
+            p[i] /= S;
+        for (int i = 0; i < N; ++i)
+        {
+            int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
+            if (k != kp)
+            {
+                a = 0;
+                for (int j = 0; j < k; ++j)
+                    a += areas[j];
+                m = (p[k+1] - p[k]) / (b[k+1] - b[k]);
+                bk = b[k];
+                c = (b[k+1]*p[k] - b[k]*p[k+1]) / (b[k+1] - b[k]);
+                kp = k;
+            }
+            assert(std::abs(f(u[i], a, m, bk, c) - double(i)/N) < .001);
+        }
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        typedef std::mt19937_64 G;
+        G g;
+        double b[] = {10, 14};
+        double p[] = {1, 1};
+        const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+        D d(b, b+Np+1, p);
+        const int N = 1000000;
+        std::vector<D::result_type> u;
+        for (int i = 0; i < N; ++i)
+        {
+            D::result_type v = d(g);
+            assert(d.min() <= v && v < d.max());
+            u.push_back(v);
+        }
+        std::sort(u.begin(), u.end());
+        int kp = -1;
+        double a;
+        double m;
+        double bk;
+        double c;
+        std::vector<double> areas(Np);
+        double S = 0;
+        for (int i = 0; i < areas.size(); ++i)
+        {
+            areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
+            S += areas[i];
+        }
+        for (int i = 0; i < areas.size(); ++i)
+            areas[i] /= S;
+        for (int i = 0; i < Np+1; ++i)
+            p[i] /= S;
+        for (int i = 0; i < N; ++i)
+        {
+            int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
+            if (k != kp)
+            {
+                a = 0;
+                for (int j = 0; j < k; ++j)
+                    a += areas[j];
+                m = (p[k+1] - p[k]) / (b[k+1] - b[k]);
+                bk = b[k];
+                c = (b[k+1]*p[k] - b[k]*p[k+1]) / (b[k+1] - b[k]);
+                kp = k;
+            }
+            assert(std::abs(f(u[i], a, m, bk, c) - double(i)/N) < .001);
+        }
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        typedef std::mt19937_64 G;
+        G g;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {25, 62.5, 12.5, 0};
+        const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+        D d(b, b+Np+1, p);
+        const int N = 1000000;
+        std::vector<D::result_type> u;
+        for (int i = 0; i < N; ++i)
+        {
+            D::result_type v = d(g);
+            assert(d.min() <= v && v < d.max());
+            u.push_back(v);
+        }
+        std::sort(u.begin(), u.end());
+        int kp = -1;
+        double a;
+        double m;
+        double bk;
+        double c;
+        std::vector<double> areas(Np);
+        double S = 0;
+        for (int i = 0; i < areas.size(); ++i)
+        {
+            areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
+            S += areas[i];
+        }
+        for (int i = 0; i < areas.size(); ++i)
+            areas[i] /= S;
+        for (int i = 0; i < Np+1; ++i)
+            p[i] /= S;
+        for (int i = 0; i < N; ++i)
+        {
+            int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
+            if (k != kp)
+            {
+                a = 0;
+                for (int j = 0; j < k; ++j)
+                    a += areas[j];
+                m = (p[k+1] - p[k]) / (b[k+1] - b[k]);
+                bk = b[k];
+                c = (b[k+1]*p[k] - b[k]*p[k+1]) / (b[k+1] - b[k]);
+                kp = k;
+            }
+            assert(std::abs(f(u[i], a, m, bk, c) - double(i)/N) < .001);
+        }
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp
new file mode 100644
index 0000000..b024b87
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp
@@ -0,0 +1,90 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// template<class _URNG> result_type operator()(_URNG& g, const param_type& parm);
+
+#include <random>
+#include <vector>
+#include <iterator>
+#include <numeric>
+#include <cassert>
+
+template <class T>
+inline
+T
+sqr(T x)
+{
+    return x*x;
+}
+
+double
+f(double x, double a, double m, double b, double c)
+{
+    return a + m*(sqr(x) - sqr(b))/2 + c*(x-b);
+}
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        typedef std::mt19937_64 G;
+        G g;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {25, 62.5, 12.5, 0};
+        const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
+        D d;
+        P pa(b, b+Np+1, p);
+        const int N = 1000000;
+        std::vector<D::result_type> u;
+        for (int i = 0; i < N; ++i)
+        {
+            D::result_type v = d(g, pa);
+            assert(10 <= v && v < 17);
+            u.push_back(v);
+        }
+        std::sort(u.begin(), u.end());
+        int kp = -1;
+        double a;
+        double m;
+        double bk;
+        double c;
+        std::vector<double> areas(Np);
+        double S = 0;
+        for (int i = 0; i < areas.size(); ++i)
+        {
+            areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
+            S += areas[i];
+        }
+        for (int i = 0; i < areas.size(); ++i)
+            areas[i] /= S;
+        for (int i = 0; i < Np+1; ++i)
+            p[i] /= S;
+        for (int i = 0; i < N; ++i)
+        {
+            int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
+            if (k != kp)
+            {
+                a = 0;
+                for (int j = 0; j < k; ++j)
+                    a += areas[j];
+                m = (p[k+1] - p[k]) / (b[k+1] - b[k]);
+                bk = b[k];
+                c = (b[k+1]*p[k] - b[k]*p[k+1]) / (b[k+1] - b[k]);
+                kp = k;
+            }
+            assert(std::abs(f(u[i], a, m, bk, c) - double(i)/N) < .001);
+        }
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp
new file mode 100644
index 0000000..b04b851
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/get_param.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// param_type param() const;
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {25, 62.5, 12.5, 10};
+        const size_t Np = sizeof(p) / sizeof(p[0]);
+        P pa(b, b+Np+1, p);
+        D d(pa);
+        assert(d.param() == pa);
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/io.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/io.pass.cpp
new file mode 100644
index 0000000..d164062
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/io.pass.cpp
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// template <class charT, class traits>
+// basic_ostream<charT, traits>&
+// operator<<(basic_ostream<charT, traits>& os,
+//            const piecewise_linear_distribution& x);
+// 
+// template <class charT, class traits>
+// basic_istream<charT, traits>&
+// operator>>(basic_istream<charT, traits>& is,
+//            piecewise_linear_distribution& x);
+
+#include <random>
+#include <sstream>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {25, 62.5, 12.5, 25};
+        const size_t Np = sizeof(p) / sizeof(p[0]);
+        D d1(b, b+Np+1, p);
+        std::ostringstream os;
+        os << d1;
+        std::istringstream is(os.str());
+        D d2;
+        is >> d2;
+        assert(d1 == d2);
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/max.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/max.pass.cpp
new file mode 100644
index 0000000..351b94d
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/max.pass.cpp
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// result_type max() const;
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {25, 62.5, 12.5, 5};
+        const size_t Np = sizeof(p) / sizeof(p[0]);
+        D d(b, b+Np, p);
+        assert(d.max() == 17);
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/min.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/min.pass.cpp
new file mode 100644
index 0000000..df0835f
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/min.pass.cpp
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// result_type min() const;
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {25, 62.5, 12.5, 0};
+        const size_t Np = sizeof(p) / sizeof(p[0]);
+        D d(b, b+Np, p);
+        assert(d.min() == 10);
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_assign.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_assign.pass.cpp
new file mode 100644
index 0000000..baa9d21
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_assign.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+// {
+//     class param_type;
+
+#include <random>
+#include <limits>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {25, 62.5, 12.5, 2};
+        const size_t Np = sizeof(p) / sizeof(p[0]);
+        P p0(b, b+Np, p);
+        P p1;
+        p1 = p0;
+        assert(p1 == p0);
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_copy.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_copy.pass.cpp
new file mode 100644
index 0000000..56e2fcd
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_copy.pass.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+// {
+//     class param_type;
+
+#include <random>
+#include <limits>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {25, 62.5, 12.5, 5};
+        const size_t Np = sizeof(p) / sizeof(p[0]);
+        P p0(b, b+Np, p);
+        P p1 = p0;
+        assert(p1 == p0);
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_default.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_default.pass.cpp
new file mode 100644
index 0000000..7417713
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_default.pass.cpp
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// param_type();
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        P pa;
+        std::vector<double> iv = pa.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 0);
+        assert(iv[1] == 1);
+        std::vector<double> dn = pa.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 1);
+        assert(dn[1] == 1);
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_func.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_func.pass.cpp
new file mode 100644
index 0000000..73c8616
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_func.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// template<class UnaryOperation>
+//     param_type(size_t nw, double xmin, double xmax,
+//                           UnaryOperation fw);
+
+#include <random>
+#include <cassert>
+
+double fw(double x)
+{
+    return 2*x;
+}
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        P pa(0, 0, 1, fw);
+        std::vector<double> iv = pa.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 0);
+        assert(iv[1] == 1);
+        std::vector<double> dn = pa.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 0);
+        assert(dn[1] == 2);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        P pa(1, 10, 12, fw);
+        std::vector<double> iv = pa.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 10);
+        assert(iv[1] == 12);
+        std::vector<double> dn = pa.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 20./44);
+        assert(dn[1] == 24./44);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        P pa(2, 6, 14, fw);
+        std::vector<double> iv = pa.intervals();
+        assert(iv.size() == 3);
+        assert(iv[0] == 6);
+        assert(iv[1] == 10);
+        assert(iv[2] == 14);
+        std::vector<double> dn = pa.densities();
+        assert(dn.size() == 3);
+        assert(dn[0] == 0.075);
+        assert(dn[1] == 0.125);
+        assert(dn[2] == 0.175);
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_init_func.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_init_func.pass.cpp
new file mode 100644
index 0000000..1b01b05
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_init_func.pass.cpp
@@ -0,0 +1,83 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// param_type(initializer_list<result_type> bl, UnaryOperation fw);
+
+#include <random>
+#include <cassert>
+
+double f(double x)
+{
+    return x*2;
+}
+
+int main()
+{
+#ifdef _LIBCPP_MOVE
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        P pa({}, f);
+        std::vector<double> iv = pa.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 0);
+        assert(iv[1] == 1);
+        std::vector<double> dn = pa.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 1);
+        assert(dn[1] == 1);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        P pa({12}, f);
+        std::vector<double> iv = pa.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 0);
+        assert(iv[1] == 1);
+        std::vector<double> dn = pa.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 1);
+        assert(dn[1] == 1);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        P pa({10, 12}, f);
+        std::vector<double> iv = pa.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 10);
+        assert(iv[1] == 12);
+        std::vector<double> dn = pa.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 20./44);
+        assert(dn[1] == 24./44);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        P pa({6, 10, 14}, f);
+        std::vector<double> iv = pa.intervals();
+        assert(iv.size() == 3);
+        assert(iv[0] == 6);
+        assert(iv[1] == 10);
+        assert(iv[2] == 14);
+        std::vector<double> dn = pa.densities();
+        assert(dn.size() == 3);
+        assert(dn[0] == 0.075);
+        assert(dn[1] == 0.125);
+        assert(dn[2] == 0.175);
+    }
+#endif
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_iterator.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_iterator.pass.cpp
new file mode 100644
index 0000000..5be45b8
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_iterator.pass.cpp
@@ -0,0 +1,105 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// template<class InputIterator>
+//     param_type(InputIteratorB firstB, InputIteratorB lastB,
+//                InputIteratorW firstW);
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        double b[] = {10};
+        double p[] = {12};
+        P pa(b, b, p);
+        std::vector<double> iv = pa.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 0);
+        assert(iv[1] == 1);
+        std::vector<double> dn = pa.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 1);
+        assert(dn[1] == 1);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        double b[] = {10};
+        double p[] = {12};
+        P pa(b, b+1, p);
+        std::vector<double> iv = pa.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 0);
+        assert(iv[1] == 1);
+        std::vector<double> dn = pa.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 1);
+        assert(dn[1] == 1);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        double b[] = {10, 15};
+        double p[] = {12, 12};
+        P pa(b, b+2, p);
+        std::vector<double> iv = pa.intervals();
+        assert(iv.size() == 2);
+        assert(iv[0] == 10);
+        assert(iv[1] == 15);
+        std::vector<double> dn = pa.densities();
+        assert(dn.size() == 2);
+        assert(dn[0] == 1/5.);
+        assert(dn[1] == 1/5.);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        double b[] = {10, 15, 16};
+        double p[] = {.25, .75, .25};
+        P pa(b, b+3, p);
+        std::vector<double> iv = pa.intervals();
+        assert(iv.size() == 3);
+        assert(iv[0] == 10);
+        assert(iv[1] == 15);
+        assert(iv[2] == 16);
+        std::vector<double> dn = pa.densities();
+        assert(dn.size() == 3);
+        assert(dn[0] == .25/3);
+        assert(dn[1] == .75/3);
+        assert(dn[2] == .25/3);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {0, 1, 1, 0};
+        P pa(b, b+4, p);
+        std::vector<double> iv = pa.intervals();
+        assert(iv.size() == 4);
+        assert(iv[0] == 10);
+        assert(iv[1] == 14);
+        assert(iv[2] == 16);
+        assert(iv[3] == 17);
+        std::vector<double> dn = pa.densities();
+        assert(dn.size() == 4);
+        assert(dn[0] == 0);
+        assert(dn[1] == 1/4.5);
+        assert(dn[2] == 1/4.5);
+        assert(dn[3] == 0);
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_eq.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_eq.pass.cpp
new file mode 100644
index 0000000..28fb0f8
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_eq.pass.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+// {
+//     class param_type;
+
+#include <random>
+#include <limits>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {25, 62.5, 12.5, 0};
+        P p1(b, b+4, p);
+        P p2(b, b+4, p);
+        assert(p1 == p2);
+    }
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {25, 62.5, 12.5, 0};
+        P p1(b, b+3, p);
+        P p2(b, b+4, p);
+        assert(p1 != p2);
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_types.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_types.pass.cpp
new file mode 100644
index 0000000..4fd475e
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_types.pass.cpp
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+// {
+//     class param_type;
+
+#include <random>
+#include <type_traits>
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type param_type;
+        typedef param_type::distribution_type distribution_type;
+        static_assert((std::is_same<D, distribution_type>::value), "");
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/set_param.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/set_param.pass.cpp
new file mode 100644
index 0000000..4e8ac96
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/set_param.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+
+// void param(const param_type& parm);
+
+#include <random>
+#include <cassert>
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::param_type P;
+        double b[] = {10, 14, 16, 17};
+        double p[] = {25, 62.5, 12.5, 0};
+        P pa(b, b+4, p);
+        D d;
+        d.param(pa);
+        assert(d.param() == pa);
+    }
+}
diff --git a/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/types.pass.cpp b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/types.pass.cpp
new file mode 100644
index 0000000..2662abf
--- /dev/null
+++ b/test/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/types.pass.cpp
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <random>
+
+// template<class RealType = double>
+// class piecewise_linear_distribution
+// {
+//     typedef bool result_type;
+
+#include <random>
+#include <type_traits>
+
+int main()
+{
+    {
+        typedef std::piecewise_linear_distribution<> D;
+        typedef D::result_type result_type;
+        static_assert((std::is_same<result_type, double>::value), "");
+    }
+    {
+        typedef std::piecewise_linear_distribution<float> D;
+        typedef D::result_type result_type;
+        static_assert((std::is_same<result_type, float>::value), "");
+    }
+}
