diff --git a/.coin-or/projDesc.xml b/.coin-or/projDesc.xml
new file mode 100644
index 000000000..1cbac651c
--- /dev/null
+++ b/.coin-or/projDesc.xml
@@ -0,0 +1,417 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet type = "text/xsl" href = "http://www.coin-or.org/projects/autoGen.xsl"?>
+<projectData xmlns="coin-or.org"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="coin-or.org http://www.coin-or.org/projects/autoGen.xsd">
+
+<!--
+  This file is a template that you fill in to provide specific information
+  about your project. For project Foo, it is used to generate the page
+  http://www.coin-or.org/projects/Foo.xml
+  Once the template is filled in and checked into your project's repository
+  in the conf/ directory, it will be automatically parsed and displayed
+  in a standard HTML format using XSLT.  When users follow the link to
+  your project from the Projects page on the COIN Web site, the generated
+  HTML is what they will see.  As an example, have a look at
+  http://www.coin-or.org/projects/Cbc.xml
+  to see the result.
+
+  The file is extensively commented to help you understand where to fill
+  in the various pieces of required information.
+
+  With a few exceptions, elements are *NOT* optional. They must appear in
+  this file, in order, or the file will not pass validation against the
+  schema. Don't delete elements, and don't rearrange them. The schema is
+  in the CoinWeb repo,
+  https://projects.coin-or.org/svn/CoinWeb/trunk/projects/autoGen.xsd
+  for those of you who know and love XML.
+
+  Elements that are optional in the generated HTML will be omitted
+  if you leave them empty (i.e., nothing but whitespace). The XSL
+  that transforms this file into HTML is also in the CoinWeb repo,
+  https://projects.coin-or.org/svn/CoinWeb/trunk/projects/autoGen.xsl
+
+  If you want to display non-ascii characters, you must use numeric
+  character references, e.g., &#xe8; or &#232, but *NOT* &egrave;. The
+  named entities are not necessarily available when the XML is processed.
+
+  *DO NOT* use HTML markup in blocks of text. It screws up the validation.
+
+  XML comments are block comments, delimited by the character sequences
+  you see at the start and end of this comment block. Comments don't nest.
+-->
+
+  <projectBasics>
+
+      <!-- Fill in your project's name in this block.                -->
+      <!-- For example, for Creme you could write:                   -->
+      <!--                                                           -->
+      <!-- <projectName>Cr&#xe8;me</projectName>                     -->
+      <!--                                                           -->
+      <!-- This string is displayed in the banner at the top of the  -->
+      <!-- project page. If you do not define projectRepo (next      -->
+      <!-- block) the same string will be used to construct the URL  -->
+      <!-- of your project's Trac page. So if projectName isn't      -->
+      <!-- plain ascii, be sure to define projectRepo.               -->
+      <!-- Fill in your text below (outside this comment block).     -->
+
+<projectName>CppAD</projectName>
+
+      <!-- Fill in with the appropriate string to construct a URL    -->
+      <!-- for your project's Trac page and SVN repository. For      -->
+      <!-- Creme, the correct string is                              -->
+      <!--                                                           -->
+      <!-- <projectRepo>Creme</projectName>                          -->
+      <!--                                                           -->
+      <!-- Use the right value for the URL for your project.         -->
+      <!-- Fill in your text below (outside this comment block).     -->
+
+<projectRepo>CppAD</projectRepo>
+
+      <!-- Fill in a brief description of your project here.         -->
+      <!-- For example, for SYMPHONY, you might put:                 -->
+      <!--                                                           -->
+      <!-- <projectDescription>                                      -->
+      <!--    SYMPHONY is an open-source generic MILP solver,        -->
+      <!--    callable library, and extensible framework for         -->
+      <!--    implementing customized solvers for mixed-integer      -->
+      <!--    linear programs (MILPs). Blah, blah, blah.             -->
+      <!-- </projectDescription>                                     -->
+      <!--                                                           -->
+      <!-- Fill in your text below (outside this comment block)      -->
+
+<projectDescription>
+Given a C++ algorithm that computes function values,
+CppAD generates an algorithm that computes corresponding derivative values.
+</projectDescription>
+
+      <!-- Provide a one or two sentence description of your         -->
+      <!-- project. This description will be used in the listings on -->
+      <!-- the main COIN-OR projects page. For DyLP, for example,    -->
+      <!-- <projectShortDescription>                                 -->
+      <!--   An implementation of the dynamic simplex method.        -->
+      <!-- </projectShortDescription>                                -->
+      <!--                                                           -->
+      <!-- Fill in your text below (outside this comment block)      -->
+
+<projectShortDescription>
+A tool for differentiation of C++ functions.
+</projectShortDescription>
+
+      <!-- Fill in the project manager's name and (obfuscated)       -->
+      <!-- e-mail address here. For example, for the SYMPHONY        -->
+      <!-- project, you could write                                  -->
+      <!--                                                           -->
+      <!--<projectManager>                                           -->
+      <!--   Ted Ralphs, tkralphs at lehigh dot edu                  -->
+      <!--</projectManager>                                          -->
+      <!--                                                           -->
+      <!-- Fill in your text below (outside this comment block).     -->
+
+<projectManager>Brad Bell, http://www.seanet.com/~bradbell</projectManager>
+
+      <!-- Fill in the URL you would like use for your project's     -->
+      <!-- main home page. This could be your Trac page, or a static -->
+      <!-- page (if you have one). For example, for SYMPHONY, the    -->
+      <!-- Trac page is                                              -->
+      <!--                                                           -->
+      <!--<projectHomePage>                                          -->
+      <!--   https://projects.coin-or.org/SYMPHONY                   -->
+      <!--</projectHomePage>                                         -->
+      <!--                                                           -->
+      <!-- Fill in your text below (outside this comment block).     -->
+
+<projectHomePage>http://www.coin-or.org/CppAD</projectHomePage>
+
+      <!-- Fill in the name of the license your project uses and a   -->
+      <!-- link to its page on www.opensource.org. For example, if   -->
+      <!-- you use the EPL, you would put                            -->
+      <!--                                                           -->
+      <!--<projectLicense>                                           -->
+      <!--  Eclipse Public License 1.0                               -->
+      <!--</projectLicense>                                          -->
+      <!--<projectLicenseURL>                                        -->
+      <!--  http://www.opensource.org/licenses/eclipse-1.0           -->
+      <!--</projectLicenseURL>                                       -->
+      <!--                                                           -->
+      <!-- Fill in your text below (outside this comment block).     -->
+
+<projectLicense>
+Eclipse Public License 2.0 or (GNU General Public License 2.0 or later)
+</projectLicense>
+<projectLicenseURL>
+https://opensource.org/licenses/EPL-2.0
+</projectLicenseURL>
+
+      <!-- Below, you can list other COIN projects your project      -->
+      <!-- depends on. These are listed one by one, as in the        -->
+      <!-- following example                                         -->
+      <!--                                                           -->
+      <!--<coinLinkedProjects>                                       -->
+      <!--                                                           -->
+      <!--   <coinProject>                                           -->
+      <!--      <repoName>CoinUtils</repoName>                       -->
+      <!--   </coinProject>                                          -->
+      <!--                                                           -->
+      <!--   <coinProject>                                           -->
+      <!--      <repoName>Ots</repoName>                             -->
+      <!--<projectName>CppAD</projectName>                           -->
+      <!--      <projectUrl>                                         -->
+      <!--        http://www.coin-or.org/Ots/index.html              -->
+      <!--      </projectUrl>                                        -->
+      <!--   </coinProject>                                          -->
+      <!--                                                           -->
+      <!--</coinLinkedProjects>                                      -->
+      <!--                                                           -->
+      <!-- The <repoName> element of <coinProject> is mandatory. If  -->
+      <!-- you do not provide <projectName>, it is assumed to be the -->
+      <!-- same as repoName. If you do not provide <projectUrl>, it  -->
+      <!-- is assumed to be http://www.coin-or.org/projects/Foo.xml  -->
+      <!-- with `Foo' replaced by the value of <repoName>.           -->
+      <!-- Add as many <coinProject> elements as you need below.     -->
+
+<coinLinkedProjects></coinLinkedProjects>
+
+      <!-- Below, you can list other packages your project requires  -->
+      <!-- or can use as an option. These are listed one-by-one, as  -->
+      <!-- in the following example:                                 -->
+      <!--                                                           -->
+      <!--<otherLinkedPackages>                                      -->
+      <!--                                                           -->
+      <!--   <otherPackage>                                          -->
+      <!--      <packageName>                                        -->
+      <!--         GLPK                                              -->
+      <!--      </packageName>                                       -->
+      <!--      <packageURL>                                         -->
+      <!--         http://www.gnu.org/software/glpk/                 -->
+      <!--      </packageURL>                                        -->
+      <!--      <requiredOrOptional>                                 -->
+      <!--         Optional                                          -->
+      <!--      </requiredOrOptional>                                -->
+      <!--   </otherPackage>                                         -->
+      <!--                                                           -->
+      <!--   <otherPackage>                                          -->
+      <!--      <packageName>                                        -->
+      <!--         GNU Readline                                      -->
+      <!--      </packageName>                                       -->
+      <!--      <packageURL>                                         -->
+      <!--      </packageURL>                                        -->
+      <!--      <requiredOrOptional>                                 -->
+      <!--         Optional                                          -->
+      <!--      </requiredOrOptional>                                -->
+      <!--   </otherPackage>                                         -->
+      <!--                                                           -->
+      <!--</otherLinkedPackages>                                     -->
+      <!--                                                           -->
+      <!-- For each <otherPackage> element, all of <packageName>,    -->
+      <!-- <packageURL>, and <requiredOrOptional> must be present,   -->
+      <!-- but they can be empty (as shown in the example).  Add as  -->
+      <!-- many <otherPackage> elements as you need.                 -->
+
+<otherLinkedPackages>
+     <otherPackage>
+          <packageName>Pthread</packageName>
+          <packageURL>http://pubs.opengroup.org/onlinepubs/009695399/basedefs/pthread.h.html</packageURL>
+          <requiredOrOptional>Optional</requiredOrOptional>
+     </otherPackage>
+     <otherPackage>
+          <packageName>OpenMP</packageName>
+          <packageURL>http://openmp.org/wp</packageURL>
+          <requiredOrOptional>Optional</requiredOrOptional>
+     </otherPackage>
+     <otherPackage>
+          <packageName>Boost uBlas vector</packageName>
+          <packageURL>http://www.boost.org/doc/libs</packageURL>
+          <requiredOrOptional>Optional</requiredOrOptional>
+     </otherPackage>
+     <otherPackage>
+          <packageName>Boost Thread</packageName>
+          <packageURL>http://www.boost.org/doc/libs</packageURL>
+          <requiredOrOptional>Optional</requiredOrOptional>
+     </otherPackage>
+     <otherPackage>
+          <packageName>Sacado</packageName>
+          <packageURL>http://trilinos.org/packages/sacado</packageURL>
+          <requiredOrOptional>Optional</requiredOrOptional>
+     </otherPackage>
+     <otherPackage>
+          <packageName>ColPack</packageName>
+          <packageURL>http://cscapes.cs.purdue.edu/dox/ColPack/html</packageURL>
+          <requiredOrOptional>Optional</requiredOrOptional>
+     </otherPackage>
+     <otherPackage>
+          <packageName>Ipopt</packageName>
+          <packageURL>http://www.coin-or.org/projects/Ipopt.xml</packageURL>
+          <requiredOrOptional>Optional</requiredOrOptional>
+     </otherPackage>
+     <otherPackage>
+          <packageName>Eigen</packageName>
+          <packageURL>http://eigen.tuxfamily.org</packageURL>
+          <requiredOrOptional>Optional</requiredOrOptional>
+     </otherPackage>
+     <otherPackage>
+          <packageName>FADBAD</packageName>
+          <packageURL>http://www.fadbad.com/fadbad.htm</packageURL>
+          <requiredOrOptional>Optional</requiredOrOptional>
+     </otherPackage>
+     <otherPackage>
+          <packageName>ADOL-C</packageName>
+          <packageURL>http://www.coin-or.org/projects/ADOL-C.xml</packageURL>
+          <requiredOrOptional>Optional</requiredOrOptional>
+     </otherPackage>
+</otherLinkedPackages>
+
+      <!-- Fill in the programming language(s) used in the project.  -->
+      <!-- For example:                                              -->
+      <!--<projectLanguage>C, C++</projectLanguage>                  -->
+      <!--                                                           -->
+      <!-- Fill in your text below (outside this comment block).     -->
+
+<projectLanguage>C++</projectLanguage>
+
+      <!-- The following fields describe the development status      -->
+      <!-- of the project.                                           -->
+
+      <developmentStatus>
+
+      <!-- If you are actively managing your project, use        -->
+      <!-- `Active'. Otherwise, change as appropriate.           -->
+      <!-- Eventually there may be formal categories.            -->
+
+<activityStatus>Active</activityStatus>
+
+      <!-- The maturity level is determined during project       -->
+      <!-- review and should have been reported to you. If not,  -->
+      <!-- ask the person who handled your project submission.   -->
+      <!-- If all else fails, see                                -->
+      <!-- http://www.coin-or.org/faqs.html#q18                  -->
+      <!-- and make an informed guess. For example,              -->
+      <!--                                                       -->
+      <!--<maturityLevel>4</maturityLevel>                       -->
+      <!--                                                       -->
+
+<maturityLevel>5</maturityLevel>
+
+      <!-- Having trouble with the automated system that     -->
+      <!-- generates stable and release version numbers? If  -->
+      <!-- so, you can override one or both with these       -->
+      <!-- elements. DO NOT USE unless necessary, as it will -->
+      <!-- your responsibility to keep them up-to-date. Your -->
+      <!-- text will be used verbatim. These two elements    -->
+      <!-- are the exception to the rule that elements must  -->
+      <!-- appear. These must *NOT* be uncommented unless    -->
+      <!-- needed.                                           -->
+
+<stableVersionNumber>20190200</stableVersionNumber>
+<releaseNumber>20190200.4</releaseNumber>
+
+      </developmentStatus>
+
+      <!-- Below, you can list the platforms on which your project   -->
+      <!-- has been tested. Again, these are listed one-by-one.      -->
+      <!-- Within a <platform>, <operatingSystem> is mandatory and   -->
+      <!-- <compiler> is optional.                                   -->
+      <!--                                                           -->
+      <!--<testedPlatforms>                                          -->
+      <!--                                                           -->
+      <!--   <platform>                                              -->
+      <!--      <operatingSystem>Microsoft Windows</operatingSystem> -->
+      <!--      <compiler>MSVC++/cl</compiler>                       -->
+      <!--   </platform>                                             -->
+      <!--                                                           -->
+      <!--   <platform>                                              -->
+      <!--      <operatingSystem>Microsoft Windows</operatingSystem> -->
+      <!--      <compiler>CYGWIN/cl</compiler>                       -->
+      <!--   </platform>                                             -->
+      <!--                                                           -->
+      <!--</testedPlatforms>                                         -->
+      <!--                                                           -->
+      <!-- Fill in your text below. Add as many platform elements as -->
+      <!-- you need.                                                 -->
+
+<testedPlatforms>
+     <platform>
+          <operatingSystem>Microsoft Windows</operatingSystem>
+          <compiler>MSVC++</compiler>
+     </platform>
+     <platform>
+          <operatingSystem>Mac</operatingSystem>
+          <compiler>clang</compiler>
+     </platform>
+     <platform>
+          <operatingSystem>Cygwin</operatingSystem>
+          <compiler>gcc, clang</compiler>
+     </platform>
+     <platform>
+          <operatingSystem>Msys2</operatingSystem>
+          <compiler>gcc, clang</compiler>
+     </platform>
+     <platform>
+          <operatingSystem>Linux</operatingSystem>
+          <compiler>gcc, clang</compiler>
+     </platform>
+</testedPlatforms>
+
+      <!-- The projectCategories element contains a list of category -->
+      <!-- elements. The text of the category elements will be       -->
+      <!-- displayed as a comma-separated list and used to classify  -->
+      <!-- your project on the main Projects page. The list given    -->
+      <!-- here contains standard categories. Please don't create a  -->
+      <!-- new one without good reason. Use as many as are           -->
+      <!-- appropriate.                                              -->
+
+<projectCategories>
+     <category>
+          Optimization utility
+     </category>
+</projectCategories>
+
+  </projectBasics>
+
+  <!-- Below, you can specify extra links for the left-hand side menu.   -->
+  <!-- If you leave an element empty, there will be no corresponding     -->
+  <!-- menu item. The first three left-hand links (COIN-OR Home,         -->
+  <!-- Projects, Project Management Page) are automatic; you cannot      -->
+  <!-- affect them from here.                                            -->
+  <!--                                                                   -->
+  <!-- For SYMPHONY, this block would look like this:                    -->
+  <!--                                                                   -->
+  <!-- <leftMenuLinks>                                                   -->
+  <!--                                                                   -->
+  <!--   <documentation>                                                 -->
+  <!--      http://www.coin-or.org/SYMPHONY/man-5.1                      -->
+  <!--   </documentation>                                                -->
+  <!--                                                                   -->
+  <!--   <sourceCodeDownload>                                            -->
+  <!--      http://www.coin-or.org/download/source/SYMPHONY              -->
+  <!--   </sourceCodeDownload>                                           -->
+  <!--                                                                   -->
+  <!--   <binaryDownload>                                                -->
+  <!--      http://www.coin-or.org/download/binary/SYMPHONY              -->
+  <!--   </binaryDownload>                                               -->
+  <!--                                                                   -->
+  <!--   <mailingList>                                                   -->
+  <!--      http://list.coin-or.org/mailman/listinfo/coin-symphony       -->
+  <!--   </mailingList>                                                  -->
+  <!-- </leftMenuLinks>                                                  -->
+  <!--                                                                   -->
+  <!-- All elements are mandatory! Just leave them empty if you have     -->
+  <!-- nothing relevant; the corresponding menu item will not appear.    -->
+  <!-- Fill in your text below (outside this comment block).             -->
+
+<leftMenuLinks>
+    <documentation>
+        https://coin-or.github.io/CppAD/doc
+    </documentation>
+    <sourceCodeDownload>
+        https://coin-or.github.io/CppAD/doc/download.htm
+    </sourceCodeDownload>
+    <binaryDownload>
+        https://github.com/coin-or/CppAD/releases
+    </binaryDownload>
+    <mailingList>
+        http://list.coin-or.org/mailman/listinfo/cppad
+    </mailingList>
+ </leftMenuLinks>
+
+</projectData>
diff --git a/.gitignore b/.gitignore
index 8d8ada48c..b2a2aa82d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,12 +13,12 @@
 # ----------------------------------------------------------------------------
 # specific directories
 /build/
+/dev/
 /doxydoc/
 /new/
 /new.*/
 # directory that is ignored by master, but not by gh-pages
 /doc/
-/dev/
 # ----------------------------------------------------------------------------
 # specific extensions in top direcotry
 /*.err
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fbfe342ba..40bb353ae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,7 +25,7 @@ if(POLICY CMP0054)
 endif()
 #
 # cppad_version is used by version.sh to get the version number.
-SET(cppad_version "20190200.4")
+SET(cppad_version "20190831")
 SET(cppad_url          "http://www.coin-or.org/CppAD" )
 SET(cppad_description  "Differentiation of C++ Algorithms" )
 #
@@ -191,14 +191,17 @@ IF( cppad_deprecated )
     MESSAGE(FATAL_ERROR "cppad_deprecated has been removed" )
 ENDIF( cppad_deprecated )
 # =============================================================================
-# colpack_libs, cppad_lib
+# cppad_lib
+# Perhaps in the future cppad_lib will depend on cmake header only flag ?
+SET( cppad_lib    "cppad_lib" )
+LINK_DIRECTORIES( ${cppad_BINARY_DIR}/cppad_lib )
+# =============================================================================
+# colpack_libs
 #
 IF( cppad_has_colpack )
     SET( colpack_libs "ColPack" )
-    SET( cppad_lib    "cppad_lib" )
 ELSE( cppad_has_colpack )
     SET( colpack_libs "" )
-    SET( cppad_lib    "" )
 ENDIF( cppad_has_colpack )
 # =============================================================================
 # automated system configuration
@@ -238,7 +241,8 @@ ENDFOREACH(dir_types includedirs libdirs datadir docdir)
 FIND_PACKAGE(OpenMP)
 # -----------------------------------------------------------------------------
 # boost_prefix
-FIND_PACKAGE(Boost)
+# Only need components for object libraries, not include libraries.
+FIND_PACKAGE(Boost COMPONENTS thread)
 SET(cppad_has_boost 0)
 IF ( Boost_FOUND )
     SET(cppad_has_boost 1)
@@ -320,9 +324,7 @@ SET(check_depends "")
 # directories with no check depends entries
 ADD_SUBDIRECTORY(include/cppad)
 ADD_SUBDIRECTORY(pkgconfig)
-IF( cppad_has_colpack )
-    ADD_SUBDIRECTORY(cppad_lib)
-ENDIF( cppad_has_colpack )
+ADD_SUBDIRECTORY(cppad_lib)
 #
 IF( NOT ( "${check_depends}" STREQUAL "" ) )
     MESSAGE(FATAL_ERROR "Error in CMakeLists.txt scripts")
diff --git a/batch_edit.sed b/batch_edit.sed
index 6c74a046d..fd3340d21 100644
--- a/batch_edit.sed
+++ b/batch_edit.sed
@@ -11,13 +11,18 @@
 # (with the possible exception of the extra_seds commands).
 # The files in bin/devel.sh ignore_files are automatically in this list.
 # ignore_files='
+#   omh/appendix/whats_new/09.omh
+#   omh/appendix/whats_new/14.omh
+#   omh/appendix/whats_new/15.omh
 # '
 # list of files and or directories that are moved to new names
 # move_paths='
+#   include/cppad/local/op_code.hpp
 # '
 # list of sed commands that map old file and directory names to new names.
 # The characters @s, @d, @n get converted to a space, dollar sign, new line.
 # move_seds='
+#   s|op_code.hpp|op_code_var.hpp|
 # '
 # list of files that get edited by the extra_seds command
 # extra_files='
@@ -29,3 +34,5 @@
 # '
 # ----------------------------------------------------------------------------
 # Put other sed commands below here and without # at start of line
+s|op_code\.hpp|op_code_var.hpp|
+s|_OP_CODE_HPP$|_OP_CODE_VAR_HPP|
diff --git a/bin/check_all.sh b/bin/check_all.sh
index 59c5648a7..21e461569 100755
--- a/bin/check_all.sh
+++ b/bin/check_all.sh
@@ -85,6 +85,7 @@ random_01() {
 }
 # -----------------------------------------------------------------------------
 # start new check_all.log
+echo "date > check_all.log"
 date > check_all.log
 top_srcdir=`pwd`
 echo "top_srcdir = $top_srcdir"
@@ -165,9 +166,8 @@ fi
 # Run automated checks for the form bin/check_*.sh with a few exceptions.
 list=`ls bin/check_* | sed \
     -e '/check_all.sh/d' \
-    -e '/check_doxygen.sh/d' \
     -e '/check_jenkins.sh/d' \
-    -e '/check_svn_dist.sh/d'`
+    -e '/check_doxygen.sh/d'`
 # ~/devel/check_copyright.sh not included in batch_edit branch
 for check in $list
 do
@@ -186,7 +186,9 @@ echo_log_eval cd cppad-$version
 echo_log_eval bin/run_cmake.sh $compiler $standard $debug_which $package_vector
 echo_log_eval cd build
 # -----------------------------------------------------------------------------
-echo_log_eval make check
+# can comment out this make check to if only running tests below it
+n_job=`nproc`
+echo_log_eval make -j $n_job check
 # -----------------------------------------------------------------------------
 skip=''
 for package in adolc eigen ipopt fadbad sacado
@@ -200,14 +202,21 @@ do
         skip="$skip $package"
     fi
 done
-#
+# ----------------------------------------------------------------------------
 # extra speed tests not run with option specified
+#
+# make speed_cppad incase make check above is commented out
+echo_log_eval make -j $n_job speed_cppad
 for option in onetape colpack optimize atomic memory boolsparsity
 do
+    #
     echo_eval speed/cppad/speed_cppad correct 432 $option
 done
 if ! echo "$skip" | grep 'adolc' > /dev/null
 then
+    # make speed_adolc incase make check above is commented out
+    echo_log_eval make -j $n_job speed_adolc
+    #
     echo_eval speed/adolc/speed_adolc correct         432 onetape
     echo_eval speed/adolc/speed_adolc sparse_jacobian 432 onetape colpack
     echo_eval speed/adolc/speed_adolc sparse_hessian  432 onetape colpack
@@ -218,61 +227,63 @@ fi
 program_list=''
 for threading in bthread openmp pthread
 do
-    program="example/multi_thread/${threading}"
-    program="$program/example_multi_thread_${threading}"
-    if [ ! -e $program ]
+    dir="example/multi_thread/$threading"
+    if [ ! -e "$dir" ]
     then
-        skip="$skip $program"
+        skip="$skip example_multi_thread_${threading}"
     else
+        program="$dir/example_multi_thread_${threading}"
         program_list="$program_list $program"
         #
-        # fast cases, test for all programs
-        echo_log_eval ./$program a11c
-        echo_log_eval ./$program simple_ad
-        echo_log_eval ./$program team_example
+        # make program incase make check above is commented out
+        echo_log_eval make -j $n_job example_multi_thread_${threading}
+        #
+        # all programs check the fast cases
+        echo_log_eval $program a11c
+        echo_log_eval $program simple_ad
+        echo_log_eval $program team_example
     fi
 done
 if [ "$program_list" != '' ]
 then
     # test_time=1,max_thread=4,mega_sum=1
     next_program
-    echo_log_eval ./$program harmonic 1 4 1
+    echo_log_eval $program harmonic 1 4 1
     #
     # test_time=1,max_thread=4,num_solve=100
     next_program
-    echo_log_eval ./$program multi_atomic 1 4 100
-    #
-    # test_time=1,max_thread=4,num_solve=100
+    echo_log_eval $program atomic_two 1 4 100
     next_program
-    echo_log_eval ./$program checkpoint 1 4 100
+    echo_log_eval $program atomic_three 1 4 100
+    next_program
+    echo_log_eval $program chkpoint_one 1 4 100
+    next_program
+    echo_log_eval $program chkpoint_two 1 4 100
     #
     # test_time=2,max_thread=4,num_zero=20,num_sub=30,num_sum=50,use_ad=true
     next_program
-    echo_log_eval ./$program multi_newton 2 4 20 30 50 true
-    #
+    echo_log_eval $program multi_newton 2 4 20 30 50 true
 fi
 #
 # print_for test
 program='example/print_for/example_print_for'
-if [ ! -e "$program" ]
+# make program incase make check above is commented out
+echo_log_eval make -j $n_job example_print_for
+echo_log_eval $program
+$program | sed -e '/^Test passes/,$d' > junk.1.$$
+$program | sed -e '1,/^Test passes/d' > junk.2.$$
+if diff junk.1.$$ junk.2.$$
 then
-    skip="$skip $program"
+    rm junk.1.$$ junk.2.$$
+    echo_log_eval echo "print_for: OK"
 else
-    echo_log_eval $program
-    $program | sed -e '/^Test passes/,$d' > junk.1.$$
-    $program | sed -e '1,/^Test passes/d' > junk.2.$$
-    if diff junk.1.$$ junk.2.$$
-    then
-        rm junk.1.$$ junk.2.$$
-        echo_log_eval echo "print_for: OK"
-    else
-        echo_log_eval echo "print_for: Error"
-        exit 1
-    fi
+    echo_log_eval echo "print_for: Error"
+    exit 1
 fi
 #
 echo_log_eval make install
 #
+echo "date >> check_all.log"
 date >> $top_srcdir/check_all.log
 if [ "$skip" != '' ]
 then
diff --git a/bin/check_define.sh b/bin/check_define.sh
index a07545f19..4162098a8 100755
--- a/bin/check_define.sh
+++ b/bin/check_define.sh
@@ -1,6 +1,6 @@
 #! /bin/bash -e
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -53,7 +53,9 @@ do
         # undef
         if [ ! -e $file.in ]
         then
+            # note <cppad/local/utility/cppad_vector_itr.hpp> is special
             sed -n -e "/^# *undef /p" $file | sed \
+                -e '/CPPAD_LOCAL_UTILITY_CPPAD_VECTOR_ITR_HPP/d' \
                 -e "s/^# *undef  *\([A-Za-z0-9_]*\).*/\1/" >> check_define.2
         fi
         # add_on
diff --git a/bin/check_include_def.sh b/bin/check_include_def.sh
index 9cbe68395..ed23883c8 100755
--- a/bin/check_include_def.sh
+++ b/bin/check_include_def.sh
@@ -1,6 +1,6 @@
 #! /bin/bash -e
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -38,7 +38,12 @@ do
         check="CPPAD_$check"
     fi
     #
-    if [ "$macro_name" != "$check" ]
+    if [ "$macro_name" == '' ]
+    then
+        echo "file_name=$file_name"
+        echo 'Cannot find  ^# *ifndef *CPPAD_[0-9A-Z_]*_HPP'
+        different='yes'
+    elif [ "$macro_name" != "$check" ]
     then
         echo " file_name=$file_name"
         echo "macro_name=$macro_name"
diff --git a/bin/check_op_code.sh b/bin/check_op_code.sh
index 9aec0021c..7dc9d1ecf 100755
--- a/bin/check_op_code.sh
+++ b/bin/check_op_code.sh
@@ -1,6 +1,6 @@
 #! /bin/bash -e
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -16,7 +16,7 @@ then
     exit 1
 fi
 echo "bin/check_op_code.sh: checking that op codes are in alphabetical order:"
-file='include/cppad/local/op_code.hpp'
+file='include/cppad/local/op_code_var.hpp'
 # ---------------------------------------------------------------------------
 # check enum list of codes are in alphabetical order
 sed -n -e '/^enum/,/^    NumberOp  /p' $file | sed \
diff --git a/bin/check_srcfile.sh b/bin/check_srcfile.sh
index e19076040..cc86b3d54 100755
--- a/bin/check_srcfile.sh
+++ b/bin/check_srcfile.sh
@@ -1,6 +1,6 @@
 #! /bin/bash -e
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -30,6 +30,7 @@ EOF
 special_case='
 bin/check_srcfile.sh
 include/cppad/core/cond_exp.hpp
+include/cppad/core/json/ad_graph.omh
 introduction/exp_2.omh
 introduction/exp_eps.omh
 omh/appendix/license.omh
diff --git a/bin/check_user_def.sh b/bin/check_user_def.sh
index cabc2c39b..4303e2ffe 100755
--- a/bin/check_user_def.sh
+++ b/bin/check_user_def.sh
@@ -1,6 +1,6 @@
 #! /bin/bash -e
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -18,7 +18,10 @@ fi
 # ---------------------------------------------------------------------------
 echo 'Check user API preprocessor define symbols'
 echo '-----------------------------------------------------------------------'
-file_list=`git grep -l 'head CPPAD' | sed -e '/bin\/check_user_def.sh/d'`
+# note configure.hpp.in is in developer (not user) documentation)
+file_list=`git grep -l 'head CPPAD' | sed \
+    -e '/bin\/check_user_def.sh/d' \
+    -e '/include\/cppad\/configure.hpp.in/d' `
 symbol_list=''
 for file in $file_list
 do
@@ -62,4 +65,3 @@ do
 done
 echo '-----------------------------------------------------------------------'
 echo "check_user_def.sh: OK"
-
diff --git a/bin/devel.sh b/bin/devel.sh
index ba414f28b..6ec102067 100755
--- a/bin/devel.sh
+++ b/bin/devel.sh
@@ -12,7 +12,7 @@ image_link='https://coin-or.github.io/CppAD'
 # List of files, besides CMakeLists.txt, that have have a copy of the
 # version number (can be empty).
 version_files='
-    doc.omh
+    omh/cppad.omh
     configure.ac
 '
 #
@@ -21,17 +21,22 @@ version_files='
 ignore_files='
     .gitignore
     .coin-or/projDesc.xml
-    ad_graph.json
 
     authors
     batch_edit.sed
     bin/devel.sh
+    bin/get_highlight.sh
+    bin/get_omhelp.sh
+    bin/run_omhelp.sh
     coin.png
     COPYING
     compile
     config.guess
     config.sub
     configure
+    depcomp
+    install-sh
+    missing
     makefile.in
 '
 # ----------------------------------------------------------------------------
diff --git a/bin/get_highlight.sh b/bin/get_highlight.sh
new file mode 100755
index 000000000..030085837
--- /dev/null
+++ b/bin/get_highlight.sh
@@ -0,0 +1,48 @@
+#! /bin/bash -e
+# Copyright: None
+# --------------------------------------------------------------------------
+# tarball='source-highlight-3.1.5.tar.gz'
+tarball='source-highlight-3.1.8.tar.gz'
+web_page='ftp://ftp.gnu.org/gnu/src-highlite/'
+start_dir=`pwd`
+# -----------------------------------------------------------------------------
+# bash function that echos and executes a command
+echo_eval() {
+    echo $*
+    eval $*
+}
+# -----------------------------------------------------------------------------
+name='highlight'
+if [ "$0" != "bin/get_$name.sh" ]
+then
+    echo "get_$name.sh should be in the ./bin directory and executed using" 
+    echo "bin/get_$name.sh"
+    exit 1
+fi
+# -----------------------------------------------------------------------------
+if [ ! -e build ]
+then
+    mkdir build
+fi
+cd build
+# -----------------------------------------------------------------------------
+dir=`echo $tarball | sed -e 's|\.tar||' -e 's|\.gz||'`
+if [ ! -e $dir ]
+then
+    echo_eval wget "$web_page/$tarball"
+    echo_eval tar -xzf $tarball
+    rm $tarball
+fi
+# -----------------------------------------------------------------------------
+echo_eval cd $dir
+if [ ! -e build ]
+then
+    mkdir build
+fi
+echo_eval cd build
+#
+echo_eval ../configure --prefix="$start_dir/build/prefix"
+echo_eval make install
+# -----------------------------------------------------------------------------
+echo "get_$name.sh: OK"
+exit 1
diff --git a/bin/get_omhelp.sh b/bin/get_omhelp.sh
new file mode 100755
index 000000000..7b1cecf9e
--- /dev/null
+++ b/bin/get_omhelp.sh
@@ -0,0 +1,58 @@
+#! /bin/bash -e
+# Copyright: None
+# -----------------------------------------------------------------------------
+web_page='https://github.com/bradbell/omhelp.git'
+version='20190829'
+git_hash='45353cb7853643277e2b57a20f8ddd22d017e4e6'
+start_dir=`pwd`
+# -----------------------------------------------------------------------------
+# bash function that echos and executes a command
+echo_eval() {
+    echo $*
+    eval $*
+}
+# -----------------------------------------------------------------------------
+name='omhelp'
+if [ "$0" != "bin/get_$name.sh" ]
+then
+    echo "get_$name.sh should be in the ./bin directory and executed using" 
+    echo "bin/get_$name.sh"
+    exit 1
+fi
+# -----------------------------------------------------------------------------
+if [ ! -e build ]
+then
+    mkdir build
+fi
+cd build
+# -----------------------------------------------------------------------------
+if [ ! -e omhelp.git ]
+then
+    git clone $web_page omhelp.git
+fi
+# -----------------------------------------------------------------------------
+cd omhelp.git
+git checkout master
+git pull
+git checkout --quiet $git_hash
+# -----------------------------------------------------------------------------
+if [ ! -e build ]
+then
+    mkdir build
+fi
+echo_eval cd build
+echo_eval cmake \
+    -D source_highlight_prefix="$start_dir/build/prefix" \
+    -D omhelp_prefix="$start_dir/build/prefix"  \
+    -D omhelp_datadir=share \
+    -D omhelp_build_type=release \
+    .. | tee cmake.log
+if grep WARNING cmake.log
+then
+    echo "get_$name.sh: aborting due to cmake command warnings"
+    exit 1
+fi
+echo_eval make install
+# -----------------------------------------------------------------------------
+echo "get_$name.sh: OK"
+exit 1
diff --git a/bin/new_release.sh b/bin/new_release.sh
index a9f485d57..c31ed0138 100755
--- a/bin/new_release.sh
+++ b/bin/new_release.sh
@@ -1,6 +1,6 @@
 #! /bin/bash -e
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -10,83 +10,157 @@
 # in the Eclipse Public License, Version 2.0 are satisfied:
 #       GNU General Public License, Version 2.0 or later.
 # -----------------------------------------------------------------------------
-stable_version="20190200" # start each stable_version at yyyymm00
-release='0'               # first release for each stable version is 0
+stable_version='20190200' # date at which this stable branch started
+release='4'               # first release for each stable version is 0
 # -----------------------------------------------------------------------------
-if [ "$0" != 'bin/new_release.sh' ]
-then
-    echo "bin/new_release.sh: must be executed from its parent directory"
-    exit 1
-fi
 # bash function that echos and executes a command
 echo_eval() {
     echo $*
     eval $*
 }
 # -----------------------------------------------------------------------------
-# Check that release version does not already exist
-#
-if git tag --list | grep "$stable_version.$release"
+if [ "$0" != 'bin/new_release.sh' ]
 then
-    echo 'This git reference tag already exists. Delete old version ?'
-    echo "    git tag -d $stable_version.$release"
-    echo "    git push --delete origin $stable_version.$release"
+    echo "bin/new_release.sh: must be executed from its parent directory"
     exit 1
 fi
-# -----------------------------------------------------------------------------
-# master
-# -----------------------------------------------------------------------------
 #
 branch=`git branch | grep '^\*'`
 if [ "$branch" != '* master' ]
 then
-    echo 'new_release.sh: cannot checkout master branch'
+    echo 'new_release.sh: must start execution using master branch'
     exit 1
 fi
+# check that .coin-or/projDesc.xml and omh/cppad.omh are correct
+#
+key='stableVersionNumber'
+sed -i .coin-or/projDesc.xml \
+    -e "s|<$key>[0-9]*</$key>|<$key>$stable_version</$key>|"
+#
+key='releaseNumber'
+sed -i .coin-or/projDesc.xml \
+    -e "s|<$key>[0-9.]*</$key>|<$key>$stable_version.$release</$key>|"
+#
+sed -i omh/cppad.omh \
+    -e "/\/archive\//N" \
+    -e "/\/archive\//s|[0-9]\{8\}\.[0-9]*|$stable_version.$release|g"
+#
 #
-# Make sure no uncommitted changes
 list=`git status -s`
 if [ "$list" != '' ]
 then
-    echo "new_release.sh: 'git status -s' is not empty (for master branch)"
-    echo 'You must commit or abort changes before proceeding.'
+    echo "new_release.sh: 'git status -s' is not empty for master branch"
     exit 1
 fi
-# local hash code for master
-local_hash=`git show-ref master | \
-    grep "refs/heads/$stable_branch" | \
-    sed -e "s| *refs/heads/$stable_branch||"`
-#
-# remote hash code
-remote_hash=`git show-ref master | \
-    grep "refs/remotes/origin/$stable_branch" | \
-    sed -e "s| *refs/remotes/origin/$stable_branch||"`
+# -----------------------------------------------------------------------------
+# Check if these reference tags alread exist
 #
-if [ "$local_hash" != "$remote_hash" ]
+tag=$stable_version.$release
+if git tag --list | grep "$tag"
 then
-    echo 'new_release.sh: local and remote for master differ'
-    echo "local  $stable_branch: $local_hash"
-    echo "remote $stable_branch: $remote_hash"
-    echo 'try:   git push'
+    echo "The reference tag $tag already exist"
+    echo 'Use the following command to delete the old version ?'
+    echo "    git tag -d $tag"
+    echo "    git push --delete origin $tag"
+    exit 1
+fi
+tag=$stable_version.doc
+if git tag --list | grep "$tag"
+then
+    if [ "$release" == 0 ]
+    then
+        echo "The reference tag $tag already exist"
+        echo 'Use the following command to delete the old version ?'
+        echo "    git tag -d $tag"
+        echo "    git push --delete origin $tag"
+        exit 1
+    fi
+else
+    if [ "$release" != 0 ]
+    then
+        echo "The reference tag $tag does not exist"
+        echo 'But the release is not 0'
+        exit 1
+    fi
+fi
+# =============================================================================
+# gh-pages
+# =============================================================================
+cat << EOF > new_release.$$
+/^commit/! b end
+N
+N
+N
+N
+/version $stable_version/! b end
+s|\\nAuthor:.*||
+s|commit *||
+p
+: end
+EOF
+# use gh-pages if they exist for this version
+doc_hash=`git log origin/gh-pages | sed -n -f new_release.$$ | head -1`
+if [ "$doc_hash" == '' ]
+then
+cat << EOF
+Cannot find commit message for $stable_version in output of
+git log origin/gh-pages. Use the following comands to fix this ?
+    git reset --hard
+    version.sh set $stable_version
+    version.sh copy
+    git add --all
+    git commit -m 'master: change to stable version number'
+    gh_pages.sh
+    git commit -m 'update gh-pages to version $stable_version'
+    git push
+    git checkout master
+EOF
+    rm new_release.$$
     exit 1
 fi
+rm new_release.$$
 # =============================================================================
 # stable branch
 # =============================================================================
-# Make sure local and  remote hash codes agree for this stable branch
 stable_branch=stable/$stable_version
 #
+# checkout the stable branch
+echo_eval git checkout $stable_branch
+#
+# check version number
+ok='yes'
+check_one=`version.sh get`
+if [ "$check_one" != "$stable_version.$release" ]
+then
+    ok='no'
+fi
+if ! version.sh check > /dev/null
+then
+    ok='no'
+fi
+if [ "$ok" != 'yes' ]
+then
+    echo 'bin/new_release.sh: version number is not correct'
+    echo 'use the following commands to fix it ?'
+    echo "    version.sh set $stable_version.$release"
+    echo '    version.sh copy'
+    echo '    version.sh check'
+    echo '    bin/autotools.sh automake'
+    echo 'Then commit the changes.'
+    exit 1
+fi
+#
 # local hash code
-local_hash=`git show-ref $stable_branch | \
+stable_local_hash=`git show-ref $stable_branch | \
     grep "refs/heads/$stable_branch" | \
     sed -e "s| *refs/heads/$stable_branch||"`
 #
 # remote hash code
-remote_hash=`git show-ref $stable_branch | \
+stable_remote_hash=`git show-ref $stable_branch | \
     grep "refs/remotes/origin/$stable_branch" | \
     sed -e "s| *refs/remotes/origin/$stable_branch||"`
 #
-if [ "$local_hash" == '' ] && [ "$remote_hash" == '' ]
+if [ "$stable_local_hash" == '' ] && [ "$stable_remote_hash" == '' ]
 then
     echo "new_release.sh: $stable_branch does not exist"
     echo "Use following command to create it ?"
@@ -96,14 +170,14 @@ then
     echo 'Then run tests. Then commit changes.'
     exit 1
 fi
-if [ "$local_hash" == '' ] && [ "$remote_hash" != '' ]
+if [ "$stable_local_hash" == '' ] && [ "$stable_remote_hash" != '' ]
 then
     echo "new_release.sh: local $stable_branch does not exist."
     echo "    git checkout -b $stable_branch origin/$stable_branch"
     exit 1
 fi
 #
-if [ "$remote_hash" == '' ]
+if [ "$stable_remote_hash" == '' ]
 then
     echo "new_release.sh: remote $stable_branch does not exist ?"
     echo "    git push origin $stable_branch"
@@ -111,46 +185,35 @@ then
 fi
 #
 # check local == remote
-if [ "$local_hash" != "$remote_hash" ]
+if [ "$stable_local_hash" != "$stable_remote_hash" ]
 then
-    echo 'new_release.sh: local and remote differ for this branch'
-    echo "local  $stable_branch: $local_hash"
-    echo "remote $stable_branch: $remote_hash"
+    echo "new_release.sh: local and remote differ for $stable_branch"
+    echo "local  $stable_local_hash"
+    echo "remote $stable_remote_hash"
     echo "try: git checkout $stable_branch"
     echo '     git push'
     exit 1
 fi
 # =============================================================================
-# stable branch
+# master
 # =============================================================================
-# checkout the stable branch
-branch=`git branch | grep '^\*' | sed -e 's|^\* *||'`
-if [ "$branch" != "$stable_branch" ]
-then
-    echo_eval git checkout $stable_branch
-fi
-# -----------------------------------------------------------------------------
-check_one=`version.sh get`
-check_two=`grep "cppad-$stable_version\.$release" doc.omh \
-    | sed -e 's|cppad-\([0-9.]*\):.*|\1|'`
-if [ "$check_one" != "$check_two" ]
-then
-    echo 'bin/new_release.sh: version number is not correct ?'
-    echo "    version.sh set $stable_version.$release"
-    echo '    version.sh copy'
-    echo '    version.sh check'
-    echo 'Then commit the changes.'
-    exit 1
-fi
-# -----------------------------------------------------------------------------
-# Make sure that autotools version of makfiles is up to current version.
-bin/autotools.sh automake
-list=`git status -s`
-if [ "$list" != '' ]
+# local hash code for master
+master_local_hash=`git show-ref master | \
+    grep "refs/heads/master" | \
+    sed -e "s| *refs/heads/master||"`
+#
+# remote hash code
+master_remote_hash=`git show-ref master | \
+    grep "refs/remotes/origin/master" | \
+    sed -e "s| *refs/remotes/origin/master||"`
+#
+if [ "$master_local_hash" != "$master_remote_hash" ]
 then
-    echo "new_release.sh: 'git status -s' is not empty"
-    echo 'stable branch autotools install not up to current version'
-    echo 'commit the local changes.'
+    echo 'new_release.sh: local and remote for master differ'
+    echo "local  $master_local_hash"
+    echo "remote $master_remote_hash"
+    echo 'try:   git checkout master'
+    echo 'try:   git push'
     exit 1
 fi
 # -----------------------------------------------------------------------------
@@ -162,12 +225,22 @@ then
     exit 1
 fi
 # -----------------------------------------------------------------------------
-# tag this release
+# tag the source code
 #
-echo_eval git tag -a -m "created by bin/new_release.sh" \
-    $stable_version.$release
+echo_eval git tag -a -m \"created by bin/new_release.sh\" \
+    $stable_version.$release $stable_remote_hash
 #
 echo_eval git push origin $stable_version.$release
+#
+# tag the documentation
+#
+if [ "$release" == '0' ]
+then
+    echo_eval git tag -a -m \"created by bin/new_release.sh\" \
+        $stable_version.doc  $doc_hash
+    #
+    echo_eval git push origin $stable_version.doc
+fi
 # =============================================================================
 # master branch
 # =============================================================================
diff --git a/bin/replace_html.py b/bin/replace_html.py
index e4c771164..71eda286f 100755
--- a/bin/replace_html.py
+++ b/bin/replace_html.py
@@ -1,6 +1,6 @@
-#! /bin/python
+#! /usr/bin/env python
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -17,19 +17,19 @@ import re
 if sys.argv[0] != 'bin/replace_html.py' :
     msg = 'bin/replace_html.py: must be executed from its parent directory'
     sys.exit(msg)
-# 
+#
 usage = '''\nusage: replace_html.py define_file replace_file new_file where
 
 define_file:  contains the define commands
 replace_file: contains the replace commands (many be same as define_file)
-new_file:     is a copy of replace file with the replacements.  
+new_file:     is a copy of replace file with the replacements.
 
 The definitions are specified by:
     <!-- define name -->source<!-- end name -->
-where name is any unique name, with no spaces ' ', for the replacement text 
-and source is the replacement text. 
+where name is any unique name, with no spaces ' ', for the replacement text
+and source is the replacement text.
 
-The replacement positions are specified by: 
+The replacement positions are specified by:
     <!-- replace name -->desination<!-- end name -->
 where name refers to a defined replacement text and destination
 is the text that is replaced.
diff --git a/bin/run_cmake.sh b/bin/run_cmake.sh
index 86391370f..f641b05cc 100755
--- a/bin/run_cmake.sh
+++ b/bin/run_cmake.sh
@@ -1,6 +1,6 @@
 #! /bin/bash -e
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -248,6 +248,10 @@ done
 # cppad_cxx_flags
 cppad_cxx_flags="-Wall -pedantic-errors -std=$standard -Wshadow"
 cppad_cxx_flags="$cppad_cxx_flags -Wfloat-conversion -Wconversion"
+if [ "$debug_which" == 'debug_odd' ] || [ "$debug_which" == 'debug_even' ]
+then
+    cppad_cxx_flags="$cppad_cxx_flags -D CPPAD_DEBUG_AND_RELEASE"
+fi
 if [ "$callgrind" == 'yes' ]
 then
     if [ "$debug_which" != 'debug_none' ]
diff --git a/bin/run_omhelp.sh b/bin/run_omhelp.sh
index 567e42ddf..57612994d 100755
--- a/bin/run_omhelp.sh
+++ b/bin/run_omhelp.sh
@@ -1,20 +1,6 @@
 #! /bin/bash -e
-# -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
-#
-# CppAD is distributed under the terms of the
-#              Eclipse Public License Version 2.0.
-#
-# This Source Code may also be made available under the following
-# Secondary License when the conditions for such availability set forth
-# in the Eclipse Public License, Version 2.0 are satisfied:
-#       GNU General Public License, Version 2.0 or later.
-# -----------------------------------------------------------------------------
-if [ ! -e "bin/run_omhelp.sh" ]
-then
-    echo "bin/run_omhelp.sh: must be executed from its parent directory"
-    exit 1
-fi
+# Copyright: None
+start_dir=`pwd`
 # -----------------------------------------------------------------------------
 # bash function that echos and executes a command
 echo_eval() {
@@ -22,104 +8,139 @@ echo_eval() {
     eval $*
 }
 # -----------------------------------------------------------------------------
+if ! which omhelp >& /dev/null
+then
+    if [ -e build/prefix/bin/omhelp ]
+    then
+        PATH="$PATH:$start_dir/build/prefix/bin"
+    fi
+fi
+if ! which omhelp 
+then
+    echo 'run_omhel.sh: cannot find omhelp'
+    echo 'perhaps you need to execute the following commands:'
+    echo '  bin/get_highlight.sh'
+    echo '  bin/get_omhelp.sh'
+    exit 1
+fi
+# -----------------------------------------------------------------------------
+# command line arguments
+cat << EOF > run_omhelp.$$
+usage: run_omhelp.sh [-clean] [-printable] [-xml] root
+where ./root.omh is the top level (root) omhelp file.
+The output is written in the ./root directory.
+EOF
 clean='no'
-htm='no'
-xml='no'
-printable='no'
+printable=''
+xml=''
+root=''
 while [ "$1" != '' ]
 do
-    case "$1" in
-
-        clean)
+    case $1 in
+    
+        -clean)
         clean='yes'
+        shift
         ;;
-
-        htm)
-        htm='yes'
+    
+        -printable)
+        printable='-printable'
+        shift
         ;;
-
-        xml)
-        xml='yes'
+    
+        -xml)
+        xml='-xml'
+        shift
         ;;
-
-        printable)
-        printable='yes'
-        ;;
-
+    
         *)
-        echo "$1 is not a valid bin/run_omhelp.sh option"
-        exit 1
+        root="$1"
+        shift
+        if [ ! -f "$root".omh ] || [ "$1" != '' ]
+        then
+            cat run_omhelp.$$
+            rm run_omhelp.$$
+            exit 1
+        fi
+        ;;
+    
     esac
-    shift
 done
-if [ "$htm" == "$xml" ]
+#
+if [ "$root" == '' ]
 then
-    echo 'usage: bin/run_omhelp.sh [clean] [htm] [xml] [printable]'
-    echo 'order does not matter and htm or xml is present (but not both).'
+    cat run_omhelp.$$
+    rm run_omhelp.$$
     exit 1
 fi
-if [ "$htm" == 'yes' ]
-then
-    ext='htm'
-else
-    ext='xml'
-fi
+rm run_omhelp.$$
 # -----------------------------------------------------------------------------
-if [ "$clean" == 'yes' ]
+for file in bin/devel.sh $root.omh
+do
+    if [ ! -e "$file" ]
+    then
+        echo "run_omhelp.sh: cannot find the file: $file"
+        exit 1
+    fi
+done
+# -----------------------------------------------------------------------------
+# get image_link
+if ! grep "^image_link='[^']*'$" bin/devel.sh > /dev/null
 then
-    echo_eval rm -rf doc
+    echo 'run_omhelp.sh cannot find the following pattern in bin/devel.sh' 
+    echo "^image_link='[^']*'$"
+    exit 1
 fi
 #
-if [ ! -e doc ]
+image_link=`grep '^image_link=' bin/devel.sh | sed \
+    -e "s|^image_link='||" -e "s|'$||"`
+echo "image_link ='$image_link'"
+if [ "$image_link" != '' ]
 then
-    echo_eval mkdir doc
+    image_link="-image_link $image_link"
 fi
-echo_eval cd doc
 # -----------------------------------------------------------------------------
-cmd='omhelp ../doc.omh -noframe -debug'
-cmd="$cmd -image_link http://www.coin-or.org/CppAD/"
-#
-if [ "$ext" == "xml" ]
-then
-    cmd="$cmd -xml"
-fi
-if [ $printable == 'yes' ]
-then
-    cmd="$cmd -printable"
-fi
-echo "$cmd >& omhelp.$ext.log"
-if !  $cmd >& ../omhelp.$ext.log
+if [ "$clean" == 'yes' ]
 then
-    cat ../omhelp.$ext.log
-    echo "OMhelp could not build doc/*.$ext documentation."
-    grep "^OMhelp Error:" ../omhelp.$ext.log
-    exit 1
+    if [ -d $root ]
+    then
+        echo_eval rm -r $root
+    fi
 fi
-if grep "^OMhelp Warning:" ../omhelp.$ext.log
+# -----------------------------------------------------------------------------
+if [ ! -d "$root" ]
 then
-    echo "See the complete warning messages in omhelp.$ext.log."
-    exit 1
+    echo_eval mkdir $root
 fi
-if [ "$printable" == 'yes' ]
+echo_eval cd $root
+if omhelp \
+    "../$root.omh" \
+    $printable \
+    $xml \
+    $image_link \
+    -noframe \
+    -debug \
+    > ../omhelp.$root.log
 then
-    root_name='_printable'
+    omhelp_error='no'
 else
-    root_name='cppad'
+    omhelp_error='yes'
 fi
-if [ ! -e "$root_name.$ext" ]
+cd ..
+# -----------------------------------------------------------------------------
+if [ "$omhelp_error" == 'yes' ]
 then
-    echo "run_omhelp.sh: Can't make $root_name.$ext the default page."
+    cat omhelp.$root.log
+    echo "OMhelp could not build $root."
+    echo "See the complete error message in omhelp.$root.log."
+    grep "^OMhelp Error:" omhelp.$root.log
     exit 1
 fi
-if [ -e 'index.htm' ]
+if grep "^OMhelp Warning:" omhelp.$root.log
 then
-    echo_eval rm index.htm
+    echo "See the complete warning messages in omhelp.$root.log."
+    exit 1
 fi
-cat << EOF > index.html
-<html><head><script>
-window.location.href="$root_name.$ext";
-</script></head></html>
-EOF
-#
-echo "OK: omhelp $*"
+# -----------------------------------------------------------------------------
+echo 'run_omhelp.sh OK'
 exit 0
diff --git a/bin/sort_all.sh b/bin/sort_all.sh
new file mode 100755
index 000000000..ec1bf2819
--- /dev/null
+++ b/bin/sort_all.sh
@@ -0,0 +1,30 @@
+#! /bin/bash -e
+# -----------------------------------------------------------------------------
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+#
+# CppAD is distributed under the terms of the
+#              Eclipse Public License Version 2.0.
+#
+# This Source Code may also be made available under the following
+# Secondary License when the conditions for such availability set forth
+# in the Eclipse Public License, Version 2.0 are satisfied:
+#       GNU General Public License, Version 2.0 or later.
+# -----------------------------------------------------------------------------
+if [ $0 != "bin/sort_all.sh" ]
+then
+    echo "bin/sort_all.sh: must be executed from its parent directory"
+    exit 1
+fi
+list=`git grep -l 'BEGIN_SORT_THIS_LINE_PLUS_' | sed \
+    -e '/\/makefile.in$/d' \
+    -e '\/^makefile.in$/d' \
+    -e '/\/sort_all.sh$/d' `
+#
+for file in $list
+do
+    sort.sh $file
+done
+#
+# ----------------------------------------------------------------------------
+echo "$0: OK"
+exit 0
diff --git a/bin/test_one.sh.in b/bin/test_one.sh.in
index 2674ca19b..b15214dd3 100755
--- a/bin/test_one.sh.in
+++ b/bin/test_one.sh.in
@@ -1,6 +1,6 @@
 #! /bin/bash -e
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -99,15 +99,6 @@ then
     set_libdir @colpack_prefix@
     library_flags="$library_flags -L@colpack_prefix@/$libdir -lColPack"
     export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:@colpack_prefix@/$libdir"
-    cppad_lib_path="@PROJECT_BINARY_DIR@/cppad_lib/libcppad_lib.so"
-    library_flags="$library_flags $cppad_lib_path"
-    #
-    if ! ls build/cppad_lib/libcppad_lib.* > /dev/null
-    then
-        cd build
-        make cppad_lib
-        cd ..
-    fi
 fi
 #
 # ipopt
@@ -124,6 +115,18 @@ if [ @cppad_has_eigen@ == 1 ]
 then
     include_flags="$include_flags -isystem @eigen_prefix@/include"
 fi
+#
+# cppad_lib
+cppad_lib_path="@PROJECT_BINARY_DIR@/cppad_lib/libcppad_lib.so"
+library_flags="$library_flags $cppad_lib_path"
+#
+cd build
+if ! make cppad_lib
+then
+    echo 'test_one.sh: Error during make cppad_lib in build directory'
+    exit
+fi
+cd ..
 # --------------------------------------------------------------------------
 # Create test_one.exe
 #
diff --git a/bug/alloc_global.sh b/bug/alloc_global.sh
deleted file mode 100755
index 86842f50e..000000000
--- a/bug/alloc_global.sh
+++ /dev/null
@@ -1,117 +0,0 @@
-#! /bin/bash -e
-# -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
-#
-# CppAD is distributed under the terms of the
-#              Eclipse Public License Version 2.0.
-#
-# This Source Code may also be made available under the following
-# Secondary License when the conditions for such availability set forth
-# in the Eclipse Public License, Version 2.0 are satisfied:
-#       GNU General Public License, Version 2.0 or later.
-# -----------------------------------------------------------------------------
-#!/bin/bash -e
-#
-if [ ! -e build ]
-then
-    mkdir build
-fi
-cd build
-if [ ! -e ../../include/cppad/configure.hpp ]
-then
-    cmake ../..
-fi
-#
-echo "$0"
-name=`echo $0 | sed -e 's|.*/||' -e 's|\..*||'`
-echo "create $name.cpp"
-cat << EOF > $name.cpp
-// BEGIN PROGRAM
-# include <cppad/cppad.hpp>
-# include <omp.h>
-# define NUMBER_THREADS  2
-
-namespace {
-    using CppAD::thread_alloc;
-
-    // used to inform CppAD when we are in parallel execution mode
-    bool in_parallel(void)
-    {   return static_cast<bool>( omp_in_parallel() ); }
-
-    // used to inform CppAD of current thread number thread_number()
-    size_t thread_number(void)
-    {   return static_cast<bool>( omp_get_thread_num() ); }
-
-    // structure with information for one thread
-    typedef struct {
-        // function object (worker input)
-        CppAD::vector<double> x;
-    } thread_one_t;
-
-    // vector with information for all threads
-    thread_one_t thread_all_[NUMBER_THREADS];
-
-    // --------------------------------------------------------------------
-    // function that does the work for one thread
-    void worker(void)
-    {
-        size_t thread_num = thread_number();
-        thread_all_[thread_num].x.resize(1);
-        thread_all_[thread_num].x[0]=static_cast<double>(thread_num);
-
-        std::stringstream stream;
-        stream << "thread_num = " << thread_num << std::endl;
-        std::cout << stream.str();
-    }
-}
-
-// Test routine called by the master thread (thread_num = 0).
-bool alloc_global(void)
-{   bool ok = true;
-    using std::cout;
-    using std::endl;
-    
-    size_t num_threads = NUMBER_THREADS;
-    if( omp_get_max_threads() < num_threads )
-    {   cout << "can't set num_threads = " << num_threads << endl;
-        ok = false;
-        return ok;
-    }
-
-    // call setup for using thread_alloc in parallel mode.
-    thread_alloc::parallel_setup(num_threads, in_parallel, thread_number);
-    
-    // Execute the worker function in parallel
-    int thread_num;
-# pragma omp parallel for
-    for(thread_num = 0; thread_num < num_threads; thread_num++)
-        worker();
-// end omp parallel for
-    
-    // now inform CppAD that there is only one thread
-    thread_alloc::parallel_setup(1, CPPAD_NULL, CPPAD_NULL);
-
-    for(thread_num = 0; thread_num < num_threads; thread_num++)
-    {   // check calculations by this thread in parallel model
-        ok &= thread_all_[thread_num].x[0] == static_cast<double>(thread_num);
-
-        // free memory that was allocated by thread thread_num
-        thread_all_[thread_num].x.resize(0);
-    }
-
-    return ok;
-}
-int main(void)
-{   bool ok = alloc_global();
-    std::cout << "OK = " << ok << std::endl;
-    return int(! ok);
-} 
-EOF
-echo "g++ -g $name.cpp -I../.. -fopenmp -std=c++11 -o $name"
-g++ -g $name.cpp -I../.. -fopenmp -std=c++11 -o $name
-#
-echo "./$name"
-./$name
-#
-echo "rm $name $name.cpp"
-rm $name $name.cpp
diff --git a/bug/boost_lu.sh b/bug/boost_lu.sh
index 679565ac0..9547c3393 100755
--- a/bug/boost_lu.sh
+++ b/bug/boost_lu.sh
@@ -10,6 +10,22 @@
 # in the Eclipse Public License, Version 2.0 are satisfied:
 #       GNU General Public License, Version 2.0 or later.
 # -----------------------------------------------------------------------------
+#!/bin/bash -e
+name=`echo $0 | sed -e 's|^bug/||' -e 's|\.sh$||'`
+if [ "$0" != "bug/$name.sh" ]
+then
+    echo 'usage: bug/alloc_global.sh'
+    exit 1
+fi
+# -----------------------------------------------------------------------------
+if [ -e build/bug ]
+then
+    rm -r build/bug
+fi
+mkdir -p build/bug
+cd build/bug
+cmake ../..
+# -----------------------------------------------------------------------------
 cat << EOF
 This test results in a very long error message with boost-1.55.0 and
 gcc-4.9.2. Here is the gist of the message:
@@ -31,7 +47,7 @@ New Text:
     S norm_diff = norm_inf(e1 - e2);
     return norm_diff < epsilon * std::max( std::max<S>(norm_1, norm_2) , min_norm );
 EOF
-cat << EOF > bug.$$
+cat << EOF > boost_lu.cpp
 #include <cppad/cppad.hpp>
 
 # define NUMERIC_LIMITS_FUN(name)                  \
@@ -105,17 +121,8 @@ int main() {
     return 0;
 }
 EOF
-# -----------------------------------------------------------------------------
-if [ ! -e build ]
-then
-    mkdir build
-fi
-cd build
-echo "$0"
-name=`echo $0 | sed -e 's|.*/||' -e 's|\..*||'`
-mv ../bug.$$ $name.cpp
-echo "g++ -I../.. --std=c++11 -g $name.cpp -o $name >& $name.log"
-if ! g++ -I../.. --std=c++11 -g $name.cpp -o $name >& $name.log
+echo "g++ -I../../include --std=c++11 -g $name.cpp -o $name >& $name.log"
+if ! g++ -I../../include --std=c++11 -g $name.cpp -o $name >& $name.log
 then
     cat << EOF > $name.sed
 s|\\[|&\\n|g
@@ -139,7 +146,7 @@ s|matrix_matrix_binary<AD_prod_ulower_upper>|AD_prod_ulower_upper|g
 EOF
     echo "sed -f $name.sed $name.log > ../$name.log"
     sed -f $name.sed $name.log > ../$name.log
-    echo "$name.sh: Compliation Error: see $name.log"
+    echo "$name.sh: Compliation Error: see build/bug/$name.log"
     exit 1
 fi
 #
@@ -151,5 +158,6 @@ then
     exit 1
 fi
 echo
+# ------------------------------------------------------------------------------
 echo "$name.sh: OK"
 exit 0
diff --git a/bug/clang_simple.sh b/bug/clang_simple.sh
index efaba6523..496d99af6 100755
--- a/bug/clang_simple.sh
+++ b/bug/clang_simple.sh
@@ -10,15 +10,21 @@
 # in the Eclipse Public License, Version 2.0 are satisfied:
 #       GNU General Public License, Version 2.0 or later.
 # -----------------------------------------------------------------------------
-name=`echo $0 | sed -e 's|.*/||' -e 's|\..*||'`
+name='clang_simple'
 if [ "$0" != "bug/$name.sh" ]
 then
     echo "usage: bug/$name.sh"
     exit 1
 fi
-cat << EOF
-Description
-EOF
+# -----------------------------------------------------------------------------
+if [ -e build/bug ]
+then
+    rm -r build/bug
+fi
+mkdir -p build/bug
+cd build/bug
+cmake ../..
+# -----------------------------------------------------------------------------
 cat << EOF > $name.cpp
 # include <cppad/cppad.hpp>
 int main(void)
@@ -34,28 +40,11 @@ int main(void)
     return 1;
 }
 EOF
-# -----------------------------------------------------------------------------
-if [ ! -e cppad/configure.hpp ]
-then
-    echo
-    echo 'Cannot find the file cppad/configure.hpp.'
-    echo 'Must run bin/run_cmake.sh to create it.'
-    rm $name.cpp
-    exit 1
-fi
-if [ -e build/bug ]
-then
-    rm -r build/bug
-fi
-mkdir -p build/bug
-mv $name.cpp build/bug/$name.cpp
-cd build/bug
 cxx_flags='-g -O0'
 eigen_dir="$HOME/prefix/eigen/include"
-echo "clang++ -I../.. -isystem $eigen_dir $cxx_flags $name.cpp -o $name"
-clang++ -I../.. -isystem $eigen_dir $cxx_flags $name.cpp -o $name
+echo "clang++ -I../../include -isystem $eigen_dir $cxx_flags $name.cpp -o $name"
+clang++ -I../../include -isystem $eigen_dir $cxx_flags $name.cpp -o $name
 #
-echo "build/bug/$name"
 if ! ./$name
 then
     echo
@@ -63,5 +52,6 @@ then
     exit 1
 fi
 echo
+# ------------------------------------------------------------------------------
 echo "./$name.sh: OK"
 exit 0
diff --git a/bug/multi_checkpoint.sh b/bug/multi_checkpoint.sh
deleted file mode 100755
index afe00062c..000000000
--- a/bug/multi_checkpoint.sh
+++ /dev/null
@@ -1,134 +0,0 @@
-#! /bin/bash -e
-# -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
-#
-# CppAD is distributed under the terms of the
-#              Eclipse Public License Version 2.0.
-#
-# This Source Code may also be made available under the following
-# Secondary License when the conditions for such availability set forth
-# in the Eclipse Public License, Version 2.0 are satisfied:
-#       GNU General Public License, Version 2.0 or later.
-# -----------------------------------------------------------------------------
-name=`echo $0 | sed -e 's|.*/||' -e 's|\..*||'`
-if [ "$0" != "bug/$name.sh" ]
-then
-    echo "usage: bug/$name.sh"
-    exit 1
-fi
-cat << EOF
-Description
-EOF
-cat << EOF > $name.cpp
-# include <cppad/cppad.hpp>
-# include <omp.h>
-
-namespace {
-
-    typedef CPPAD_TESTVECTOR(double)               d_vector;
-    typedef CPPAD_TESTVECTOR( CppAD::AD<double> ) ad_vector;
-
-
-    // algorithm that we are checkpoingint
-    const size_t length_of_sum_ = 5000;
-    void long_sum_algo(const ad_vector& ax, ad_vector& ay)
-    {   ay[0] = 0.0;
-        for(size_t i = 0; i < length_of_sum_; ++i)
-            ay[0] += ax[0];
-        return;
-    }
-    // inform CppAD if we are in parallel mode
-    bool in_parallel(void)
-    {   return omp_in_parallel() != 0; }
-    //
-    // inform CppAD of the current thread number
-    size_t thread_num(void)
-    {   return static_cast<size_t>( omp_get_thread_num() ); }
-
-}
-
-int main(void)
-{   bool ok = true;
-
-    // OpenMP setup
-    size_t num_threads = 2;      // number of threads
-    omp_set_dynamic(0);          // turn off dynamic thread adjustment
-    omp_set_num_threads( int(num_threads) );  // set number of OMP threads
-
-    // check that multi-threading is possible on this machine
-    if( omp_get_max_threads() < 2 )
-    {   std::cout << "This machine does not support multi-threading: ";
-    }
-
-    // create checkpoint version of algorithm
-    size_t n(1), m(1);
-    ad_vector ax(n), ay(m);
-    ax[0] = 2.0;
-    CppAD::atomic_base<double>::option_enum sparsity =
-        CppAD::atomic_base<double>::set_sparsity_enum;
-    bool optimize = false;
-    CppAD::checkpoint<double> atom_fun(
-        "long_sum", long_sum_algo, ax, ay, sparsity, optimize
-    );
-
-    // setup for using CppAD in paralle mode
-    CppAD::thread_alloc::parallel_setup(num_threads, in_parallel, thread_num);
-    CppAD::thread_alloc::hold_memory(true);
-    CppAD::parallel_ad<double>();
-
-    // place to hold result for each thread
-    d_vector y(num_threads);
-    for(size_t thread = 0; thread < num_threads; thread++)
-        y[thread] = 0.0;
-
-    # pragma omp parallel for
-    for(int thread = 0; thread < int(num_threads); thread++)
-    {   ad_vector au(n), av(m);
-        au[0] = 1.0;
-        atom_fun(au, av);
-        //
-        y[thread] = double( length_of_sum_ * (thread + 1) );
-    }
-
-    // check the results
-    for(size_t thread = 0; thread < num_threads; thread++)
-    {   double check = double( length_of_sum_ * (thread + 1) );
-        ok          &= check == y[thread];
-    }
-    if( ok )
-        return 0;
-    return 1;
-}
-
-EOF
-# -----------------------------------------------------------------------------
-if [ ! -e cppad/configure.hpp ]
-then
-    echo
-    echo 'Cannot find the file cppad/configure.hpp.'
-    echo 'Must run bin/run_cmake.sh to create it.'
-    rm $name.cpp
-    exit 1
-fi
-if [ -e build/bug ]
-then
-    rm -r build/bug
-fi
-mkdir -p build/bug
-mv $name.cpp build/bug/$name.cpp
-cd build/bug
-cxx_flags='-Wall -pedantic-errors -std=c++11 -Wshadow -Wconversion -g -O0 -fopenmp'
-eigen_dir="$HOME/prefix/eigen/include"
-echo "g++ -I../.. -isystem $eigen_dir $cxx_flags $name.cpp -o $name"
-g++ -I../.. -isystem $eigen_dir $cxx_flags $name.cpp -o $name
-#
-echo "build/bug/$name"
-if ! ./$name
-then
-    echo
-    echo "build/bug/$name: Error"
-    exit 1
-fi
-echo
-echo "./$name.sh: OK"
-exit 0
diff --git a/bug/optimize.sh b/bug/optimize.sh
deleted file mode 100755
index c84fad5d8..000000000
--- a/bug/optimize.sh
+++ /dev/null
@@ -1,96 +0,0 @@
-#! /bin/bash -e
-# -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
-#
-# CppAD is distributed under the terms of the
-#              Eclipse Public License Version 2.0.
-#
-# This Source Code may also be made available under the following
-# Secondary License when the conditions for such availability set forth
-# in the Eclipse Public License, Version 2.0 are satisfied:
-#       GNU General Public License, Version 2.0 or later.
-# -----------------------------------------------------------------------------
-cat << EOF
-Bug in CppAD optimizer.
-Test passes when nz = 9998 and fails when nz = 9999
-EOF
-cat << EOF > bug.$$
-# include <cppad/cppad.hpp>
-int main(void)
-{   bool ok = true;
-    using std::cout;
-    using CppAD::AD;
-    using CppAD::vector;
-    //
-    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
-    //
-    // length of the data vector z
-    size_t nz = 9999;
-    //
-    // factor for last term
-    double factor = 1e+5;
-    //
-    // z starts at -1.0 and ends at 1.0
-    vector<double> z(nz);
-    for(size_t i = 0; i < nz; i++)
-        z[i] = -1.0 + i * 2.0 / double(nz - 1);
-    //
-    // f(x) = sum from i=0 to nz-1 of (x - z[i])^2
-    vector< AD<double> > ax(1), ay(1);
-    ax[0] = 0.0;
-    CppAD::Independent(ax);
-    AD<double> asum = 0.0;
-    for(size_t i = 0; i < nz; i++)
-    {   AD<double> aterm = z[i] - ax[0];
-        if( i == nz - 1 )
-            asum += factor * aterm;
-        else
-            asum += aterm / factor;
-    }
-    ay[0] = asum;
-    CppAD::ADFun<double> f(ax, ay);
-    //
-    // value of x where we are computing derivative
-    vector<double> x(1), y_before(1), y_after(1);
-    x[0]     = .1;
-    y_before = f.Forward(0, x);
-    f.optimize();
-    y_after  = f.Forward(0, x);
-    //
-    ok &= CppAD::NearEqual(y_before[0], y_after[0], eps99, eps99);
-    //
-    if( ok )
-        return 0;
-    return 1;
-}
-EOF
-# -----------------------------------------------------------------------------
-if [ ! -e ../include/cppad/configure.hpp ]
-then
-    echo
-    echo 'Cannot find the file cppad/configure.hpp in directory ..'
-    echo 'Must change into .. directory and run bin/run_cmake.sh'
-    rm bug.$$
-    exit 1
-fi
-if [ ! -e build ]
-then
-    mkdir build
-fi
-cd build
-echo "$0"
-name=`echo $0 | sed -e 's|.*/||' -e 's|\..*||'`
-mv ../bug.$$ $name.cpp
-echo "g++ -I../.. --std=c++11 -g $name.cpp -o $name"
-g++ -I../.. --std=c++11 -g $name.cpp -o $name
-#
-echo "./$name"
-if ! ./$name
-then
-    echo
-    echo "$name.sh: Error"
-    exit 1
-fi
-echo
-echo "$name.sh: OK"
-exit 0
diff --git a/bug/pow.sh b/bug/pow.sh
new file mode 100755
index 000000000..6b628d938
--- /dev/null
+++ b/bug/pow.sh
@@ -0,0 +1,85 @@
+#! /bin/bash -e
+# vim: set expandtab:
+# -----------------------------------------------------------------------------
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+#
+# CppAD is distributed under the terms of the
+#              Eclipse Public License Version 2.0.
+#
+# This Source Code may also be made available under the following
+# Secondary License when the conditions for such availability set forth
+# in the Eclipse Public License, Version 2.0 are satisfied:
+#       GNU General Public License, Version 2.0 or later.
+# -----------------------------------------------------------------------------
+name=`echo $0 | sed -e 's|^bug/||' -e 's|\.sh$||'`
+if [ "$0" != "bug/$name.sh" ]
+then
+    echo 'usage: bug/pow.sh'
+    exit 1
+fi
+# -----------------------------------------------------------------------------
+if [ -e build/bug ]
+then
+    rm -r build/bug
+fi
+mkdir -p build/bug
+cd build/bug
+# cmake ../..
+# -----------------------------------------------------------------------------
+cat << EOF
+Issue 43:
+f(x) = (x^0.5) * (x^0.5) = x, and differentiate at x = 0.
+Expect some NaN, Inf, or possibly one, but not zero.
+EOF
+cat << EOF > $name.cpp
+# include <cstdio>
+# include "cppad/cppad.hpp"
+
+
+int main(int argc, char** argv)
+{   bool ok = true;
+
+    using std::cout;
+    using CppAD::AD;
+    using CppAD::vector;
+    //
+    vector< double> x(1), y(1), w(1), dw(1);
+    vector< AD<double> > ax(1), ay(1);
+    //
+    ax[0] = 0.0;
+    //
+    CppAD::Independent(ax);
+    ay[0] = pow(ax[0], 0.5) * pow(ax[0], 0.5);
+    CppAD::ADFun<double> f(ax, ay);
+    //
+    x[0]  = 0.0;
+    y     = f.Forward(0, x);
+    w[0]  = 1.0;
+    dw    = f.Reverse(1, w);
+    //
+    cout << "dw = " << dw << "\n";
+    //
+    ok &= y[0] == 0.0;
+    ok &= dw[0] == 1.0 || ! std::isfinite( dw[0] );
+    //
+    if( ! ok )
+        return 1;
+    return 0;
+}
+EOF
+cxx_flags='-Wall -pedantic-errors -std=c++11 -Wshadow -Wconversion -g -O0'
+eigen_dir="$HOME/prefix/eigen/include"
+echo "g++ -I../../include -isystem $eigen_dir $cxx_flags $name.cpp -o $name"
+g++ -I../../include -isystem $eigen_dir $cxx_flags $name.cpp -o $name
+#
+echo "build/bug/$name"
+if ! ./$name
+then
+    echo
+    echo "build/bug/$name: Error"
+    exit 1
+fi
+echo
+# -----------------------------------------------------------------------------
+echo "bug/$name.sh: OK"
+exit 0
diff --git a/bug/subgraph.sh b/bug/subgraph.sh
new file mode 100755
index 000000000..1e7f0dd66
--- /dev/null
+++ b/bug/subgraph.sh
@@ -0,0 +1,92 @@
+#! /bin/bash -e
+# -----------------------------------------------------------------------------
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+#
+# CppAD is distributed under the terms of the
+#              Eclipse Public License Version 2.0.
+#
+# This Source Code may also be made available under the following
+# Secondary License when the conditions for such availability set forth
+# in the Eclipse Public License, Version 2.0 are satisfied:
+#       GNU General Public License, Version 2.0 or later.
+# -----------------------------------------------------------------------------
+name=`echo $0 | sed -e 's|^bug/||' -e 's|\.sh$||'`
+if [ "$0" != "bug/$name.sh" ]
+then
+    echo 'usage: bug/alloc_global.sh'
+    exit 1
+fi
+# -----------------------------------------------------------------------------
+if [ -e build/bug ]
+then
+    rm -r build/bug
+fi
+mkdir -p build/bug
+cd build/bug
+cmake ../..
+# -----------------------------------------------------------------------------
+cat << EOF
+Description: Test for bug in subgraph_jac_rev(x, subset).
+EOF
+cat << EOF > $name.cpp
+# include <cppad/cppad.hpp>
+int main(void)
+{   bool ok = true;
+    using std::cout;
+    using CppAD::AD;
+    using CppAD::vector;
+    typedef vector<double> d_vector;
+    typedef vector<size_t> s_vector;
+    //
+    size_t n = 4;
+    d_vector x(n);
+    vector< AD<double> > ax(n), ay(n);
+    for(size_t j = 0; j < n; ++j)
+        ax[j] = x[j] = double(j);
+    CppAD::Independent(ax);
+    for(size_t i = 0; i < n; ++i)
+    {   ay[i] = 0.0;
+        for(size_t j = 0; j < n; ++j)
+            ay[i] += double(i + j + 1) * ax[j];
+    }
+    CppAD::ADFun<double> f(ax, ay);
+    //
+    size_t nnz = (n * (n + 1)) / 2;
+    CppAD::sparse_rc<s_vector> upper_triangle(n, n, nnz);
+    size_t k = 0;
+    for(size_t i = 0; i < n; ++i)
+    {   for(size_t j = i; j < n; ++j)
+            upper_triangle.set(k++, i, j);
+    }
+    ok &= k == nnz;
+    CppAD::sparse_rcv<s_vector, d_vector> subset( upper_triangle );
+    //
+    f.subgraph_jac_rev(x, subset);
+    const d_vector& val = subset.val();
+    k = 0;
+    for(size_t i = 0; i < n; ++i)
+    {   for(size_t j = i; j < n; ++j)
+            ok &= val[k++] == double(i + j + 1);
+    }
+    ok &= k == nnz;
+    //
+    if( ok )
+        return 0;
+    return 1;
+}
+EOF
+cxx_flags='-Wall -pedantic-errors -std=c++11 -Wshadow -Wconversion -g -O0'
+echo "g++ -I../../include $cxx_flags $name.cpp -o $name"
+g++ -I../../include $cxx_flags $name.cpp -o $name
+#
+echo "build/bug/$name"
+if ! ./$name
+then
+    echo
+    echo "build/bug/$name: Error"
+    exit 1
+fi
+echo
+# -----------------------------------------------------------------------------
+echo "bug/$name.sh: OK"
+exit 0
diff --git a/bug/template.sh b/bug/template.sh
index c3eb55f5d..710939f85 100755
--- a/bug/template.sh
+++ b/bug/template.sh
@@ -1,6 +1,6 @@
 #! /bin/bash -e
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -10,14 +10,23 @@
 # in the Eclipse Public License, Version 2.0 are satisfied:
 #       GNU General Public License, Version 2.0 or later.
 # -----------------------------------------------------------------------------
-name=`echo $0 | sed -e 's|.*/||' -e 's|\..*||'`
+name=`echo $0 | sed -e 's|^bug/||' -e 's|\.sh$||'`
 if [ "$0" != "bug/$name.sh" ]
 then
     echo "usage: bug/$name.sh"
     exit 1
 fi
+# -----------------------------------------------------------------------------
+if [ -e build/bug ]
+then
+    rm -r build/bug
+fi
+mkdir -p build/bug
+cd build/bug
+cmake ../..
+# -----------------------------------------------------------------------------
 cat << EOF
-Description
+Description:
 EOF
 cat << EOF > $name.cpp
 # include <cppad/cppad.hpp>
@@ -25,37 +34,22 @@ int main(void)
 {   bool ok = true;
     using std::cout;
     using CppAD::AD;
+    using CppAD::vector;
     //
-    cout << "1. copy bug/template.sh to bug/<name>.sh\n";
-    cout << "2. Edit bug/<name>.sh replacing description and C++ source code\n";
-    cout << "3. Run bug/<name>.sh\n";
-    cout << "where <name> is a name that describes the bug\n";
+    cout << "1. copy bug/template.sh to bug/$name.sh\n";
+    cout << "2. Edit bug/$name.sh replacing description and C++ source code\n";
+    cout << "3. Run bug/$name.sh\n";
+    cout << "Test passes (fails) if bug/$name.sh: OK (Error) echoed at end\n";
     //
     if( ok )
         return 0;
     return 1;
 }
 EOF
-# -----------------------------------------------------------------------------
-if [ ! -e cppad/configure.hpp ]
-then
-    echo
-    echo 'Cannot find the file cppad/configure.hpp.'
-    echo 'Must run bin/run_cmake.sh to create it.'
-    rm $name.cpp
-    exit 1
-fi
-if [ -e build/bug ]
-then
-    rm -r build/bug
-fi
-mkdir -p build/bug
-mv $name.cpp build/bug/$name.cpp
-cd build/bug
 cxx_flags='-Wall -pedantic-errors -std=c++11 -Wshadow -Wconversion -g -O0'
 eigen_dir="$HOME/prefix/eigen/include"
-echo "g++ -I../.. -isystem $eigen_dir $cxx_flags $name.cpp -o $name"
-g++ -I../.. -isystem $eigen_dir $cxx_flags $name.cpp -o $name
+echo "g++ -I../../include -isystem $eigen_dir $cxx_flags $name.cpp -o $name"
+g++ -I../../include -isystem $eigen_dir $cxx_flags $name.cpp -o $name
 #
 echo "build/bug/$name"
 if ! ./$name
@@ -65,5 +59,6 @@ then
     exit 1
 fi
 echo
-echo "./$name.sh: OK"
+# -----------------------------------------------------------------------------
+echo "bug/$name.sh: OK"
 exit 0
diff --git a/bug/vec_itr_speed.sh b/bug/vec_itr_speed.sh
new file mode 100755
index 000000000..7abbf21b5
--- /dev/null
+++ b/bug/vec_itr_speed.sh
@@ -0,0 +1,181 @@
+#! /bin/bash -e
+# -----------------------------------------------------------------------------
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+#
+# CppAD is distributed under the terms of the
+#              Eclipse Public License Version 2.0.
+#
+# This Source Code may also be made available under the following
+# Secondary License when the conditions for such availability set forth
+# in the Eclipse Public License, Version 2.0 are satisfied:
+#       GNU General Public License, Version 2.0 or later.
+# -----------------------------------------------------------------------------
+name=`echo $0 | sed -e 's|^bug/||' -e 's|\.sh$||'`
+error='none'
+if [ "$0" != "bug/$name.sh" ]
+then
+    echo "program name is not bug/$name.sh"
+    ok='no'
+fi
+compiler="$1"
+if [ "$compiler" != 'g++' ] && [ "$compiler" != 'clang++' ]
+then
+    if [ "$compiler" != '' ]
+    then
+        echo 'complier is not g++ or clang++'
+    fi
+    ok='no'
+fi
+debug="$2"
+if [ "$debug" != 'yes' ] && [ "$debug" != 'no' ]
+then
+    if [ "$debug" != '' ]
+    then
+        echo 'debug is not yes or no'
+    fi
+    ok='no'
+fi
+opt_level="$3"
+if [[ "$opt_level" =~ "[^0-3]" ]]
+then
+    if [ "$opt_level" != '' ]
+    then
+        echo 'opt_leve is not 0, 1, 2, or 3'
+    fi
+    ok='no'
+fi
+if [ "$ok" == 'no' ]
+then
+    echo
+    echo "usage: bug/$name.sh compiler debug opt_level"
+    echo 'complier is:  g++ or clang++'
+    echo 'debug is:     yes or no'
+    echo 'opt_level is: 0, 1, 2, or 3.'
+    exit 1
+fi
+# -----------------------------------------------------------------------------
+if [ -e build/bug ]
+then
+    rm -r build/bug
+fi
+mkdir -p build/bug
+cd build/bug
+# cmake ../..
+# -----------------------------------------------------------------------------
+cat << EOF
+This is speed test (not a bug report) comparing the speed using CppAD vector
+iterators and raw pointer with the algorithms std::sort and std::reverse.
+EOF
+cat << EOF > $name.cpp
+# include <cppad/utility/vector.hpp>
+# include <cppad/utility/time_test.hpp>
+namespace {
+    // declared here so setup does not include allocation
+    CppAD::vector<size_t> vec;
+    // ----------------------------------------------------------------------
+    // sort test functions
+    void sort_itr(size_t size, size_t repeat)
+    {   // size and vec.size() are equal
+        size_t* data = vec.data();
+        while( repeat-- )
+        {   // sort a vector that is not in order
+            for(size_t i = 0; i < size; ++i)
+                data[i] = (size - i) % 21;
+            std::sort(vec.begin(), vec.end());
+        }
+    }
+    void sort_ptr(size_t size, size_t repeat)
+    {   // size and vec.size() are equal
+        size_t* data = vec.data();
+        while( repeat-- )
+        {   // sort same vector as in sort_itr
+            for(size_t i = 0; i < size; ++i)
+                data[i] = (size - i) % 21;
+            std::sort(vec.data(), vec.data() + vec.size());
+        }
+    }
+    // ----------------------------------------------------------------------
+    // reverse test functions
+    void reverse_itr(size_t size, size_t repeat)
+    {   // size and vec.size() are equal
+        size_t* data = vec.data();
+        while( repeat-- )
+        {   // reverse a vector that is not in order
+            for(size_t i = 0; i < size; ++i)
+                data[i] = i;
+            std::reverse(vec.begin(), vec.end());
+        }
+    }
+    void reverse_ptr(size_t size, size_t repeat)
+    {   // size and vec.size() are equal
+        size_t* data = vec.data();
+        while( repeat-- )
+        {   // reverse same vector as in reverse_itr
+            for(size_t i = 0; i < size; ++i)
+                data[i] = i;
+            std::reverse(vec.data(), vec.data() + vec.size());
+        }
+    }
+}
+int main(void)
+{   bool ok = true;
+    using CppAD::time_test;
+    using std::cout;
+    //
+    size_t test_size = 100000; // size of vector in test
+    double time_min  = 1.0;    // minimum time in seconds for each test
+    vec.resize(test_size);     // allocate memory outsize of test
+    size_t repeat;             // output by time_test function
+    // -----------------------------------------------------------------------
+    // sort tests
+    //
+    // iterator
+    double sort_itr_sec  = time_test(sort_itr, time_min, test_size, repeat);
+    for(size_t i = 1; i < test_size; ++i)
+        ok &= vec[i-1] <= vec[i];
+    cout << "sort_itr_sec=" << sort_itr_sec << ", repeat=" << repeat << "\n";
+    //
+    // pointer
+    double sort_ptr_sec  = time_test(sort_ptr, time_min, test_size, repeat);
+    for(size_t i = 1; i < test_size; ++i)
+        ok &= vec[i-1] <= vec[i];
+    cout << "sort_ptr_sec=" << sort_ptr_sec << ", repeat=" << repeat << "\n";
+    // -----------------------------------------------------------------------
+    // reverse tests
+    //
+    // iterator
+    double rev_itr_sec  = time_test(reverse_itr, time_min, test_size, repeat);
+    for(size_t i = 1; i < test_size; ++i)
+        ok &= vec[i] == test_size - 1 - i;
+    cout << "rev_itr_sec=" << rev_itr_sec << ", repeat=" << repeat << "\n";
+    //
+    // pointer
+    double rev_ptr_sec  = time_test(reverse_ptr, time_min, test_size, repeat);
+    for(size_t i = 1; i < test_size; ++i)
+        ok &= vec[i] == test_size - 1 - i;
+    cout << "rev_ptr_sec=" << rev_ptr_sec << ", repeat=" << repeat;
+    // -----------------------------------------------------------------------
+    if( ok )
+        return 0;
+    return 1;
+}
+EOF
+cxx_flags="-Wall -std=c++11 -Wshadow -Wconversion -O$opt_level"
+if [ "$debug" == 'no' ]
+then
+    cxx_flags="$cxx_flags -DNDEBUG"
+fi
+echo "$compiler -I../../include $cxx_flags $name.cpp -o $name"
+$compiler -I../../include $cxx_flags $name.cpp -o $name
+#
+echo "build/bug/$name"
+if ! ./$name
+then
+    echo
+    echo "build/bug/$name: Error"
+    exit 1
+fi
+echo
+# -----------------------------------------------------------------------------
+echo "bug/$name.sh: OK"
+exit 0
diff --git a/cmake/check_source_runs.cmake b/cmake/check_source_runs.cmake
index 9028c8ecf..37e308464 100644
--- a/cmake/check_source_runs.cmake
+++ b/cmake/check_source_runs.cmake
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -13,26 +13,32 @@
 #
 # source: (in)
 # contains the source for the program that will be run.
-# 
+#
 # variable: (out)
-# the value of this variable is 1 if the program runs and 
+# This variable must not be defined when this macro is called.
+# Upon return, the value of this variable is 1 if the program runs and
 # returns a zero status. Otherwise its value is 0.
 # Note that this is the reverse of the status flag returned by the program.
-# 
+#
 MACRO(check_source_runs source variable)
+    IF( DEFINED ${variable} )
+        MESSAGE(ERROR
+            "check_source_runs: ${variable} is defined before expected"
+        )
+    ENDIF( DEFINED ${variable} )
+    SET(CMAKE_REQUIRED_DEFINITIONS "" )
     SET(CMAKE_REQUIRED_INCLUDES    "" )
     SET(CMAKE_REQUIRED_LIBRARIES   "" )
-    SET(CMAKE_REQUIRED_DEFINITIONS "" )
     IF( cppad_cxx_flags )
         SET(CMAKE_REQUIRED_FLAGS   "${cppad_cxx_flags}" )
     ELSE( cppad_cxx_flags )
         SET(CMAKE_REQUIRED_FLAGS   "" )
     ENDIF( cppad_cxx_flags )
-    CHECK_CXX_SOURCE_RUNS("${source}" ${variable}_result)
-    IF( ${variable}_result )
+    CHECK_CXX_SOURCE_RUNS("${source}" ${variable} )
+    IF( ${variable} )
         SET(${variable} 1)
-    ELSE( ${variable}_result )
+    ELSE( ${variable} )
         SET(${variable} 0)
-    ENDIF( ${variable}_result )
+    ENDIF( ${variable} )
     MESSAGE(STATUS "${variable} = ${${variable}}" )
 ENDMACRO( check_source_runs )
diff --git a/config.guess b/config.guess
index 717b22874..b33c9e890 100755
--- a/config.guess
+++ b/config.guess
@@ -1,8 +1,8 @@
-#!/bin/sh
+#! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2017 Free Software Foundation, Inc.
+#   Copyright 1992-2018 Free Software Foundation, Inc.
 
-timestamp='2017-08-08'
+timestamp='2018-08-29'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@ timestamp='2017-08-08'
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -27,7 +27,7 @@ timestamp='2017-08-08'
 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 #
 # Please send patches to <config-patches@gnu.org>.
 
@@ -39,7 +39,7 @@ Usage: $0 [OPTION]
 
 Output the configuration name of the system \`$me' is run on.
 
-Operation modes:
+Options:
   -h, --help         print this help, then exit
   -t, --time-stamp   print date of last modification, then exit
   -v, --version      print version number, then exit
@@ -50,7 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2017 Free Software Foundation, Inc.
+Copyright 1992-2018 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -84,8 +84,6 @@ if test $# != 0; then
   exit 1
 fi
 
-trap 'exit 1' 1 2 15
-
 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
 # compiler to aid in system detection is discouraged as it requires
 # temporary files to be created and, as you can see below, it is a
@@ -96,34 +94,39 @@ trap 'exit 1' 1 2 15
 
 # Portable tmp directory creation inspired by the Autoconf team.
 
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > $dummy.c ;
-	for c in cc gcc c89 c99 ; do
-	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
-	     CC_FOR_BUILD="$c"; break ;
-	  fi ;
-	done ;
-	if test x"$CC_FOR_BUILD" = x ; then
-	  CC_FOR_BUILD=no_compiler_found ;
-	fi
-	;;
- ,,*)   CC_FOR_BUILD=$CC ;;
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15
+trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0
+
+set_cc_for_build() {
+    : "${TMPDIR=/tmp}"
+    # shellcheck disable=SC2039
+    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+    dummy=$tmp/dummy
+    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+	,,)    echo "int x;" > "$dummy.c"
+	       for driver in cc gcc c89 c99 ; do
+		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+		       CC_FOR_BUILD="$driver"
+		       break
+		   fi
+	       done
+	       if test x"$CC_FOR_BUILD" = x ; then
+		   CC_FOR_BUILD=no_compiler_found
+	       fi
+	       ;;
+	,,*)   CC_FOR_BUILD=$CC ;;
+	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+    esac
+}
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
 	PATH=$PATH:/.attbin ; export PATH
 fi
 
@@ -132,14 +135,14 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-case "${UNAME_SYSTEM}" in
+case "$UNAME_SYSTEM" in
 Linux|GNU|GNU/*)
 	# If the system lacks a compiler, then just pick glibc.
 	# We could probably try harder.
 	LIBC=gnu
 
-	eval $set_cc_for_build
-	cat <<-EOF > $dummy.c
+	set_cc_for_build
+	cat <<-EOF > "$dummy.c"
 	#include <features.h>
 	#if defined(__UCLIBC__)
 	LIBC=uclibc
@@ -149,13 +152,20 @@ Linux|GNU|GNU/*)
 	LIBC=gnu
 	#endif
 	EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
+
+	# If ldd exists, use it to detect musl libc.
+	if command -v ldd >/dev/null && \
+		ldd --version 2>&1 | grep -q ^musl
+	then
+	    LIBC=musl
+	fi
 	;;
 esac
 
 # Note: order is significant - the case branches are not exclusive.
 
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
     *:NetBSD:*:*)
 	# NetBSD (nbsd) targets should (where applicable) match one or
 	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -169,30 +179,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# portion of the name.  We always set it to "unknown".
 	sysctl="sysctl -n hw.machine_arch"
 	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
-	    /sbin/$sysctl 2>/dev/null || \
-	    /usr/sbin/$sysctl 2>/dev/null || \
+	    "/sbin/$sysctl" 2>/dev/null || \
+	    "/usr/sbin/$sysctl" 2>/dev/null || \
 	    echo unknown)`
-	case "${UNAME_MACHINE_ARCH}" in
+	case "$UNAME_MACHINE_ARCH" in
 	    armeb) machine=armeb-unknown ;;
 	    arm*) machine=arm-unknown ;;
 	    sh3el) machine=shl-unknown ;;
 	    sh3eb) machine=sh-unknown ;;
 	    sh5el) machine=sh5le-unknown ;;
 	    earmv*)
-		arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
-		endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
-		machine=${arch}${endian}-unknown
+		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+		machine="${arch}${endian}"-unknown
 		;;
-	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	    *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
 	# to ELF recently (or will in the future) and ABI.
-	case "${UNAME_MACHINE_ARCH}" in
+	case "$UNAME_MACHINE_ARCH" in
 	    earm*)
 		os=netbsdelf
 		;;
 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-		eval $set_cc_for_build
+		set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
 			| grep -q __ELF__
 		then
@@ -208,10 +218,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		;;
 	esac
 	# Determine ABI tags.
-	case "${UNAME_MACHINE_ARCH}" in
+	case "$UNAME_MACHINE_ARCH" in
 	    earm*)
 		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
-		abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
 		;;
 	esac
 	# The OS release
@@ -219,49 +229,55 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# thus, need a distinct triplet. However, they do not need
 	# kernel version information, so it can be replaced with a
 	# suitable tag, in the style of linux-gnu.
-	case "${UNAME_VERSION}" in
+	case "$UNAME_VERSION" in
 	    Debian*)
 		release='-gnu'
 		;;
 	    *)
-		release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
+		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
 		;;
 	esac
 	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-	echo "${machine}-${os}${release}${abi}"
+	echo "$machine-${os}${release}${abi-}"
 	exit ;;
     *:Bitrig:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+	echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
 	exit ;;
     *:OpenBSD:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
 	exit ;;
     *:LibertyBSD:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
+	exit ;;
+    *:MidnightBSD:*:*)
+	echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
 	exit ;;
     *:ekkoBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
 	exit ;;
     *:SolidBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
 	exit ;;
     macppc:MirBSD:*:*)
-	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
 	exit ;;
     *:MirBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
 	exit ;;
     *:Sortix:*:*)
-	echo ${UNAME_MACHINE}-unknown-sortix
+	echo "$UNAME_MACHINE"-unknown-sortix
 	exit ;;
     *:Redox:*:*)
-	echo ${UNAME_MACHINE}-unknown-redox
+	echo "$UNAME_MACHINE"-unknown-redox
 	exit ;;
+    mips:OSF1:*.*)
+        echo mips-dec-osf1
+        exit ;;
     alpha:OSF1:*:*)
 	case $UNAME_RELEASE in
 	*4.0)
@@ -313,28 +329,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# A Tn.n version is a released field test version.
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
-	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+	echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
 	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
 	exitcode=$?
 	trap '' 0
 	exit $exitcode ;;
-    Alpha\ *:Windows_NT*:*)
-	# How do we know it's Interix rather than the generic POSIX subsystem?
-	# Should we change UNAME_MACHINE based on the output of uname instead
-	# of the specific Alpha model?
-	echo alpha-pc-interix
-	exit ;;
-    21064:Windows_NT:50:3)
-	echo alpha-dec-winnt3.5
-	exit ;;
     Amiga*:UNIX_System_V:4.0:*)
 	echo m68k-unknown-sysv4
 	exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-amigaos
+	echo "$UNAME_MACHINE"-unknown-amigaos
 	exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-morphos
+	echo "$UNAME_MACHINE"-unknown-morphos
 	exit ;;
     *:OS/390:*:*)
 	echo i370-ibm-openedition
@@ -346,7 +353,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	echo powerpc-ibm-os400
 	exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-	echo arm-acorn-riscix${UNAME_RELEASE}
+	echo arm-acorn-riscix"$UNAME_RELEASE"
 	exit ;;
     arm*:riscos:*:*|arm*:RISCOS:*:*)
 	echo arm-unknown-riscos
@@ -373,38 +380,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	    sparc) echo sparc-icl-nx7; exit ;;
 	esac ;;
     s390x:SunOS:*:*)
-	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
 	exit ;;
     sun4H:SunOS:5.*:*)
-	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
 	exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
 	exit ;;
     i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
-	echo i386-pc-auroraux${UNAME_RELEASE}
+	echo i386-pc-auroraux"$UNAME_RELEASE"
 	exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-	eval $set_cc_for_build
-	SUN_ARCH=i386
-	# If there is a compiler, see if it is configured for 64-bit objects.
-	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
-	# This test works for both compilers.
-	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
-	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
-		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-		grep IS_64BIT_ARCH >/dev/null
-	    then
-		SUN_ARCH=x86_64
-	    fi
-	fi
-	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
+	case `isainfo -b` in
+	    32)
+		echo i386-pc-solaris2"$UNAME_REL"
+		;;
+	    64)
+		echo x86_64-pc-solaris2"$UNAME_REL"
+		;;
+	esac
 	exit ;;
     sun4*:SunOS:6*:*)
 	# According to config.sub, this is the proper way to canonicalize
 	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
 	# it's likely to be more like Solaris than SunOS4.
-	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
 	exit ;;
     sun4*:SunOS:*:*)
 	case "`/usr/bin/arch -k`" in
@@ -413,25 +415,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		;;
 	esac
 	# Japanese Language versions have a version number like `4.1.3-JL'.
-	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
 	exit ;;
     sun3*:SunOS:*:*)
-	echo m68k-sun-sunos${UNAME_RELEASE}
+	echo m68k-sun-sunos"$UNAME_RELEASE"
 	exit ;;
     sun*:*:4.2BSD:*)
 	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
-	test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
+	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
 	case "`/bin/arch`" in
 	    sun3)
-		echo m68k-sun-sunos${UNAME_RELEASE}
+		echo m68k-sun-sunos"$UNAME_RELEASE"
 		;;
 	    sun4)
-		echo sparc-sun-sunos${UNAME_RELEASE}
+		echo sparc-sun-sunos"$UNAME_RELEASE"
 		;;
 	esac
 	exit ;;
     aushp:SunOS:*:*)
-	echo sparc-auspex-sunos${UNAME_RELEASE}
+	echo sparc-auspex-sunos"$UNAME_RELEASE"
 	exit ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
@@ -442,44 +444,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # MiNT.  But MiNT is downward compatible to TOS, so this should
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint"$UNAME_RELEASE"
 	exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint"$UNAME_RELEASE"
 	exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint"$UNAME_RELEASE"
 	exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-	echo m68k-milan-mint${UNAME_RELEASE}
+	echo m68k-milan-mint"$UNAME_RELEASE"
 	exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-	echo m68k-hades-mint${UNAME_RELEASE}
+	echo m68k-hades-mint"$UNAME_RELEASE"
 	exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-	echo m68k-unknown-mint${UNAME_RELEASE}
+	echo m68k-unknown-mint"$UNAME_RELEASE"
 	exit ;;
     m68k:machten:*:*)
-	echo m68k-apple-machten${UNAME_RELEASE}
+	echo m68k-apple-machten"$UNAME_RELEASE"
 	exit ;;
     powerpc:machten:*:*)
-	echo powerpc-apple-machten${UNAME_RELEASE}
+	echo powerpc-apple-machten"$UNAME_RELEASE"
 	exit ;;
     RISC*:Mach:*:*)
 	echo mips-dec-mach_bsd4.3
 	exit ;;
     RISC*:ULTRIX:*:*)
-	echo mips-dec-ultrix${UNAME_RELEASE}
+	echo mips-dec-ultrix"$UNAME_RELEASE"
 	exit ;;
     VAX*:ULTRIX*:*:*)
-	echo vax-dec-ultrix${UNAME_RELEASE}
+	echo vax-dec-ultrix"$UNAME_RELEASE"
 	exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
-	echo clipper-intergraph-clix${UNAME_RELEASE}
+	echo clipper-intergraph-clix"$UNAME_RELEASE"
 	exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
+	set_cc_for_build
+	sed 's/^	//' << EOF > "$dummy.c"
 #ifdef __cplusplus
 #include <stdio.h>  /* for printf() prototype */
 	int main (int argc, char *argv[]) {
@@ -488,23 +490,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 #endif
 	#if defined (host_mips) && defined (MIPSEB)
 	#if defined (SYSTYPE_SYSV)
-	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
 	#endif
 	#if defined (SYSTYPE_SVR4)
-	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
 	#endif
 	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
-	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
 	#endif
 	#endif
 	  exit (-1);
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c &&
-	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
 	    { echo "$SYSTEM_NAME"; exit; }
-	echo mips-mips-riscos${UNAME_RELEASE}
+	echo mips-mips-riscos"$UNAME_RELEASE"
 	exit ;;
     Motorola:PowerMAX_OS:*:*)
 	echo powerpc-motorola-powermax
@@ -530,17 +532,17 @@ EOF
     AViiON:dgux:*:*)
 	# DG/UX returns AViiON for all architectures
 	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
 	then
-	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
+	       [ "$TARGET_BINARY_INTERFACE"x = x ]
 	    then
-		echo m88k-dg-dgux${UNAME_RELEASE}
+		echo m88k-dg-dgux"$UNAME_RELEASE"
 	    else
-		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+		echo m88k-dg-dguxbcs"$UNAME_RELEASE"
 	    fi
 	else
-	    echo i586-dg-dgux${UNAME_RELEASE}
+	    echo i586-dg-dgux"$UNAME_RELEASE"
 	fi
 	exit ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
@@ -557,7 +559,7 @@ EOF
 	echo m68k-tektronix-bsd
 	exit ;;
     *:IRIX*:*:*)
-	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
 	exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
 	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
@@ -569,14 +571,14 @@ EOF
 	if [ -x /usr/bin/oslevel ] ; then
 		IBM_REV=`/usr/bin/oslevel`
 	else
-		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
 	fi
-	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
 	exit ;;
     *:AIX:2:3)
 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-		eval $set_cc_for_build
-		sed 's/^		//' << EOF >$dummy.c
+		set_cc_for_build
+		sed 's/^		//' << EOF > "$dummy.c"
 		#include <sys/systemcfg.h>
 
 		main()
@@ -587,7 +589,7 @@ EOF
 			exit(0);
 			}
 EOF
-		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
 		then
 			echo "$SYSTEM_NAME"
 		else
@@ -601,7 +603,7 @@ EOF
 	exit ;;
     *:AIX:*:[4567])
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
-	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
 		IBM_ARCH=rs6000
 	else
 		IBM_ARCH=powerpc
@@ -610,18 +612,18 @@ EOF
 		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
 			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
 	else
-		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
 	fi
-	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
 	exit ;;
     *:AIX:*:*)
 	echo rs6000-ibm-aix
 	exit ;;
-    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
 	echo romp-ibm-bsd4.4
 	exit ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
-	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
 	exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
 	echo rs6000-bull-bosx
@@ -636,28 +638,28 @@ EOF
 	echo m68k-hp-bsd4.4
 	exit ;;
     9000/[34678]??:HP-UX:*:*)
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-	case "${UNAME_MACHINE}" in
-	    9000/31? )            HP_ARCH=m68000 ;;
-	    9000/[34]?? )         HP_ARCH=m68k ;;
+	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+	case "$UNAME_MACHINE" in
+	    9000/31?)            HP_ARCH=m68000 ;;
+	    9000/[34]??)         HP_ARCH=m68k ;;
 	    9000/[678][0-9][0-9])
 		if [ -x /usr/bin/getconf ]; then
 		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
 		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-		    case "${sc_cpu_version}" in
+		    case "$sc_cpu_version" in
 		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
 		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
 		      532)                      # CPU_PA_RISC2_0
-			case "${sc_kernel_bits}" in
+			case "$sc_kernel_bits" in
 			  32) HP_ARCH=hppa2.0n ;;
 			  64) HP_ARCH=hppa2.0w ;;
 			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
 			esac ;;
 		    esac
 		fi
-		if [ "${HP_ARCH}" = "" ]; then
-		    eval $set_cc_for_build
-		    sed 's/^		//' << EOF >$dummy.c
+		if [ "$HP_ARCH" = "" ]; then
+		    set_cc_for_build
+		    sed 's/^		//' << EOF > "$dummy.c"
 
 		#define _HPUX_SOURCE
 		#include <stdlib.h>
@@ -690,13 +692,13 @@ EOF
 		    exit (0);
 		}
 EOF
-		    (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
 		    test -z "$HP_ARCH" && HP_ARCH=hppa
 		fi ;;
 	esac
-	if [ ${HP_ARCH} = hppa2.0w ]
+	if [ "$HP_ARCH" = hppa2.0w ]
 	then
-	    eval $set_cc_for_build
+	    set_cc_for_build
 
 	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
 	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
@@ -715,15 +717,15 @@ EOF
 		HP_ARCH=hppa64
 	    fi
 	fi
-	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
 	exit ;;
     ia64:HP-UX:*:*)
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-	echo ia64-hp-hpux${HPUX_REV}
+	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux"$HPUX_REV"
 	exit ;;
     3050*:HI-UX:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
+	set_cc_for_build
+	sed 's/^	//' << EOF > "$dummy.c"
 	#include <unistd.h>
 	int
 	main ()
@@ -748,11 +750,11 @@ EOF
 	  exit (0);
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
 		{ echo "$SYSTEM_NAME"; exit; }
 	echo unknown-hitachi-hiuxwe2
 	exit ;;
-    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
 	echo hppa1.1-hp-bsd
 	exit ;;
     9000/8??:4.3bsd:*:*)
@@ -761,7 +763,7 @@ EOF
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
 	echo hppa1.0-hp-mpeix
 	exit ;;
-    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
 	echo hppa1.1-hp-osf
 	exit ;;
     hp8??:OSF1:*:*)
@@ -769,9 +771,9 @@ EOF
 	exit ;;
     i*86:OSF1:*:*)
 	if [ -x /usr/sbin/sysversion ] ; then
-	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	    echo "$UNAME_MACHINE"-unknown-osf1mk
 	else
-	    echo ${UNAME_MACHINE}-unknown-osf1
+	    echo "$UNAME_MACHINE"-unknown-osf1
 	fi
 	exit ;;
     parisc*:Lites*:*:*)
@@ -796,128 +798,120 @@ EOF
 	echo c4-convex-bsd
 	exit ;;
     CRAY*Y-MP:*:*:*)
-	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     CRAY*[A-Z]90:*:*:*)
-	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
 	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
 	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
 	      -e 's/\.[^.]*$/.X/'
 	exit ;;
     CRAY*TS:*:*:*)
-	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     CRAY*T3E:*:*:*)
-	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     CRAY*SV1:*:*:*)
-	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     *:UNICOS/mp:*:*)
-	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
 	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
-	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
 	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 	exit ;;
     5000:UNIX_System_V:4.*:*)
 	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
-	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
 	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 	exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
-	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
 	exit ;;
     sparc*:BSD/OS:*:*)
-	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	echo sparc-unknown-bsdi"$UNAME_RELEASE"
 	exit ;;
     *:BSD/OS:*:*)
-	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
+	exit ;;
+    arm:FreeBSD:*:*)
+	UNAME_PROCESSOR=`uname -p`
+	set_cc_for_build
+	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+	    | grep -q __ARM_PCS_VFP
+	then
+	    echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
+	else
+	    echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
+	fi
 	exit ;;
     *:FreeBSD:*:*)
 	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	case ${UNAME_PROCESSOR} in
+	case "$UNAME_PROCESSOR" in
 	    amd64)
 		UNAME_PROCESSOR=x86_64 ;;
 	    i386)
 		UNAME_PROCESSOR=i586 ;;
 	esac
-	echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
 	exit ;;
     i*:CYGWIN*:*)
-	echo ${UNAME_MACHINE}-pc-cygwin
+	echo "$UNAME_MACHINE"-pc-cygwin
 	exit ;;
     *:MINGW64*:*)
-	echo ${UNAME_MACHINE}-pc-mingw64
+	echo "$UNAME_MACHINE"-pc-mingw64
 	exit ;;
     *:MINGW*:*)
-	echo ${UNAME_MACHINE}-pc-mingw32
+	echo "$UNAME_MACHINE"-pc-mingw32
 	exit ;;
     *:MSYS*:*)
-	echo ${UNAME_MACHINE}-pc-msys
-	exit ;;
-    i*:windows32*:*)
-	# uname -m includes "-pc" on this system.
-	echo ${UNAME_MACHINE}-mingw32
+	echo "$UNAME_MACHINE"-pc-msys
 	exit ;;
     i*:PW*:*)
-	echo ${UNAME_MACHINE}-pc-pw32
+	echo "$UNAME_MACHINE"-pc-pw32
 	exit ;;
     *:Interix*:*)
-	case ${UNAME_MACHINE} in
+	case "$UNAME_MACHINE" in
 	    x86)
-		echo i586-pc-interix${UNAME_RELEASE}
+		echo i586-pc-interix"$UNAME_RELEASE"
 		exit ;;
 	    authenticamd | genuineintel | EM64T)
-		echo x86_64-unknown-interix${UNAME_RELEASE}
+		echo x86_64-unknown-interix"$UNAME_RELEASE"
 		exit ;;
 	    IA64)
-		echo ia64-unknown-interix${UNAME_RELEASE}
+		echo ia64-unknown-interix"$UNAME_RELEASE"
 		exit ;;
 	esac ;;
-    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
-	echo i${UNAME_MACHINE}-pc-mks
-	exit ;;
-    8664:Windows_NT:*)
-	echo x86_64-pc-mks
-	exit ;;
-    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
-	# How do we know it's Interix rather than the generic POSIX subsystem?
-	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
-	# UNAME_MACHINE based on the output of uname instead of i386?
-	echo i586-pc-interix
-	exit ;;
     i*:UWIN*:*)
-	echo ${UNAME_MACHINE}-pc-uwin
+	echo "$UNAME_MACHINE"-pc-uwin
 	exit ;;
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
 	echo x86_64-unknown-cygwin
 	exit ;;
-    p*:CYGWIN*:*)
-	echo powerpcle-unknown-cygwin
-	exit ;;
     prep*:SunOS:5.*:*)
-	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
 	exit ;;
     *:GNU:*:*)
 	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
 	exit ;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+	echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
 	exit ;;
-    i*86:Minix:*:*)
-	echo ${UNAME_MACHINE}-pc-minix
+    *:Minix:*:*)
+	echo "$UNAME_MACHINE"-unknown-minix
 	exit ;;
     aarch64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     aarch64_be:Linux:*:*)
 	UNAME_MACHINE=aarch64_be
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -931,63 +925,63 @@ EOF
 	esac
 	objdump --private-headers /bin/sh | grep -q ld.so.1
 	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     arc:Linux:*:* | arceb:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     arm*:Linux:*:*)
-	eval $set_cc_for_build
+	set_cc_for_build
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
-	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	else
 	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
 		| grep -q __ARM_PCS_VFP
 	    then
-		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
 	    else
-		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
 	    fi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     cris:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
 	exit ;;
     crisv32:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
 	exit ;;
     e2k:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     frv:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     hexagon:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     i*86:Linux:*:*)
-	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
 	exit ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     k1om:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
+	set_cc_for_build
+	sed 's/^	//' << EOF > "$dummy.c"
 	#undef CPU
 	#undef ${UNAME_MACHINE}
 	#undef ${UNAME_MACHINE}el
@@ -1001,70 +995,70 @@ EOF
 	#endif
 	#endif
 EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
+	test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
 	;;
     mips64el:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     openrisc*:Linux:*:*)
-	echo or1k-unknown-linux-${LIBC}
+	echo or1k-unknown-linux-"$LIBC"
 	exit ;;
     or32:Linux:*:* | or1k*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     padre:Linux:*:*)
-	echo sparc-unknown-linux-${LIBC}
+	echo sparc-unknown-linux-"$LIBC"
 	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-${LIBC}
+	echo hppa64-unknown-linux-"$LIBC"
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
-	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
-	  *)    echo hppa-unknown-linux-${LIBC} ;;
+	  PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
+	  PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
+	  *)    echo hppa-unknown-linux-"$LIBC" ;;
 	esac
 	exit ;;
     ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-${LIBC}
+	echo powerpc64-unknown-linux-"$LIBC"
 	exit ;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-${LIBC}
+	echo powerpc-unknown-linux-"$LIBC"
 	exit ;;
     ppc64le:Linux:*:*)
-	echo powerpc64le-unknown-linux-${LIBC}
+	echo powerpc64le-unknown-linux-"$LIBC"
 	exit ;;
     ppcle:Linux:*:*)
-	echo powerpcle-unknown-linux-${LIBC}
+	echo powerpcle-unknown-linux-"$LIBC"
 	exit ;;
     riscv32:Linux:*:* | riscv64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+	echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
 	exit ;;
     sh64*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     tile*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+	echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
 	exit ;;
     x86_64:Linux:*:*)
-	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
 	exit ;;
     xtensa*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1078,34 +1072,34 @@ EOF
 	# I am not positive that other SVR4 systems won't match this,
 	# I just have to hope.  -- rms.
 	# Use sysv4.2uw... so that sysv4* matches it.
-	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
 	exit ;;
     i*86:OS/2:*:*)
 	# If we were able to find `uname', then EMX Unix compatibility
 	# is probably installed.
-	echo ${UNAME_MACHINE}-pc-os2-emx
+	echo "$UNAME_MACHINE"-pc-os2-emx
 	exit ;;
     i*86:XTS-300:*:STOP)
-	echo ${UNAME_MACHINE}-unknown-stop
+	echo "$UNAME_MACHINE"-unknown-stop
 	exit ;;
     i*86:atheos:*:*)
-	echo ${UNAME_MACHINE}-unknown-atheos
+	echo "$UNAME_MACHINE"-unknown-atheos
 	exit ;;
     i*86:syllable:*:*)
-	echo ${UNAME_MACHINE}-pc-syllable
+	echo "$UNAME_MACHINE"-pc-syllable
 	exit ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
-	echo i386-unknown-lynxos${UNAME_RELEASE}
+	echo i386-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     i*86:*DOS:*:*)
-	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	echo "$UNAME_MACHINE"-pc-msdosdjgpp
 	exit ;;
-    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
-	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+    i*86:*:4.*:*)
+	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
 	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+		echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
 	else
-		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+		echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
 	fi
 	exit ;;
     i*86:*:5:[678]*)
@@ -1115,12 +1109,12 @@ EOF
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 	esac
-	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
 	exit ;;
     i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
 		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+		echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
 	elif /bin/uname -X 2>/dev/null >/dev/null ; then
 		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
 		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1130,9 +1124,9 @@ EOF
 			&& UNAME_MACHINE=i686
 		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
 			&& UNAME_MACHINE=i686
-		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+		echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
 	else
-		echo ${UNAME_MACHINE}-pc-sysv32
+		echo "$UNAME_MACHINE"-pc-sysv32
 	fi
 	exit ;;
     pc:*:*:*)
@@ -1152,9 +1146,9 @@ EOF
 	exit ;;
     i860:*:4.*:*) # i860-SVR4
 	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
-	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	  echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
 	else # Add other i860-SVR4 vendors below as they are discovered.
-	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	  echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
 	fi
 	exit ;;
     mini*:CTIX:SYS*5:*)
@@ -1174,9 +1168,9 @@ EOF
 	test -r /etc/.relid \
 	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
 	  && { echo i486-ncr-sysv4; exit; } ;;
@@ -1185,28 +1179,28 @@ EOF
 	test -r /etc/.relid \
 	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
 	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
-	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	echo m68k-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     mc68030:UNIX_System_V:4.*:*)
 	echo m68k-atari-sysv4
 	exit ;;
     TSUNAMI:LynxOS:2.*:*)
-	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	echo sparc-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     rs6000:LynxOS:2.*:*)
-	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	echo rs6000-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
-	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	echo powerpc-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     SM[BE]S:UNIX_SV:*:*)
-	echo mips-dde-sysv${UNAME_RELEASE}
+	echo mips-dde-sysv"$UNAME_RELEASE"
 	exit ;;
     RM*:ReliantUNIX-*:*:*)
 	echo mips-sni-sysv4
@@ -1217,7 +1211,7 @@ EOF
     *:SINIX-*:*:*)
 	if uname -p 2>/dev/null >/dev/null ; then
 		UNAME_MACHINE=`(uname -p) 2>/dev/null`
-		echo ${UNAME_MACHINE}-sni-sysv4
+		echo "$UNAME_MACHINE"-sni-sysv4
 	else
 		echo ns32k-sni-sysv
 	fi
@@ -1237,23 +1231,23 @@ EOF
 	exit ;;
     i*86:VOS:*:*)
 	# From Paul.Green@stratus.com.
-	echo ${UNAME_MACHINE}-stratus-vos
+	echo "$UNAME_MACHINE"-stratus-vos
 	exit ;;
     *:VOS:*:*)
 	# From Paul.Green@stratus.com.
 	echo hppa1.1-stratus-vos
 	exit ;;
     mc68*:A/UX:*:*)
-	echo m68k-apple-aux${UNAME_RELEASE}
+	echo m68k-apple-aux"$UNAME_RELEASE"
 	exit ;;
     news*:NEWS-OS:6*:*)
 	echo mips-sony-newsos6
 	exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 	if [ -d /usr/nec ]; then
-		echo mips-nec-sysv${UNAME_RELEASE}
+		echo mips-nec-sysv"$UNAME_RELEASE"
 	else
-		echo mips-unknown-sysv${UNAME_RELEASE}
+		echo mips-unknown-sysv"$UNAME_RELEASE"
 	fi
 	exit ;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
@@ -1272,39 +1266,39 @@ EOF
 	echo x86_64-unknown-haiku
 	exit ;;
     SX-4:SUPER-UX:*:*)
-	echo sx4-nec-superux${UNAME_RELEASE}
+	echo sx4-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-5:SUPER-UX:*:*)
-	echo sx5-nec-superux${UNAME_RELEASE}
+	echo sx5-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-6:SUPER-UX:*:*)
-	echo sx6-nec-superux${UNAME_RELEASE}
+	echo sx6-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-7:SUPER-UX:*:*)
-	echo sx7-nec-superux${UNAME_RELEASE}
+	echo sx7-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-8:SUPER-UX:*:*)
-	echo sx8-nec-superux${UNAME_RELEASE}
+	echo sx8-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-8R:SUPER-UX:*:*)
-	echo sx8r-nec-superux${UNAME_RELEASE}
+	echo sx8r-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-ACE:SUPER-UX:*:*)
-	echo sxace-nec-superux${UNAME_RELEASE}
+	echo sxace-nec-superux"$UNAME_RELEASE"
 	exit ;;
     Power*:Rhapsody:*:*)
-	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	echo powerpc-apple-rhapsody"$UNAME_RELEASE"
 	exit ;;
     *:Rhapsody:*:*)
-	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
 	exit ;;
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	eval $set_cc_for_build
+	set_cc_for_build
 	if test "$UNAME_PROCESSOR" = unknown ; then
 	    UNAME_PROCESSOR=powerpc
 	fi
-	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+	if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
 	    if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
 		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
 		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
@@ -1332,7 +1326,7 @@ EOF
 	    # that Apple uses in portable devices.
 	    UNAME_PROCESSOR=x86_64
 	fi
-	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
 	exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
 	UNAME_PROCESSOR=`uname -p`
@@ -1340,22 +1334,25 @@ EOF
 		UNAME_PROCESSOR=i386
 		UNAME_MACHINE=pc
 	fi
-	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
 	exit ;;
     *:QNX:*:4*)
 	echo i386-pc-qnx
 	exit ;;
     NEO-*:NONSTOP_KERNEL:*:*)
-	echo neo-tandem-nsk${UNAME_RELEASE}
+	echo neo-tandem-nsk"$UNAME_RELEASE"
 	exit ;;
     NSE-*:NONSTOP_KERNEL:*:*)
-	echo nse-tandem-nsk${UNAME_RELEASE}
+	echo nse-tandem-nsk"$UNAME_RELEASE"
 	exit ;;
     NSR-*:NONSTOP_KERNEL:*:*)
-	echo nsr-tandem-nsk${UNAME_RELEASE}
+	echo nsr-tandem-nsk"$UNAME_RELEASE"
+	exit ;;
+    NSV-*:NONSTOP_KERNEL:*:*)
+	echo nsv-tandem-nsk"$UNAME_RELEASE"
 	exit ;;
     NSX-*:NONSTOP_KERNEL:*:*)
-	echo nsx-tandem-nsk${UNAME_RELEASE}
+	echo nsx-tandem-nsk"$UNAME_RELEASE"
 	exit ;;
     *:NonStop-UX:*:*)
 	echo mips-compaq-nonstopux
@@ -1364,18 +1361,19 @@ EOF
 	echo bs2000-siemens-sysv
 	exit ;;
     DS/*:UNIX_System_V:*:*)
-	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
 	exit ;;
     *:Plan9:*:*)
 	# "uname -m" is not consistent, so use $cputype instead. 386
 	# is converted to i386 for consistency with other x86
 	# operating systems.
+	# shellcheck disable=SC2154
 	if test "$cputype" = 386; then
 	    UNAME_MACHINE=i386
 	else
 	    UNAME_MACHINE="$cputype"
 	fi
-	echo ${UNAME_MACHINE}-unknown-plan9
+	echo "$UNAME_MACHINE"-unknown-plan9
 	exit ;;
     *:TOPS-10:*:*)
 	echo pdp10-unknown-tops10
@@ -1396,14 +1394,14 @@ EOF
 	echo pdp10-unknown-its
 	exit ;;
     SEI:*:*:SEIUX)
-	echo mips-sei-seiux${UNAME_RELEASE}
+	echo mips-sei-seiux"$UNAME_RELEASE"
 	exit ;;
     *:DragonFly:*:*)
-	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
 	exit ;;
     *:*VMS:*:*)
 	UNAME_MACHINE=`(uname -p) 2>/dev/null`
-	case "${UNAME_MACHINE}" in
+	case "$UNAME_MACHINE" in
 	    A*) echo alpha-dec-vms ; exit ;;
 	    I*) echo ia64-dec-vms ; exit ;;
 	    V*) echo vax-dec-vms ; exit ;;
@@ -1412,32 +1410,44 @@ EOF
 	echo i386-pc-xenix
 	exit ;;
     i*86:skyos:*:*)
-	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
+	echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
 	exit ;;
     i*86:rdos:*:*)
-	echo ${UNAME_MACHINE}-pc-rdos
+	echo "$UNAME_MACHINE"-pc-rdos
 	exit ;;
     i*86:AROS:*:*)
-	echo ${UNAME_MACHINE}-pc-aros
+	echo "$UNAME_MACHINE"-pc-aros
 	exit ;;
     x86_64:VMkernel:*:*)
-	echo ${UNAME_MACHINE}-unknown-esx
+	echo "$UNAME_MACHINE"-unknown-esx
 	exit ;;
     amd64:Isilon\ OneFS:*:*)
 	echo x86_64-unknown-onefs
 	exit ;;
 esac
 
+echo "$0: unable to guess system type" >&2
+
+case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+    mips:Linux | mips64:Linux)
+	# If we got here on MIPS GNU/Linux, output extra information.
+	cat >&2 <<EOF
+
+NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
+the system type. Please install a C compiler and try again.
+EOF
+	;;
+esac
+
 cat >&2 <<EOF
-$0: unable to guess system type
 
 This script (version $timestamp), has failed to recognize the
 operating system you are using. If your script is old, overwrite *all*
 copies of config.guess and config.sub with the latest versions from:
 
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 and
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
 
 If $0 has already been updated, send the following data and any
 information you think might be pertinent to config-patches@gnu.org to
@@ -1460,16 +1470,16 @@ hostinfo               = `(hostinfo) 2>/dev/null`
 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
 
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM  = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM  = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
 EOF
 
 exit 1
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
diff --git a/config.sub b/config.sub
index f4bafc180..b51fb8cdb 100755
--- a/config.sub
+++ b/config.sub
@@ -1,8 +1,8 @@
-#!/bin/sh
+#! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright 1992-2017 Free Software Foundation, Inc.
+#   Copyright 1992-2018 Free Software Foundation, Inc.
 
-timestamp='2017-04-02'
+timestamp='2018-08-29'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@ timestamp='2017-04-02'
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -33,7 +33,7 @@ timestamp='2017-04-02'
 # Otherwise, we print the canonical config type on stdout and succeed.
 
 # You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
 
 # This file is supposed to be the same for all GNU packages
 # and recognize all the CPU types, system types and aliases
@@ -57,7 +57,7 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
 
 Canonicalize a configuration name.
 
-Operation modes:
+Options:
   -h, --help         print this help, then exit
   -t, --time-stamp   print date of last modification, then exit
   -v, --version      print version number, then exit
@@ -67,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright 1992-2017 Free Software Foundation, Inc.
+Copyright 1992-2018 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -94,7 +94,7 @@ while test $# -gt 0 ; do
 
     *local*)
        # First pass through any local machine types.
-       echo $1
+       echo "$1"
        exit ;;
 
     * )
@@ -110,1252 +110,1159 @@ case $# in
     exit 1;;
 esac
 
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
-  kopensolaris*-gnu* | cloudabi*-eabi* | \
-  storm-chaos* | os2-emx* | rtmk-nova*)
-    os=-$maybe_os
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-    ;;
-  android-linux)
-    os=-linux-android
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
-    ;;
-  *)
-    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
-    if [ $basic_machine != $1 ]
-    then os=`echo $1 | sed 's/.*-/-/'`
-    else os=; fi
-    ;;
-esac
+# Split fields of configuration type
+IFS="-" read -r field1 field2 field3 field4 <<EOF
+$1
+EOF
 
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work.  We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
-	-sun*os*)
-		# Prevent following clause from handling this invalid input.
-		;;
-	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray | -microblaze*)
-		os=
-		basic_machine=$1
-		;;
-	-bluegene*)
-		os=-cnk
-		;;
-	-sim | -cisco | -oki | -wec | -winbond)
-		os=
-		basic_machine=$1
-		;;
-	-scout)
-		;;
-	-wrs)
-		os=-vxworks
-		basic_machine=$1
-		;;
-	-chorusos*)
-		os=-chorusos
-		basic_machine=$1
-		;;
-	-chorusrdb)
-		os=-chorusrdb
-		basic_machine=$1
-		;;
-	-hiux*)
-		os=-hiuxwe2
-		;;
-	-sco6)
-		os=-sco5v6
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco5)
-		os=-sco3.2v5
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco4)
-		os=-sco3.2v4
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco3.2.[4-9]*)
-		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco3.2v[4-9]*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco5v6*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco*)
-		os=-sco3.2v2
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-udk*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-isc)
-		os=-isc2.2
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-clix*)
-		basic_machine=clipper-intergraph
-		;;
-	-isc*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-lynx*178)
-		os=-lynxos178
-		;;
-	-lynx*5)
-		os=-lynxos5
-		;;
-	-lynx*)
-		os=-lynxos
+# Separate into logical components for further validation
+case $1 in
+	*-*-*-*-*)
+		echo Invalid configuration \`"$1"\': more than four components >&2
+		exit 1
 		;;
-	-ptx*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+	*-*-*-*)
+		basic_machine=$field1-$field2
+		os=$field3-$field4
 		;;
-	-windowsnt*)
-		os=`echo $os | sed -e 's/windowsnt/winnt/'`
+	*-*-*)
+		# Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+		# parts
+		maybe_os=$field2-$field3
+		case $maybe_os in
+			nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
+			| linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
+			| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+			| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+			| storm-chaos* | os2-emx* | rtmk-nova*)
+				basic_machine=$field1
+				os=$maybe_os
+				;;
+			android-linux)
+				basic_machine=$field1-unknown
+				os=linux-android
+				;;
+			*)
+				basic_machine=$field1-$field2
+				os=$field3
+				;;
+		esac
 		;;
-	-psos*)
-		os=-psos
+	*-*)
+		# A lone config we happen to match not fitting any patern
+		case $field1-$field2 in
+			decstation-3100)
+				basic_machine=mips-dec
+				os=
+				;;
+			*-*)
+				# Second component is usually, but not always the OS
+				case $field2 in
+					# Prevent following clause from handling this valid os
+					sun*os*)
+						basic_machine=$field1
+						os=$field2
+						;;
+					# Manufacturers
+					dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+					| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+					| unicom* | ibm* | next | hp | isi* | apollo | altos* \
+					| convergent* | ncr* | news | 32* | 3600* | 3100* \
+					| hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
+					| ultra | tti* | harris | dolphin | highlevel | gould \
+					| cbm | ns | masscomp | apple | axis | knuth | cray \
+					| microblaze* | sim | cisco \
+					| oki | wec | wrs | winbond)
+						basic_machine=$field1-$field2
+						os=
+						;;
+					*)
+						basic_machine=$field1
+						os=$field2
+						;;
+				esac
+			;;
+		esac
 		;;
-	-mint | -mint[0-9]*)
-		basic_machine=m68k-atari
-		os=-mint
+	*)
+		# Convert single-component short-hands not valid as part of
+		# multi-component configurations.
+		case $field1 in
+			386bsd)
+				basic_machine=i386-pc
+				os=bsd
+				;;
+			a29khif)
+				basic_machine=a29k-amd
+				os=udi
+				;;
+			adobe68k)
+				basic_machine=m68010-adobe
+				os=scout
+				;;
+			alliant)
+				basic_machine=fx80-alliant
+				os=
+				;;
+			altos | altos3068)
+				basic_machine=m68k-altos
+				os=
+				;;
+			am29k)
+				basic_machine=a29k-none
+				os=bsd
+				;;
+			amdahl)
+				basic_machine=580-amdahl
+				os=sysv
+				;;
+			amiga)
+				basic_machine=m68k-unknown
+				os=
+				;;
+			amigaos | amigados)
+				basic_machine=m68k-unknown
+				os=amigaos
+				;;
+			amigaunix | amix)
+				basic_machine=m68k-unknown
+				os=sysv4
+				;;
+			apollo68)
+				basic_machine=m68k-apollo
+				os=sysv
+				;;
+			apollo68bsd)
+				basic_machine=m68k-apollo
+				os=bsd
+				;;
+			aros)
+				basic_machine=i386-pc
+				os=aros
+				;;
+			aux)
+				basic_machine=m68k-apple
+				os=aux
+				;;
+			balance)
+				basic_machine=ns32k-sequent
+				os=dynix
+				;;
+			blackfin)
+				basic_machine=bfin-unknown
+				os=linux
+				;;
+			cegcc)
+				basic_machine=arm-unknown
+				os=cegcc
+				;;
+			convex-c1)
+				basic_machine=c1-convex
+				os=bsd
+				;;
+			convex-c2)
+				basic_machine=c2-convex
+				os=bsd
+				;;
+			convex-c32)
+				basic_machine=c32-convex
+				os=bsd
+				;;
+			convex-c34)
+				basic_machine=c34-convex
+				os=bsd
+				;;
+			convex-c38)
+				basic_machine=c38-convex
+				os=bsd
+				;;
+			cray)
+				basic_machine=j90-cray
+				os=unicos
+				;;
+			crds | unos)
+				basic_machine=m68k-crds
+				os=
+				;;
+			da30)
+				basic_machine=m68k-da30
+				os=
+				;;
+			decstation | pmax | pmin | dec3100 | decstatn)
+				basic_machine=mips-dec
+				os=
+				;;
+			delta88)
+				basic_machine=m88k-motorola
+				os=sysv3
+				;;
+			dicos)
+				basic_machine=i686-pc
+				os=dicos
+				;;
+			djgpp)
+				basic_machine=i586-pc
+				os=msdosdjgpp
+				;;
+			ebmon29k)
+				basic_machine=a29k-amd
+				os=ebmon
+				;;
+			es1800 | OSE68k | ose68k | ose | OSE)
+				basic_machine=m68k-ericsson
+				os=ose
+				;;
+			gmicro)
+				basic_machine=tron-gmicro
+				os=sysv
+				;;
+			go32)
+				basic_machine=i386-pc
+				os=go32
+				;;
+			h8300hms)
+				basic_machine=h8300-hitachi
+				os=hms
+				;;
+			h8300xray)
+				basic_machine=h8300-hitachi
+				os=xray
+				;;
+			h8500hms)
+				basic_machine=h8500-hitachi
+				os=hms
+				;;
+			harris)
+				basic_machine=m88k-harris
+				os=sysv3
+				;;
+			hp300)
+				basic_machine=m68k-hp
+				;;
+			hp300bsd)
+				basic_machine=m68k-hp
+				os=bsd
+				;;
+			hp300hpux)
+				basic_machine=m68k-hp
+				os=hpux
+				;;
+			hppaosf)
+				basic_machine=hppa1.1-hp
+				os=osf
+				;;
+			hppro)
+				basic_machine=hppa1.1-hp
+				os=proelf
+				;;
+			i386mach)
+				basic_machine=i386-mach
+				os=mach
+				;;
+			vsta)
+				basic_machine=i386-pc
+				os=vsta
+				;;
+			isi68 | isi)
+				basic_machine=m68k-isi
+				os=sysv
+				;;
+			m68knommu)
+				basic_machine=m68k-unknown
+				os=linux
+				;;
+			magnum | m3230)
+				basic_machine=mips-mips
+				os=sysv
+				;;
+			merlin)
+				basic_machine=ns32k-utek
+				os=sysv
+				;;
+			mingw64)
+				basic_machine=x86_64-pc
+				os=mingw64
+				;;
+			mingw32)
+				basic_machine=i686-pc
+				os=mingw32
+				;;
+			mingw32ce)
+				basic_machine=arm-unknown
+				os=mingw32ce
+				;;
+			monitor)
+				basic_machine=m68k-rom68k
+				os=coff
+				;;
+			morphos)
+				basic_machine=powerpc-unknown
+				os=morphos
+				;;
+			moxiebox)
+				basic_machine=moxie-unknown
+				os=moxiebox
+				;;
+			msdos)
+				basic_machine=i386-pc
+				os=msdos
+				;;
+			msys)
+				basic_machine=i686-pc
+				os=msys
+				;;
+			mvs)
+				basic_machine=i370-ibm
+				os=mvs
+				;;
+			nacl)
+				basic_machine=le32-unknown
+				os=nacl
+				;;
+			ncr3000)
+				basic_machine=i486-ncr
+				os=sysv4
+				;;
+			netbsd386)
+				basic_machine=i386-pc
+				os=netbsd
+				;;
+			netwinder)
+				basic_machine=armv4l-rebel
+				os=linux
+				;;
+			news | news700 | news800 | news900)
+				basic_machine=m68k-sony
+				os=newsos
+				;;
+			news1000)
+				basic_machine=m68030-sony
+				os=newsos
+				;;
+			necv70)
+				basic_machine=v70-nec
+				os=sysv
+				;;
+			nh3000)
+				basic_machine=m68k-harris
+				os=cxux
+				;;
+			nh[45]000)
+				basic_machine=m88k-harris
+				os=cxux
+				;;
+			nindy960)
+				basic_machine=i960-intel
+				os=nindy
+				;;
+			mon960)
+				basic_machine=i960-intel
+				os=mon960
+				;;
+			nonstopux)
+				basic_machine=mips-compaq
+				os=nonstopux
+				;;
+			os400)
+				basic_machine=powerpc-ibm
+				os=os400
+				;;
+			OSE68000 | ose68000)
+				basic_machine=m68000-ericsson
+				os=ose
+				;;
+			os68k)
+				basic_machine=m68k-none
+				os=os68k
+				;;
+			paragon)
+				basic_machine=i860-intel
+				os=osf
+				;;
+			parisc)
+				basic_machine=hppa-unknown
+				os=linux
+				;;
+			pw32)
+				basic_machine=i586-unknown
+				os=pw32
+				;;
+			rdos | rdos64)
+				basic_machine=x86_64-pc
+				os=rdos
+				;;
+			rdos32)
+				basic_machine=i386-pc
+				os=rdos
+				;;
+			rom68k)
+				basic_machine=m68k-rom68k
+				os=coff
+				;;
+			sa29200)
+				basic_machine=a29k-amd
+				os=udi
+				;;
+			sei)
+				basic_machine=mips-sei
+				os=seiux
+				;;
+			sequent)
+				basic_machine=i386-sequent
+				os=
+				;;
+			sps7)
+				basic_machine=m68k-bull
+				os=sysv2
+				;;
+			st2000)
+				basic_machine=m68k-tandem
+				os=
+				;;
+			stratus)
+				basic_machine=i860-stratus
+				os=sysv4
+				;;
+			sun2)
+				basic_machine=m68000-sun
+				os=
+				;;
+			sun2os3)
+				basic_machine=m68000-sun
+				os=sunos3
+				;;
+			sun2os4)
+				basic_machine=m68000-sun
+				os=sunos4
+				;;
+			sun3)
+				basic_machine=m68k-sun
+				os=
+				;;
+			sun3os3)
+				basic_machine=m68k-sun
+				os=sunos3
+				;;
+			sun3os4)
+				basic_machine=m68k-sun
+				os=sunos4
+				;;
+			sun4)
+				basic_machine=sparc-sun
+				os=
+				;;
+			sun4os3)
+				basic_machine=sparc-sun
+				os=sunos3
+				;;
+			sun4os4)
+				basic_machine=sparc-sun
+				os=sunos4
+				;;
+			sun4sol2)
+				basic_machine=sparc-sun
+				os=solaris2
+				;;
+			sun386 | sun386i | roadrunner)
+				basic_machine=i386-sun
+				os=
+				;;
+			sv1)
+				basic_machine=sv1-cray
+				os=unicos
+				;;
+			symmetry)
+				basic_machine=i386-sequent
+				os=dynix
+				;;
+			t3e)
+				basic_machine=alphaev5-cray
+				os=unicos
+				;;
+			t90)
+				basic_machine=t90-cray
+				os=unicos
+				;;
+			toad1)
+				basic_machine=pdp10-xkl
+				os=tops20
+				;;
+			tpf)
+				basic_machine=s390x-ibm
+				os=tpf
+				;;
+			udi29k)
+				basic_machine=a29k-amd
+				os=udi
+				;;
+			ultra3)
+				basic_machine=a29k-nyu
+				os=sym1
+				;;
+			v810 | necv810)
+				basic_machine=v810-nec
+				os=none
+				;;
+			vaxv)
+				basic_machine=vax-dec
+				os=sysv
+				;;
+			vms)
+				basic_machine=vax-dec
+				os=vms
+				;;
+			vxworks960)
+				basic_machine=i960-wrs
+				os=vxworks
+				;;
+			vxworks68)
+				basic_machine=m68k-wrs
+				os=vxworks
+				;;
+			vxworks29k)
+				basic_machine=a29k-wrs
+				os=vxworks
+				;;
+			xbox)
+				basic_machine=i686-pc
+				os=mingw32
+				;;
+			ymp)
+				basic_machine=ymp-cray
+				os=unicos
+				;;
+			*)
+				basic_machine=$1
+				os=
+				;;
+		esac
 		;;
 esac
 
-# Decode aliases for certain CPU-COMPANY combinations.
+# Decode 1-component or ad-hoc basic machines
 case $basic_machine in
-	# Recognize the basic CPU types without company name.
-	# Some are omitted here because they have special meanings below.
-	1750a | 580 \
-	| a29k \
-	| aarch64 | aarch64_be \
-	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
-	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
-	| am33_2.0 \
-	| arc | arceb \
-	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
-	| avr | avr32 \
-	| ba \
-	| be32 | be64 \
-	| bfin \
-	| c4x | c8051 | clipper \
-	| d10v | d30v | dlx | dsp16xx \
-	| e2k | epiphany \
-	| fido | fr30 | frv | ft32 \
-	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-	| hexagon \
-	| i370 | i860 | i960 | ia16 | ia64 \
-	| ip2k | iq2000 \
-	| k1om \
-	| le32 | le64 \
-	| lm32 \
-	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
-	| mips | mipsbe | mipseb | mipsel | mipsle \
-	| mips16 \
-	| mips64 | mips64el \
-	| mips64octeon | mips64octeonel \
-	| mips64orion | mips64orionel \
-	| mips64r5900 | mips64r5900el \
-	| mips64vr | mips64vrel \
-	| mips64vr4100 | mips64vr4100el \
-	| mips64vr4300 | mips64vr4300el \
-	| mips64vr5000 | mips64vr5000el \
-	| mips64vr5900 | mips64vr5900el \
-	| mipsisa32 | mipsisa32el \
-	| mipsisa32r2 | mipsisa32r2el \
-	| mipsisa32r6 | mipsisa32r6el \
-	| mipsisa64 | mipsisa64el \
-	| mipsisa64r2 | mipsisa64r2el \
-	| mipsisa64r6 | mipsisa64r6el \
-	| mipsisa64sb1 | mipsisa64sb1el \
-	| mipsisa64sr71k | mipsisa64sr71kel \
-	| mipsr5900 | mipsr5900el \
-	| mipstx39 | mipstx39el \
-	| mn10200 | mn10300 \
-	| moxie \
-	| mt \
-	| msp430 \
-	| nds32 | nds32le | nds32be \
-	| nios | nios2 | nios2eb | nios2el \
-	| ns16k | ns32k \
-	| open8 | or1k | or1knd | or32 \
-	| pdp10 | pdp11 | pj | pjl \
-	| powerpc | powerpc64 | powerpc64le | powerpcle \
-	| pru \
-	| pyramid \
-	| riscv32 | riscv64 \
-	| rl78 | rx \
-	| score \
-	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
-	| sh64 | sh64le \
-	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
-	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-	| spu \
-	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
-	| ubicom32 \
-	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
-	| visium \
-	| wasm32 \
-	| we32k \
-	| x86 | xc16x | xstormy16 | xtensa \
-	| z8k | z80)
-		basic_machine=$basic_machine-unknown
-		;;
-	c54x)
-		basic_machine=tic54x-unknown
-		;;
-	c55x)
-		basic_machine=tic55x-unknown
-		;;
-	c6x)
-		basic_machine=tic6x-unknown
-		;;
-	leon|leon[3-9])
-		basic_machine=sparc-$basic_machine
-		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
-		basic_machine=$basic_machine-unknown
-		os=-none
+	# Here we handle the default manufacturer of certain CPU types.  It is in
+	# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		cpu=hppa1.1
+		vendor=winbond
 		;;
-	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+	op50n)
+		cpu=hppa1.1
+		vendor=oki
 		;;
-	ms1)
-		basic_machine=mt-unknown
+	op60c)
+		cpu=hppa1.1
+		vendor=oki
 		;;
-
-	strongarm | thumb | xscale)
-		basic_machine=arm-unknown
+	ibm*)
+		cpu=i370
+		vendor=ibm
 		;;
-	xgate)
-		basic_machine=$basic_machine-unknown
-		os=-none
+	orion105)
+		cpu=clipper
+		vendor=highlevel
 		;;
-	xscaleeb)
-		basic_machine=armeb-unknown
+	mac | mpw | mac-mpw)
+		cpu=m68k
+		vendor=apple
 		;;
-
-	xscaleel)
-		basic_machine=armel-unknown
+	pmac | pmac-mpw)
+		cpu=powerpc
+		vendor=apple
 		;;
 
-	# We use `pc' rather than `unknown'
-	# because (1) that's what they normally are, and
-	# (2) the word "unknown" tends to confuse beginning users.
-	i*86 | x86_64)
-	  basic_machine=$basic_machine-pc
-	  ;;
-	# Object if more than one company name word.
-	*-*-*)
-		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-		exit 1
-		;;
-	# Recognize the basic CPU types with company name.
-	580-* \
-	| a29k-* \
-	| aarch64-* | aarch64_be-* \
-	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
-	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
-	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-	| avr-* | avr32-* \
-	| ba-* \
-	| be32-* | be64-* \
-	| bfin-* | bs2000-* \
-	| c[123]* | c30-* | [cjt]90-* | c4x-* \
-	| c8051-* | clipper-* | craynv-* | cydra-* \
-	| d10v-* | d30v-* | dlx-* \
-	| e2k-* | elxsi-* \
-	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
-	| h8300-* | h8500-* \
-	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
-	| hexagon-* \
-	| i*86-* | i860-* | i960-* | ia16-* | ia64-* \
-	| ip2k-* | iq2000-* \
-	| k1om-* \
-	| le32-* | le64-* \
-	| lm32-* \
-	| m32c-* | m32r-* | m32rle-* \
-	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
-	| microblaze-* | microblazeel-* \
-	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
-	| mips16-* \
-	| mips64-* | mips64el-* \
-	| mips64octeon-* | mips64octeonel-* \
-	| mips64orion-* | mips64orionel-* \
-	| mips64r5900-* | mips64r5900el-* \
-	| mips64vr-* | mips64vrel-* \
-	| mips64vr4100-* | mips64vr4100el-* \
-	| mips64vr4300-* | mips64vr4300el-* \
-	| mips64vr5000-* | mips64vr5000el-* \
-	| mips64vr5900-* | mips64vr5900el-* \
-	| mipsisa32-* | mipsisa32el-* \
-	| mipsisa32r2-* | mipsisa32r2el-* \
-	| mipsisa32r6-* | mipsisa32r6el-* \
-	| mipsisa64-* | mipsisa64el-* \
-	| mipsisa64r2-* | mipsisa64r2el-* \
-	| mipsisa64r6-* | mipsisa64r6el-* \
-	| mipsisa64sb1-* | mipsisa64sb1el-* \
-	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
-	| mipsr5900-* | mipsr5900el-* \
-	| mipstx39-* | mipstx39el-* \
-	| mmix-* \
-	| mt-* \
-	| msp430-* \
-	| nds32-* | nds32le-* | nds32be-* \
-	| nios-* | nios2-* | nios2eb-* | nios2el-* \
-	| none-* | np1-* | ns16k-* | ns32k-* \
-	| open8-* \
-	| or1k*-* \
-	| orion-* \
-	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
-	| pru-* \
-	| pyramid-* \
-	| riscv32-* | riscv64-* \
-	| rl78-* | romp-* | rs6000-* | rx-* \
-	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
-	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
-	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
-	| tahoe-* \
-	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-	| tile*-* \
-	| tron-* \
-	| ubicom32-* \
-	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
-	| vax-* \
-	| visium-* \
-	| wasm32-* \
-	| we32k-* \
-	| x86-* | x86_64-* | xc16x-* | xps100-* \
-	| xstormy16-* | xtensa*-* \
-	| ymp-* \
-	| z8k-* | z80-*)
-		;;
-	# Recognize the basic CPU types without company name, with glob match.
-	xtensa*)
-		basic_machine=$basic_machine-unknown
-		;;
 	# Recognize the various machine names and aliases which stand
 	# for a CPU type and a company and sometimes even an OS.
-	386bsd)
-		basic_machine=i386-unknown
-		os=-bsd
-		;;
 	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
-		basic_machine=m68000-att
+		cpu=m68000
+		vendor=att
 		;;
 	3b*)
-		basic_machine=we32k-att
-		;;
-	a29khif)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	abacus)
-		basic_machine=abacus-unknown
-		;;
-	adobe68k)
-		basic_machine=m68010-adobe
-		os=-scout
-		;;
-	alliant | fx80)
-		basic_machine=fx80-alliant
-		;;
-	altos | altos3068)
-		basic_machine=m68k-altos
-		;;
-	am29k)
-		basic_machine=a29k-none
-		os=-bsd
-		;;
-	amd64)
-		basic_machine=x86_64-pc
-		;;
-	amd64-*)
-		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	amdahl)
-		basic_machine=580-amdahl
-		os=-sysv
-		;;
-	amiga | amiga-*)
-		basic_machine=m68k-unknown
-		;;
-	amigaos | amigados)
-		basic_machine=m68k-unknown
-		os=-amigaos
-		;;
-	amigaunix | amix)
-		basic_machine=m68k-unknown
-		os=-sysv4
-		;;
-	apollo68)
-		basic_machine=m68k-apollo
-		os=-sysv
-		;;
-	apollo68bsd)
-		basic_machine=m68k-apollo
-		os=-bsd
-		;;
-	aros)
-		basic_machine=i386-pc
-		os=-aros
-		;;
-	asmjs)
-		basic_machine=asmjs-unknown
-		;;
-	aux)
-		basic_machine=m68k-apple
-		os=-aux
-		;;
-	balance)
-		basic_machine=ns32k-sequent
-		os=-dynix
-		;;
-	blackfin)
-		basic_machine=bfin-unknown
-		os=-linux
-		;;
-	blackfin-*)
-		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
+		cpu=we32k
+		vendor=att
 		;;
 	bluegene*)
-		basic_machine=powerpc-ibm
-		os=-cnk
-		;;
-	c54x-*)
-		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c55x-*)
-		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c6x-*)
-		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c90)
-		basic_machine=c90-cray
-		os=-unicos
-		;;
-	cegcc)
-		basic_machine=arm-unknown
-		os=-cegcc
-		;;
-	convex-c1)
-		basic_machine=c1-convex
-		os=-bsd
-		;;
-	convex-c2)
-		basic_machine=c2-convex
-		os=-bsd
-		;;
-	convex-c32)
-		basic_machine=c32-convex
-		os=-bsd
-		;;
-	convex-c34)
-		basic_machine=c34-convex
-		os=-bsd
-		;;
-	convex-c38)
-		basic_machine=c38-convex
-		os=-bsd
-		;;
-	cray | j90)
-		basic_machine=j90-cray
-		os=-unicos
-		;;
-	craynv)
-		basic_machine=craynv-cray
-		os=-unicosmp
-		;;
-	cr16 | cr16-*)
-		basic_machine=cr16-unknown
-		os=-elf
-		;;
-	crds | unos)
-		basic_machine=m68k-crds
-		;;
-	crisv32 | crisv32-* | etraxfs*)
-		basic_machine=crisv32-axis
-		;;
-	cris | cris-* | etrax*)
-		basic_machine=cris-axis
-		;;
-	crx)
-		basic_machine=crx-unknown
-		os=-elf
-		;;
-	da30 | da30-*)
-		basic_machine=m68k-da30
-		;;
-	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
-		basic_machine=mips-dec
+		cpu=powerpc
+		vendor=ibm
+		os=cnk
 		;;
 	decsystem10* | dec10*)
-		basic_machine=pdp10-dec
-		os=-tops10
+		cpu=pdp10
+		vendor=dec
+		os=tops10
 		;;
 	decsystem20* | dec20*)
-		basic_machine=pdp10-dec
-		os=-tops20
+		cpu=pdp10
+		vendor=dec
+		os=tops20
 		;;
 	delta | 3300 | motorola-3300 | motorola-delta \
 	      | 3300-motorola | delta-motorola)
-		basic_machine=m68k-motorola
+		cpu=m68k
+		vendor=motorola
 		;;
-	delta88)
-		basic_machine=m88k-motorola
-		os=-sysv3
-		;;
-	dicos)
-		basic_machine=i686-pc
-		os=-dicos
-		;;
-	djgpp)
-		basic_machine=i586-pc
-		os=-msdosdjgpp
-		;;
-	dpx20 | dpx20-*)
-		basic_machine=rs6000-bull
-		os=-bosx
-		;;
-	dpx2* | dpx2*-bull)
-		basic_machine=m68k-bull
-		os=-sysv3
-		;;
-	e500v[12])
-		basic_machine=powerpc-unknown
-		os=$os"spe"
-		;;
-	e500v[12]-*)
-		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=$os"spe"
-		;;
-	ebmon29k)
-		basic_machine=a29k-amd
-		os=-ebmon
-		;;
-	elxsi)
-		basic_machine=elxsi-elxsi
-		os=-bsd
+	dpx2*)
+		cpu=m68k
+		vendor=bull
+		os=sysv3
 		;;
 	encore | umax | mmax)
-		basic_machine=ns32k-encore
+		cpu=ns32k
+		vendor=encore
 		;;
-	es1800 | OSE68k | ose68k | ose | OSE)
-		basic_machine=m68k-ericsson
-		os=-ose
+	elxsi)
+		cpu=elxsi
+		vendor=elxsi
+		os=${os:-bsd}
 		;;
 	fx2800)
-		basic_machine=i860-alliant
+		cpu=i860
+		vendor=alliant
 		;;
 	genix)
-		basic_machine=ns32k-ns
-		;;
-	gmicro)
-		basic_machine=tron-gmicro
-		os=-sysv
-		;;
-	go32)
-		basic_machine=i386-pc
-		os=-go32
+		cpu=ns32k
+		vendor=ns
 		;;
 	h3050r* | hiux*)
-		basic_machine=hppa1.1-hitachi
-		os=-hiuxwe2
-		;;
-	h8300hms)
-		basic_machine=h8300-hitachi
-		os=-hms
-		;;
-	h8300xray)
-		basic_machine=h8300-hitachi
-		os=-xray
-		;;
-	h8500hms)
-		basic_machine=h8500-hitachi
-		os=-hms
-		;;
-	harris)
-		basic_machine=m88k-harris
-		os=-sysv3
-		;;
-	hp300-*)
-		basic_machine=m68k-hp
-		;;
-	hp300bsd)
-		basic_machine=m68k-hp
-		os=-bsd
-		;;
-	hp300hpux)
-		basic_machine=m68k-hp
-		os=-hpux
+		cpu=hppa1.1
+		vendor=hitachi
+		os=hiuxwe2
 		;;
 	hp3k9[0-9][0-9] | hp9[0-9][0-9])
-		basic_machine=hppa1.0-hp
+		cpu=hppa1.0
+		vendor=hp
 		;;
 	hp9k2[0-9][0-9] | hp9k31[0-9])
-		basic_machine=m68000-hp
+		cpu=m68000
+		vendor=hp
 		;;
 	hp9k3[2-9][0-9])
-		basic_machine=m68k-hp
+		cpu=m68k
+		vendor=hp
 		;;
 	hp9k6[0-9][0-9] | hp6[0-9][0-9])
-		basic_machine=hppa1.0-hp
+		cpu=hppa1.0
+		vendor=hp
 		;;
 	hp9k7[0-79][0-9] | hp7[0-79][0-9])
-		basic_machine=hppa1.1-hp
+		cpu=hppa1.1
+		vendor=hp
 		;;
 	hp9k78[0-9] | hp78[0-9])
 		# FIXME: really hppa2.0-hp
-		basic_machine=hppa1.1-hp
+		cpu=hppa1.1
+		vendor=hp
 		;;
 	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
 		# FIXME: really hppa2.0-hp
-		basic_machine=hppa1.1-hp
+		cpu=hppa1.1
+		vendor=hp
 		;;
 	hp9k8[0-9][13679] | hp8[0-9][13679])
-		basic_machine=hppa1.1-hp
+		cpu=hppa1.1
+		vendor=hp
 		;;
 	hp9k8[0-9][0-9] | hp8[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hppa-next)
-		os=-nextstep3
-		;;
-	hppaosf)
-		basic_machine=hppa1.1-hp
-		os=-osf
-		;;
-	hppro)
-		basic_machine=hppa1.1-hp
-		os=-proelf
-		;;
-	i370-ibm* | ibm*)
-		basic_machine=i370-ibm
+		cpu=hppa1.0
+		vendor=hp
 		;;
 	i*86v32)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv32
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
+		vendor=pc
+		os=sysv32
 		;;
 	i*86v4*)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv4
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
+		vendor=pc
+		os=sysv4
 		;;
 	i*86v)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
+		vendor=pc
+		os=sysv
 		;;
 	i*86sol2)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-solaris2
-		;;
-	i386mach)
-		basic_machine=i386-mach
-		os=-mach
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
+		vendor=pc
+		os=solaris2
 		;;
-	i386-vsta | vsta)
-		basic_machine=i386-unknown
-		os=-vsta
+	j90 | j90-cray)
+		cpu=j90
+		vendor=cray
+		os=${os:-unicos}
 		;;
 	iris | iris4d)
-		basic_machine=mips-sgi
+		cpu=mips
+		vendor=sgi
 		case $os in
-		    -irix*)
+		    irix*)
 			;;
 		    *)
-			os=-irix4
+			os=irix4
 			;;
 		esac
 		;;
-	isi68 | isi)
-		basic_machine=m68k-isi
-		os=-sysv
-		;;
-	leon-*|leon[3-9]-*)
-		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
-		;;
-	m68knommu)
-		basic_machine=m68k-unknown
-		os=-linux
-		;;
-	m68knommu-*)
-		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	m88k-omron*)
-		basic_machine=m88k-omron
-		;;
-	magnum | m3230)
-		basic_machine=mips-mips
-		os=-sysv
-		;;
-	merlin)
-		basic_machine=ns32k-utek
-		os=-sysv
-		;;
-	microblaze*)
-		basic_machine=microblaze-xilinx
-		;;
-	mingw64)
-		basic_machine=x86_64-pc
-		os=-mingw64
-		;;
-	mingw32)
-		basic_machine=i686-pc
-		os=-mingw32
-		;;
-	mingw32ce)
-		basic_machine=arm-unknown
-		os=-mingw32ce
-		;;
 	miniframe)
-		basic_machine=m68000-convergent
-		;;
-	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
-		basic_machine=m68k-atari
-		os=-mint
-		;;
-	mips3*-*)
-		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
-		;;
-	mips3*)
-		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
-		;;
-	monitor)
-		basic_machine=m68k-rom68k
-		os=-coff
-		;;
-	morphos)
-		basic_machine=powerpc-unknown
-		os=-morphos
-		;;
-	moxiebox)
-		basic_machine=moxie-unknown
-		os=-moxiebox
-		;;
-	msdos)
-		basic_machine=i386-pc
-		os=-msdos
-		;;
-	ms1-*)
-		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
-		;;
-	msys)
-		basic_machine=i686-pc
-		os=-msys
-		;;
-	mvs)
-		basic_machine=i370-ibm
-		os=-mvs
-		;;
-	nacl)
-		basic_machine=le32-unknown
-		os=-nacl
+		cpu=m68000
+		vendor=convergent
 		;;
-	ncr3000)
-		basic_machine=i486-ncr
-		os=-sysv4
-		;;
-	netbsd386)
-		basic_machine=i386-unknown
-		os=-netbsd
-		;;
-	netwinder)
-		basic_machine=armv4l-rebel
-		os=-linux
-		;;
-	news | news700 | news800 | news900)
-		basic_machine=m68k-sony
-		os=-newsos
-		;;
-	news1000)
-		basic_machine=m68030-sony
-		os=-newsos
+	*mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		cpu=m68k
+		vendor=atari
+		os=mint
 		;;
 	news-3600 | risc-news)
-		basic_machine=mips-sony
-		os=-newsos
+		cpu=mips
+		vendor=sony
+		os=newsos
 		;;
-	necv70)
-		basic_machine=v70-nec
-		os=-sysv
-		;;
-	next | m*-next )
-		basic_machine=m68k-next
+	next | m*-next)
+		cpu=m68k
+		vendor=next
 		case $os in
-		    -nextstep* )
+		    nextstep* )
 			;;
-		    -ns2*)
-		      os=-nextstep2
+		    ns2*)
+		      os=nextstep2
 			;;
 		    *)
-		      os=-nextstep3
+		      os=nextstep3
 			;;
 		esac
 		;;
-	nh3000)
-		basic_machine=m68k-harris
-		os=-cxux
-		;;
-	nh[45]000)
-		basic_machine=m88k-harris
-		os=-cxux
-		;;
-	nindy960)
-		basic_machine=i960-intel
-		os=-nindy
-		;;
-	mon960)
-		basic_machine=i960-intel
-		os=-mon960
-		;;
-	nonstopux)
-		basic_machine=mips-compaq
-		os=-nonstopux
-		;;
 	np1)
-		basic_machine=np1-gould
-		;;
-	neo-tandem)
-		basic_machine=neo-tandem
-		;;
-	nse-tandem)
-		basic_machine=nse-tandem
-		;;
-	nsr-tandem)
-		basic_machine=nsr-tandem
-		;;
-	nsx-tandem)
-		basic_machine=nsx-tandem
+		cpu=np1
+		vendor=gould
 		;;
 	op50n-* | op60c-*)
-		basic_machine=hppa1.1-oki
-		os=-proelf
-		;;
-	openrisc | openrisc-*)
-		basic_machine=or32-unknown
-		;;
-	os400)
-		basic_machine=powerpc-ibm
-		os=-os400
-		;;
-	OSE68000 | ose68000)
-		basic_machine=m68000-ericsson
-		os=-ose
-		;;
-	os68k)
-		basic_machine=m68k-none
-		os=-os68k
+		cpu=hppa1.1
+		vendor=oki
+		os=proelf
 		;;
 	pa-hitachi)
-		basic_machine=hppa1.1-hitachi
-		os=-hiuxwe2
-		;;
-	paragon)
-		basic_machine=i860-intel
-		os=-osf
-		;;
-	parisc)
-		basic_machine=hppa-unknown
-		os=-linux
-		;;
-	parisc-*)
-		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
+		cpu=hppa1.1
+		vendor=hitachi
+		os=hiuxwe2
 		;;
 	pbd)
-		basic_machine=sparc-tti
+		cpu=sparc
+		vendor=tti
 		;;
 	pbb)
-		basic_machine=m68k-tti
-		;;
-	pc532 | pc532-*)
-		basic_machine=ns32k-pc532
+		cpu=m68k
+		vendor=tti
 		;;
-	pc98)
-		basic_machine=i386-pc
-		;;
-	pc98-*)
-		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentium | p5 | k5 | k6 | nexgen | viac3)
-		basic_machine=i586-pc
-		;;
-	pentiumpro | p6 | 6x86 | athlon | athlon_*)
-		basic_machine=i686-pc
-		;;
-	pentiumii | pentium2 | pentiumiii | pentium3)
-		basic_machine=i686-pc
-		;;
-	pentium4)
-		basic_machine=i786-pc
-		;;
-	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
-		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentiumpro-* | p6-* | 6x86-* | athlon-*)
-		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
-		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentium4-*)
-		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+	pc532)
+		cpu=ns32k
+		vendor=pc532
 		;;
 	pn)
-		basic_machine=pn-gould
+		cpu=pn
+		vendor=gould
 		;;
-	power)	basic_machine=power-ibm
-		;;
-	ppc | ppcbe)	basic_machine=powerpc-unknown
-		;;
-	ppc-* | ppcbe-*)
-		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppcle | powerpclittle)
-		basic_machine=powerpcle-unknown
-		;;
-	ppcle-* | powerpclittle-*)
-		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppc64)	basic_machine=powerpc64-unknown
-		;;
-	ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppc64le | powerpc64little)
-		basic_machine=powerpc64le-unknown
-		;;
-	ppc64le-* | powerpc64little-*)
-		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+	power)
+		cpu=power
+		vendor=ibm
 		;;
 	ps2)
-		basic_machine=i386-ibm
-		;;
-	pw32)
-		basic_machine=i586-unknown
-		os=-pw32
-		;;
-	rdos | rdos64)
-		basic_machine=x86_64-pc
-		os=-rdos
-		;;
-	rdos32)
-		basic_machine=i386-pc
-		os=-rdos
-		;;
-	rom68k)
-		basic_machine=m68k-rom68k
-		os=-coff
+		cpu=i386
+		vendor=ibm
 		;;
 	rm[46]00)
-		basic_machine=mips-siemens
+		cpu=mips
+		vendor=siemens
 		;;
 	rtpc | rtpc-*)
-		basic_machine=romp-ibm
-		;;
-	s390 | s390-*)
-		basic_machine=s390-ibm
-		;;
-	s390x | s390x-*)
-		basic_machine=s390x-ibm
-		;;
-	sa29200)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	sb1)
-		basic_machine=mipsisa64sb1-unknown
-		;;
-	sb1el)
-		basic_machine=mipsisa64sb1el-unknown
+		cpu=romp
+		vendor=ibm
 		;;
 	sde)
-		basic_machine=mipsisa32-sde
-		os=-elf
+		cpu=mipsisa32
+		vendor=sde
+		os=${os:-elf}
 		;;
-	sei)
-		basic_machine=mips-sei
-		os=-seiux
+	simso-wrs)
+		cpu=sparclite
+		vendor=wrs
+		os=vxworks
 		;;
-	sequent)
-		basic_machine=i386-sequent
+	tower | tower-32)
+		cpu=m68k
+		vendor=ncr
 		;;
-	sh)
-		basic_machine=sh-hitachi
-		os=-hms
+	vpp*|vx|vx-*)
+		cpu=f301
+		vendor=fujitsu
 		;;
-	sh5el)
-		basic_machine=sh5le-unknown
+	w65)
+		cpu=w65
+		vendor=wdc
 		;;
-	sh64)
-		basic_machine=sh64-unknown
+	w89k-*)
+		cpu=hppa1.1
+		vendor=winbond
+		os=proelf
 		;;
-	sparclite-wrs | simso-wrs)
-		basic_machine=sparclite-wrs
-		os=-vxworks
+	none)
+		cpu=none
+		vendor=none
 		;;
-	sps7)
-		basic_machine=m68k-bull
-		os=-sysv2
+	leon|leon[3-9])
+		cpu=sparc
+		vendor=$basic_machine
 		;;
-	spur)
-		basic_machine=spur-unknown
+	leon-*|leon[3-9]-*)
+		cpu=sparc
+		vendor=`echo "$basic_machine" | sed 's/-.*//'`
 		;;
-	st2000)
-		basic_machine=m68k-tandem
+
+	*-*)
+		IFS="-" read -r cpu vendor <<EOF
+$basic_machine
+EOF
 		;;
-	stratus)
-		basic_machine=i860-stratus
-		os=-sysv4
+	# We use `pc' rather than `unknown'
+	# because (1) that's what they normally are, and
+	# (2) the word "unknown" tends to confuse beginning users.
+	i*86 | x86_64)
+		cpu=$basic_machine
+		vendor=pc
 		;;
-	strongarm-* | thumb-*)
-		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+	# These rules are duplicated from below for sake of the special case above;
+	# i.e. things that normalized to x86 arches should also default to "pc"
+	pc98)
+		cpu=i386
+		vendor=pc
 		;;
-	sun2)
-		basic_machine=m68000-sun
+	x64 | amd64)
+		cpu=x86_64
+		vendor=pc
 		;;
-	sun2os3)
-		basic_machine=m68000-sun
-		os=-sunos3
+	# Recognize the basic CPU types without company name.
+	*)
+		cpu=$basic_machine
+		vendor=unknown
 		;;
-	sun2os4)
-		basic_machine=m68000-sun
-		os=-sunos4
+esac
+
+unset -v basic_machine
+
+# Decode basic machines in the full and proper CPU-Company form.
+case $cpu-$vendor in
+	# Here we handle the default manufacturer of certain CPU types in cannonical form. It is in
+	# some cases the only manufacturer, in others, it is the most popular.
+	craynv-unknown)
+		vendor=cray
+		os=${os:-unicosmp}
 		;;
-	sun3os3)
-		basic_machine=m68k-sun
-		os=-sunos3
+	c90-unknown | c90-cray)
+		vendor=cray
+		os=${os:-unicos}
 		;;
-	sun3os4)
-		basic_machine=m68k-sun
-		os=-sunos4
+	fx80-unknown)
+		vendor=alliant
 		;;
-	sun4os3)
-		basic_machine=sparc-sun
-		os=-sunos3
+	romp-unknown)
+		vendor=ibm
 		;;
-	sun4os4)
-		basic_machine=sparc-sun
-		os=-sunos4
+	mmix-unknown)
+		vendor=knuth
 		;;
-	sun4sol2)
-		basic_machine=sparc-sun
-		os=-solaris2
+	microblaze-unknown | microblazeel-unknown)
+		vendor=xilinx
 		;;
-	sun3 | sun3-*)
-		basic_machine=m68k-sun
+	rs6000-unknown)
+		vendor=ibm
 		;;
-	sun4)
-		basic_machine=sparc-sun
+	vax-unknown)
+		vendor=dec
 		;;
-	sun386 | sun386i | roadrunner)
-		basic_machine=i386-sun
+	pdp11-unknown)
+		vendor=dec
 		;;
-	sv1)
-		basic_machine=sv1-cray
-		os=-unicos
+	we32k-unknown)
+		vendor=att
 		;;
-	symmetry)
-		basic_machine=i386-sequent
-		os=-dynix
+	cydra-unknown)
+		vendor=cydrome
 		;;
-	t3e)
-		basic_machine=alphaev5-cray
-		os=-unicos
+	i370-ibm*)
+		vendor=ibm
 		;;
-	t90)
-		basic_machine=t90-cray
-		os=-unicos
+	orion-unknown)
+		vendor=highlevel
 		;;
-	tile*)
-		basic_machine=$basic_machine-unknown
-		os=-linux-gnu
+	xps-unknown | xps100-unknown)
+		cpu=xps100
+		vendor=honeywell
 		;;
-	tx39)
-		basic_machine=mipstx39-unknown
+
+	# Here we normalize CPU types with a missing or matching vendor
+	dpx20-unknown | dpx20-bull)
+		cpu=rs6000
+		vendor=bull
+		os=${os:-bosx}
 		;;
-	tx39el)
-		basic_machine=mipstx39el-unknown
+
+	# Here we normalize CPU types irrespective of the vendor
+	amd64-*)
+		cpu=x86_64
 		;;
-	toad1)
-		basic_machine=pdp10-xkl
-		os=-tops20
+	blackfin-*)
+		cpu=bfin
+		os=linux
 		;;
-	tower | tower-32)
-		basic_machine=m68k-ncr
+	c54x-*)
+		cpu=tic54x
 		;;
-	tpf)
-		basic_machine=s390x-ibm
-		os=-tpf
+	c55x-*)
+		cpu=tic55x
 		;;
-	udi29k)
-		basic_machine=a29k-amd
-		os=-udi
+	c6x-*)
+		cpu=tic6x
 		;;
-	ultra3)
-		basic_machine=a29k-nyu
-		os=-sym1
+	e500v[12]-*)
+		cpu=powerpc
+		os=$os"spe"
 		;;
-	v810 | necv810)
-		basic_machine=v810-nec
-		os=-none
+	mips3*-*)
+		cpu=mips64
 		;;
-	vaxv)
-		basic_machine=vax-dec
-		os=-sysv
+	ms1-*)
+		cpu=mt
 		;;
-	vms)
-		basic_machine=vax-dec
-		os=-vms
+	m68knommu-*)
+		cpu=m68k
+		os=linux
 		;;
-	vpp*|vx|vx-*)
-		basic_machine=f301-fujitsu
+	m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+		cpu=s12z
 		;;
-	vxworks960)
-		basic_machine=i960-wrs
-		os=-vxworks
+	openrisc-*)
+		cpu=or32
 		;;
-	vxworks68)
-		basic_machine=m68k-wrs
-		os=-vxworks
+	parisc-*)
+		cpu=hppa
+		os=linux
 		;;
-	vxworks29k)
-		basic_machine=a29k-wrs
-		os=-vxworks
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+		cpu=i586
 		;;
-	wasm32)
-		basic_machine=wasm32-unknown
+	pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+		cpu=i686
 		;;
-	w65*)
-		basic_machine=w65-wdc
-		os=-none
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+		cpu=i686
 		;;
-	w89k-*)
-		basic_machine=hppa1.1-winbond
-		os=-proelf
+	pentium4-*)
+		cpu=i786
 		;;
-	xbox)
-		basic_machine=i686-pc
-		os=-mingw32
+	pc98-*)
+		cpu=i386
 		;;
-	xps | xps100)
-		basic_machine=xps100-honeywell
+	ppc-* | ppcbe-*)
+		cpu=powerpc
 		;;
-	xscale-* | xscalee[bl]-*)
-		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+	ppcle-* | powerpclittle-*)
+		cpu=powerpcle
 		;;
-	ymp)
-		basic_machine=ymp-cray
-		os=-unicos
+	ppc64-*)
+		cpu=powerpc64
 		;;
-	z8k-*-coff)
-		basic_machine=z8k-unknown
-		os=-sim
+	ppc64le-* | powerpc64little-*)
+		cpu=powerpc64le
 		;;
-	z80-*-coff)
-		basic_machine=z80-unknown
-		os=-sim
+	sb1-*)
+		cpu=mipsisa64sb1
 		;;
-	none)
-		basic_machine=none-none
-		os=-none
+	sb1el-*)
+		cpu=mipsisa64sb1el
 		;;
-
-# Here we handle the default manufacturer of certain CPU types.  It is in
-# some cases the only manufacturer, in others, it is the most popular.
-	w89k)
-		basic_machine=hppa1.1-winbond
+	sh5e[lb]-*)
+		cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
 		;;
-	op50n)
-		basic_machine=hppa1.1-oki
+	spur-*)
+		cpu=spur
 		;;
-	op60c)
-		basic_machine=hppa1.1-oki
+	strongarm-* | thumb-*)
+		cpu=arm
 		;;
-	romp)
-		basic_machine=romp-ibm
+	tx39-*)
+		cpu=mipstx39
 		;;
-	mmix)
-		basic_machine=mmix-knuth
+	tx39el-*)
+		cpu=mipstx39el
 		;;
-	rs6000)
-		basic_machine=rs6000-ibm
+	x64-*)
+		cpu=x86_64
 		;;
-	vax)
-		basic_machine=vax-dec
+	xscale-* | xscalee[bl]-*)
+		cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
 		;;
-	pdp10)
-		# there are many clones, so DEC is not a safe bet
-		basic_machine=pdp10-unknown
+
+	# Recognize the cannonical CPU Types that limit and/or modify the
+	# company names they are paired with.
+	cr16-*)
+		os=${os:-elf}
 		;;
-	pdp11)
-		basic_machine=pdp11-dec
+	crisv32-* | etraxfs*-*)
+		cpu=crisv32
+		vendor=axis
 		;;
-	we32k)
-		basic_machine=we32k-att
+	cris-* | etrax*-*)
+		cpu=cris
+		vendor=axis
 		;;
-	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
-		basic_machine=sh-unknown
+	crx-*)
+		os=${os:-elf}
 		;;
-	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
-		basic_machine=sparc-sun
+	neo-tandem)
+		cpu=neo
+		vendor=tandem
 		;;
-	cydra)
-		basic_machine=cydra-cydrome
+	nse-tandem)
+		cpu=nse
+		vendor=tandem
 		;;
-	orion)
-		basic_machine=orion-highlevel
+	nsr-tandem)
+		cpu=nsr
+		vendor=tandem
 		;;
-	orion105)
-		basic_machine=clipper-highlevel
+	nsv-tandem)
+		cpu=nsv
+		vendor=tandem
 		;;
-	mac | mpw | mac-mpw)
-		basic_machine=m68k-apple
+	nsx-tandem)
+		cpu=nsx
+		vendor=tandem
 		;;
-	pmac | pmac-mpw)
-		basic_machine=powerpc-apple
+	s390-*)
+		cpu=s390
+		vendor=ibm
+		;;
+	s390x-*)
+		cpu=s390x
+		vendor=ibm
 		;;
-	*-unknown)
-		# Make sure to match an already-canonicalized machine name.
+	tile*-*)
+		os=${os:-linux-gnu}
 		;;
+
 	*)
-		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-		exit 1
+		# Recognize the cannonical CPU types that are allowed with any
+		# company name.
+		case $cpu in
+			1750a | 580 \
+			| a29k \
+			| aarch64 | aarch64_be \
+			| abacus \
+			| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
+			| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+			| alphapca5[67] | alpha64pca5[67] \
+			| am33_2.0 \
+			| arc | arceb \
+			| arm  | arm[lb]e | arme[lb] | armv* \
+			| avr | avr32 \
+			| asmjs \
+			| ba \
+			| be32 | be64 \
+			| bfin | bs2000 \
+			| c[123]* | c30 | [cjt]90 | c4x \
+			| c8051 | clipper | craynv | csky | cydra \
+			| d10v | d30v | dlx | dsp16xx \
+			| e2k | elxsi | epiphany \
+			| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+			| h8300 | h8500 \
+			| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+			| hexagon \
+			| i370 | i*86 | i860 | i960 | ia16 | ia64 \
+			| ip2k | iq2000 \
+			| k1om \
+			| le32 | le64 \
+			| lm32 \
+			| m32c | m32r | m32rle \
+			| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k | v70 | w65 \
+			| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip \
+			| m88110 | m88k | maxq | mb | mcore | mep | metag \
+			| microblaze | microblazeel \
+			| mips | mipsbe | mipseb | mipsel | mipsle \
+			| mips16 \
+			| mips64 | mips64el \
+			| mips64octeon | mips64octeonel \
+			| mips64orion | mips64orionel \
+			| mips64r5900 | mips64r5900el \
+			| mips64vr | mips64vrel \
+			| mips64vr4100 | mips64vr4100el \
+			| mips64vr4300 | mips64vr4300el \
+			| mips64vr5000 | mips64vr5000el \
+			| mips64vr5900 | mips64vr5900el \
+			| mipsisa32 | mipsisa32el \
+			| mipsisa32r2 | mipsisa32r2el \
+			| mipsisa32r6 | mipsisa32r6el \
+			| mipsisa64 | mipsisa64el \
+			| mipsisa64r2 | mipsisa64r2el \
+			| mipsisa64r6 | mipsisa64r6el \
+			| mipsisa64sb1 | mipsisa64sb1el \
+			| mipsisa64sr71k | mipsisa64sr71kel \
+			| mipsr5900 | mipsr5900el \
+			| mipstx39 | mipstx39el \
+			| mmix \
+			| mn10200 | mn10300 \
+			| moxie \
+			| mt \
+			| msp430 \
+			| nds32 | nds32le | nds32be \
+			| nfp \
+			| nios | nios2 | nios2eb | nios2el \
+			| none | np1 | ns16k | ns32k \
+			| open8 \
+			| or1k* \
+			| or32 \
+			| orion \
+			| pdp10 | pdp11 | pj | pjl | pn | power \
+			| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+			| pru \
+			| pyramid \
+			| riscv | riscv32 | riscv64 \
+			| rl78 | romp | rs6000 | rx \
+			| score \
+			| sh | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+			| sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+			| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+			| sparclite \
+			| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+			| spu \
+			| tahoe \
+			| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+			| tron \
+			| ubicom32 \
+			| v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+			| vax \
+			| visium \
+			| wasm32 \
+			| we32k \
+			| x86 | x86_64 | xc16x | xgate | xps100 \
+			| xstormy16 | xtensa* \
+			| ymp \
+			| z8k | z80)
+				;;
+
+			*)
+				echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
+				exit 1
+				;;
+		esac
 		;;
 esac
 
 # Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
-	*-digital*)
-		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+case $vendor in
+	digital*)
+		vendor=dec
 		;;
-	*-commodore*)
-		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+	commodore*)
+		vendor=cbm
 		;;
 	*)
 		;;
@@ -1363,200 +1270,246 @@ esac
 
 # Decode manufacturer-specific aliases for certain operating systems.
 
-if [ x"$os" != x"" ]
+if [ x$os != x ]
 then
 case $os in
-	# First match some system type aliases
-	# that might get confused with valid system types.
-	# -solaris* is a basic system type, with this one exception.
-	-auroraux)
-		os=-auroraux
+	# First match some system type aliases that might get confused
+	# with valid system types.
+	# solaris* is a basic system type, with this one exception.
+	auroraux)
+		os=auroraux
 		;;
-	-solaris1 | -solaris1.*)
-		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+	bluegene*)
+		os=cnk
 		;;
-	-solaris)
-		os=-solaris2
+	solaris1 | solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
 		;;
-	-svr4*)
-		os=-sysv4
+	solaris)
+		os=solaris2
 		;;
-	-unixware*)
-		os=-sysv4.2uw
+	unixware*)
+		os=sysv4.2uw
 		;;
-	-gnu/linux*)
+	gnu/linux*)
 		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
 		;;
-	# First accept the basic system types.
+	# es1800 is here to avoid being matched by es* (a different OS)
+	es1800*)
+		os=ose
+		;;
+	# Some version numbers need modification
+	chorusos*)
+		os=chorusos
+		;;
+	isc)
+		os=isc2.2
+		;;
+	sco6)
+		os=sco5v6
+		;;
+	sco5)
+		os=sco3.2v5
+		;;
+	sco4)
+		os=sco3.2v4
+		;;
+	sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		;;
+	sco3.2v[4-9]* | sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		;;
+	scout)
+		# Don't match below
+		;;
+	sco*)
+		os=sco3.2v2
+		;;
+	psos*)
+		os=psos
+		;;
+	# Now accept the basic system types.
 	# The portable systems comes first.
-	# Each alternative MUST END IN A *, to match a version number.
-	# -sysv* is not here because it comes later, after sysvr4.
-	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
-	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-	      | -sym* | -kopensolaris* | -plan9* \
-	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* | -aros* | -cloudabi* | -sortix* \
-	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
-	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-	      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
-	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
-	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
-	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
-	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-	      | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
-	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
-	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
-	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
-	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
-	      | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
+	# Each alternative MUST end in a * to match a version number.
+	# sysv* is not here because it comes later, after sysvr4.
+	gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+	     | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
+	     | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+	     | sym* | kopensolaris* | plan9* \
+	     | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+	     | aos* | aros* | cloudabi* | sortix* \
+	     | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+	     | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+	     | knetbsd* | mirbsd* | netbsd* \
+	     | bitrig* | openbsd* | solidbsd* | libertybsd* \
+	     | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
+	     | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+	     | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+	     | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
+	     | chorusrdb* | cegcc* | glidix* \
+	     | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+	     | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
+	     | linux-newlib* | linux-musl* | linux-uclibc* \
+	     | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+	     | interix* | uwin* | mks* | rhapsody* | darwin* \
+	     | openstep* | oskit* | conix* | pw32* | nonstopux* \
+	     | storm-chaos* | tops10* | tenex* | tops20* | its* \
+	     | os2* | vos* | palmos* | uclinux* | nucleus* \
+	     | morphos* | superux* | rtmk* | windiss* \
+	     | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+	     | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+	     | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+	     | midnightbsd*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
-	-qnx*)
-		case $basic_machine in
-		    x86-* | i*86-*)
+	qnx*)
+		case $cpu in
+		    x86 | i*86)
 			;;
 		    *)
-			os=-nto$os
+			os=nto-$os
 			;;
 		esac
 		;;
-	-nto-qnx*)
+	hiux*)
+		os=hiuxwe2
 		;;
-	-nto*)
-		os=`echo $os | sed -e 's|nto|nto-qnx|'`
+	nto-qnx*)
 		;;
-	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
-	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+	nto*)
+		os=`echo $os | sed -e 's|nto|nto-qnx|'`
 		;;
-	-mac*)
-		os=`echo $os | sed -e 's|mac|macos|'`
+	sim | xray | os68k* | v88r* \
+	    | windows* | osx | abug | netware* | os9* \
+	    | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
 		;;
-	-linux-dietlibc)
-		os=-linux-dietlibc
+	linux-dietlibc)
+		os=linux-dietlibc
 		;;
-	-linux*)
+	linux*)
 		os=`echo $os | sed -e 's|linux|linux-gnu|'`
 		;;
-	-sunos5*)
-		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+	lynx*178)
+		os=lynxos178
 		;;
-	-sunos6*)
-		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+	lynx*5)
+		os=lynxos5
 		;;
-	-opened*)
-		os=-openedition
+	lynx*)
+		os=lynxos
 		;;
-	-os400*)
-		os=-os400
+	mac*)
+		os=`echo "$os" | sed -e 's|mac|macos|'`
 		;;
-	-wince*)
-		os=-wince
+	opened*)
+		os=openedition
 		;;
-	-osfrose*)
-		os=-osfrose
+	os400*)
+		os=os400
 		;;
-	-osf*)
-		os=-osf
+	sunos5*)
+		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
 		;;
-	-utek*)
-		os=-bsd
+	sunos6*)
+		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
 		;;
-	-dynix*)
-		os=-bsd
+	wince*)
+		os=wince
 		;;
-	-acis*)
-		os=-aos
+	utek*)
+		os=bsd
 		;;
-	-atheos*)
-		os=-atheos
+	dynix*)
+		os=bsd
 		;;
-	-syllable*)
-		os=-syllable
+	acis*)
+		os=aos
 		;;
-	-386bsd)
-		os=-bsd
+	atheos*)
+		os=atheos
 		;;
-	-ctix* | -uts*)
-		os=-sysv
+	syllable*)
+		os=syllable
+		;;
+	386bsd)
+		os=bsd
 		;;
-	-nova*)
-		os=-rtmk-nova
+	ctix* | uts*)
+		os=sysv
 		;;
-	-ns2 )
-		os=-nextstep2
+	nova*)
+		os=rtmk-nova
 		;;
-	-nsk*)
-		os=-nsk
+	ns2)
+		os=nextstep2
+		;;
+	nsk*)
+		os=nsk
 		;;
 	# Preserve the version number of sinix5.
-	-sinix5.*)
+	sinix5.*)
 		os=`echo $os | sed -e 's|sinix|sysv|'`
 		;;
-	-sinix*)
-		os=-sysv4
-		;;
-	-tpf*)
-		os=-tpf
+	sinix*)
+		os=sysv4
 		;;
-	-triton*)
-		os=-sysv3
+	tpf*)
+		os=tpf
 		;;
-	-oss*)
-		os=-sysv3
+	triton*)
+		os=sysv3
 		;;
-	-svr4)
-		os=-sysv4
+	oss*)
+		os=sysv3
 		;;
-	-svr3)
-		os=-sysv3
+	svr4*)
+		os=sysv4
 		;;
-	-sysvr4)
-		os=-sysv4
+	svr3)
+		os=sysv3
 		;;
-	# This must come after -sysvr4.
-	-sysv*)
+	sysvr4)
+		os=sysv4
 		;;
-	-ose*)
-		os=-ose
+	# This must come after sysvr4.
+	sysv*)
 		;;
-	-es1800*)
-		os=-ose
+	ose*)
+		os=ose
 		;;
-	-xenix)
-		os=-xenix
+	*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+		os=mint
 		;;
-	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-		os=-mint
+	zvmoe)
+		os=zvmoe
 		;;
-	-aros*)
-		os=-aros
+	dicos*)
+		os=dicos
 		;;
-	-zvmoe)
-		os=-zvmoe
+	pikeos*)
+		# Until real need of OS specific support for
+		# particular features comes up, bare metal
+		# configurations are quite functional.
+		case $cpu in
+		    arm*)
+			os=eabi
+			;;
+		    *)
+			os=elf
+			;;
+		esac
 		;;
-	-dicos*)
-		os=-dicos
+	nacl*)
 		;;
-	-nacl*)
+	ios)
 		;;
-	-ios)
+	none)
 		;;
-	-none)
+	*-eabi)
 		;;
 	*)
-		# Get rid of the `-' at the beginning of $os.
-		os=`echo $os | sed 's/[^-]*-//'`
-		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
 		exit 1
 		;;
 esac
@@ -1572,264 +1525,265 @@ else
 # will signal an error saying that MANUFACTURER isn't an operating
 # system, and we'll never get to this point.
 
-case $basic_machine in
+case $cpu-$vendor in
 	score-*)
-		os=-elf
+		os=elf
 		;;
 	spu-*)
-		os=-elf
+		os=elf
 		;;
 	*-acorn)
-		os=-riscix1.2
+		os=riscix1.2
 		;;
 	arm*-rebel)
-		os=-linux
+		os=linux
 		;;
 	arm*-semi)
-		os=-aout
+		os=aout
 		;;
 	c4x-* | tic4x-*)
-		os=-coff
+		os=coff
 		;;
 	c8051-*)
-		os=-elf
+		os=elf
+		;;
+	clipper-intergraph)
+		os=clix
 		;;
 	hexagon-*)
-		os=-elf
+		os=elf
 		;;
 	tic54x-*)
-		os=-coff
+		os=coff
 		;;
 	tic55x-*)
-		os=-coff
+		os=coff
 		;;
 	tic6x-*)
-		os=-coff
+		os=coff
 		;;
 	# This must come before the *-dec entry.
 	pdp10-*)
-		os=-tops20
+		os=tops20
 		;;
 	pdp11-*)
-		os=-none
+		os=none
 		;;
 	*-dec | vax-*)
-		os=-ultrix4.2
+		os=ultrix4.2
 		;;
 	m68*-apollo)
-		os=-domain
+		os=domain
 		;;
 	i386-sun)
-		os=-sunos4.0.2
+		os=sunos4.0.2
 		;;
 	m68000-sun)
-		os=-sunos3
+		os=sunos3
 		;;
 	m68*-cisco)
-		os=-aout
+		os=aout
 		;;
 	mep-*)
-		os=-elf
+		os=elf
 		;;
 	mips*-cisco)
-		os=-elf
+		os=elf
 		;;
 	mips*-*)
-		os=-elf
+		os=elf
 		;;
 	or32-*)
-		os=-coff
+		os=coff
 		;;
 	*-tti)	# must be before sparc entry or we get the wrong os.
-		os=-sysv3
+		os=sysv3
 		;;
 	sparc-* | *-sun)
-		os=-sunos4.1.1
+		os=sunos4.1.1
 		;;
 	pru-*)
-		os=-elf
+		os=elf
 		;;
 	*-be)
-		os=-beos
-		;;
-	*-haiku)
-		os=-haiku
+		os=beos
 		;;
 	*-ibm)
-		os=-aix
+		os=aix
 		;;
 	*-knuth)
-		os=-mmixware
+		os=mmixware
 		;;
 	*-wec)
-		os=-proelf
+		os=proelf
 		;;
 	*-winbond)
-		os=-proelf
+		os=proelf
 		;;
 	*-oki)
-		os=-proelf
+		os=proelf
 		;;
 	*-hp)
-		os=-hpux
+		os=hpux
 		;;
 	*-hitachi)
-		os=-hiux
+		os=hiux
 		;;
 	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
-		os=-sysv
+		os=sysv
 		;;
 	*-cbm)
-		os=-amigaos
+		os=amigaos
 		;;
 	*-dg)
-		os=-dgux
+		os=dgux
 		;;
 	*-dolphin)
-		os=-sysv3
+		os=sysv3
 		;;
 	m68k-ccur)
-		os=-rtu
+		os=rtu
 		;;
 	m88k-omron*)
-		os=-luna
+		os=luna
 		;;
-	*-next )
-		os=-nextstep
+	*-next)
+		os=nextstep
 		;;
 	*-sequent)
-		os=-ptx
+		os=ptx
 		;;
 	*-crds)
-		os=-unos
+		os=unos
 		;;
 	*-ns)
-		os=-genix
+		os=genix
 		;;
 	i370-*)
-		os=-mvs
-		;;
-	*-next)
-		os=-nextstep3
+		os=mvs
 		;;
 	*-gould)
-		os=-sysv
+		os=sysv
 		;;
 	*-highlevel)
-		os=-bsd
+		os=bsd
 		;;
 	*-encore)
-		os=-bsd
+		os=bsd
 		;;
 	*-sgi)
-		os=-irix
+		os=irix
 		;;
 	*-siemens)
-		os=-sysv4
+		os=sysv4
 		;;
 	*-masscomp)
-		os=-rtu
+		os=rtu
 		;;
 	f30[01]-fujitsu | f700-fujitsu)
-		os=-uxpv
+		os=uxpv
 		;;
 	*-rom68k)
-		os=-coff
+		os=coff
 		;;
 	*-*bug)
-		os=-coff
+		os=coff
 		;;
 	*-apple)
-		os=-macos
+		os=macos
 		;;
 	*-atari*)
-		os=-mint
+		os=mint
+		;;
+	*-wrs)
+		os=vxworks
 		;;
 	*)
-		os=-none
+		os=none
 		;;
 esac
 fi
 
 # Here we handle the case where we know the os, and the CPU type, but not the
 # manufacturer.  We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
-	*-unknown)
+case $vendor in
+	unknown)
 		case $os in
-			-riscix*)
+			riscix*)
 				vendor=acorn
 				;;
-			-sunos*)
+			sunos*)
 				vendor=sun
 				;;
-			-cnk*|-aix*)
+			cnk*|-aix*)
 				vendor=ibm
 				;;
-			-beos*)
+			beos*)
 				vendor=be
 				;;
-			-hpux*)
+			hpux*)
 				vendor=hp
 				;;
-			-mpeix*)
+			mpeix*)
 				vendor=hp
 				;;
-			-hiux*)
+			hiux*)
 				vendor=hitachi
 				;;
-			-unos*)
+			unos*)
 				vendor=crds
 				;;
-			-dgux*)
+			dgux*)
 				vendor=dg
 				;;
-			-luna*)
+			luna*)
 				vendor=omron
 				;;
-			-genix*)
+			genix*)
 				vendor=ns
 				;;
-			-mvs* | -opened*)
+			clix*)
+				vendor=intergraph
+				;;
+			mvs* | opened*)
 				vendor=ibm
 				;;
-			-os400*)
+			os400*)
 				vendor=ibm
 				;;
-			-ptx*)
+			ptx*)
 				vendor=sequent
 				;;
-			-tpf*)
+			tpf*)
 				vendor=ibm
 				;;
-			-vxsim* | -vxworks* | -windiss*)
+			vxsim* | vxworks* | windiss*)
 				vendor=wrs
 				;;
-			-aux*)
+			aux*)
 				vendor=apple
 				;;
-			-hms*)
+			hms*)
 				vendor=hitachi
 				;;
-			-mpw* | -macos*)
+			mpw* | macos*)
 				vendor=apple
 				;;
-			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+			*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
 				vendor=atari
 				;;
-			-vos*)
+			vos*)
 				vendor=stratus
 				;;
 		esac
-		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
 		;;
 esac
 
-echo $basic_machine$os
+echo "$cpu-$vendor-$os"
 exit
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
diff --git a/configure b/configure
index 1c4db93ce..7930c9942 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for cppad 20190200.3.
+# Generated by GNU Autoconf 2.69 for cppad 20190810.
 #
 # Report bugs to <cppad@list.coin-or.org>.
 #
@@ -579,8 +579,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='cppad'
 PACKAGE_TARNAME='cppad'
-PACKAGE_VERSION='20190200.3'
-PACKAGE_STRING='cppad 20190200.3'
+PACKAGE_VERSION='20190810'
+PACKAGE_STRING='cppad 20190810'
 PACKAGE_BUGREPORT='cppad@list.coin-or.org'
 PACKAGE_URL=''
 
@@ -700,7 +700,6 @@ am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
-am__quote
 am__include
 DEPDIR
 OBJEXT
@@ -779,7 +778,8 @@ PACKAGE_VERSION
 PACKAGE_TARNAME
 PACKAGE_NAME
 PATH_SEPARATOR
-SHELL'
+SHELL
+am__quote'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
@@ -1357,7 +1357,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures cppad 20190200.3 to adapt to many kinds of systems.
+\`configure' configures cppad 20190810 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1427,7 +1427,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of cppad 20190200.3:";;
+     short | recursive ) echo "Configuration of cppad 20190810:";;
    esac
   cat <<\_ACEOF
 
@@ -1549,7 +1549,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-cppad configure 20190200.3
+cppad configure 20190810
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1922,7 +1922,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by cppad $as_me 20190200.3, which was
+It was created by cppad $as_me 20190810, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2336,7 +2336,7 @@ fi
 
 
 
-am__api_version='1.15'
+am__api_version='1.16'
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -2812,7 +2812,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='cppad'
- VERSION='20190200.3'
+ VERSION='20190810'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2842,8 +2842,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
 # For better backward compatibility.  To be removed once Automake 1.9.x
 # dies out for good.  For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 mkdir_p='$(MKDIR_P)'
 
 # We need awk for the "check" target (and possibly the TAP driver).  The
@@ -2894,7 +2894,7 @@ END
 Aborting the configuration process, to ensure you take notice of the issue.
 
 You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
 
 If you want to complete the configuration process using your problematic
 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -2914,45 +2914,45 @@ DEPDIR="${am__leading_dot}deps"
 
 ac_config_commands="$ac_config_commands depfiles"
 
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
 am__doit:
-	@echo this is the am__doit target
+	@echo this is the am__doit target >confinc.out
 .PHONY: am__doit
 END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
 am__include="#"
 am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+  { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+   (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }
+  case $?:`cat confinc.out 2>/dev/null` in #(
+  '0:this is the am__doit target') :
+    case $s in #(
+  BSD) :
+    am__include='.include' am__quote='"' ;; #(
+  *) :
+    am__include='include' am__quote='' ;;
+esac ;; #(
+  *) :
      ;;
-   esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
+esac
+  if test "$am__include" != "#"; then
+    _am_result="yes ($s style)"
+    break
+  fi
+done
+rm -f confinc.* confmf.*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+$as_echo "${_am_result}" >&6; }
 
 # Check whether --enable-dependency-tracking was given.
 if test "${enable_dependency_tracking+set}" = set; then :
@@ -7659,7 +7659,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by cppad $as_me 20190200.3, which was
+This file was extended by cppad $as_me 20190810, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -7716,7 +7716,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-cppad config.status 20190200.3
+cppad config.status 20190810
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -7824,7 +7824,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 #
 # INIT-COMMANDS
 #
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
 abs_top_srcdir=$abs_top_srcdir
 
 abs_top_srcdir=$abs_top_srcdir
@@ -8326,29 +8326,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
   # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  case $CONFIG_FILES in #(
+  *\'*) :
+    eval set x "$CONFIG_FILES" ;; #(
+  *) :
+    set x $CONFIG_FILES ;; #(
+  *) :
+     ;;
+esac
   shift
-  for mf
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
   do
     # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
+    am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile which includes
+    # dependency-tracking related rules and includes.
+    # Grep'ing the whole file directly is not great: AIX grep has a line
     # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$mf" : 'X\(//\)[^/]' \| \
-	 X"$mf" : 'X\(//\)$' \| \
-	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+      || continue
+    am_dirpart=`$as_dirname -- "$am_mf" ||
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$am_mf" : 'X\(//\)[^/]' \| \
+	 X"$am_mf" : 'X\(//\)$' \| \
+	 X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$am_mf" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -8366,53 +8372,48 @@ $as_echo X"$mf" |
 	    q
 	  }
 	  s/.*/./; q'`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running 'make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "$am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$file" : 'X\(//\)[^/]' \| \
-	 X"$file" : 'X\(//\)$' \| \
-	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
+    am_filepart=`$as_basename -- "$am_mf" ||
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$am_mf" : 'X\(//\)$' \| \
+	 X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$am_mf" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
 	    s//\1/
 	    q
 	  }
-	  /^X\(\/\/\)$/{
+	  /^X\/\(\/\/\)$/{
 	    s//\1/
 	    q
 	  }
-	  /^X\(\/\).*/{
+	  /^X\/\(\/\).*/{
 	    s//\1/
 	    q
 	  }
 	  s/.*/./; q'`
-      as_dir=$dirpart/$fdir; as_fn_mkdir_p
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
+    { echo "$as_me:$LINENO: cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles" >&5
+   (cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } || am_rc=$?
   done
+  if test $am_rc -ne 0; then
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Something went wrong bootstrapping makefile fragments
+    for automatic dependency tracking.  Try re-running configure with the
+    '--disable-dependency-tracking' option to at least be able to build
+    the package (albeit without support for automatic dependency tracking).
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+  { am_dirpart=; unset am_dirpart;}
+  { am_filepart=; unset am_filepart;}
+  { am_mf=; unset am_mf;}
+  { am_rc=; unset am_rc;}
+  rm -f conftest-deps.mk
 }
  ;;
     "configure.hpp":C) cp include/cppad/configure.hpp  \
diff --git a/configure.ac b/configure.ac
index 696a48311..164695b91 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,7 +11,7 @@
 # -----------------------------------------------------------------------------
 dnl Process this file with autoconf to produce a configure script.
 dnl   package   version              bug-report
-AC_INIT([cppad], [20190200.4], [cppad@list.coin-or.org])
+AC_INIT([cppad], [20190831], [cppad@list.coin-or.org])
 AM_SILENT_RULES([no])
 
 dnl By defalut disable maintainer mode when running configure;
diff --git a/cppad_ipopt/example/CMakeLists.txt b/cppad_ipopt/example/CMakeLists.txt
index 99c1e43a3..bbaaa27d4 100644
--- a/cppad_ipopt/example/CMakeLists.txt
+++ b/cppad_ipopt/example/CMakeLists.txt
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -20,6 +20,7 @@ LINK_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR}/../src ${ipopt_LIBRARY_DIRS} )
 # add_executable(<name> [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL]
 #                 source1 source2 ... sourceN
 # )
+# BEGIN_SORT_THIS_LINE_PLUS_2
 SET(source_list
     example.cpp
     get_started.cpp
@@ -32,6 +33,8 @@ SET(source_list
     ode_simple_check.cpp
     ode_simple.hpp
 )
+# END_SORT_THIS_LINE_MINUS_2
+
 set_compile_flags( cppad_ipopt_example "${cppad_debug_which}" "${source_list}" )
 #
 ADD_EXECUTABLE( cppad_ipopt_example EXCLUDE_FROM_ALL ${source_list} )
diff --git a/cppad_ipopt/example/makefile.in b/cppad_ipopt/example/makefile.in
index a08578f75..bdd40316e 100644
--- a/cppad_ipopt/example/makefile.in
+++ b/cppad_ipopt/example/makefile.in
@@ -1,7 +1,7 @@
-# makefile.in generated by automake 1.15.1 from makefile.am.
+# makefile.in generated by automake 1.16.1 from makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -119,7 +119,10 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = 
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/example.Po \
+	./$(DEPDIR)/get_started.Po ./$(DEPDIR)/ode_check.Po \
+	./$(DEPDIR)/ode_fast_check.Po ./$(DEPDIR)/ode_simple_check.Po
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -403,8 +406,8 @@ makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
 	  *config.status*) \
 	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -431,11 +434,17 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_started.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_check.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_fast_check.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_simple_check.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_started.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_check.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_fast_check.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_simple_check.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+	@$(MKDIR_P) $(@D)
+	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -505,7 +514,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -575,7 +587,11 @@ clean: clean-am
 clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/example.Po
+	-rm -f ./$(DEPDIR)/get_started.Po
+	-rm -f ./$(DEPDIR)/ode_check.Po
+	-rm -f ./$(DEPDIR)/ode_fast_check.Po
+	-rm -f ./$(DEPDIR)/ode_simple_check.Po
 	-rm -f makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -621,7 +637,11 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/example.Po
+	-rm -f ./$(DEPDIR)/get_started.Po
+	-rm -f ./$(DEPDIR)/ode_check.Po
+	-rm -f ./$(DEPDIR)/ode_fast_check.Po
+	-rm -f ./$(DEPDIR)/ode_simple_check.Po
 	-rm -f makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -641,7 +661,7 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
 	clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \
 	distclean distclean-compile distclean-generic distclean-tags \
 	distdir dvi dvi-am html html-am info info-am install \
diff --git a/cppad_ipopt/speed/CMakeLists.txt b/cppad_ipopt/speed/CMakeLists.txt
index bdcdae201..8f9abdacb 100644
--- a/cppad_ipopt/speed/CMakeLists.txt
+++ b/cppad_ipopt/speed/CMakeLists.txt
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -23,7 +23,9 @@ LINK_DIRECTORIES( ${ipopt_LIBRARY_DIRS} )
 #                 source1 source2 ... sourceN
 # )
 # Include source for cppad_ipopt library so we build it without debugging
+# BEGIN_SORT_THIS_LINE_PLUS_2
 SET(source_list
+    ode_speed.cpp
     speed.cpp
     ../src/cppad_ipopt_nlp.cpp
     ../src/fun_record.hpp
@@ -31,8 +33,9 @@ SET(source_list
     ../src/jac_g_map.cpp
     ../src/sparse_map2vec.cpp
     ../src/vec_fun_pattern.cpp
-    ode_speed.cpp
 )
+# END_SORT_THIS_LINE_MINUS_2
+
 set_compile_flags( cppad_ipopt_example "${cppad_debug_which}" "${source_list}" )
 #
 ADD_EXECUTABLE( cppad_ipopt_speed EXCLUDE_FROM_ALL ${source_list} )
diff --git a/cppad_ipopt/speed/makefile.in b/cppad_ipopt/speed/makefile.in
index 6edc965a2..f0f3d70e3 100644
--- a/cppad_ipopt/speed/makefile.in
+++ b/cppad_ipopt/speed/makefile.in
@@ -1,7 +1,7 @@
-# makefile.in generated by automake 1.15.1 from makefile.am.
+# makefile.in generated by automake 1.16.1 from makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -121,7 +121,12 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = 
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ../src/$(DEPDIR)/cppad_ipopt_nlp.Po \
+	../src/$(DEPDIR)/hes_fg_map.Po ../src/$(DEPDIR)/jac_g_map.Po \
+	../src/$(DEPDIR)/sparse_map2vec.Po \
+	../src/$(DEPDIR)/vec_fun_pattern.Po ./$(DEPDIR)/ode_speed.Po \
+	./$(DEPDIR)/speed.Po
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -417,8 +422,8 @@ makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
 	  *config.status*) \
 	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -462,13 +467,19 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/cppad_ipopt_nlp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/hes_fg_map.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/jac_g_map.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/sparse_map2vec.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/vec_fun_pattern.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_speed.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/speed.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/cppad_ipopt_nlp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/hes_fg_map.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/jac_g_map.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/sparse_map2vec.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/vec_fun_pattern.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_speed.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/speed.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+	@$(MKDIR_P) $(@D)
+	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -538,7 +549,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -610,7 +624,13 @@ clean: clean-am
 clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf ../src/$(DEPDIR) ./$(DEPDIR)
+		-rm -f ../src/$(DEPDIR)/cppad_ipopt_nlp.Po
+	-rm -f ../src/$(DEPDIR)/hes_fg_map.Po
+	-rm -f ../src/$(DEPDIR)/jac_g_map.Po
+	-rm -f ../src/$(DEPDIR)/sparse_map2vec.Po
+	-rm -f ../src/$(DEPDIR)/vec_fun_pattern.Po
+	-rm -f ./$(DEPDIR)/ode_speed.Po
+	-rm -f ./$(DEPDIR)/speed.Po
 	-rm -f makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -656,7 +676,13 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ../src/$(DEPDIR) ./$(DEPDIR)
+		-rm -f ../src/$(DEPDIR)/cppad_ipopt_nlp.Po
+	-rm -f ../src/$(DEPDIR)/hes_fg_map.Po
+	-rm -f ../src/$(DEPDIR)/jac_g_map.Po
+	-rm -f ../src/$(DEPDIR)/sparse_map2vec.Po
+	-rm -f ../src/$(DEPDIR)/vec_fun_pattern.Po
+	-rm -f ./$(DEPDIR)/ode_speed.Po
+	-rm -f ./$(DEPDIR)/speed.Po
 	-rm -f makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -676,7 +702,7 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
 	clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \
 	distclean distclean-compile distclean-generic distclean-tags \
 	distdir dvi dvi-am html html-am info info-am install \
diff --git a/cppad_ipopt/src/CMakeLists.txt b/cppad_ipopt/src/CMakeLists.txt
index d485a0991..3186e1f69 100644
--- a/cppad_ipopt/src/CMakeLists.txt
+++ b/cppad_ipopt/src/CMakeLists.txt
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -15,6 +15,7 @@
 #  add_library(<name> [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL]
 #   source1 source2 ... sourceN)
 # )
+# BEGIN_SORT_THIS_LINE_PLUS_2
 SET(source_list
     cppad_ipopt_nlp.cpp
     hes_fg_map.cpp
@@ -22,6 +23,8 @@ SET(source_list
     sparse_map2vec.cpp
     vec_fun_pattern.cpp
 )
+# END_SORT_THIS_LINE_MINUS_2
+
 ADD_LIBRARY(cppad_ipopt ${source_list})
 set_compile_flags( cppad_ipopt "${cppad_debug_which}" "${source_list}" )
 
diff --git a/cppad_ipopt/src/makefile.in b/cppad_ipopt/src/makefile.in
index 02c9747b6..7ae66a45e 100644
--- a/cppad_ipopt/src/makefile.in
+++ b/cppad_ipopt/src/makefile.in
@@ -1,7 +1,7 @@
-# makefile.in generated by automake 1.15.1 from makefile.am.
+# makefile.in generated by automake 1.16.1 from makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -157,7 +157,10 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = 
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/cppad_ipopt_nlp.Po \
+	./$(DEPDIR)/hes_fg_map.Po ./$(DEPDIR)/jac_g_map.Po \
+	./$(DEPDIR)/sparse_map2vec.Po ./$(DEPDIR)/vec_fun_pattern.Po
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -434,8 +437,8 @@ makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
 	  *config.status*) \
 	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -489,11 +492,17 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cppad_ipopt_nlp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hes_fg_map.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jac_g_map.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_map2vec.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vec_fun_pattern.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cppad_ipopt_nlp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hes_fg_map.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jac_g_map.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_map2vec.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vec_fun_pattern.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+	@$(MKDIR_P) $(@D)
+	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -563,7 +572,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -635,7 +647,11 @@ clean: clean-am
 clean-am: clean-generic clean-libLIBRARIES mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/cppad_ipopt_nlp.Po
+	-rm -f ./$(DEPDIR)/hes_fg_map.Po
+	-rm -f ./$(DEPDIR)/jac_g_map.Po
+	-rm -f ./$(DEPDIR)/sparse_map2vec.Po
+	-rm -f ./$(DEPDIR)/vec_fun_pattern.Po
 	-rm -f makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -681,7 +697,11 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/cppad_ipopt_nlp.Po
+	-rm -f ./$(DEPDIR)/hes_fg_map.Po
+	-rm -f ./$(DEPDIR)/jac_g_map.Po
+	-rm -f ./$(DEPDIR)/sparse_map2vec.Po
+	-rm -f ./$(DEPDIR)/vec_fun_pattern.Po
 	-rm -f makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -701,18 +721,19 @@ uninstall-am: uninstall-libLIBRARIES
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-	clean-libLIBRARIES cscopelist-am ctags ctags-am distclean \
-	distclean-compile distclean-generic distclean-tags distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-libLIBRARIES install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am uninstall-libLIBRARIES
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+	clean-generic clean-libLIBRARIES cscopelist-am ctags ctags-am \
+	distclean distclean-compile distclean-generic distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am \
+	install-libLIBRARIES install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
+	uninstall-am uninstall-libLIBRARIES
 
 .PRECIOUS: makefile
 
diff --git a/cppad_ipopt/test/makefile.in b/cppad_ipopt/test/makefile.in
index 7fd5bfa6f..71742dc74 100644
--- a/cppad_ipopt/test/makefile.in
+++ b/cppad_ipopt/test/makefile.in
@@ -1,7 +1,7 @@
-# makefile.in generated by automake 1.15.1 from makefile.am.
+# makefile.in generated by automake 1.16.1 from makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -119,7 +119,10 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = 
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/k_gt_one.Po \
+	./$(DEPDIR)/multiple_solution.Po ./$(DEPDIR)/retape_k1_l1.Po \
+	./$(DEPDIR)/retape_k1_l2.Po ./$(DEPDIR)/test_more.Po
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -386,8 +389,8 @@ makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
 	  *config.status*) \
 	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -414,11 +417,17 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/k_gt_one.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multiple_solution.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/retape_k1_l1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/retape_k1_l2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_more.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/k_gt_one.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multiple_solution.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/retape_k1_l1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/retape_k1_l2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_more.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+	@$(MKDIR_P) $(@D)
+	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -488,7 +497,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -558,7 +570,11 @@ clean: clean-am
 clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/k_gt_one.Po
+	-rm -f ./$(DEPDIR)/multiple_solution.Po
+	-rm -f ./$(DEPDIR)/retape_k1_l1.Po
+	-rm -f ./$(DEPDIR)/retape_k1_l2.Po
+	-rm -f ./$(DEPDIR)/test_more.Po
 	-rm -f makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -604,7 +620,11 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/k_gt_one.Po
+	-rm -f ./$(DEPDIR)/multiple_solution.Po
+	-rm -f ./$(DEPDIR)/retape_k1_l1.Po
+	-rm -f ./$(DEPDIR)/retape_k1_l2.Po
+	-rm -f ./$(DEPDIR)/test_more.Po
 	-rm -f makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -624,7 +644,7 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
 	clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \
 	distclean distclean-compile distclean-generic distclean-tags \
 	distdir dvi dvi-am html html-am info info-am install \
diff --git a/cppad_lib/CMakeLists.txt b/cppad_lib/CMakeLists.txt
index ee29d3c3e..aefa603bc 100644
--- a/cppad_lib/CMakeLists.txt
+++ b/cppad_lib/CMakeLists.txt
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -11,39 +11,46 @@
 # -----------------------------------------------------------------------------
 # Build and install the cppad_lib shared library
 #
-# string(REGEX REPLACE <regular_expression>
-#        <replace_expression> <output variable>
-#        <input> [<input>...])
-#
-# (year - 2000) dot (remove leading 0 from mmdd) dot (release)
-# Note that the dot (release) is optional
-# Also name that when mmdd is 0000 get (year - 2000) dot dot (release)
+# split cppad_version into year;month;day;release
 STRING(REGEX REPLACE
-    "20([0-9][0-9])0*([0-9]*)([.]?[0-9]*)"
-    "\\1.\\2\\3"
-    soversion
+    "([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])[.]*([0-9]*)"
+    "\\1;\\2;\\3;\\4"
+    version_list
     ${cppad_version}
 )
-# In case where mmdd is 0000, dot (release) is present. Convert to
-# (year - 2000) dot 0 dot (release)
-STRING(REGEX REPLACE
-    "([.][.])"
-    ".0."
-    soversion
-    ${soversion}
-)
+LIST(GET version_list 0 year)
+LIST(GET version_list 1 month)
+LIST(GET version_list 2 day)
+LIST(GET version_list 3 release)
+#
+# soversion: dynamic library version number
+MATH(EXPR major "${day} - 1 + 31 * ( ${month} - 1 + 12 * ( ${year} - 2019))")
+IF( "${release}" STREQUAL "" )
+    SET(soversion "${major}")
+ELSE( "${release}" STREQUAL "" )
+    SET(soversion "${major}.${release}")
+ENDIF( "${release}" STREQUAL "" )
 print_variable(soversion)
 #
-#  add_library(<name> [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL]
-#   source1 source2 ... sourceN)
-# )
-SET(source_list cppad_colpack.cpp)
+# BEGIN_SORT_THIS_LINE_PLUS_2
+SET(source_list
+    cppad_colpack.cpp
+    json_lexer.cpp
+    json_operator.cpp
+    json_parser.cpp
+)
+# END_SORT_THIS_LINE_MINUS_2
+#
 set_compile_flags(cppad_lib "${cppad_debug_which}" "${source_list}" )
-ADD_LIBRARY( cppad_lib SHARED ${source_list} )
 #
-# set_target_properties(target1 target2 ...
-# PROPERTIES prop1 value1 prop2 value2 ...)
-SET_TARGET_PROPERTIES( cppad_lib PROPERTIES SOVERSION ${soversion} )
+IF( ${CMAKE_SYSTEM_NAME} STREQUAL "Windows" )
+    MESSAGE( STATUS "Windows system so building static cpapd_lib")
+    ADD_LIBRARY( cppad_lib STATIC ${source_list} )
+ELSE( ${CMAKE_SYSTEM_NAME} STREQUAL "Windows" )
+    MESSAGE( STATUS "Not Windows system so building shared cpapd_lib")
+    ADD_LIBRARY( cppad_lib SHARED ${source_list} )
+    SET_TARGET_PROPERTIES( cppad_lib PROPERTIES SOVERSION ${soversion} )
+ENDIF( ${CMAKE_SYSTEM_NAME} STREQUAL "Windows" )
 #
 # install(TARGETS myExe mySharedLib myStaticLib
 #   RUNTIME DESTINATION bin
diff --git a/cppad_lib/cppad_colpack.cpp b/cppad_lib/cppad_colpack.cpp
index 8c46f5f0d..dc3327053 100644
--- a/cppad_lib/cppad_colpack.cpp
+++ b/cppad_lib/cppad_colpack.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -19,7 +19,7 @@ in the Eclipse Public License, Version 2.0 are satisfied:
 namespace CppAD { namespace local {
     CPPAD_LIB_EXPORT void this_routine_should_never_get_called(void)
     {   CPPAD_ASSERT_UNKNOWN(false); }
-}
+} }
 # else // CPPAD_HAS_COLPACK
 # include <ColPack/ColPackHeaders.h>
 
@@ -74,6 +74,13 @@ CPPAD_LIB_EXPORT void cppad_colpack_general(
         "SMALLEST_LAST", "ROW_PARTIAL_DISTANCE_TWO"
     );
 
+    // ----------------------------------------------------------------------
+    // If we had access to BipartiteGraphPartialColoring::m_vi_LeftVertexColors
+    // we could access the coloring and not need to go through seed matrix; see
+    // BipartiteGraphPartialColoring::GetLeftSeedMatrix_unmanaged in colpack
+    // and cppad_colpack_symmetric below.
+    // ----------------------------------------------------------------------
+
     // Use coloring information to create seed matrix
     int n_seed_row;
     int n_seed_col;
@@ -176,28 +183,20 @@ CPPAD_LIB_EXPORT void cppad_colpack_symmetric(
     // not necessary to solve equations to extract values.
     graph.Coloring("SMALLEST_LAST", "STAR");
 
-    // Use coloring information to create seed matrix
-    int n_seed_row;
-    int n_seed_col;
-    double** seed_matrix = graph.GetSeedMatrix(&n_seed_row, &n_seed_col);
-    CPPAD_ASSERT_UNKNOWN( size_t(n_seed_row) == m );
+    // pointer to Colpack coloring solution
+    const std::vector<int>* vertex_colors_ptr = graph.GetVertexColorsPtr();
+    CPPAD_ASSERT_UNKNOWN( vertex_colors_ptr->size() == m );
 
-    // now return coloring for each row in format required by CppAD
-    for(i = 0; i < m; i++)
-        color[i] = m;
+    // now return coloring in format required by CppAD
     for(i = 0; i < m; i++)
-    {   for(size_t k = 0; k < size_t(n_seed_col); k++)
-        {   if( seed_matrix[i][k] != 0.0 )
-            {   // check that entries in seed matrix are zero or one
-                CPPAD_ASSERT_UNKNOWN( seed_matrix[i][k] == 1.0 );
-                // check that now row appears twice in the coloring
-                CPPAD_ASSERT_UNKNOWN( color[i] == m );
-                // only need include rows with non-zero entries
-                if( adolc_pattern[i][0] != 0 )
-                {   // set color for this row
-                    color[i] = k;
-                }
-            }
+    {   if( adolc_pattern[i][0] == 0 )
+        {   // no entries in row of of sparsity patter
+            color[i] = m;
+        }
+        else
+        {   // there are non-zero entries in row i
+            color[i] = size_t( (*vertex_colors_ptr)[i] );
+            CPPAD_ASSERT_UNKNOWN( color[i] < m );
         }
     }
 
diff --git a/cppad_lib/json_lexer.cpp b/cppad_lib/json_lexer.cpp
new file mode 100644
index 000000000..8fd7b78e3
--- /dev/null
+++ b/cppad_lib/json_lexer.cpp
@@ -0,0 +1,285 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+  CppAD is distributed under the terms of the
+               Eclipse Public License Version 2.0.
+
+  This Source Code may also be made available under the following
+  Secondary License when the conditions for such availability set forth
+  in the Eclipse Public License, Version 2.0 are satisfied:
+        GNU General Public License, Version 2.0 or later.
+-------------------------------------------------------------------------- */
+# include <cppad/local/json/lexer.hpp>
+# include <cppad/local/json/operator.hpp>
+# include <cppad/utility/error_handler.hpp>
+# include <cppad/utility/to_string.hpp>
+# include <cppad/utility/thread_alloc.hpp>
+
+
+// BEGIN_CPPAD_LOCAL_JSON_NAMESPACE
+namespace CppAD { namespace local { namespace json {
+
+// report_error
+void lexer::report_error(
+    const std::string& expected ,
+    const std::string& found    )
+{   size_t pos = index_;
+    size_t count_newline = 0;
+    while(0 < pos && count_newline < 2 )
+    {   --pos;
+        count_newline += graph_[pos] == '\n';
+    }
+    std::string recent_input = graph_.substr( pos, index_ - pos + 1);
+
+    std::string msg = "Error occured while parsing Json AD graph";
+    if( function_name_ != "" )
+        msg += " for the function " + function_name_;
+    msg += ".\n";
+    msg += "Expected a " + expected + " token but found " + found + "\n";
+    msg += "Detected at end of following input:";
+    msg += recent_input + "\n";
+    msg += "This end is character " + to_string(char_number_);
+    msg += " in line " + to_string(line_number_) + " of the graph.\n";
+    msg += "See https://coin-or.github.io/CppAD/doc/json_ad_graph.htm.";
+    //
+    // use this source code as point of detection
+    bool known       = true;
+    int  line        = __LINE__;
+    const char* file = __FILE__;
+    const char* exp  = "false";
+    //
+    // CppAD error handler
+    ErrorHandler::Call(known, line, file, exp, msg.c_str());
+}
+
+// next_index
+void lexer::next_index(void)
+{   CPPAD_ASSERT_UNKNOWN( index_ < graph_.size() );
+    if( graph_[index_] == '\n' )
+    {   ++line_number_;
+        char_number_ = 0;
+    }
+    ++index_;
+    ++char_number_;
+}
+
+// skip_white_space
+void lexer::skip_white_space(void)
+{  while( index_ < graph_.size() && isspace( graph_[index_] ) )
+        next_index();
+}
+
+// constructor
+lexer::lexer(const std::string& graph)
+:
+graph_(graph),
+index_(0),
+line_number_(1),
+char_number_(1),
+token_(""),
+function_name_("")
+{   // make sure op_name2enum has been initialized
+    if( op_name2enum.size() == 0 )
+    {   CPPAD_ASSERT_KNOWN( ! thread_alloc::in_parallel() ,
+            "call to set_operator_info in parallel mode"
+        );
+        set_operator_info();
+    }
+
+    skip_white_space();
+    if( index_ < graph_.size() )
+        token_ = graph_[index_];
+    if( token_ != "{" )
+    {   std::string expected = "'{'";
+        std::string found    = "'";
+        if( index_ < graph_.size() )
+            found += graph_[index_];
+        found += "'";
+        report_error(expected, found);
+    }
+    return;
+}
+
+
+// token
+const std::string& lexer::token(void) const
+{   return token_; }
+
+// line_number
+size_t lexer::line_number(void) const
+{   return line_number_; }
+
+// char_number
+size_t lexer::char_number(void) const
+{   return char_number_; }
+
+// set_function_name
+void lexer::set_function_name(const std::string& function_name)
+{   function_name_ = function_name; }
+
+// token2size_t
+size_t lexer::token2size_t(void) const
+{   return size_t( std::atoi( token_.c_str() ) ); }
+
+// token2double
+double lexer::token2double(void) const
+{   return std::atof( token_.c_str() ); }
+
+// check_next_char
+void lexer::check_next_char(char ch)
+{   // advance to next character
+    if( index_ < graph_.size() )
+        next_index();
+    skip_white_space();
+    //
+    bool ok = false;
+    if( index_ < graph_.size() )
+    {   token_.resize(1);
+        token_[0] = graph_[index_];
+        ok = (token_[0] == ch) | (ch == '\0');
+    }
+    if( ! ok )
+    {   std::string expected = "a character that is not white space";
+        if( ch != '\0' )
+        {   expected  = "'";
+            expected += ch;
+            expected += "'";
+        }
+        //
+        std::string found = "'";
+        if( index_ < graph_.size() )
+            found += graph_[index_];;
+        found += "'";
+        report_error(expected, found);
+    }
+}
+
+// check_next_string
+void lexer::check_next_string(const std::string& expected)
+{   // advance to next character
+    bool found_first_quote = index_ < graph_.size();
+    if( found_first_quote )
+    {   next_index();
+        skip_white_space();
+        found_first_quote = index_ < graph_.size();
+    }
+    // check for "
+    if( found_first_quote )
+        found_first_quote = graph_[index_] == '"';
+    //
+    // set value of token
+    token_.resize(0);
+    if( found_first_quote )
+    {   next_index();
+        while( index_ < graph_.size() && graph_[index_] != '"' )
+        {   token_.push_back( graph_[index_] );
+            next_index();
+        }
+    }
+    // check for "
+    bool found_second_quote = false;
+    if( found_first_quote && index_ < graph_.size() )
+        found_second_quote = graph_[index_] == '"';
+    //
+    bool ok = found_first_quote & found_second_quote;
+    if( ok & (expected != "" ) )
+        ok = expected == token_;
+    if( ! ok )
+    {   std::string expected_token;
+        if( expected == "" )
+            expected_token = "string";
+        else
+        {   expected_token = '"';
+            expected_token += expected;
+            expected_token += '"';
+        }
+        //
+        std::string found;
+        if( ! found_first_quote )
+        {   found = "'";
+            if( index_ < graph_.size() )
+                found += graph_[index_];
+            found += "'";
+        }
+        else
+        {   found += '"';
+            found += token_;
+            if( found_second_quote )
+                found += '"';
+        }
+        report_error(expected_token, found);
+    }
+}
+
+// next_non_neg_int
+void lexer::next_non_neg_int(void)
+{   // advance to next character
+    bool ok = index_ < graph_.size();
+    if( ok )
+    {   next_index();
+        skip_white_space();
+        ok = index_ < graph_.size();
+    }
+    if( ok )
+        ok = std::isdigit( graph_[index_] );
+    if( ! ok )
+    {   std::string expected_token = "non-negative integer";
+        std::string found = "'";
+        if( index_ < graph_.size() )
+            found += graph_[index_];
+        found += "'";
+        report_error(expected_token, found);
+    }
+    //
+    token_.resize(0);
+    while( ok )
+    {   token_.push_back( graph_[index_] );
+        ok = index_ + 1 < graph_.size();
+        if( ok )
+            ok = isdigit( graph_[index_ + 1] );
+        if( ok )
+            next_index();
+    }
+}
+
+// next_float
+void lexer::next_float(void)
+{   // advance to next character
+    bool ok = index_ < graph_.size();
+    if( ok )
+    {   next_index();
+        skip_white_space();
+        ok = index_ < graph_.size();
+    }
+    if( ok )
+    {   char ch = graph_[index_];
+        ok = std::isdigit(ch);
+        ok |= (ch == '.') | (ch == '+') | (ch == '-');
+        ok |= (ch == 'e') | (ch == 'E');
+    }
+    if( ! ok )
+    {   std::string expected_token = "floating point number";
+        std::string found = "'";
+        if( index_ < graph_.size() )
+            found += graph_[index_];
+        found += "'";
+        report_error(expected_token, found);
+    }
+    //
+    token_.resize(0);
+    while( ok )
+    {   token_.push_back( graph_[index_] );
+        ok = index_ + 1 < graph_.size();
+        if( ok )
+        {   char ch  = graph_[index_ + 1];
+            ok  = isdigit(ch);
+            ok |= (ch == '.') | (ch == '+') | (ch == '-');
+            ok |= (ch == 'e') | (ch == 'E');
+        }
+        if( ok )
+            next_index();
+    }
+    return;
+}
+
+} } } // END_CPPAD_LOCAL_JSON_NAMESPACE
diff --git a/cppad_lib/json_operator.cpp b/cppad_lib/json_operator.cpp
new file mode 100644
index 000000000..a492b72d4
--- /dev/null
+++ b/cppad_lib/json_operator.cpp
@@ -0,0 +1,81 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+  CppAD is distributed under the terms of the
+               Eclipse Public License Version 2.0.
+
+  This Source Code may also be made available under the following
+  Secondary License when the conditions for such availability set forth
+  in the Eclipse Public License, Version 2.0 are satisfied:
+        GNU General Public License, Version 2.0 or later.
+-------------------------------------------------------------------------- */
+# include <cppad/local/json/operator.hpp>
+# include <cppad/core/cppad_assert.hpp>
+# include <utility>
+
+// BEGIN_CPPAD_LOCAL_JSON_NAMESPACE
+namespace CppAD { namespace local { namespace json {
+
+// mapping from operator name to json_op_enum value
+std::map<std::string, json_op_enum> op_name2enum;
+
+// map from operator enum to name
+const char* op_enum2name[n_json_op];
+
+// map from operator enum to n_arg (when fixed number of arguments)
+size_t op_enum2fixed_n_arg[n_json_op];
+
+void set_operator_info(void)
+{   typedef std::pair<std::string, json_op_enum> pair;
+    struct op_info {
+        json_op_enum code;
+        const char*  name;
+        size_t       n_arg;
+    };
+    op_info op_info_vec[] = {
+        { abs_json_op,   "abs",   1 }, // 1 result
+        { acosh_json_op, "acosh", 1 }, // 1 result
+        { acos_json_op,  "acos",  1 }, // 1 result
+        { add_json_op,   "add",   2 }, // 1 result
+        { asinh_json_op, "asinh", 1 }, // 1 result
+        { asin_json_op,  "asin",  1 }, // 1 result
+        { atanh_json_op, "atanh", 1 }, // 1 result
+        { atan_json_op,  "atan",  1 }, // 1 result
+        { atom_json_op,  "atom",  0 }, // variable number arg and result
+        { cosh_json_op,  "cosh",  1 }, // 1 result
+        { cos_json_op,   "cos",   1 }, // 1 result
+        { div_json_op,   "div",   2 }, // 1 result
+        { erf_json_op,   "erf",   1 }, // 1 result
+        { erfc_json_op,  "erfc",  1 }, // 1 result
+        { exp_json_op,   "exp",   1 }, // 1 result
+        { expm1_json_op, "expm1", 1 }, // 1 result
+        { log1p_json_op, "log1p", 1 }, // 1 result
+        { log_json_op,   "log",   1 }, // 1 result
+        { mul_json_op,   "mul",   2 }, // 1 result
+        { sign_json_op,  "sign",  1 }, // 1 result
+        { sinh_json_op,  "sinh",  1 }, // 1 result
+        { sin_json_op,   "sin",   1 }, // 1 result
+        { sqrt_json_op,  "sqrt",  1 }, // 1 result
+        { sub_json_op,   "sub",   2 }, // 1 result
+        { sum_json_op,   "sum",   0 }, // variable number arg and result
+        { tanh_json_op,  "tanh",  1 }, // 1 result
+        { tan_json_op,   "tan",   1 }  // 1 result
+    };
+    CPPAD_ASSERT_UNKNOWN(
+        size_t(n_json_op) == sizeof(op_info_vec) / sizeof(op_info_vec[0])
+    );
+    for(size_t i = 0; i < size_t(n_json_op); ++i)
+    {   json_op_enum code              = op_info_vec[i].code;
+        const char*  name              = op_info_vec[i].name;
+        size_t       n_arg             = op_info_vec[i].n_arg;
+        CPPAD_ASSERT_UNKNOWN( size_t(code) == i );
+        //
+        op_enum2name[code]        = name;
+        op_enum2fixed_n_arg[code] = n_arg;
+        op_name2enum.insert( pair(name, code) );
+    }
+}
+
+
+
+} } } // END_CPPAD_LOCAL_JSON_NAMESPACE
diff --git a/cppad_lib/json_parser.cpp b/cppad_lib/json_parser.cpp
new file mode 100644
index 000000000..d8a83f79b
--- /dev/null
+++ b/cppad_lib/json_parser.cpp
@@ -0,0 +1,301 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+
+# include <cppad/local/json/parser.hpp>
+# include <cppad/local/json/lexer.hpp>
+# include <cppad/local/define.hpp>
+# include <cppad/local/atomic_index.hpp>
+# include <cppad/utility/to_string.hpp>
+
+CPPAD_LIB_EXPORT void CppAD::local::json::parser(
+    const std::string&                        graph                  ,
+    std::string&                              function_name          ,
+    size_t&                                   n_dynamic_ind          ,
+    size_t&                                   n_independent          ,
+    CppAD::vector<std::string>&               atomic_name_vec        ,
+    CppAD::vector<double>&                    constant_vec           ,
+    CppAD::vector<json_op_struct>&            operator_vec           ,
+    CppAD::vector<size_t>&                    operator_arg           ,
+    CppAD::vector<size_t>&                    dependent_vec          )
+{   using std::string;
+    const std::string match_any_string = "";
+    //
+    // atomic_name_vec
+    bool        set_null = true;
+    size_t      index_in = 0;
+    size_t      type;
+    string      name;
+    void*       ptr;
+    size_t n_atomic = CppAD::local::atomic_index<double>(
+        set_null, index_in, type, &name, ptr
+    );
+    atomic_name_vec.resize(n_atomic + 1 );
+    atomic_name_vec[0] = "";
+    set_null = false;
+    for(index_in = 1; index_in <= n_atomic; ++index_in)
+    {   CppAD::local::atomic_index<double>(
+            set_null, index_in, type, &name, ptr
+        );
+        if( type == 3 )
+            atomic_name_vec[index_in] = name;
+        else
+            atomic_name_vec[index_in] = "";
+    }
+    //
+    // The values in this vector will be set while parsing op_devine_vec.
+    // Note that the values in op_code2enum[0] are not used.
+    CppAD::vector<json_op_enum> op_code2enum(1);
+    //
+    // -----------------------------------------------------------------------
+    // json_lexer constructor checks for { at beginning
+    CppAD::local::json::lexer json_lexer(graph);
+    //
+    // "function_name" : function_name
+    json_lexer.check_next_string("function_name");
+    json_lexer.check_next_char(':');
+    json_lexer.check_next_string(match_any_string);
+    function_name = json_lexer.token();
+    json_lexer.set_function_name(function_name);
+    json_lexer.check_next_char(',');
+    //
+    // -----------------------------------------------------------------------
+    // "op_define_vec" : [ n_define, [
+    json_lexer.check_next_string("op_define_vec");
+    json_lexer.check_next_char(':');
+    json_lexer.check_next_char('[');
+    //
+    json_lexer.next_non_neg_int();
+    size_t n_define = json_lexer.token2size_t();
+    json_lexer.check_next_char(',');
+    //
+    json_lexer.check_next_char('[');
+    for(size_t i = 0; i < n_define; ++i)
+    {   // {
+        json_lexer.check_next_char('{');
+        //
+        // "op_code" : op_code,
+        json_lexer.check_next_string("op_code");
+        json_lexer.check_next_char(':');
+        json_lexer.next_non_neg_int();
+# ifndef NDEBUG
+        size_t op_code = json_lexer.token2size_t();
+        assert( op_code == op_code2enum.size() );
+# endif
+        json_lexer.check_next_char(',');
+        //
+        // "name" : name
+        json_lexer.check_next_string("name");
+        json_lexer.check_next_char(':');
+        json_lexer.check_next_string(match_any_string);
+        name                 = json_lexer.token();
+        json_op_enum op_enum = op_name2enum[name];
+# if ! CPPAD_USE_CPLUSPLUS_2011
+        switch( op_enum )
+        {
+            case local::json::acosh_json_op:
+            case local::json::asinh_json_op:
+            case local::json::atanh_json_op:
+            case local::json::erf_json_op:
+            case local::json::erfc_json_op:
+            case local::json::expm1_json_op:
+            case local::json::log1p_json_op:
+            {   string expected = "a C++98 function";
+                string found    = name + " which is a C++11 function.";
+                json_lexer.report_error(expected, found);
+            }
+            break;
+
+            default:
+            break;
+        }
+
+# endif
+        //
+        // op_code2enum for this op_code
+        op_code2enum.push_back(op_enum);
+        //
+        size_t n_arg = op_enum2fixed_n_arg[op_enum];
+        if( n_arg > 0 )
+        {   // , "narg" : n_arg
+            json_lexer.check_next_char(',');
+            json_lexer.check_next_string("n_arg");
+            json_lexer.check_next_char(':');
+            json_lexer.next_non_neg_int();
+            if( n_arg != json_lexer.token2size_t() )
+            {   string expected = CppAD::to_string(n_arg);
+                string found    = json_lexer.token();
+                json_lexer.report_error(expected, found);
+            }
+        }
+        json_lexer.check_next_char('}');
+        //
+        // , (if not last entry)
+        if( i + 1 < n_define )
+            json_lexer.check_next_char(',');
+    }
+    json_lexer.check_next_char(']');
+    // ],
+    json_lexer.check_next_char(']');
+    json_lexer.check_next_char(',');
+    //
+    // -----------------------------------------------------------------------
+    // "n_dynamic_ind" : n_dynamic_ind ,
+    json_lexer.check_next_string("n_dynamic_ind");
+    json_lexer.check_next_char(':');
+    //
+    json_lexer.next_non_neg_int();
+    n_dynamic_ind = json_lexer.token2size_t();
+    //
+    json_lexer.check_next_char(',');
+    // -----------------------------------------------------------------------
+    // "n_independent" : n_independent ,
+    json_lexer.check_next_string("n_independent");
+    json_lexer.check_next_char(':');
+    //
+    json_lexer.next_non_neg_int();
+    n_independent = json_lexer.token2size_t();
+    //
+    json_lexer.check_next_char(',');
+    // -----------------------------------------------------------------------
+    // "constant_vec": n_constant, [ first_constant, ..., last_constant ],
+    json_lexer.check_next_string("constant_vec");
+    json_lexer.check_next_char(':');
+    //
+    json_lexer.next_non_neg_int();
+    size_t n_constant = json_lexer.token2size_t();
+    constant_vec.resize(n_constant);
+    //
+    json_lexer.check_next_char(',');
+    //
+    // [ first_constant, ... , last_constant ]
+    json_lexer.check_next_char('[');
+    for(size_t i = 0; i < n_constant; ++i)
+    {   json_lexer.next_float();
+        constant_vec[i] = json_lexer.token2double();
+        //
+        if( i + 1 < n_constant )
+            json_lexer.check_next_char(',');
+    }
+    json_lexer.check_next_char(']');
+    json_lexer.check_next_char(',');
+    // -----------------------------------------------------------------------
+    // "op_usage_vec": n_usage, [ first_op_usage, ..., last_op_usage ],
+    json_lexer.check_next_string("op_usage_vec");
+    json_lexer.check_next_char(':');
+    //
+    json_lexer.next_non_neg_int();
+    size_t n_usage = json_lexer.token2size_t();
+    operator_vec.resize(n_usage);
+    operator_arg.resize(0);
+    //
+    json_lexer.check_next_char(',');
+    //
+    json_lexer.check_next_char('[');
+    for(size_t i = 0; i < n_usage; ++i)
+    {   // [ op_code,
+        json_lexer.check_next_char('[');
+        //
+        // op_enum
+        json_lexer.next_non_neg_int();
+        json_op_enum op_enum    = op_code2enum[ json_lexer.token2size_t() ];
+        operator_vec[i].op_enum = op_enum;
+        operator_vec[i].atomic_index = 0; // value for not an atomic function
+        json_lexer.check_next_char(',');
+        //
+        size_t n_result = 1;
+        size_t n_arg    = op_enum2fixed_n_arg[op_enum];
+        //
+        // check if number of arguments is fixed
+        bool fixed      = n_arg > 0;
+        if( ! fixed )
+        {   if( op_enum == atom_json_op )
+            {   // name,
+                json_lexer.check_next_string(match_any_string);
+                name = json_lexer.token();
+                for(size_t index = 1; index < atomic_name_vec.size(); ++index)
+                {   if( atomic_name_vec[index] == name )
+                    {   if( operator_vec[i].atomic_index != 0 )
+                        {   string expected = "unique atomic function name";
+                            string found    = name;
+                            json_lexer.report_error(expected, found);
+                        }
+                        operator_vec[i].atomic_index = index;
+                    }
+                }
+                if( operator_vec[i].atomic_index == 0 )
+                {   string expected = "a valid atomic function name";
+                    string found    = name;
+                    json_lexer.report_error(expected, found);
+                }
+                json_lexer.check_next_char(',');
+            }
+            // n_result,
+            json_lexer.next_non_neg_int();
+            n_result = json_lexer.token2size_t();
+            json_lexer.check_next_char(',');
+            //
+            // n_arg, [
+            json_lexer.next_non_neg_int();
+            n_arg = json_lexer.token2size_t();
+            json_lexer.check_next_char(',');
+            json_lexer.check_next_char('[');
+        }
+        operator_vec[i].n_result = n_result;
+        operator_vec[i].n_arg    = n_arg;
+        //
+        // start_arg
+        operator_vec[i].start_arg = operator_arg.size();
+        for(size_t j = 0; j < n_arg; ++j)
+        {   // next_arg
+            json_lexer.next_non_neg_int();
+            size_t argument_node = json_lexer.token2size_t();
+            operator_arg.push_back( argument_node );
+            //
+            // , (if not last entry)
+            if( j + 1 < n_arg )
+                json_lexer.check_next_char(',');
+        }
+        json_lexer.check_next_char(']');
+        if( ! fixed )
+            json_lexer.check_next_char(']');
+        //
+        // , (if not last entry)
+        if( i + 1 < n_usage )
+            json_lexer.check_next_char(',');
+    }
+    json_lexer.check_next_char(']');
+    json_lexer.check_next_char(',');
+    // -----------------------------------------------------------------------
+    // "dependent_vec": [ n_dependent, [first_dependent, ..., last_dependent] ]
+    json_lexer.check_next_string("dependent_vec");
+    json_lexer.check_next_char(':');
+    //
+    json_lexer.next_non_neg_int();
+    size_t n_dependent = json_lexer.token2size_t();
+    dependent_vec.resize(n_dependent);
+    json_lexer.check_next_char(',');
+    //
+    json_lexer.check_next_char('[');
+    for(size_t i = 0; i < n_dependent; ++i)
+    {   json_lexer.next_float();
+        dependent_vec[i] = json_lexer.token2size_t();
+        //
+        if( i + 1 < n_dependent )
+            json_lexer.check_next_char(',');
+    }
+    json_lexer.check_next_char(']');
+    // -----------------------------------------------------------------------
+    // end of Json object
+    json_lexer.check_next_char('}');
+    //
+    return;
+}
diff --git a/debian/changelog b/debian/changelog
index fe29039fc..3011745b8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+cppad (2019.02.00.4+git20190831.41fb271-1) UNRELEASED; urgency=medium
+
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Sat, 07 Sep 2019 12:45:08 +0000
+
 cppad (2019.02.00.4-1) unstable; urgency=medium
 
   * New upstream release
diff --git a/depcomp b/depcomp
index 30379e224..65cbf7093 100755
--- a/depcomp
+++ b/depcomp
@@ -1,9 +1,9 @@
-#!/bin/sh
+#! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -783,7 +783,7 @@ exit 0
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
diff --git a/dev.omh b/dev.omh
new file mode 100755
index 000000000..cc0b4df51
--- /dev/null
+++ b/dev.omh
@@ -0,0 +1,32 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+  CppAD is distributed under the terms of the
+               Eclipse Public License Version 2.0.
+
+  This Source Code may also be made available under the following
+  Secondary License when the conditions for such availability set forth
+  in the Eclipse Public License, Version 2.0 are satisfied:
+        GNU General Public License, Version 2.0 or later.
+-------------------------------------------------------------------------- */
+$begin CppAD$$
+$comment Top level Developer documentaion$$
+
+$include omh/cppad.omh$$
+
+$children%
+    omh/install/install.omh%
+    omh/theory/theory.omh%
+    include/cppad/core/user_ad.hpp%
+    include/cppad/core/ad_fun.hpp%
+    omh/preprocessor.omh%
+    omh/multi_thread.omh%
+    include/cppad/utility/omh/utility.omh%
+    include/cppad/ipopt/solve.hpp%
+    omh/example.omh%
+    omh/speed/speed.omh%
+    omh/appendix/appendix.omh%
+    omh/devel/devel.omh
+%$$
+
+$end
diff --git a/doc.omh b/doc.omh
index ebb9e8685..2d1dcd47c 100755
--- a/doc.omh
+++ b/doc.omh
@@ -10,240 +10,9 @@ CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
         GNU General Public License, Version 2.0 or later.
 -------------------------------------------------------------------------- */
 $begin CppAD$$
-$escape $$
-$comment default navigate command for all of CppAD documentation$$
-$navigate%
-    Prev%Prev%
-    Next%Next%
-    Across%Index%
-    Up%Up%
-    Down_up_3%_up_3%
-    Down_up_2%_up_2%
-    Down_up_1%_up_1%
-    Down_up_0%_up_0%
-    Current%Headings
-%$$
-$comment -------------------------------------------------------------
-default automatic indexing command for all CppAD documentaiton
-$$
-$aindex section head subhead$$
-$comment -------------------------------------------------------------
-Latex used throughout the CppAD documentation
-$$
-$latex
-\newcommand{\W}[1]{ \; #1 \; }
-\newcommand{\R}[1]{ {\rm #1} }
-\newcommand{\B}[1]{ {\bf #1} }
-\newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} }
-\newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} }
-\newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial  {#2}^{#1}} }
-\newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }
-$$
-$comment
-==============================================================================
-$$
-$spell
-    cppad
-    templated
-    Microsoft
-    Cpp
-    http
-    www
-    seanet
-    bradbell
-    https
-    github
-    Jacobian
-    Jacobians
-    subgraph
-    Posix
-    Openmp
-$$
-
-$comment bin/version assumes that : follows cppad version number here$$
-$section
-cppad-20190200.4: A C++ Algorithmic Differentiation Package$$
-
-$comment =================================================================== $$
-$align middle$$
-$table
-$icon coin.png$$
-$cnext
-$comment ------------------------------------------------------------------- $$
-
-$table
-$href%https://github.com/coin-or/CppAD%github%$$,     $cnext
-$href%https://travis-ci.org/coin-or/CppAD%travis%$$,  $cnext
-$href%https://ci.appveyor.com/project/bradbell/cppad%appveyor%$$
-$tend
-$pre
-
-$$
-$comment ------------------------------------------------------------------- $$
-$table
-$cref install$$,                                      $cnext
-$cref/get_started/get_started.cpp/$$,                 $cnext
-$cref whats_new$$,                                    $cnext
-$cref addon$$,                                        $cnext
-$cref research$$,                                     $cnext
-$href%http://www.seanet.com/~bradbell%project manager%$$
-$tend
-$pre
-
-$$
-$comment ------------------------------------------------------------------- $$
-CppAD is distributed by
-$href%http://www.coin-or.org%COIN-OR%$$
-with the Eclipse Public License
-$href%http://www.opensource.org/licenses/EPL-2.0%EPL-2.0%$$
-or the GNU General Public License
-$href%http://www.opensource.org/licenses/GPL-2.0%GPL-2.0%$$ or later.
-
-$tend
-$align top$$
-$comment =================================================================== $$
-
-$head Algorithmic Differentiation$$
-We refer to the automatic creation of an algorithm that
-computes derivative values from an algorithm that computes function values
-as $italic Algorithmic Differentiation$$,
-also referred to as $italic Automatic Differentiation$$ or just AD.
-A brief introduction to AD can be found in
-$href%http://en.wikipedia.org/wiki/Automatic_differentiation%wikipedia%$$.
-The web site
-$href%http://www.autodiff.org%autodiff.org%$$
-is dedicated to research about, and promoting the use of, AD.
-
-$head Features$$
-
-$subhead Operator Overloading$$
-CppAD uses operator overloading of the C++ template class $cref AD$$
-to compute derivatives of algorithms defined using AD objects; see
-the $cref introduction$$ for a description of how this is accomplished.
-
-$subhead Base Type$$
-The operator overloading uses a templated base type that
-can be user defined; see $cref base_require$$.
-The required definitions for $code AD<float>$$ and
-$code AD<double>$$ are included as part of CppAD.
-
-$subhead Recording Operations$$
-A sequence of $codei%AD<%Base%>%$$
-$cref/operations/glossary/Operation/Sequence/$$
-can be recorded and stored in an
-$cref/AD function object/ADFun/$$ object.
-This object can then be used to evaluate
-function values and arbitrary order derivatives,
-and sparsity patterns of derivative values using the $icode Base$$ type.
-
-$subhead Multi-Threading$$
-CppAD supports an arbitrary $cref/multi threading/multi_thread/$$ environment.
-Examples are provided using Boost threads, Posix threads, and Openmp threads.
-
-$subhead Optimizing Operations Sequences$$
-During the recording of a function,
-the $cref Independent$$ variables are know and a forward dependency
-analysis is used to determine which operations should be recorded.
-Once the $cref Dependent$$ variables are determined,
-a reverse dependency analysis can be preformed.
-This $cref optimize$$ routine uses a reverse dependency analysis,
-and other techniques,
-to remove unnecessary operations.
-
-$subhead Dynamic Parameters$$
-CppAD enables one to specify a vector of
-$cref/dynamic/glossary/Parameter/Dynamic/$$ parameters.
-The value of the function and derivatives can depend on these parameters,
-but no derivatives are taken with respect to these parameters.
-This enables CppAD to reduce the derivative calculations; e.g.,
-the derivative of variable times a variable has two terms
-while a variable times a parameter only has one.
-
-$subhead Derivative Calculations$$
-Arbitrary order
-$cref/forward/Forward/$$ and $cref/reverse/Reverse/$$
-mode derivative calculations
-can be preformed using an $code ADFun$$ object.
-Easy to user drivers that compute the
-entire $cref Jacobian$$ and a specific $cref Hessian$$ are included.
-
-$subhead Sparsity$$
-Both forward and reverse mode can be used to calculation the sparsity
-pattern for Jacobians and Hessians; see $cref sparsity_pattern$$.
-Where a Jacobian or Hessian is sparse,
-both forward and reverse mode can be combined with the sparsity pattern
-to speed up the calculation of
-$cref/sparse derivatives/sparse_derivative/$$.
-In addition, a $cref/subgraph/subgraph_jac_rev/$$ method,
-that does not require a sparsity pattern, can be used
-to speed up these derivative calculations.
-
-$subhead Recording Derivative Operations$$
-A $code ADFun$$ object can be converted into an object that
-evaluates derivatives using the type $codei%AD<%Base%>%$$; see $cref base2ad$$.
-This enables one to record new functions that
-are expressed using derivatives of other functions.
-
-$subhead Atomic Functions$$
-User defined derivative calculations for arbitrary functions
-can also be included in
-a recording using $cref/atomic functions/atomic_two/$$ functions.
-A special $cref/checkpoint/chkpoint_one/$$ class is included
-which allows one to record a function and reuse it as
-an atomic operation in other functions.
-There also is a special interface for user defined unary
-$cref/discrete functions/Discrete/$$ functions; i.e.,
-functions that depend on the
-$cref/independent variables/glossary/Tape/Independent Variable/$$
-but which have identically zero derivatives (e.g., a step function).
-
-$subhead Logical Comparisons$$
-Logical comparisons can be included in an operation sequence
-using AD $cref/conditional expressions/CondExp/$$.
-
-$subhead Vectors$$
-The CppAD API allows one to use any
-$cref SimpleVector$$ class.
-The preprocessor symbol $cref/CPPAD_TESTVECTOR/testvector/$$
-is template vector class which is used for correctness testing.
-Many of the correctness tests use this template vector class
-which you can choose during the $cref cmake$$ configuration command.
-
-$head Software Engineering$$
-CppAD is developed using the software engineering procedures described
-on the project manager's
-$href%https://www.seanet.com/~bradbell/software.htm%software%$$
-web page.
-
-$head Testing$$
-
-$subhead Correctness$$
-There is an extensive set of correctness tests; see $cref cmake_check$$.
-
-$subhead Speed$$
-A set of programs for doing $cref speed$$ comparisons between
-$href%https://projects.coin-or.org/ADOL-C%Adolc%$$,
-CppAD,
-$href%http://www.fadbad.com/%Fadbad%$$,
-and
-$href%http://trilinos.sandia.gov/packages/sacado/%Sacado%$$
-are included.
-
-$head Utilities$$
-CppAD includes a set of C++ $cref/utilities/utility/$$ that are useful
-for general operator overloaded numerical methods.
-
-$head Release Notes$$
-This $cref whats_new$$ for a list of recent extensions and bug fixes.
+$comment Top level User documentaion$$
 
-$head Example$$
-The file $cref get_started.cpp$$
-contains an example and test of using CppAD to compute
-the derivative of a polynomial.
-There are many other
-$cref/examples/Example/$$.
-All of the examples are also correctness tests,
-which ensures that they work properly.
+$include omh/cppad.omh$$
 
 $children%
     omh/install/install.omh%
@@ -252,11 +21,11 @@ $children%
     include/cppad/core/ad_fun.hpp%
     omh/preprocessor.omh%
     omh/multi_thread.omh%
-    omh/utility.omh%
+    include/cppad/utility/omh/utility.omh%
     include/cppad/ipopt/solve.hpp%
     omh/example.omh%
     omh/speed/speed.omh%
-    omh/appendix.omh
+    omh/appendix/appendix.omh
 %$$
 
 $end
diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt
index cdc782c4a..5aa95b965 100644
--- a/example/CMakeLists.txt
+++ b/example/CMakeLists.txt
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -36,6 +36,9 @@ IF( cppad_has_ipopt)
     ADD_SUBDIRECTORY(ipopt_solve)
 ENDIF( cppad_has_ipopt)
 
+# Json AD graph examples
+ADD_SUBDIRECTORY(json)
+
 # multi_thread examples
 ADD_SUBDIRECTORY(multi_thread)
 
diff --git a/example/abs_normal/CMakeLists.txt b/example/abs_normal/CMakeLists.txt
index 03e8117af..04f243a74 100644
--- a/example/abs_normal/CMakeLists.txt
+++ b/example/abs_normal/CMakeLists.txt
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -11,6 +11,7 @@
 # -----------------------------------------------------------------------------
 # Build the example/print_for directory tests
 #
+# BEGIN_SORT_THIS_LINE_PLUS_2
 SET(source_list
     abs_eval.cpp
     abs_min_linear.cpp
@@ -24,6 +25,8 @@ SET(source_list
     qp_interior.cpp
     simplex_method.cpp
 )
+# END_SORT_THIS_LINE_MINUS_2
+
 #
 set_compile_flags( example_abs_normal "${cppad_debug_which}" "${source_list}" )
 #
diff --git a/example/abs_normal/makefile.in b/example/abs_normal/makefile.in
index 001954789..5f0064a6e 100644
--- a/example/abs_normal/makefile.in
+++ b/example/abs_normal/makefile.in
@@ -1,7 +1,7 @@
-# makefile.in generated by automake 1.15.1 from makefile.am.
+# makefile.in generated by automake 1.16.1 from makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -119,7 +119,13 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = 
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/abs_eval.Po \
+	./$(DEPDIR)/abs_min_linear.Po ./$(DEPDIR)/abs_min_quad.Po \
+	./$(DEPDIR)/abs_normal.Po ./$(DEPDIR)/get_started.Po \
+	./$(DEPDIR)/lp_box.Po ./$(DEPDIR)/min_nso_linear.Po \
+	./$(DEPDIR)/min_nso_quad.Po ./$(DEPDIR)/qp_box.Po \
+	./$(DEPDIR)/qp_interior.Po ./$(DEPDIR)/simplex_method.Po
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -414,8 +420,8 @@ makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
 	  *config.status*) \
 	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -440,17 +446,23 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abs_eval.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abs_min_linear.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abs_min_quad.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abs_normal.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_started.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lp_box.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/min_nso_linear.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/min_nso_quad.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qp_box.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qp_interior.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simplex_method.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abs_eval.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abs_min_linear.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abs_min_quad.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abs_normal.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_started.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lp_box.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/min_nso_linear.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/min_nso_quad.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qp_box.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qp_interior.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simplex_method.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+	@$(MKDIR_P) $(@D)
+	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -520,7 +532,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -590,7 +605,17 @@ clean: clean-am
 clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/abs_eval.Po
+	-rm -f ./$(DEPDIR)/abs_min_linear.Po
+	-rm -f ./$(DEPDIR)/abs_min_quad.Po
+	-rm -f ./$(DEPDIR)/abs_normal.Po
+	-rm -f ./$(DEPDIR)/get_started.Po
+	-rm -f ./$(DEPDIR)/lp_box.Po
+	-rm -f ./$(DEPDIR)/min_nso_linear.Po
+	-rm -f ./$(DEPDIR)/min_nso_quad.Po
+	-rm -f ./$(DEPDIR)/qp_box.Po
+	-rm -f ./$(DEPDIR)/qp_interior.Po
+	-rm -f ./$(DEPDIR)/simplex_method.Po
 	-rm -f makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -636,7 +661,17 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/abs_eval.Po
+	-rm -f ./$(DEPDIR)/abs_min_linear.Po
+	-rm -f ./$(DEPDIR)/abs_min_quad.Po
+	-rm -f ./$(DEPDIR)/abs_normal.Po
+	-rm -f ./$(DEPDIR)/get_started.Po
+	-rm -f ./$(DEPDIR)/lp_box.Po
+	-rm -f ./$(DEPDIR)/min_nso_linear.Po
+	-rm -f ./$(DEPDIR)/min_nso_quad.Po
+	-rm -f ./$(DEPDIR)/qp_box.Po
+	-rm -f ./$(DEPDIR)/qp_interior.Po
+	-rm -f ./$(DEPDIR)/simplex_method.Po
 	-rm -f makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -656,7 +691,7 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
 	clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \
 	distclean distclean-compile distclean-generic distclean-tags \
 	distdir dvi dvi-am html html-am info info-am install \
diff --git a/example/atomic_three/CMakeLists.txt b/example/atomic_three/CMakeLists.txt
index ff5333fe6..f96251281 100644
--- a/example/atomic_three/CMakeLists.txt
+++ b/example/atomic_three/CMakeLists.txt
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -10,21 +10,24 @@
 #       GNU General Public License, Version 2.0 or later.
 # -----------------------------------------------------------------------------
 #
+# BEGIN_SORT_THIS_LINE_PLUS_2
 SET(source_list
-    norm_sq.cpp
-    tangent.cpp
-    base2ad.cpp
-    reciprocal.cpp
     atomic_three.cpp
-    mat_mul.cpp
+    base2ad.cpp
     dynamic.cpp
     forward.cpp
     get_started.cpp
     hes_sparsity.cpp
     jac_sparsity.cpp
-    reverse.cpp
+    mat_mul.cpp
+    norm_sq.cpp
+    reciprocal.cpp
     rev_depend.cpp
+    reverse.cpp
+    tangent.cpp
 )
+# END_SORT_THIS_LINE_MINUS_2
+
 set_compile_flags(example_atomic_three "${cppad_debug_which}" "${source_list}" )
 #
 ADD_EXECUTABLE(example_atomic_three EXCLUDE_FROM_ALL ${source_list})
diff --git a/example/atomic_three/makefile.in b/example/atomic_three/makefile.in
index fe6d8c721..2e98fc89e 100644
--- a/example/atomic_three/makefile.in
+++ b/example/atomic_three/makefile.in
@@ -1,7 +1,7 @@
-# makefile.in generated by automake 1.15.1 from makefile.am.
+# makefile.in generated by automake 1.16.1 from makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -118,7 +118,14 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = 
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/atomic_three.Po \
+	./$(DEPDIR)/base2ad.Po ./$(DEPDIR)/dynamic.Po \
+	./$(DEPDIR)/forward.Po ./$(DEPDIR)/get_started.Po \
+	./$(DEPDIR)/hes_sparsity.Po ./$(DEPDIR)/jac_sparsity.Po \
+	./$(DEPDIR)/mat_mul.Po ./$(DEPDIR)/norm_sq.Po \
+	./$(DEPDIR)/reciprocal.Po ./$(DEPDIR)/rev_depend.Po \
+	./$(DEPDIR)/reverse.Po ./$(DEPDIR)/tangent.Po
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -382,8 +389,8 @@ makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
 	  *config.status*) \
 	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -408,19 +415,25 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomic_three.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base2ad.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynamic.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/forward.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_started.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hes_sparsity.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jac_sparsity.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mat_mul.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/norm_sq.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reciprocal.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_depend.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reverse.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tangent.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomic_three.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base2ad.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynamic.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/forward.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_started.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hes_sparsity.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jac_sparsity.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mat_mul.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/norm_sq.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reciprocal.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_depend.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reverse.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tangent.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+	@$(MKDIR_P) $(@D)
+	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -490,7 +503,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -560,7 +576,19 @@ clean: clean-am
 clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/atomic_three.Po
+	-rm -f ./$(DEPDIR)/base2ad.Po
+	-rm -f ./$(DEPDIR)/dynamic.Po
+	-rm -f ./$(DEPDIR)/forward.Po
+	-rm -f ./$(DEPDIR)/get_started.Po
+	-rm -f ./$(DEPDIR)/hes_sparsity.Po
+	-rm -f ./$(DEPDIR)/jac_sparsity.Po
+	-rm -f ./$(DEPDIR)/mat_mul.Po
+	-rm -f ./$(DEPDIR)/norm_sq.Po
+	-rm -f ./$(DEPDIR)/reciprocal.Po
+	-rm -f ./$(DEPDIR)/rev_depend.Po
+	-rm -f ./$(DEPDIR)/reverse.Po
+	-rm -f ./$(DEPDIR)/tangent.Po
 	-rm -f makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -606,7 +634,19 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/atomic_three.Po
+	-rm -f ./$(DEPDIR)/base2ad.Po
+	-rm -f ./$(DEPDIR)/dynamic.Po
+	-rm -f ./$(DEPDIR)/forward.Po
+	-rm -f ./$(DEPDIR)/get_started.Po
+	-rm -f ./$(DEPDIR)/hes_sparsity.Po
+	-rm -f ./$(DEPDIR)/jac_sparsity.Po
+	-rm -f ./$(DEPDIR)/mat_mul.Po
+	-rm -f ./$(DEPDIR)/norm_sq.Po
+	-rm -f ./$(DEPDIR)/reciprocal.Po
+	-rm -f ./$(DEPDIR)/rev_depend.Po
+	-rm -f ./$(DEPDIR)/reverse.Po
+	-rm -f ./$(DEPDIR)/tangent.Po
 	-rm -f makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -626,7 +666,7 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
 	clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \
 	distclean distclean-compile distclean-generic distclean-tags \
 	distdir dvi dvi-am html html-am info info-am install \
diff --git a/example/atomic_three/mat_mul.cpp b/example/atomic_three/mat_mul.cpp
index eb1ac2caf..5aeb4646d 100644
--- a/example/atomic_three/mat_mul.cpp
+++ b/example/atomic_three/mat_mul.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -22,11 +22,11 @@ $head See Also$$
 $cref atomic_two_eigen_mat_mul.cpp$$
 
 $children%
-    include/cppad/example/mat_mul.hpp
+    include/cppad/example/atomic_three/mat_mul.hpp
 %$$
 
 $head Class Definition$$
-This example uses the file $cref atomic_mat_mul.hpp$$
+This example uses the file $cref atomic_three_mat_mul.hpp$$
 which defines matrix multiply as a $cref atomic_three$$ operation.
 
 $nospell
@@ -34,7 +34,7 @@ $nospell
 $head Use Atomic Function$$
 $srccode%cpp% */
 # include <cppad/cppad.hpp>
-# include <cppad/example/mat_mul.hpp>
+# include <cppad/example/atomic_three/mat_mul.hpp>
 
 bool mat_mul(void)
 {   bool ok = true;
diff --git a/example/atomic_two/CMakeLists.txt b/example/atomic_two/CMakeLists.txt
index 46cbc564a..cae570360 100644
--- a/example/atomic_two/CMakeLists.txt
+++ b/example/atomic_two/CMakeLists.txt
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -17,10 +17,13 @@ ELSE( cppad_has_eigen )
     SET(eigen_sources "")
 ENDIF( cppad_has_eigen )
 #
+# BEGIN_SORT_THIS_LINE_PLUS_2
 SET(source_list
     ${eigen_sources}
     atomic_two.cpp
 )
+# END_SORT_THIS_LINE_MINUS_2
+
 set_compile_flags( example_atomic_two "${cppad_debug_which}" "${source_list}" )
 #
 ADD_EXECUTABLE(example_atomic_two EXCLUDE_FROM_ALL ${source_list})
diff --git a/example/atomic_two/eigen_cholesky.cpp b/example/atomic_two/eigen_cholesky.cpp
index 912e770ba..7a9ec8b0a 100644
--- a/example/atomic_two/eigen_cholesky.cpp
+++ b/example/atomic_two/eigen_cholesky.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -40,13 +40,13 @@ $latex x_0 > 0$$, $latex x_2 > 0$$ and
 $latex x_0 x_2 - x_1 x_1 > 0$$.
 
 $childtable%omh/theory/cholesky.omh
-    %include/cppad/example/eigen_cholesky.hpp
+    %include/cppad/example/atomic_two/eigen_cholesky.hpp
 %$$
 
 $head Use Atomic Function$$
 $srccode%cpp% */
 # include <cppad/cppad.hpp>
-# include <cppad/example/eigen_cholesky.hpp>
+# include <cppad/example/atomic_two/eigen_cholesky.hpp>
 
 
 bool eigen_cholesky(void)
diff --git a/example/atomic_two/eigen_mat_inv.cpp b/example/atomic_two/eigen_mat_inv.cpp
index 2fef6010e..c830d7aab 100644
--- a/example/atomic_two/eigen_mat_inv.cpp
+++ b/example/atomic_two/eigen_mat_inv.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -39,11 +39,11 @@ f(x) =
 \] $$
 
 $children%
-    include/cppad/example/eigen_mat_inv.hpp
+    include/cppad/example/atomic_two/eigen_mat_inv.hpp
 %$$
 
 $head Class Definition$$
-This example uses the file $cref atomic_eigen_mat_inv.hpp$$
+This example uses the file $cref atomic_two_eigen_mat_inv.hpp$$
 which defines matrix multiply as a $cref atomic_two$$ operation.
 
 $nospell
@@ -51,8 +51,8 @@ $nospell
 $head Use Atomic Function$$
 $srccode%cpp% */
 # include <cppad/cppad.hpp>
-# include <cppad/example/eigen_mat_inv.hpp>
-# include <cppad/example/eigen_mat_mul.hpp>
+# include <cppad/example/atomic_two/eigen_mat_inv.hpp>
+# include <cppad/example/atomic_two/eigen_mat_mul.hpp>
 
 
 bool eigen_mat_inv(void)
diff --git a/example/atomic_two/eigen_mat_mul.cpp b/example/atomic_two/eigen_mat_mul.cpp
index 727b35a61..38e2006bd 100644
--- a/example/atomic_two/eigen_mat_mul.cpp
+++ b/example/atomic_two/eigen_mat_mul.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -41,11 +41,11 @@ f(x) =
 \] $$
 
 $children%
-    include/cppad/example/eigen_mat_mul.hpp
+    include/cppad/example/atomic_two/eigen_mat_mul.hpp
 %$$
 
 $head Class Definition$$
-This example uses the file $cref atomic_eigen_mat_mul.hpp$$
+This example uses the file $cref atomic_two_eigen_mat_mul.hpp$$
 which defines matrix multiply as a $cref atomic_two$$ operation.
 
 $nospell
@@ -53,7 +53,7 @@ $nospell
 $head Use Atomic Function$$
 $srccode%cpp% */
 # include <cppad/cppad.hpp>
-# include <cppad/example/eigen_mat_mul.hpp>
+# include <cppad/example/atomic_two/eigen_mat_mul.hpp>
 
 bool eigen_mat_mul(void)
 {   //
diff --git a/example/atomic_two/makefile.in b/example/atomic_two/makefile.in
index 69e020774..e0494814b 100644
--- a/example/atomic_two/makefile.in
+++ b/example/atomic_two/makefile.in
@@ -1,7 +1,7 @@
-# makefile.in generated by automake 1.15.1 from makefile.am.
+# makefile.in generated by automake 1.16.1 from makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -119,7 +119,10 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = 
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/atomic_two.Po \
+	./$(DEPDIR)/eigen_cholesky.Po ./$(DEPDIR)/eigen_mat_inv.Po \
+	./$(DEPDIR)/eigen_mat_mul.Po
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -375,8 +378,8 @@ makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
 	  *config.status*) \
 	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -401,10 +404,16 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomic_two.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eigen_cholesky.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eigen_mat_inv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eigen_mat_mul.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomic_two.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eigen_cholesky.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eigen_mat_inv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eigen_mat_mul.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+	@$(MKDIR_P) $(@D)
+	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -474,7 +483,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -544,7 +556,10 @@ clean: clean-am
 clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/atomic_two.Po
+	-rm -f ./$(DEPDIR)/eigen_cholesky.Po
+	-rm -f ./$(DEPDIR)/eigen_mat_inv.Po
+	-rm -f ./$(DEPDIR)/eigen_mat_mul.Po
 	-rm -f makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -590,7 +605,10 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/atomic_two.Po
+	-rm -f ./$(DEPDIR)/eigen_cholesky.Po
+	-rm -f ./$(DEPDIR)/eigen_mat_inv.Po
+	-rm -f ./$(DEPDIR)/eigen_mat_mul.Po
 	-rm -f makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -610,7 +628,7 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
 	clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \
 	distclean distclean-compile distclean-generic distclean-tags \
 	distdir dvi dvi-am html html-am info info-am install \
diff --git a/example/chkpoint_two/CMakeLists.txt b/example/chkpoint_two/CMakeLists.txt
index 610fcb9a5..ee1ef3b7c 100644
--- a/example/chkpoint_two/CMakeLists.txt
+++ b/example/chkpoint_two/CMakeLists.txt
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -10,14 +10,17 @@
 #       GNU General Public License, Version 2.0 or later.
 # -----------------------------------------------------------------------------
 #
+# BEGIN_SORT_THIS_LINE_PLUS_2
 SET(source_list
-    chkpoint_two.cpp
     base2ad.cpp
+    chkpoint_two.cpp
     compare.cpp
     dynamic.cpp
     get_started.cpp
     ode.cpp
 )
+# END_SORT_THIS_LINE_MINUS_2
+
 set_compile_flags( example_chkpoint_two "${cppad_debug_which}" "${source_list}" )
 #
 ADD_EXECUTABLE(example_chkpoint_two EXCLUDE_FROM_ALL ${source_list})
diff --git a/example/chkpoint_two/makefile.in b/example/chkpoint_two/makefile.in
index d348f0f64..02a064bcf 100644
--- a/example/chkpoint_two/makefile.in
+++ b/example/chkpoint_two/makefile.in
@@ -1,7 +1,7 @@
-# makefile.in generated by automake 1.15.1 from makefile.am.
+# makefile.in generated by automake 1.16.1 from makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -116,7 +116,11 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = 
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/base2ad.Po \
+	./$(DEPDIR)/chkpoint_two.Po ./$(DEPDIR)/compare.Po \
+	./$(DEPDIR)/dynamic.Po ./$(DEPDIR)/get_started.Po \
+	./$(DEPDIR)/ode.Po
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -372,8 +376,8 @@ makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
 	  *config.status*) \
 	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -398,12 +402,18 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base2ad.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chkpoint_two.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compare.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynamic.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_started.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base2ad.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chkpoint_two.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compare.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynamic.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_started.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+	@$(MKDIR_P) $(@D)
+	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -473,7 +483,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -543,7 +556,12 @@ clean: clean-am
 clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/base2ad.Po
+	-rm -f ./$(DEPDIR)/chkpoint_two.Po
+	-rm -f ./$(DEPDIR)/compare.Po
+	-rm -f ./$(DEPDIR)/dynamic.Po
+	-rm -f ./$(DEPDIR)/get_started.Po
+	-rm -f ./$(DEPDIR)/ode.Po
 	-rm -f makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -589,7 +607,12 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/base2ad.Po
+	-rm -f ./$(DEPDIR)/chkpoint_two.Po
+	-rm -f ./$(DEPDIR)/compare.Po
+	-rm -f ./$(DEPDIR)/dynamic.Po
+	-rm -f ./$(DEPDIR)/get_started.Po
+	-rm -f ./$(DEPDIR)/ode.Po
 	-rm -f makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -609,7 +632,7 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
 	clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \
 	distclean distclean-compile distclean-generic distclean-tags \
 	distdir dvi dvi-am html html-am info info-am install \
diff --git a/example/general/CMakeLists.txt b/example/general/CMakeLists.txt
index 3442d37de..409e8eb29 100644
--- a/example/general/CMakeLists.txt
+++ b/example/general/CMakeLists.txt
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -27,12 +27,11 @@ ELSE( cppad_has_eigen )
     SET(eigen_sources "")
 ENDIF( cppad_has_eigen )
 #
+# BEGIN_SORT_THIS_LINE_PLUS_2
 SET(source_list
-    general.cpp
     ${adolc_sources}
     ${eigen_sources}
     abort_recording.cpp
-    fabs.cpp
     acos.cpp
     acosh.cpp
     ad_assign.cpp
@@ -49,8 +48,8 @@ SET(source_list
     atan.cpp
     atanh.cpp
     azmul.cpp
-    base_alloc.hpp
     base2ad.cpp
+    base_alloc.hpp
     base_require.cpp
     bender_quad.cpp
     bool_fun.cpp
@@ -61,14 +60,17 @@ SET(source_list
     compare.cpp
     complex_poly.cpp
     cond_exp.cpp
+    con_dyn_var.cpp
     cos.cpp
     cosh.cpp
     div.cpp
     div_eq.cpp
     equal_op_seq.cpp
+    erfc.cpp
     erf.cpp
     exp.cpp
     expm1.cpp
+    fabs.cpp
     for_one.cpp
     for_two.cpp
     forward.cpp
@@ -76,6 +78,7 @@ SET(source_list
     forward_order.cpp
     fun_assign.cpp
     fun_check.cpp
+    general.cpp
     hes_lagrangian.cpp
     hes_lu_det.cpp
     hes_minor_det.cpp
@@ -106,9 +109,7 @@ SET(source_list
     numeric_type.cpp
     num_limits.cpp
     ode_stiff.cpp
-    taylor_ode.cpp
     opt_val_hes.cpp
-    con_dyn_var.cpp
     poly.cpp
     pow.cpp
     pow_int.cpp
@@ -132,12 +133,15 @@ SET(source_list
     tan.cpp
     tanh.cpp
     tape_index.cpp
+    taylor_ode.cpp
     unary_minus.cpp
     unary_plus.cpp
     value.cpp
     var2par.cpp
     vec_ad.cpp
 )
+# END_SORT_THIS_LINE_MINUS_2
+
 set_compile_flags( example_general "${cppad_debug_which}" "${source_list}" )
 #
 ADD_EXECUTABLE(example_general EXCLUDE_FROM_ALL ${source_list})
diff --git a/example/general/base_alloc.hpp b/example/general/base_alloc.hpp
index 7497860cb..1ebea9f04 100644
--- a/example/general/base_alloc.hpp
+++ b/example/general/base_alloc.hpp
@@ -1,7 +1,7 @@
 # ifndef CPPAD_EXAMPLE_GENERAL_BASE_ALLOC_HPP
 # define CPPAD_EXAMPLE_GENERAL_BASE_ALLOC_HPP
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -45,6 +45,7 @@ $spell
     std
     fabs
     erf
+    erfc
     endif
 $$
 $section Example AD<Base> Where Base Constructor Allocates Memory$$
@@ -315,17 +316,19 @@ namespace CppAD {
 
 $head erf, asinh, acosh, atanh, expm1, log1p$$
 The following defines the
-$cref/erf, asinh, acosh, atanh, expm1, log1p
+$cref/asinh, acosh, atanh, erf, erfc, expm1, log1p
     /base_std_math
-    /erf, asinh, acosh, atanh, expm1, log1p
-/$$ functions
+    /asinh, acosh, atanh, erf, erfc, expm1, log1p
+/$$
+functions
 required by $code AD<base_alloc>$$:
 $srccode%cpp% */
 # if CPPAD_USE_CPLUSPLUS_2011
-    BASE_ALLOC_STD_MATH(erf)
     BASE_ALLOC_STD_MATH(asinh)
     BASE_ALLOC_STD_MATH(acosh)
     BASE_ALLOC_STD_MATH(atanh)
+    BASE_ALLOC_STD_MATH(erf)
+    BASE_ALLOC_STD_MATH(erfc)
     BASE_ALLOC_STD_MATH(expm1)
     BASE_ALLOC_STD_MATH(log1p)
 # endif
diff --git a/example/general/change_param.cpp b/example/general/change_param.cpp
index f517cdea5..7913c731d 100644
--- a/example/general/change_param.cpp
+++ b/example/general/change_param.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -51,7 +51,7 @@ bool change_param(void)
 {   bool ok = true;                     // initialize test result
 
     typedef CppAD::AD<double> a1type;   // for first level of taping
-    typedef CppAD::AD<a1type>  a2type;  // for second level of taping
+    typedef CppAD::AD<a1type> a2type;  // for second level of taping
 
     size_t nu = 3;       // number components in u
     size_t nx = 2;       // number components in x
diff --git a/example/general/erf.cpp b/example/general/erf.cpp
index 426c3491f..becd61c8a 100644
--- a/example/general/erf.cpp
+++ b/example/general/erf.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -30,7 +30,7 @@ $end
 # include <cmath>
 # include <limits>
 
-bool Erf(void)
+bool erf(void)
 {   bool ok = true;
 
     using CppAD::AD;
diff --git a/example/general/erfc.cpp b/example/general/erfc.cpp
new file mode 100644
index 000000000..1299c91a2
--- /dev/null
+++ b/example/general/erfc.cpp
@@ -0,0 +1,103 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+
+/*
+$begin erfc.cpp$$
+$spell
+    tan
+    erfc
+$$
+
+$section The AD erfc Function: Example and Test$$
+
+
+$srcfile%example/general/erfc.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+
+# include <cppad/cppad.hpp>
+# include <cmath>
+# include <limits>
+
+bool erfc(void)
+{   bool ok = true;
+
+    using CppAD::AD;
+    using CppAD::NearEqual;
+    double eps = 10. * CppAD::numeric_limits<double>::epsilon();
+
+    // domain space vector
+    size_t n  = 1;
+    double x0 = 0.5;
+    CPPAD_TESTVECTOR(AD<double>) ax(n);
+    ax[0]     = x0;
+
+    // declare independent variables and start tape recording
+    CppAD::Independent(ax);
+
+    // range space vector
+    size_t m = 1;
+    CPPAD_TESTVECTOR(AD<double>) ay(m);
+    ay[0] = CppAD::erfc(ax[0]);
+
+    // create f: x -> y and stop tape recording
+    CppAD::ADFun<double> f(ax, ay);
+
+    // check relative erorr
+    double erfc_x0 = 0.4795001221869534;
+    ok &= NearEqual(ay[0] , erfc_x0,  0.,    4e-4);
+# if CPPAD_USE_CPLUSPLUS_2011
+    double tmp = std::max(1e-15, eps);
+    ok &= NearEqual(ay[0] , erfc_x0,  0.,    tmp);
+# endif
+
+    // value of derivative of erfc at x0
+    double pi     = 4. * std::atan(1.);
+    double factor = 2. / sqrt(pi);
+    double check  = - factor * std::exp(-x0 * x0);
+
+    // forward computation of first partial w.r.t. x[0]
+    CPPAD_TESTVECTOR(double) dx(n);
+    CPPAD_TESTVECTOR(double) dy(m);
+    dx[0] = 1.;
+    dy    = f.Forward(1, dx);
+    ok   &= NearEqual(dy[0], check,  0.,  1e-3);
+# if CPPAD_USE_CPLUSPLUS_2011
+    ok   &= NearEqual(dy[0], check,  0.,  eps);
+# endif
+
+    // reverse computation of derivative of y[0]
+    CPPAD_TESTVECTOR(double)  w(m);
+    CPPAD_TESTVECTOR(double) dw(n);
+    w[0]  = 1.;
+    dw    = f.Reverse(1, w);
+    ok   &= NearEqual(dw[0], check,  0., 1e-1);
+# if CPPAD_USE_CPLUSPLUS_2011
+    ok   &= NearEqual(dw[0], check,  0., eps);
+# endif
+
+    // use a VecAD<Base>::reference object with erfc
+    CppAD::VecAD<double> v(1);
+    AD<double> zero(0);
+    v[zero]           = x0;
+    AD<double> result = CppAD::erfc(v[zero]);
+    ok   &= NearEqual(result, ay[0], eps, eps);
+
+    // use a double with erfc
+    ok   &= NearEqual(CppAD::erfc(x0), ay[0], eps, eps);
+
+    return ok;
+}
+
+// END C++
diff --git a/example/general/general.cpp b/example/general/general.cpp
index 668fc95bc..e19766ceb 100644
--- a/example/general/general.cpp
+++ b/example/general/general.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -74,6 +74,7 @@ extern bool compare_change(void);
 extern bool Compare(void);
 extern bool complex_poly(void);
 extern bool CondExp(void);
+extern bool con_dyn_var(void);
 extern bool Cosh(void);
 extern bool Cos(void);
 extern bool DivEq(void);
@@ -81,7 +82,8 @@ extern bool Div(void);
 extern bool eigen_array(void);
 extern bool eigen_det(void);
 extern bool EqualOpSeq(void);
-extern bool Erf(void);
+extern bool erfc(void);
+extern bool erf(void);
 extern bool expm1(void);
 extern bool exp(void);
 extern bool fabs(void);
@@ -122,9 +124,7 @@ extern bool number_skip(void);
 extern bool NumericType(void);
 extern bool num_limits(void);
 extern bool OdeStiff(void);
-extern bool taylor_ode(void);
 extern bool opt_val_hes(void);
-extern bool con_dyn_var(void);
 extern bool Poly(void);
 extern bool pow_int(void);
 extern bool pow(void);
@@ -148,6 +148,7 @@ extern bool Sub(void);
 extern bool Tanh(void);
 extern bool Tan(void);
 extern bool TapeIndex(void);
+extern bool taylor_ode(void);
 extern bool UnaryMinus(void);
 extern bool UnaryPlus(void);
 extern bool Value(void);
@@ -191,12 +192,14 @@ int main(void)
     Run( Compare,           "Compare"          );
     Run( complex_poly,      "complex_poly"     );
     Run( CondExp,           "CondExp"          );
+    Run( con_dyn_var,       "con_dyn_var"      );
     Run( Cos,               "Cos"              );
     Run( Cosh,              "Cosh"             );
     Run( Div,               "Div"              );
     Run( DivEq,             "DivEq"            );
     Run( EqualOpSeq,        "EqualOpSeq"       );
-    Run( Erf,               "Erf"              );
+    Run( erfc,              "erfc"             );
+    Run( erf,               "erf"              );
     Run( exp,               "exp"              );
     Run( expm1,             "expm1"            );
     Run( fabs,              "fabs"             );
@@ -235,9 +238,7 @@ int main(void)
     Run( NumericType,       "NumericType"      );
     Run( num_limits,        "num_limits"       );
     Run( OdeStiff,          "OdeStiff"         );
-    Run( taylor_ode,        "ode_taylor"       );
     Run( opt_val_hes,       "opt_val_hes"      );
-    Run( con_dyn_var,       "con_dyn_var"      );
     Run( Poly,              "Poly"             );
     Run( pow_int,           "pow_int"          );
     Run( pow,               "pow"              );
@@ -260,6 +261,7 @@ int main(void)
     Run( Tanh,              "Tanh"             );
     Run( Tan,               "Tan"              );
     Run( TapeIndex,         "TapeIndex"        );
+    Run( taylor_ode,        "ode_taylor"       );
     Run( UnaryMinus,        "UnaryMinus"       );
     Run( UnaryPlus,         "UnaryPlus"        );
     Run( Value,             "Value"            );
diff --git a/example/general/makefile.am b/example/general/makefile.am
index e6df2c4ea..ffb32bd81 100644
--- a/example/general/makefile.am
+++ b/example/general/makefile.am
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -88,6 +88,7 @@ general_SOURCES   = \
 	div_eq.cpp \
 	equal_op_seq.cpp \
 	erf.cpp \
+	erfc.cpp \
 	general.cpp \
 	exp.cpp \
 	expm1.cpp \
diff --git a/example/general/makefile.in b/example/general/makefile.in
index dae134c4c..8f9db6c21 100644
--- a/example/general/makefile.in
+++ b/example/general/makefile.in
@@ -1,7 +1,7 @@
-# makefile.in generated by automake 1.15.1 from makefile.am.
+# makefile.in generated by automake 1.16.1 from makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -106,7 +106,7 @@ am__general_SOURCES_DIST = mul_level_adolc.cpp mul_level_adolc_ode.cpp \
 	capacity_order.cpp change_param.cpp check_for_nan.cpp \
 	compare_change.cpp compare.cpp complex_poly.cpp cond_exp.cpp \
 	cos.cpp cosh.cpp div.cpp div_eq.cpp equal_op_seq.cpp erf.cpp \
-	general.cpp exp.cpp expm1.cpp for_one.cpp for_two.cpp \
+	erfc.cpp general.cpp exp.cpp expm1.cpp for_one.cpp for_two.cpp \
 	forward.cpp forward_dir.cpp forward_order.cpp fun_assign.cpp \
 	fun_check.cpp hes_lagrangian.cpp hes_lu_det.cpp \
 	hes_minor_det.cpp hessian.cpp hes_times_dir.cpp \
@@ -141,12 +141,13 @@ am_general_OBJECTS = $(am__objects_1) $(am__objects_2) \
 	compare_change.$(OBJEXT) compare.$(OBJEXT) \
 	complex_poly.$(OBJEXT) cond_exp.$(OBJEXT) cos.$(OBJEXT) \
 	cosh.$(OBJEXT) div.$(OBJEXT) div_eq.$(OBJEXT) \
-	equal_op_seq.$(OBJEXT) erf.$(OBJEXT) general.$(OBJEXT) \
-	exp.$(OBJEXT) expm1.$(OBJEXT) for_one.$(OBJEXT) \
-	for_two.$(OBJEXT) forward.$(OBJEXT) forward_dir.$(OBJEXT) \
-	forward_order.$(OBJEXT) fun_assign.$(OBJEXT) \
-	fun_check.$(OBJEXT) hes_lagrangian.$(OBJEXT) \
-	hes_lu_det.$(OBJEXT) hes_minor_det.$(OBJEXT) hessian.$(OBJEXT) \
+	equal_op_seq.$(OBJEXT) erf.$(OBJEXT) erfc.$(OBJEXT) \
+	general.$(OBJEXT) exp.$(OBJEXT) expm1.$(OBJEXT) \
+	for_one.$(OBJEXT) for_two.$(OBJEXT) forward.$(OBJEXT) \
+	forward_dir.$(OBJEXT) forward_order.$(OBJEXT) \
+	fun_assign.$(OBJEXT) fun_check.$(OBJEXT) \
+	hes_lagrangian.$(OBJEXT) hes_lu_det.$(OBJEXT) \
+	hes_minor_det.$(OBJEXT) hessian.$(OBJEXT) \
 	hes_times_dir.$(OBJEXT) independent.$(OBJEXT) \
 	integer.$(OBJEXT) interface2c.$(OBJEXT) \
 	interp_onetape.$(OBJEXT) interp_retape.$(OBJEXT) \
@@ -187,7 +188,60 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = 
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/abort_recording.Po \
+	./$(DEPDIR)/acos.Po ./$(DEPDIR)/acosh.Po \
+	./$(DEPDIR)/ad_assign.Po ./$(DEPDIR)/ad_ctor.Po \
+	./$(DEPDIR)/ad_fun.Po ./$(DEPDIR)/ad_in_c.Po \
+	./$(DEPDIR)/ad_input.Po ./$(DEPDIR)/ad_output.Po \
+	./$(DEPDIR)/add.Po ./$(DEPDIR)/add_eq.Po ./$(DEPDIR)/asin.Po \
+	./$(DEPDIR)/asinh.Po ./$(DEPDIR)/atan.Po ./$(DEPDIR)/atan2.Po \
+	./$(DEPDIR)/atanh.Po ./$(DEPDIR)/azmul.Po \
+	./$(DEPDIR)/base2ad.Po ./$(DEPDIR)/base_require.Po \
+	./$(DEPDIR)/bender_quad.Po ./$(DEPDIR)/bool_fun.Po \
+	./$(DEPDIR)/capacity_order.Po ./$(DEPDIR)/change_param.Po \
+	./$(DEPDIR)/check_for_nan.Po ./$(DEPDIR)/compare.Po \
+	./$(DEPDIR)/compare_change.Po ./$(DEPDIR)/complex_poly.Po \
+	./$(DEPDIR)/con_dyn_var.Po ./$(DEPDIR)/cond_exp.Po \
+	./$(DEPDIR)/cos.Po ./$(DEPDIR)/cosh.Po ./$(DEPDIR)/div.Po \
+	./$(DEPDIR)/div_eq.Po ./$(DEPDIR)/eigen_array.Po \
+	./$(DEPDIR)/eigen_det.Po ./$(DEPDIR)/equal_op_seq.Po \
+	./$(DEPDIR)/erf.Po ./$(DEPDIR)/erfc.Po ./$(DEPDIR)/exp.Po \
+	./$(DEPDIR)/expm1.Po ./$(DEPDIR)/fabs.Po \
+	./$(DEPDIR)/for_one.Po ./$(DEPDIR)/for_two.Po \
+	./$(DEPDIR)/forward.Po ./$(DEPDIR)/forward_dir.Po \
+	./$(DEPDIR)/forward_order.Po ./$(DEPDIR)/fun_assign.Po \
+	./$(DEPDIR)/fun_check.Po ./$(DEPDIR)/general.Po \
+	./$(DEPDIR)/hes_lagrangian.Po ./$(DEPDIR)/hes_lu_det.Po \
+	./$(DEPDIR)/hes_minor_det.Po ./$(DEPDIR)/hes_times_dir.Po \
+	./$(DEPDIR)/hessian.Po ./$(DEPDIR)/independent.Po \
+	./$(DEPDIR)/integer.Po ./$(DEPDIR)/interface2c.Po \
+	./$(DEPDIR)/interp_onetape.Po ./$(DEPDIR)/interp_retape.Po \
+	./$(DEPDIR)/jac_lu_det.Po ./$(DEPDIR)/jac_minor_det.Po \
+	./$(DEPDIR)/jacobian.Po ./$(DEPDIR)/log.Po \
+	./$(DEPDIR)/log10.Po ./$(DEPDIR)/log1p.Po \
+	./$(DEPDIR)/lu_ratio.Po ./$(DEPDIR)/lu_vec_ad.Po \
+	./$(DEPDIR)/lu_vec_ad_ok.Po ./$(DEPDIR)/mul.Po \
+	./$(DEPDIR)/mul_eq.Po ./$(DEPDIR)/mul_level.Po \
+	./$(DEPDIR)/mul_level_adolc.Po \
+	./$(DEPDIR)/mul_level_adolc_ode.Po \
+	./$(DEPDIR)/mul_level_ode.Po ./$(DEPDIR)/near_equal_ext.Po \
+	./$(DEPDIR)/new_dynamic.Po ./$(DEPDIR)/num_limits.Po \
+	./$(DEPDIR)/number_skip.Po ./$(DEPDIR)/numeric_type.Po \
+	./$(DEPDIR)/ode_stiff.Po ./$(DEPDIR)/opt_val_hes.Po \
+	./$(DEPDIR)/poly.Po ./$(DEPDIR)/pow.Po ./$(DEPDIR)/pow_int.Po \
+	./$(DEPDIR)/print_for.Po ./$(DEPDIR)/rev_one.Po \
+	./$(DEPDIR)/rev_two.Po ./$(DEPDIR)/reverse_checkpoint.Po \
+	./$(DEPDIR)/reverse_one.Po ./$(DEPDIR)/reverse_three.Po \
+	./$(DEPDIR)/reverse_two.Po ./$(DEPDIR)/rosen_34.Po \
+	./$(DEPDIR)/runge45_2.Po ./$(DEPDIR)/seq_property.Po \
+	./$(DEPDIR)/sign.Po ./$(DEPDIR)/sin.Po ./$(DEPDIR)/sinh.Po \
+	./$(DEPDIR)/sqrt.Po ./$(DEPDIR)/stack_machine.Po \
+	./$(DEPDIR)/sub.Po ./$(DEPDIR)/sub_eq.Po ./$(DEPDIR)/tan.Po \
+	./$(DEPDIR)/tanh.Po ./$(DEPDIR)/tape_index.Po \
+	./$(DEPDIR)/taylor_ode.Po ./$(DEPDIR)/unary_minus.Po \
+	./$(DEPDIR)/unary_plus.Po ./$(DEPDIR)/value.Po \
+	./$(DEPDIR)/var2par.Po ./$(DEPDIR)/vec_ad.Po
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -270,7 +324,7 @@ CXX_FLAGS = @CXX_FLAGS@
 CYGPATH_W = @CYGPATH_W@
 
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -483,6 +537,7 @@ general_SOURCES = \
 	div_eq.cpp \
 	equal_op_seq.cpp \
 	erf.cpp \
+	erfc.cpp \
 	general.cpp \
 	exp.cpp \
 	expm1.cpp \
@@ -576,8 +631,8 @@ makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
 	  *config.status*) \
 	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -602,115 +657,122 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abort_recording.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acos.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acosh.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_assign.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_ctor.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_fun.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_in_c.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_input.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_output.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_eq.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asin.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asinh.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atan.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atan2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atanh.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/azmul.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base2ad.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_require.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bender_quad.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bool_fun.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/capacity_order.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/change_param.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_for_nan.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compare.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compare_change.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/complex_poly.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/con_dyn_var.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cond_exp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cos.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cosh.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/div.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/div_eq.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eigen_array.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eigen_det.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/equal_op_seq.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expm1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fabs.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/for_one.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/for_two.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/forward.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/forward_dir.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/forward_order.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fun_assign.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fun_check.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/general.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hes_lagrangian.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hes_lu_det.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hes_minor_det.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hes_times_dir.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hessian.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/independent.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/integer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interface2c.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interp_onetape.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interp_retape.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jac_lu_det.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jac_minor_det.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jacobian.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log10.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log1p.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lu_ratio.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lu_vec_ad.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lu_vec_ad_ok.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul_eq.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul_level.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul_level_adolc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul_level_adolc_ode.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul_level_ode.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/near_equal_ext.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/new_dynamic.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/num_limits.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/number_skip.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numeric_type.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_stiff.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_val_hes.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poly.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_int.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_for.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_one.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_two.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reverse_checkpoint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reverse_one.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reverse_three.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reverse_two.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rosen_34.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runge45_2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seq_property.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sign.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sin.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sinh.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sqrt.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack_machine.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sub.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sub_eq.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tan.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tanh.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape_index.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taylor_ode.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unary_minus.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unary_plus.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/value.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/var2par.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vec_ad.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abort_recording.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acos.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acosh.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_assign.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_ctor.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_fun.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_in_c.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_input.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ad_output.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_eq.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asin.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asinh.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atan.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atan2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atanh.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/azmul.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base2ad.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_require.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bender_quad.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bool_fun.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/capacity_order.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/change_param.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_for_nan.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compare.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compare_change.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/complex_poly.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/con_dyn_var.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cond_exp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cos.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cosh.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/div.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/div_eq.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eigen_array.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eigen_det.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/equal_op_seq.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erfc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expm1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fabs.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/for_one.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/for_two.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/forward.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/forward_dir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/forward_order.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fun_assign.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fun_check.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/general.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hes_lagrangian.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hes_lu_det.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hes_minor_det.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hes_times_dir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hessian.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/independent.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/integer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interface2c.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interp_onetape.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interp_retape.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jac_lu_det.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jac_minor_det.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jacobian.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log10.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log1p.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lu_ratio.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lu_vec_ad.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lu_vec_ad_ok.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul_eq.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul_level.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul_level_adolc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul_level_adolc_ode.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mul_level_ode.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/near_equal_ext.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/new_dynamic.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/num_limits.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/number_skip.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numeric_type.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_stiff.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt_val_hes.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poly.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pow_int.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_for.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_one.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_two.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reverse_checkpoint.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reverse_one.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reverse_three.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reverse_two.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rosen_34.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runge45_2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seq_property.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sign.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sin.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sinh.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sqrt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack_machine.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sub.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sub_eq.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tan.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tanh.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape_index.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taylor_ode.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unary_minus.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unary_plus.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/value.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/var2par.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vec_ad.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+	@$(MKDIR_P) $(@D)
+	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -780,7 +842,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -850,7 +915,116 @@ clean: clean-am
 clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/abort_recording.Po
+	-rm -f ./$(DEPDIR)/acos.Po
+	-rm -f ./$(DEPDIR)/acosh.Po
+	-rm -f ./$(DEPDIR)/ad_assign.Po
+	-rm -f ./$(DEPDIR)/ad_ctor.Po
+	-rm -f ./$(DEPDIR)/ad_fun.Po
+	-rm -f ./$(DEPDIR)/ad_in_c.Po
+	-rm -f ./$(DEPDIR)/ad_input.Po
+	-rm -f ./$(DEPDIR)/ad_output.Po
+	-rm -f ./$(DEPDIR)/add.Po
+	-rm -f ./$(DEPDIR)/add_eq.Po
+	-rm -f ./$(DEPDIR)/asin.Po
+	-rm -f ./$(DEPDIR)/asinh.Po
+	-rm -f ./$(DEPDIR)/atan.Po
+	-rm -f ./$(DEPDIR)/atan2.Po
+	-rm -f ./$(DEPDIR)/atanh.Po
+	-rm -f ./$(DEPDIR)/azmul.Po
+	-rm -f ./$(DEPDIR)/base2ad.Po
+	-rm -f ./$(DEPDIR)/base_require.Po
+	-rm -f ./$(DEPDIR)/bender_quad.Po
+	-rm -f ./$(DEPDIR)/bool_fun.Po
+	-rm -f ./$(DEPDIR)/capacity_order.Po
+	-rm -f ./$(DEPDIR)/change_param.Po
+	-rm -f ./$(DEPDIR)/check_for_nan.Po
+	-rm -f ./$(DEPDIR)/compare.Po
+	-rm -f ./$(DEPDIR)/compare_change.Po
+	-rm -f ./$(DEPDIR)/complex_poly.Po
+	-rm -f ./$(DEPDIR)/con_dyn_var.Po
+	-rm -f ./$(DEPDIR)/cond_exp.Po
+	-rm -f ./$(DEPDIR)/cos.Po
+	-rm -f ./$(DEPDIR)/cosh.Po
+	-rm -f ./$(DEPDIR)/div.Po
+	-rm -f ./$(DEPDIR)/div_eq.Po
+	-rm -f ./$(DEPDIR)/eigen_array.Po
+	-rm -f ./$(DEPDIR)/eigen_det.Po
+	-rm -f ./$(DEPDIR)/equal_op_seq.Po
+	-rm -f ./$(DEPDIR)/erf.Po
+	-rm -f ./$(DEPDIR)/erfc.Po
+	-rm -f ./$(DEPDIR)/exp.Po
+	-rm -f ./$(DEPDIR)/expm1.Po
+	-rm -f ./$(DEPDIR)/fabs.Po
+	-rm -f ./$(DEPDIR)/for_one.Po
+	-rm -f ./$(DEPDIR)/for_two.Po
+	-rm -f ./$(DEPDIR)/forward.Po
+	-rm -f ./$(DEPDIR)/forward_dir.Po
+	-rm -f ./$(DEPDIR)/forward_order.Po
+	-rm -f ./$(DEPDIR)/fun_assign.Po
+	-rm -f ./$(DEPDIR)/fun_check.Po
+	-rm -f ./$(DEPDIR)/general.Po
+	-rm -f ./$(DEPDIR)/hes_lagrangian.Po
+	-rm -f ./$(DEPDIR)/hes_lu_det.Po
+	-rm -f ./$(DEPDIR)/hes_minor_det.Po
+	-rm -f ./$(DEPDIR)/hes_times_dir.Po
+	-rm -f ./$(DEPDIR)/hessian.Po
+	-rm -f ./$(DEPDIR)/independent.Po
+	-rm -f ./$(DEPDIR)/integer.Po
+	-rm -f ./$(DEPDIR)/interface2c.Po
+	-rm -f ./$(DEPDIR)/interp_onetape.Po
+	-rm -f ./$(DEPDIR)/interp_retape.Po
+	-rm -f ./$(DEPDIR)/jac_lu_det.Po
+	-rm -f ./$(DEPDIR)/jac_minor_det.Po
+	-rm -f ./$(DEPDIR)/jacobian.Po
+	-rm -f ./$(DEPDIR)/log.Po
+	-rm -f ./$(DEPDIR)/log10.Po
+	-rm -f ./$(DEPDIR)/log1p.Po
+	-rm -f ./$(DEPDIR)/lu_ratio.Po
+	-rm -f ./$(DEPDIR)/lu_vec_ad.Po
+	-rm -f ./$(DEPDIR)/lu_vec_ad_ok.Po
+	-rm -f ./$(DEPDIR)/mul.Po
+	-rm -f ./$(DEPDIR)/mul_eq.Po
+	-rm -f ./$(DEPDIR)/mul_level.Po
+	-rm -f ./$(DEPDIR)/mul_level_adolc.Po
+	-rm -f ./$(DEPDIR)/mul_level_adolc_ode.Po
+	-rm -f ./$(DEPDIR)/mul_level_ode.Po
+	-rm -f ./$(DEPDIR)/near_equal_ext.Po
+	-rm -f ./$(DEPDIR)/new_dynamic.Po
+	-rm -f ./$(DEPDIR)/num_limits.Po
+	-rm -f ./$(DEPDIR)/number_skip.Po
+	-rm -f ./$(DEPDIR)/numeric_type.Po
+	-rm -f ./$(DEPDIR)/ode_stiff.Po
+	-rm -f ./$(DEPDIR)/opt_val_hes.Po
+	-rm -f ./$(DEPDIR)/poly.Po
+	-rm -f ./$(DEPDIR)/pow.Po
+	-rm -f ./$(DEPDIR)/pow_int.Po
+	-rm -f ./$(DEPDIR)/print_for.Po
+	-rm -f ./$(DEPDIR)/rev_one.Po
+	-rm -f ./$(DEPDIR)/rev_two.Po
+	-rm -f ./$(DEPDIR)/reverse_checkpoint.Po
+	-rm -f ./$(DEPDIR)/reverse_one.Po
+	-rm -f ./$(DEPDIR)/reverse_three.Po
+	-rm -f ./$(DEPDIR)/reverse_two.Po
+	-rm -f ./$(DEPDIR)/rosen_34.Po
+	-rm -f ./$(DEPDIR)/runge45_2.Po
+	-rm -f ./$(DEPDIR)/seq_property.Po
+	-rm -f ./$(DEPDIR)/sign.Po
+	-rm -f ./$(DEPDIR)/sin.Po
+	-rm -f ./$(DEPDIR)/sinh.Po
+	-rm -f ./$(DEPDIR)/sqrt.Po
+	-rm -f ./$(DEPDIR)/stack_machine.Po
+	-rm -f ./$(DEPDIR)/sub.Po
+	-rm -f ./$(DEPDIR)/sub_eq.Po
+	-rm -f ./$(DEPDIR)/tan.Po
+	-rm -f ./$(DEPDIR)/tanh.Po
+	-rm -f ./$(DEPDIR)/tape_index.Po
+	-rm -f ./$(DEPDIR)/taylor_ode.Po
+	-rm -f ./$(DEPDIR)/unary_minus.Po
+	-rm -f ./$(DEPDIR)/unary_plus.Po
+	-rm -f ./$(DEPDIR)/value.Po
+	-rm -f ./$(DEPDIR)/var2par.Po
+	-rm -f ./$(DEPDIR)/vec_ad.Po
 	-rm -f makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -896,7 +1070,116 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/abort_recording.Po
+	-rm -f ./$(DEPDIR)/acos.Po
+	-rm -f ./$(DEPDIR)/acosh.Po
+	-rm -f ./$(DEPDIR)/ad_assign.Po
+	-rm -f ./$(DEPDIR)/ad_ctor.Po
+	-rm -f ./$(DEPDIR)/ad_fun.Po
+	-rm -f ./$(DEPDIR)/ad_in_c.Po
+	-rm -f ./$(DEPDIR)/ad_input.Po
+	-rm -f ./$(DEPDIR)/ad_output.Po
+	-rm -f ./$(DEPDIR)/add.Po
+	-rm -f ./$(DEPDIR)/add_eq.Po
+	-rm -f ./$(DEPDIR)/asin.Po
+	-rm -f ./$(DEPDIR)/asinh.Po
+	-rm -f ./$(DEPDIR)/atan.Po
+	-rm -f ./$(DEPDIR)/atan2.Po
+	-rm -f ./$(DEPDIR)/atanh.Po
+	-rm -f ./$(DEPDIR)/azmul.Po
+	-rm -f ./$(DEPDIR)/base2ad.Po
+	-rm -f ./$(DEPDIR)/base_require.Po
+	-rm -f ./$(DEPDIR)/bender_quad.Po
+	-rm -f ./$(DEPDIR)/bool_fun.Po
+	-rm -f ./$(DEPDIR)/capacity_order.Po
+	-rm -f ./$(DEPDIR)/change_param.Po
+	-rm -f ./$(DEPDIR)/check_for_nan.Po
+	-rm -f ./$(DEPDIR)/compare.Po
+	-rm -f ./$(DEPDIR)/compare_change.Po
+	-rm -f ./$(DEPDIR)/complex_poly.Po
+	-rm -f ./$(DEPDIR)/con_dyn_var.Po
+	-rm -f ./$(DEPDIR)/cond_exp.Po
+	-rm -f ./$(DEPDIR)/cos.Po
+	-rm -f ./$(DEPDIR)/cosh.Po
+	-rm -f ./$(DEPDIR)/div.Po
+	-rm -f ./$(DEPDIR)/div_eq.Po
+	-rm -f ./$(DEPDIR)/eigen_array.Po
+	-rm -f ./$(DEPDIR)/eigen_det.Po
+	-rm -f ./$(DEPDIR)/equal_op_seq.Po
+	-rm -f ./$(DEPDIR)/erf.Po
+	-rm -f ./$(DEPDIR)/erfc.Po
+	-rm -f ./$(DEPDIR)/exp.Po
+	-rm -f ./$(DEPDIR)/expm1.Po
+	-rm -f ./$(DEPDIR)/fabs.Po
+	-rm -f ./$(DEPDIR)/for_one.Po
+	-rm -f ./$(DEPDIR)/for_two.Po
+	-rm -f ./$(DEPDIR)/forward.Po
+	-rm -f ./$(DEPDIR)/forward_dir.Po
+	-rm -f ./$(DEPDIR)/forward_order.Po
+	-rm -f ./$(DEPDIR)/fun_assign.Po
+	-rm -f ./$(DEPDIR)/fun_check.Po
+	-rm -f ./$(DEPDIR)/general.Po
+	-rm -f ./$(DEPDIR)/hes_lagrangian.Po
+	-rm -f ./$(DEPDIR)/hes_lu_det.Po
+	-rm -f ./$(DEPDIR)/hes_minor_det.Po
+	-rm -f ./$(DEPDIR)/hes_times_dir.Po
+	-rm -f ./$(DEPDIR)/hessian.Po
+	-rm -f ./$(DEPDIR)/independent.Po
+	-rm -f ./$(DEPDIR)/integer.Po
+	-rm -f ./$(DEPDIR)/interface2c.Po
+	-rm -f ./$(DEPDIR)/interp_onetape.Po
+	-rm -f ./$(DEPDIR)/interp_retape.Po
+	-rm -f ./$(DEPDIR)/jac_lu_det.Po
+	-rm -f ./$(DEPDIR)/jac_minor_det.Po
+	-rm -f ./$(DEPDIR)/jacobian.Po
+	-rm -f ./$(DEPDIR)/log.Po
+	-rm -f ./$(DEPDIR)/log10.Po
+	-rm -f ./$(DEPDIR)/log1p.Po
+	-rm -f ./$(DEPDIR)/lu_ratio.Po
+	-rm -f ./$(DEPDIR)/lu_vec_ad.Po
+	-rm -f ./$(DEPDIR)/lu_vec_ad_ok.Po
+	-rm -f ./$(DEPDIR)/mul.Po
+	-rm -f ./$(DEPDIR)/mul_eq.Po
+	-rm -f ./$(DEPDIR)/mul_level.Po
+	-rm -f ./$(DEPDIR)/mul_level_adolc.Po
+	-rm -f ./$(DEPDIR)/mul_level_adolc_ode.Po
+	-rm -f ./$(DEPDIR)/mul_level_ode.Po
+	-rm -f ./$(DEPDIR)/near_equal_ext.Po
+	-rm -f ./$(DEPDIR)/new_dynamic.Po
+	-rm -f ./$(DEPDIR)/num_limits.Po
+	-rm -f ./$(DEPDIR)/number_skip.Po
+	-rm -f ./$(DEPDIR)/numeric_type.Po
+	-rm -f ./$(DEPDIR)/ode_stiff.Po
+	-rm -f ./$(DEPDIR)/opt_val_hes.Po
+	-rm -f ./$(DEPDIR)/poly.Po
+	-rm -f ./$(DEPDIR)/pow.Po
+	-rm -f ./$(DEPDIR)/pow_int.Po
+	-rm -f ./$(DEPDIR)/print_for.Po
+	-rm -f ./$(DEPDIR)/rev_one.Po
+	-rm -f ./$(DEPDIR)/rev_two.Po
+	-rm -f ./$(DEPDIR)/reverse_checkpoint.Po
+	-rm -f ./$(DEPDIR)/reverse_one.Po
+	-rm -f ./$(DEPDIR)/reverse_three.Po
+	-rm -f ./$(DEPDIR)/reverse_two.Po
+	-rm -f ./$(DEPDIR)/rosen_34.Po
+	-rm -f ./$(DEPDIR)/runge45_2.Po
+	-rm -f ./$(DEPDIR)/seq_property.Po
+	-rm -f ./$(DEPDIR)/sign.Po
+	-rm -f ./$(DEPDIR)/sin.Po
+	-rm -f ./$(DEPDIR)/sinh.Po
+	-rm -f ./$(DEPDIR)/sqrt.Po
+	-rm -f ./$(DEPDIR)/stack_machine.Po
+	-rm -f ./$(DEPDIR)/sub.Po
+	-rm -f ./$(DEPDIR)/sub_eq.Po
+	-rm -f ./$(DEPDIR)/tan.Po
+	-rm -f ./$(DEPDIR)/tanh.Po
+	-rm -f ./$(DEPDIR)/tape_index.Po
+	-rm -f ./$(DEPDIR)/taylor_ode.Po
+	-rm -f ./$(DEPDIR)/unary_minus.Po
+	-rm -f ./$(DEPDIR)/unary_plus.Po
+	-rm -f ./$(DEPDIR)/value.Po
+	-rm -f ./$(DEPDIR)/var2par.Po
+	-rm -f ./$(DEPDIR)/vec_ad.Po
 	-rm -f makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -916,7 +1199,7 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
 	clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \
 	distclean distclean-compile distclean-generic distclean-tags \
 	distdir dvi dvi-am html html-am info info-am install \
diff --git a/example/general/mul_level.cpp b/example/general/mul_level.cpp
index 5b01a52b9..c155de6e1 100644
--- a/example/general/mul_level.cpp
+++ b/example/general/mul_level.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -21,6 +21,9 @@ $$
 
 $section Multiple Level of AD: Example and Test$$
 
+$head See Also$$
+$cref base2ad.cpp$$
+
 $head Purpose$$
 In this example, we use $code AD< AD<double> >$$ (level two taping),
 the compute values of the function $latex f : \B{R}^n \rightarrow \B{R}$$ where
diff --git a/example/get_started/makefile.in b/example/get_started/makefile.in
index 9b2e8c67b..9eba69066 100644
--- a/example/get_started/makefile.in
+++ b/example/get_started/makefile.in
@@ -1,7 +1,7 @@
-# makefile.in generated by automake 1.15.1 from makefile.am.
+# makefile.in generated by automake 1.16.1 from makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -114,7 +114,8 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = 
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/get_started.Po
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -363,8 +364,8 @@ makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
 	  *config.status*) \
 	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -389,7 +390,13 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_started.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_started.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+	@$(MKDIR_P) $(@D)
+	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -459,7 +466,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -529,7 +539,7 @@ clean: clean-am
 clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/get_started.Po
 	-rm -f makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -575,7 +585,7 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/get_started.Po
 	-rm -f makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -595,7 +605,7 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
 	clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \
 	distclean distclean-compile distclean-generic distclean-tags \
 	distdir dvi dvi-am html html-am info info-am install \
diff --git a/example/ipopt_solve/CMakeLists.txt b/example/ipopt_solve/CMakeLists.txt
index 1cae85445..72427cbb0 100644
--- a/example/ipopt_solve/CMakeLists.txt
+++ b/example/ipopt_solve/CMakeLists.txt
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -14,12 +14,15 @@
 # Local link directories to search, as determined by pkg-config for ipopt
 LINK_DIRECTORIES( ${ipopt_LIBRARY_DIRS} )
 #
+# BEGIN_SORT_THIS_LINE_PLUS_2
 SET(source_list
     get_started.cpp
     ipopt_solve.cpp
     ode_inverse.cpp
     retape.cpp
 )
+# END_SORT_THIS_LINE_MINUS_2
+
 set_compile_flags( example_ipopt_solve "${cppad_debug_which}" "${source_list}" )
 #
 ADD_EXECUTABLE(example_ipopt_solve EXCLUDE_FROM_ALL ${source_list})
diff --git a/example/ipopt_solve/makefile.in b/example/ipopt_solve/makefile.in
index b1586bf4f..43ede56fc 100644
--- a/example/ipopt_solve/makefile.in
+++ b/example/ipopt_solve/makefile.in
@@ -1,7 +1,7 @@
-# makefile.in generated by automake 1.15.1 from makefile.am.
+# makefile.in generated by automake 1.16.1 from makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -118,7 +118,10 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = 
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/get_started.Po \
+	./$(DEPDIR)/ipopt_solve.Po ./$(DEPDIR)/ode_inverse.Po \
+	./$(DEPDIR)/retape.Po
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -381,8 +384,8 @@ makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
 	  *config.status*) \
 	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -409,10 +412,16 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_started.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipopt_solve.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_inverse.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/retape.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_started.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipopt_solve.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_inverse.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/retape.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+	@$(MKDIR_P) $(@D)
+	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -482,7 +491,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -552,7 +564,10 @@ clean: clean-am
 clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/get_started.Po
+	-rm -f ./$(DEPDIR)/ipopt_solve.Po
+	-rm -f ./$(DEPDIR)/ode_inverse.Po
+	-rm -f ./$(DEPDIR)/retape.Po
 	-rm -f makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -598,7 +613,10 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/get_started.Po
+	-rm -f ./$(DEPDIR)/ipopt_solve.Po
+	-rm -f ./$(DEPDIR)/ode_inverse.Po
+	-rm -f ./$(DEPDIR)/retape.Po
 	-rm -f makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -618,7 +636,7 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
 	clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \
 	distclean distclean-compile distclean-generic distclean-tags \
 	distdir dvi dvi-am html html-am info info-am install \
diff --git a/example/json/CMakeLists.txt b/example/json/CMakeLists.txt
new file mode 100644
index 000000000..bb4e247d6
--- /dev/null
+++ b/example/json/CMakeLists.txt
@@ -0,0 +1,68 @@
+# -----------------------------------------------------------------------------
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+#
+# CppAD is distributed under the terms of the
+#              Eclipse Public License Version 2.0.
+#
+# This Source Code may also be made available under the following
+# Secondary License when the conditions for such availability set forth
+# in the Eclipse Public License, Version 2.0 are satisfied:
+#       GNU General Public License, Version 2.0 or later.
+# -----------------------------------------------------------------------------
+#
+# BEGIN_SORT_THIS_LINE_PLUS_2
+SET(source_list
+    abs_op.cpp
+    acosh_op.cpp
+    acos_op.cpp
+    add_op.cpp
+    asinh_op.cpp
+    asin_op.cpp
+    atanh_op.cpp
+    atan_op.cpp
+    atom_op.cpp
+    cosh_op.cpp
+    cos_op.cpp
+    div_op.cpp
+    erfc_op.cpp
+    erf_op.cpp
+    expm1_op.cpp
+    exp_op.cpp
+    from_json.cpp
+    json.cpp
+    log1p_op.cpp
+    log_op.cpp
+    mul_op.cpp
+    sign_op.cpp
+    sinh_op.cpp
+    sin_op.cpp
+    sparse.cpp
+    sqrt_op.cpp
+    sub_op.cpp
+    sum_op.cpp
+    tanh_op.cpp
+    tan_op.cpp
+    to_json.cpp
+)
+# END_SORT_THIS_LINE_MINUS_2
+
+set_compile_flags(example_json "${cppad_debug_which}" "${source_list}" )
+#
+ADD_EXECUTABLE(example_json EXCLUDE_FROM_ALL ${source_list})
+
+# List of libraries to be linked into the specified target
+TARGET_LINK_LIBRARIES(example_json
+    ${cppad_lib}
+    ${colpack_libs}
+)
+#
+# Add the check_example_json target
+ADD_CUSTOM_TARGET(check_example_json
+    example_json
+    DEPENDS example_json
+)
+MESSAGE(STATUS "make check_example_json: available")
+#
+# add to check check_example_depends in parent environment
+add_to_list(check_example_depends check_example_json)
+SET(check_example_depends "${check_example_depends}" PARENT_SCOPE)
diff --git a/example/json/abs_op.cpp b/example/json/abs_op.cpp
new file mode 100644
index 000000000..0175b9f9a
--- /dev/null
+++ b/example/json/abs_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_abs_op.cpp$$
+$spell
+    abs
+    Json
+$$
+
+$section Json abs Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/abs_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool abs_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : abs(p[0])
+    // node_5 : abs(x[0])
+    // node_6 : abs(c[0])
+    // node_7 : abs(p[0]) + abs(x[0]) + abs(c[0])
+    // y[0]   = abs(p[0]) + abs(x[0]) + abs(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'abs_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'abs', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'            } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ -0.1 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // abs(p[0])
+        "       [ 1, 2]                ,\n" // abs(x[0])
+        "       [ 1, 3]                ,\n" // abs(c[0])
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // abs(p[0])+abs(x[0])+abs(c[0])
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = abs(p_0) + abs(x_0) + abs(c_0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = -0.1;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = 0.2;
+    x[0] = 0.3;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = std::fabs(p[0]) + std::fabs(x[0]) + std::fabs(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/acos_op.cpp b/example/json/acos_op.cpp
new file mode 100644
index 000000000..1768da512
--- /dev/null
+++ b/example/json/acos_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_acos_op.cpp$$
+$spell
+    acos
+    Json
+$$
+
+$section Json acos Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/acos_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool acos_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : acos(p[0])
+    // node_5 : acos(x[0])
+    // node_6 : acos(c[0])
+    // node_7 : acos(p[0]) + acos(x[0]) + acos(c[0])
+    // y[0]   = acos(p[0]) + acos(x[0]) + acos(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'acos_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'acos', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'             } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ -0.1 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // acos(p[0])
+        "       [ 1, 2]                ,\n" // acos(x[0])
+        "       [ 1, 3]                ,\n" // acos(c[0])
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // acos(p[0])+acos(x[0])+acos(c[0])
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = acos(p_0) + acos(x_0) + acos(c_0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = -0.1;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = 0.2;
+    x[0] = 0.3;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = std::acos(p[0]) + std::acos(x[0]) + std::acos(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/acosh_op.cpp b/example/json/acosh_op.cpp
new file mode 100644
index 000000000..dbafcc063
--- /dev/null
+++ b/example/json/acosh_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_acosh_op.cpp$$
+$spell
+    acosh
+    Json
+$$
+
+$section Json acosh Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/acosh_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool acosh_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : acosh(p[0])
+    // node_5 : acosh(x[0])
+    // node_6 : acosh(c[0])
+    // node_7 : acosh(p[0]) + acosh(x[0]) + acosh(c[0])
+    // y[0]   = acosh(p[0]) + acosh(x[0]) + acosh(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'acosh_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'acosh', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'              } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ 1.3 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // acosh(p0)
+        "       [ 1, 2]                ,\n" // acosh(x0)
+        "       [ 1, 3]                ,\n" // acosh(c0)
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // acosh(p0)+acosh(x0)+acosh(c0)
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = acosh(p0) + acosh(x0) + acosh(c0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = 1.3;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = 1.1;
+    x[0] = 1.2;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = CppAD::acosh(p[0]) + CppAD::acosh(x[0]) + CppAD::acosh(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/add_op.cpp b/example/json/add_op.cpp
new file mode 100644
index 000000000..ee27cdae5
--- /dev/null
+++ b/example/json/add_op.cpp
@@ -0,0 +1,84 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_add_op.cpp$$
+$spell
+    add
+    Json
+$$
+
+$section Json add Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/add_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool add_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : p[1]
+    // node_3 : x[0]
+    // node_4 : p[0] + p[1]
+    // node_5 : x[0] + ( p[0] + p[1] )
+    // y[0]   = x[0] + ( p[0] + p[1] )
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'add_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'add', 'n_arg':2 } ,\n"
+        "       { 'op_code':2, 'name':'sub', 'n_arg':2 } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 2,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 0, [ ],\n"
+        "   'op_usage_vec'   : 2, [\n"
+        "       [ 1, 1, 2 ] ,\n" // p[0] + p[1]
+        "       [ 1, 3, 4 ] ]\n" // x[0] + ( p[0] + p[1] )
+        "   ,\n"
+        "   'dependent_vec' : 1, [5]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = x_0 + ( p_0 + p_1 )
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 2;
+    //
+    // set independent variables and parameters
+    vector<double> p(2), x(1);
+    p[0] = 2.0;
+    p[1] = 3.0;
+    x[0] = 4.0;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    ok &= y[0] == x[0] + ( p[0] + p[1] );
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/asin_op.cpp b/example/json/asin_op.cpp
new file mode 100644
index 000000000..feffd0c0c
--- /dev/null
+++ b/example/json/asin_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_asin_op.cpp$$
+$spell
+    asin
+    Json
+$$
+
+$section Json asin Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/asin_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool asin_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : asin(p[0])
+    // node_5 : asin(x[0])
+    // node_6 : asin(c[0])
+    // node_7 : asin(p[0]) + asin(x[0]) + asin(c[0])
+    // y[0]   = asin(p[0]) + asin(x[0]) + asin(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'asin_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'asin', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'             } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ -0.1 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // asin(p[0])
+        "       [ 1, 2]                ,\n" // asin(x[0])
+        "       [ 1, 3]                ,\n" // asin(c[0])
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // asin(p[0])+asin(x[0])+asin(c[0])
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = asin(p_0) + asin(x_0) + asin(c_0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = -0.1;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = 0.2;
+    x[0] = 0.3;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = std::asin(p[0]) + std::asin(x[0]) + std::asin(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/asinh_op.cpp b/example/json/asinh_op.cpp
new file mode 100644
index 000000000..776751717
--- /dev/null
+++ b/example/json/asinh_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_asinh_op.cpp$$
+$spell
+    asinh
+    Json
+$$
+
+$section Json asinh Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/asinh_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool asinh_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : asinh(p[0])
+    // node_5 : asinh(x[0])
+    // node_6 : asinh(c[0])
+    // node_7 : asinh(p[0]) + asinh(x[0]) + asinh(c[0])
+    // y[0]   = asinh(p[0]) + asinh(x[0]) + asinh(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'asinh_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'asinh', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'              } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ 0.3 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // asinh(p0)
+        "       [ 1, 2]                ,\n" // asinh(x0)
+        "       [ 1, 3]                ,\n" // asinh(c0)
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // asinh(p0)+asinh(x0)+asinh(c0)
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = asinh(p0) + asinh(x0) + asinh(c0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = 0.3;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = -0.1;
+    x[0] = 0.2;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = CppAD::asinh(p[0]) + CppAD::asinh(x[0]) + CppAD::asinh(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/atan_op.cpp b/example/json/atan_op.cpp
new file mode 100644
index 000000000..6ae547017
--- /dev/null
+++ b/example/json/atan_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_atan_op.cpp$$
+$spell
+    atan
+    Json
+$$
+
+$section Json atan Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/atan_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool atan_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : atan(p[0])
+    // node_5 : atan(x[0])
+    // node_6 : atan(c[0])
+    // node_7 : atan(p[0]) + atan(x[0]) + atan(c[0])
+    // y[0]   = atan(p[0]) + atan(x[0]) + atan(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'atan_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'atan', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'             } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ -0.1 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // atan(p[0])
+        "       [ 1, 2]                ,\n" // atan(x[0])
+        "       [ 1, 3]                ,\n" // atan(c[0])
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // atan(p[0])+atan(x[0])+atan(c[0])
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = atan(p_0) + atan(x_0) + atan(c_0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = -0.1;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = 0.2;
+    x[0] = 0.3;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = std::atan(p[0]) + std::atan(x[0]) + std::atan(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/atanh_op.cpp b/example/json/atanh_op.cpp
new file mode 100644
index 000000000..19f49e30a
--- /dev/null
+++ b/example/json/atanh_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_atanh_op.cpp$$
+$spell
+    atanh
+    Json
+$$
+
+$section Json atanh Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/atanh_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool atanh_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : atanh(p[0])
+    // node_5 : atanh(x[0])
+    // node_6 : atanh(c[0])
+    // node_7 : atanh(p[0]) + atanh(x[0]) + atanh(c[0])
+    // y[0]   = atanh(p[0]) + atanh(x[0]) + atanh(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'atanh_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'atanh', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'              } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ 0.3 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // atanh(p0)
+        "       [ 1, 2]                ,\n" // atanh(x0)
+        "       [ 1, 3]                ,\n" // atanh(c0)
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // atanh(p0)+atanh(x0)+atanh(c0)
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = atanh(p0) + atanh(x0) + atanh(c0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = 0.3;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = -0.1;
+    x[0] = 0.2;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = CppAD::atanh(p[0]) + CppAD::atanh(x[0]) + CppAD::atanh(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/atom_op.cpp b/example/json/atom_op.cpp
new file mode 100644
index 000000000..37ea11c9d
--- /dev/null
+++ b/example/json/atom_op.cpp
@@ -0,0 +1,169 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_atom_op.cpp$$
+$spell
+    atom
+    Json
+$$
+
+$section Json Atomic Function Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/atom_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool atom_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    // use single quote in graphs to avoid having to escape double quote
+    //
+    // -----------------------------------------------------------------------
+    // Define f_0 (x_0, x_1; p) = x_1 + p_0 * x_0
+    //
+    // This function does not have an atomic function operator
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : x[1]
+    // node_4 : p[0] * x[0]
+    // node_5 : x[1] + p[0] * x[0]
+    // y[0]   = x[1] + p[0] * x[0]
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'f(x; p)',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'mul', 'n_arg':2 } ,\n"
+        "       { 'op_code':2, 'name':'add', 'n_arg':2 } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"         // p[0]
+        "   'n_independent'  : 2,\n"         // x[0], x[1]
+        "   'constant_vec'   : 0, [ ],\n"
+        "   'op_usage_vec'   : 2, [\n"
+        "       [ 1, 1, 2 ] ,\n" // p[0] * x[0]
+        "       [ 2, 3, 4 ] ]\n" // x[1] + p[0] * x[0]
+        "   ,\n"
+        "   'dependent_vec' : 1, [5]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 2;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // A ckhpoint_two function with name f(x; p) is derived from
+    // an atomic_three fucntion with the same name.
+    bool internal_bool    = false;
+    bool use_hes_sparsity = false;
+    bool use_base2ad      = false;
+    bool use_in_parallel  = false;
+    CppAD::chkpoint_two<double> chk_f(f, "f(x; p)",
+        internal_bool, use_hes_sparsity, use_base2ad, use_in_parallel
+    );
+    // -----------------------------------------------------------------------
+    // g (u_0, u_1; p, q) = f(u_0 + q_0, u_1 + q_1, p)
+    //                    = u_1 + q_1 + p_0 * ( u_0 + q_0 )
+    //
+    // This function has an atomic function operator with name f(x; p)
+    // node_1 : q[0]
+    // node_2 : q[1]
+    // node_3 : u[0]
+    // node_4 : u[1]
+    // node_5 : u[0] + q[0]
+    // node_6 : u[1] + q[1]
+    // node_7 : f( u[0] + q[0], u[1] + q[1]; p)
+    // y[0]   = u[1] + q[1] + p[0] * (u[0]  + q[0])
+    graph =
+        "{\n"
+        "   'function_name'  : 'g(u; p, q)',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'atom'           } ,\n"
+        "       { 'op_code':2, 'name':'add', 'n_arg':2 } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 2,\n"              // q[0], q[1]
+        "   'n_independent'  : 2,\n"              // u[0], u[1]
+        "   'constant_vec'   : 0, [ ],\n"
+        "   'op_usage_vec'   : 3, [\n"
+        "       [ 2, 3, 1 ]                      ,\n" // u[0] + q[0]
+        "       [ 2, 4, 2 ]                      ,\n" // u[1] + q[1]
+        // f(u_0 + q_0, u_1 + q_1; p) =  u[1] + q[1] + p[0] * (u[0]  + q[0])
+        "       [ 1, 'f(x; p)', 1, 2, [ 5, 6 ] ] ]\n"
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    // ------------------------------------------------------------------------
+    CppAD::ADFun<double> g;
+    g.from_json(graph);
+    // ------------------------------------------------------------------------
+    ok &= g.Domain() == 2;
+    ok &= g.Range() == 1;
+    ok &= g.size_dyn_ind() == 2;
+    //
+    // set p in g(u; p, q)
+    vector<double> p(1);
+    p[0] = 2.0;
+    chk_f.new_dynamic(p);
+    //
+    // set q in g(u; p, q)
+    vector<double> q(2);
+    q[0] = 3.0;
+    q[1] = 4.0;
+    g.new_dynamic(q);
+    //
+    // evalute g(u; p, q)
+    vector<double> u(2), y(1);
+    u[0] = 5.0;
+    u[1] = 6.0;
+    y    = g.Forward(0, u);
+    //
+    // check value
+    ok &= y[0] == u[1] + q[1] + p[0] * (u[0]  + q[0]);
+    // ------------------------------------------------------------------------
+    graph = g.to_json();
+    g.from_json(graph);
+    // ------------------------------------------------------------------------
+    ok &= g.Domain() == 2;
+    ok &= g.Range() == 1;
+    ok &= g.size_dyn_ind() == 2;
+    //
+    // set p in g(u; p, q)
+    p[0] = 3.0;
+    chk_f.new_dynamic(p);
+    //
+    // set q in g(u; p, q)
+    q[0] = 4.0;
+    q[1] = 5.0;
+    g.new_dynamic(q);
+    //
+    // evalute g(u; p, q)
+    u[0] = 6.0;
+    u[1] = 7.0;
+    y    = g.Forward(0, u);
+    //
+    // check value
+    ok &= y[0] == u[1] + q[1] + p[0] * (u[0]  + q[0]);
+    // ------------------------------------------------------------------------
+    // std::cout << graph;
+    return ok;
+}
+// END C++
diff --git a/example/json/cos_op.cpp b/example/json/cos_op.cpp
new file mode 100644
index 000000000..b20a97dd2
--- /dev/null
+++ b/example/json/cos_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_cos_op.cpp$$
+$spell
+    cos
+    Json
+$$
+
+$section Json cos Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/cos_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool cos_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : cos(p[0])
+    // node_5 : cos(x[0])
+    // node_6 : cos(c[0])
+    // node_7 : cos(p[0]) + cos(x[0]) + cos(c[0])
+    // y[0]   = cos(p[0]) + cos(x[0]) + cos(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'cos_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'cos', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'            } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ -0.1 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // cos(p[0])
+        "       [ 1, 2]                ,\n" // cos(x[0])
+        "       [ 1, 3]                ,\n" // cos(c[0])
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // cos(p[0])+cos(x[0])+cos(c[0])
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = cos(p_0) + cos(x_0) + cos(c_0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = -0.1;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = 0.2;
+    x[0] = 0.3;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = std::cos(p[0]) + std::cos(x[0]) + std::cos(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/cosh_op.cpp b/example/json/cosh_op.cpp
new file mode 100644
index 000000000..4ef5d4299
--- /dev/null
+++ b/example/json/cosh_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_cosh_op.cpp$$
+$spell
+    cosh
+    Json
+$$
+
+$section Json cosh Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/cosh_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool cosh_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : cosh(p[0])
+    // node_5 : cosh(x[0])
+    // node_6 : cosh(c[0])
+    // node_7 : cosh(p[0]) + cosh(x[0]) + cosh(c[0])
+    // y[0]   = cosh(p[0]) + cosh(x[0]) + cosh(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'cosh_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'cosh', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'             } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ -0.1 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // cosh(p[0])
+        "       [ 1, 2]                ,\n" // cosh(x[0])
+        "       [ 1, 3]                ,\n" // cosh(c[0])
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // cosh(p[0])+cosh(x[0])+cosh(c[0])
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = cosh(p_0) + cosh(x_0) + cosh(c_0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = -0.1;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = 0.2;
+    x[0] = 0.3;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = std::cosh(p[0]) + std::cosh(x[0]) + std::cosh(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/div_op.cpp b/example/json/div_op.cpp
new file mode 100644
index 000000000..72cf19807
--- /dev/null
+++ b/example/json/div_op.cpp
@@ -0,0 +1,87 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_div_op.cpp$$
+$spell
+    div
+    Json
+$$
+
+$section Json div Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/div_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool div_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    using CppAD::NearEqual;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : p[1]
+    // node_3 : x[0]
+    // node_4 : p[0] / p[1]
+    // node_5 : x[0] / ( p[1] / p[0] )
+    // y[0]   = p[0] / p[1]
+    // y[1]   = x[0] / ( p[0] / p[1] )
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'div example',\n"
+        "   'op_define_vec'  : [ 1, [\n"
+        "       { 'op_code':1, 'name':'div', 'n_arg':2 } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 2,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 0, [ ],\n"
+        "   'op_usage_vec'   : 2, [\n"
+        "       [ 1, 1, 2 ] ,\n" // p[0] / p[1]
+        "       [ 1, 3, 4 ] ]\n" // x[0] / ( p[0] / p[1] )
+        "   ,\n"
+        "   'dependent_vec' : 2, [4, 5]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = [ p_0 / p_1 , x_0 * p_1 / p_0 ]
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 2;
+    ok &= f.size_dyn_ind() == 2;
+    //
+    // set independent variables and parameters
+    vector<double> p(2), x(1);
+    p[0] = 2.0;
+    p[1] = 3.0;
+    x[0] = 4.0;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    ok &= NearEqual(y[0] , p[0] / p[1] , eps99, eps99 );
+    ok &= NearEqual(y[1] , x[0] / ( p[0] / p[1] ), eps99, eps99 );
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/erf_op.cpp b/example/json/erf_op.cpp
new file mode 100644
index 000000000..3fdbf4270
--- /dev/null
+++ b/example/json/erf_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_erf_op.cpp$$
+$spell
+    erf
+    Json
+$$
+
+$section Json erf Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/erf_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool erf_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : erf(p[0])
+    // node_5 : erf(x[0])
+    // node_6 : erf(c[0])
+    // node_7 : erf(p[0]) + erf(x[0]) + erf(c[0])
+    // y[0]   = erf(p[0]) + erf(x[0]) + erf(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'erf_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'erf', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'            } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ 0.3 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // erf(p0)
+        "       [ 1, 2]                ,\n" // erf(x0)
+        "       [ 1, 3]                ,\n" // erf(c0)
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // erf(p0)+erf(x0)+erf(c0)
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = erf(p0) + erf(x0) + erf(c0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = 0.3;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = -0.1;
+    x[0] = 0.2;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = CppAD::erf(p[0]) + CppAD::erf(x[0]) + CppAD::erf(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/erfc_op.cpp b/example/json/erfc_op.cpp
new file mode 100644
index 000000000..08b8a53cb
--- /dev/null
+++ b/example/json/erfc_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_erfc_op.cpp$$
+$spell
+    erfc
+    Json
+$$
+
+$section Json erfc Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/erfc_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool erfc_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : erfc(p[0])
+    // node_5 : erfc(x[0])
+    // node_6 : erfc(c[0])
+    // node_7 : erfc(p[0]) + erfc(x[0]) + erfc(c[0])
+    // y[0]   = erfc(p[0]) + erfc(x[0]) + erfc(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'erfc_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'erfc', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'             } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ 0.3 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // erfc(p0)
+        "       [ 1, 2]                ,\n" // erfc(x0)
+        "       [ 1, 3]                ,\n" // erfc(c0)
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // erfc(p0)+erfc(x0)+erfc(c0)
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = erfc(p0) + erfc(x0) + erfc(c0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = 0.3;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = -0.1;
+    x[0] = 0.2;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = CppAD::erfc(p[0]) + CppAD::erfc(x[0]) + CppAD::erfc(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/exp_op.cpp b/example/json/exp_op.cpp
new file mode 100644
index 000000000..538fbd841
--- /dev/null
+++ b/example/json/exp_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_exp_op.cpp$$
+$spell
+    exp
+    Json
+$$
+
+$section Json exp Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/exp_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool exp_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : exp(p[0])
+    // node_5 : exp(x[0])
+    // node_6 : exp(c[0])
+    // node_7 : exp(p[0]) + exp(x[0]) + exp(c[0])
+    // y[0]   = exp(p[0]) + exp(x[0]) + exp(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'exp_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'exp', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'            } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ -0.1 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // exp(p[0])
+        "       [ 1, 2]                ,\n" // exp(x[0])
+        "       [ 1, 3]                ,\n" // exp(c[0])
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // exp(p[0])+exp(x[0])+exp(c[0])
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = exp(p_0) + exp(x_0) + exp(c_0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = -0.1;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = 0.2;
+    x[0] = 0.3;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = std::exp(p[0]) + std::exp(x[0]) + std::exp(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/expm1_op.cpp b/example/json/expm1_op.cpp
new file mode 100644
index 000000000..e62f17419
--- /dev/null
+++ b/example/json/expm1_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_expm1_op.cpp$$
+$spell
+    expm1
+    Json
+$$
+
+$section Json expm1 Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/expm1_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool expm1_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : expm1(p[0])
+    // node_5 : expm1(x[0])
+    // node_6 : expm1(c[0])
+    // node_7 : expm1(p[0]) + expm1(x[0]) + expm1(c[0])
+    // y[0]   = expm1(p[0]) + expm1(x[0]) + expm1(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'expm1_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'expm1', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'              } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ 0.3 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // expm1(p0)
+        "       [ 1, 2]                ,\n" // expm1(x0)
+        "       [ 1, 3]                ,\n" // expm1(c0)
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // expm1(p0)+expm1(x0)+expm1(c0)
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = expm1(p0) + expm1(x0) + expm1(c0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = 0.3;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = -0.1;
+    x[0] = 0.2;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = CppAD::expm1(p[0]) + CppAD::expm1(x[0]) + CppAD::expm1(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/from_json.cpp b/example/json/from_json.cpp
new file mode 100644
index 000000000..c3d8bbbce
--- /dev/null
+++ b/example/json/from_json.cpp
@@ -0,0 +1,81 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin from_json.cpp$$
+$spell
+    Json
+$$
+
+$section ADFun Object Corresponding to Json AD Graph : Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/from_json.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool from_json(void)
+{   bool ok = true;
+    using CppAD::vector;
+    //
+    // An AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : x[1]
+    // node_4 : -2.0
+    // node_5 : p[0] + x[0] + x[1]
+    // node_6 : (p[0] + x[0] + x[1]) * (p[0] + x[0] + x[1])
+    // y[0]   = (p[0] + x[0] + x[1]) * (p[0] + x[0] + x[1])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'from_json example',\n"
+        "   'op_define_vec'  : [ 3, [\n"
+        "       { 'op_code':1, 'name':'add', 'n_arg':2 } ,\n"
+        "       { 'op_code':2, 'name':'mul', 'n_arg':2 } ,\n"
+        "       { 'op_code':3, 'name':'sum'            } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 2,\n"
+        "   'constant_vec'   : 1, [ -2.0 ],\n"
+        "   'op_usage_vec'   : 2, [\n"
+        "       [ 3, 1, 3, [1, 2, 3 ] ] ,\n"
+        "       [ 2, 5, 5             ] ] \n"
+        "   ,\n"
+        "   'dependent_vec'   : 1, [6]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    CppAD::ADFun<double> fun;
+    fun.from_json(graph);
+    //
+    // Compute function value
+    vector<double> p(1), x(2);
+    p[0] = 1.0;
+    x[0] = 2.0;
+    x[1] = 3.0;
+    fun.new_dynamic(p);
+    vector<double> y = fun.Forward(0, x);
+    ok  &= y[0] ==  (p[0] + x[0] + x[1]) * (p[0] + x[0] + x[1]);
+    //
+    // Conpute derivative value
+    vector<double> jac = fun.Jacobian(x);
+    ok &= jac[0] == 2.0 * (p[0] + x[0] + x[1]);
+    ok &= jac[1] == 2.0 * (p[0] + x[0] + x[1]);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/json.cpp b/example/json/json.cpp
new file mode 100644
index 000000000..360cb31fb
--- /dev/null
+++ b/example/json/json.cpp
@@ -0,0 +1,116 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+
+// CPPAD_HAS_* defines
+# include <cppad/configure.hpp>
+
+// system include files used for I/O
+# include <iostream>
+
+// C style asserts
+# include <cassert>
+
+// for thread_alloc
+# include <cppad/utility/thread_alloc.hpp>
+
+// test runner
+# include <cppad/utility/test_boolofvoid.hpp>
+
+// BEGIN_SORT_THIS_LINE_PLUS_2
+// external compiled tests
+extern bool abs_op(void);
+extern bool acosh_op(void);
+extern bool acos_op(void);
+extern bool add_op(void);
+extern bool asinh_op(void);
+extern bool asin_op(void);
+extern bool atanh_op(void);
+extern bool atan_op(void);
+extern bool atom_op(void);
+extern bool cosh_op(void);
+extern bool cos_op(void);
+extern bool div_op(void);
+extern bool erfc_op(void);
+extern bool erf_op(void);
+extern bool expm1_op(void);
+extern bool exp_op(void);
+extern bool from_json(void);
+extern bool log1p_op(void);
+extern bool log_op(void);
+extern bool mul_op(void);
+extern bool sign_op(void);
+extern bool sinh_op(void);
+extern bool sin_op(void);
+extern bool sparse(void);
+extern bool sqrt_op(void);
+extern bool sub_op(void);
+extern bool sum_op(void);
+extern bool tanh_op(void);
+extern bool tan_op(void);
+extern bool to_json(void);
+// END_SORT_THIS_LINE_MINUS_1
+
+// main program that runs all the tests
+int main(void)
+{   std::string group = "example/json";
+    size_t      width = 20;
+    CppAD::test_boolofvoid Run(group, width);
+
+    // This line is used by test_one.sh
+
+    // BEGIN_SORT_THIS_LINE_PLUS_2
+    // external compiled tests
+    Run( abs_op,               "abs_op"          );
+    Run( acos_op,              "acos_op"         );
+    Run( add_op,               "add_op"          );
+    Run( asin_op,              "asin_op"         );
+    Run( atan_op,              "atan_op"         );
+    Run( atom_op,              "atom_op"         );
+    Run( cosh_op,              "cosh_op"         );
+    Run( cos_op,               "cos_op"          );
+    Run( div_op,               "div_op"          );
+    Run( exp_op,               "exp_op"          );
+    Run( from_json,            "from_json"       );
+    Run( log_op,               "log_op"          );
+    Run( mul_op,               "mul_op"          );
+    Run( sign_op,              "sign_op"         );
+    Run( sinh_op,              "sinh_op"         );
+    Run( sin_op,               "sin_op"          );
+    Run( sparse,               "sparse"          );
+    Run( sqrt_op,              "sqrt_op"         );
+    Run( sub_op,               "sub_op"          );
+    Run( sum_op,               "sum_op"          );
+    Run( tanh_op,              "tanh_op"         );
+    Run( tan_op,               "tan_op"          );
+    Run( to_json,              "to_json"         );
+    // END_SORT_THIS_LINE_MINUS_1
+
+    // BEGIN_SORT_THIS_LINE_PLUS_2
+# if CPPAD_USE_CPLUSPLUS_2011
+    Run( acosh_op,             "acosh_op"        );
+    Run( asinh_op,             "asinh_op"        );
+    Run( atanh_op,             "atanh_op"        );
+    Run( erfc_op,              "erfc_op"         );
+    Run( erf_op,               "erf_op"          );
+    Run( expm1_op,            "expm1_op"       );
+    Run( log1p_op,             "log1p_op"        );
+# endif
+    // END_SORT_THIS_LINE_MINUS_2
+
+
+    // check for memory leak
+    bool memory_ok = CppAD::thread_alloc::free_all();
+    // print summary at end
+    bool ok = Run.summary(memory_ok);
+    //
+    return static_cast<int>( ! ok );
+}
diff --git a/example/json/log1p_op.cpp b/example/json/log1p_op.cpp
new file mode 100644
index 000000000..6f8497b9d
--- /dev/null
+++ b/example/json/log1p_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_log1p_op.cpp$$
+$spell
+    log1p
+    Json
+$$
+
+$section Json log1p Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/log1p_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool log1p_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : log1p(p[0])
+    // node_5 : log1p(x[0])
+    // node_6 : log1p(c[0])
+    // node_7 : log1p(p[0]) + log1p(x[0]) + log1p(c[0])
+    // y[0]   = log1p(p[0]) + log1p(x[0]) + log1p(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'log1p_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'log1p', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'               } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ 0.3 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // log1p(p0)
+        "       [ 1, 2]                ,\n" // log1p(x0)
+        "       [ 1, 3]                ,\n" // log1p(c0)
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // log1p(p0)+log1p(x0)+log1p(c0)
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = log1p(p0) + log1p(x0) + log1p(c0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = 0.3;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = -0.1;
+    x[0] = 0.2;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = CppAD::log1p(p[0]) + CppAD::log1p(x[0]) + CppAD::log1p(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/log_op.cpp b/example/json/log_op.cpp
new file mode 100644
index 000000000..30eb6a87a
--- /dev/null
+++ b/example/json/log_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_log_op.cpp$$
+$spell
+    log
+    Json
+$$
+
+$section Json log Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/log_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool log_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : log(p[0])
+    // node_5 : log(x[0])
+    // node_6 : log(c[0])
+    // node_7 : log(p[0]) + log(x[0]) + log(c[0])
+    // y[0]   = log(p[0]) + log(x[0]) + log(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'log_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'log', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'            } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ +0.1 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // log(p[0])
+        "       [ 1, 2]                ,\n" // log(x[0])
+        "       [ 1, 3]                ,\n" // log(c[0])
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // log(p[0])+log(x[0])+log(c[0])
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = log(p_0) + log(x_0) + log(c_0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = +0.1;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = 0.2;
+    x[0] = 0.3;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = std::log(p[0]) + std::log(x[0]) + std::log(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/mul_op.cpp b/example/json/mul_op.cpp
new file mode 100644
index 000000000..d6424f5cf
--- /dev/null
+++ b/example/json/mul_op.cpp
@@ -0,0 +1,84 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_mul_op.cpp$$
+$spell
+    mul
+    Json
+$$
+
+$section Json mul Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/mul_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool mul_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : p[1]
+    // node_3 : x[0]
+    // node_4 : p[0] * p[1]
+    // node_5 : x[0] * p[0] * p[1]
+    // y[0]   = x[0] * p[0] * p[1]
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'mul_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'add', 'n_arg':2 } ,\n"
+        "       { 'op_code':2, 'name':'mul', 'n_arg':2 } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 2,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 0, [ ],\n"
+        "   'op_usage_vec'   : 2, [\n"
+        "       [ 2, 1, 2 ] ,\n" // p[0] * p[1]
+        "       [ 2, 3, 4 ] ]\n" // x[0] * p[0] * p[1]
+        "   ,\n"
+        "   'dependent_vec' : 1, [5]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = x_0 * p_0 * p_1
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 2;
+    //
+    // set independent variables and parameters
+    vector<double> p(2), x(1);
+    p[0] = 2.0;
+    p[1] = 3.0;
+    x[0] = 4.0;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    ok &= y[0] == x[0] * p[0] * p[1];
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/sign_op.cpp b/example/json/sign_op.cpp
new file mode 100644
index 000000000..f3587a999
--- /dev/null
+++ b/example/json/sign_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_sign_op.cpp$$
+$spell
+    sign
+    Json
+$$
+
+$section Json sign Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/sign_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool sign_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : sign(p[0])
+    // node_5 : sign(x[0])
+    // node_6 : sign(c[0])
+    // node_7 : sign(p[0]) + sign(x[0]) + sign(c[0])
+    // y[0]   = sign(p[0]) + sign(x[0]) + sign(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'sign_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'sign', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'             } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ -0.1 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // sign(p[0])
+        "       [ 1, 2]                ,\n" // sign(x[0])
+        "       [ 1, 3]                ,\n" // sign(c[0])
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // sign(p[0])+sign(x[0])+sign(c[0])
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = sign(p_0) + sign(x_0) + sign(c_0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = -0.1;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = 0.2;
+    x[0] = 0.3;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = CppAD::sign(p[0]) + CppAD::sign(x[0]) + CppAD::sign(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/sin_op.cpp b/example/json/sin_op.cpp
new file mode 100644
index 000000000..f6c870fea
--- /dev/null
+++ b/example/json/sin_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_sin_op.cpp$$
+$spell
+    sin
+    Json
+$$
+
+$section Json sin Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/sin_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool sin_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : sin(p[0])
+    // node_5 : sin(x[0])
+    // node_6 : sin(c[0])
+    // node_7 : sin(p[0]) + sin(x[0]) + sin(c[0])
+    // y[0]   = sin(p[0]) + sin(x[0]) + sin(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'sin_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'sin', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'            } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ -0.1 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // sin(p[0])
+        "       [ 1, 2]                ,\n" // sin(x[0])
+        "       [ 1, 3]                ,\n" // sin(c[0])
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // sin(p[0])+sin(x[0])+sin(c[0])
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = sin(p_0) + sin(x_0) + sin(c_0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = -0.1;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = 0.2;
+    x[0] = 0.3;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = std::sin(p[0]) + std::sin(x[0]) + std::sin(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/sinh_op.cpp b/example/json/sinh_op.cpp
new file mode 100644
index 000000000..1318cccee
--- /dev/null
+++ b/example/json/sinh_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_sinh_op.cpp$$
+$spell
+    sinh
+    Json
+$$
+
+$section Json sinh Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/sinh_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool sinh_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : sinh(p[0])
+    // node_5 : sinh(x[0])
+    // node_6 : sinh(c[0])
+    // node_7 : sinh(p[0]) + sinh(x[0]) + sinh(c[0])
+    // y[0]   = sinh(p[0]) + sinh(x[0]) + sinh(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'sinh_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'sinh', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'             } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ -0.1 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // sinh(p[0])
+        "       [ 1, 2]                ,\n" // sinh(x[0])
+        "       [ 1, 3]                ,\n" // sinh(c[0])
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // sinh(p[0])+sinh(x[0])+sinh(c[0])
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = sinh(p_0) + sinh(x_0) + sinh(c_0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = -0.1;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = 0.2;
+    x[0] = 0.3;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = std::sinh(p[0]) + std::sinh(x[0]) + std::sinh(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/sparse.cpp b/example/json/sparse.cpp
new file mode 100644
index 000000000..24f17dbb1
--- /dev/null
+++ b/example/json/sparse.cpp
@@ -0,0 +1,142 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_sparse.cpp$$
+$spell
+    CppAD
+    Json
+$$
+
+$section Using Json to Represent a Sparse Matrix: Example and Test$$
+
+$head Discussion$$
+The example using a CppAD Json to represent the sparse matrix
+$latex \[
+\partial_x f(x, p) = \left( \begin{array}{ccc}
+    p_0 & 0    & 0 \\
+    0   & p_1  & 0 \\
+    0   & 0    & c_0
+\end{array} \right)
+\] $$
+where $latex c_0$$ is the constant 3.
+
+$head Source Code$$
+$srcfile%example/json/sparse.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool sparse(void)
+{   bool ok = true;
+    using CppAD::vector;
+    typedef vector<size_t> s_vector;
+    typedef vector<double> d_vector;
+    //
+    // An AD graph example
+    // node_1 : p[0]
+    // node_2 : p[1]
+    // node_3 : x[0]
+    // node_4 : x[1]
+    // node_5 : x[2]
+    // node_6 : c[0]
+    // node_7 : p[0] * x[0]
+    // node_8 : p[1] * x[1]
+    // node_9 : c[0] * x[2]
+    // y[0]   = p[0] * x[0]
+    // y[1]   = p[1] * x[1]
+    // y[2]   = c[0] * x[0]
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'sparse example',\n"
+        "   'op_define_vec'  : [ 1, [\n"
+        "       { 'op_code':1, 'name':'mul', 'n_arg':2 } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 2,\n"
+        "   'n_independent'  : 3,\n"
+        "   'constant_vec'   : 1, [ 3.0 ],\n"
+        "   'op_usage_vec'   : 3, [\n"
+        "       [ 1, 1, 3 ] , \n"
+        "       [ 1, 2, 4 ] , \n"
+        "       [ 1, 6, 5 ] ] \n"
+        "   ,\n"
+        "   'dependent_vec'   : 3, [7, 8, 9]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    CppAD::ADFun<double> fun;
+    fun.from_json(graph);
+    ok &= fun.Domain() == 3;
+    ok &= fun.Range()  == 3;
+    ok &= fun.size_dyn_ind() == 2;
+    //
+    // Point at which we are going to evaluate the Jacobian of f(x, p).
+    // The Jacobian is constant w.r.t. x, so the value of x does not matter.
+    vector<double> p(2), x(3);
+    p[0] = 1.0;
+    p[1] = 2.0;
+    for(size_t j = 0; j < x.size(); ++j)
+        x[j] = 0.0;
+    //
+    // set the dynamic parameters
+    fun.new_dynamic(p);
+    //
+    // compute the sparsity pattern for f_x(x, p)
+    vector<bool> select_domain(3);
+    vector<bool> select_range(3);
+    for(size_t i = 0; i < 3; ++i)
+    {   select_domain[i] = true;
+        select_range[i]  = true;
+    }
+    bool transpose = false;
+    CppAD::sparse_rc<s_vector> pattern;
+    fun.subgraph_sparsity(select_domain, select_range, transpose, pattern);
+    //
+    // compute the entire Jacobian
+    CppAD::sparse_rcv<s_vector, d_vector> subset(pattern);
+    fun.subgraph_jac_rev(x, subset);
+    //
+    // information in the sparse Jacobian
+    const s_vector& row( subset.row() );
+    const s_vector& col( subset.col() );
+    const d_vector& val( subset.val() );
+    size_t   nnz       = subset.nnz();
+    s_vector row_major = subset.row_major();
+    //
+    // check number of non-zero elements in sparse matrix
+    ok      &= nnz == 3;
+    //
+    // check first element of matrix (in row major order)
+    size_t k = row_major[0];
+    ok      &= row[k] == 0;
+    ok      &= col[k] == 0;
+    ok      &= val[k] == p[0];
+    //
+    // check second element of matrix
+    k        = row_major[1];
+    ok      &= row[k] == 1;
+    ok      &= col[k] == 1;
+    ok      &= val[k] == p[1];
+    //
+    // check third element of matrix
+    k        = row_major[2];
+    ok      &= row[k] == 2;
+    ok      &= col[k] == 2;
+    ok      &= val[k] == 3.0;
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/sqrt_op.cpp b/example/json/sqrt_op.cpp
new file mode 100644
index 000000000..6c6d2369e
--- /dev/null
+++ b/example/json/sqrt_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_sqrt_op.cpp$$
+$spell
+    sqrt
+    Json
+$$
+
+$section Json sqrt Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/sqrt_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool sqrt_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : sqrt(p[0])
+    // node_5 : sqrt(x[0])
+    // node_6 : sqrt(c[0])
+    // node_7 : sqrt(p[0]) + sqrt(x[0]) + sqrt(c[0])
+    // y[0]   = sqrt(p[0]) + sqrt(x[0]) + sqrt(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'sqrt_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'sqrt', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'             } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ +0.1 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // sqrt(p[0])
+        "       [ 1, 2]                ,\n" // sqrt(x[0])
+        "       [ 1, 3]                ,\n" // sqrt(c[0])
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // sqrt(p[0])+sqrt(x[0])+sqrt(c[0])
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = sqrt(p_0) + sqrt(x_0) + sqrt(c_0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = +0.1;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = 0.2;
+    x[0] = 0.3;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = std::sqrt(p[0]) + std::sqrt(x[0]) + std::sqrt(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/sub_op.cpp b/example/json/sub_op.cpp
new file mode 100644
index 000000000..0e2e4bdb4
--- /dev/null
+++ b/example/json/sub_op.cpp
@@ -0,0 +1,84 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_sub_op.cpp$$
+$spell
+    sub
+    Json
+$$
+
+$section Json sub Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/sub_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool sub_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : p[1]
+    // node_3 : x[0]
+    // node_4 : p[0] - p[1]
+    // node_5 : x[0] - ( p[0] - p[1] )
+    // y[0]   = x[0] - ( p[0] - p[1] )
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'sub_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'add', 'n_arg':2 } ,\n"
+        "       { 'op_code':2, 'name':'sub', 'n_arg':2 } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 2,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 0, [ ],\n"
+        "   'op_usage_vec'   : 2, [\n"
+        "       [ 2, 1, 2 ] ,\n" // p[0] - p[1]
+        "       [ 2, 3, 4 ] ]\n" // x[0] - ( p[0] - p[1] )
+        "   ,\n"
+        "   'dependent_vec' : 1, [5]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = x_0 - ( p_0 - p_1 )
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 2;
+    //
+    // set independent variables and parameters
+    vector<double> p(2), x(1);
+    p[0] = 2.0;
+    p[1] = 3.0;
+    x[0] = 4.0;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    ok &= y[0] == x[0] - ( p[0] - p[1] );
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/sum_op.cpp b/example/json/sum_op.cpp
new file mode 100644
index 000000000..4bb1a38e3
--- /dev/null
+++ b/example/json/sum_op.cpp
@@ -0,0 +1,85 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_sum_op.cpp$$
+$spell
+    sum
+    Json
+$$
+
+$section Json sum Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/sum_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool sum_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : p[1]
+    // node_3 : p[2]
+    // node_4 : x[0]
+    // node_5 : p[0] + p[1] + p[2]
+    // node_6 : x[0] + p[0] + p[1] + p[2]
+    // y[0]   = x[0] + p[0] + p[1] + p[2]
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'sum_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'add', 'n_arg':2 } ,\n"
+        "       { 'op_code':2, 'name':'sum' } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 3,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 0, [ ],\n"
+        "   'op_usage_vec'   : 2, [\n"
+        "       [ 2, 1, 3, [1, 2, 3] ] ,\n" // p[0] + p[1] + p[2]
+        "       [ 2, 1, 2, [4, 5 ]   ] ]\n" // x[0] + p[0] + p[1] + p[2]
+        "   ,\n"
+        "   'dependent_vec' : 1, [6]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = x_0 + p_0 + p_1 + p_2
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 3;
+    //
+    // set independent variables and parameters
+    vector<double> p(3), x(1);
+    for(size_t j = 0; j < 3; ++j)
+        p[j] = double(j + 1);
+    x[0] = 5.0;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    ok &= y[0] == x[0] + p[0] + p[1] + p[2];
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/tan_op.cpp b/example/json/tan_op.cpp
new file mode 100644
index 000000000..04e981061
--- /dev/null
+++ b/example/json/tan_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_tan_op.cpp$$
+$spell
+    tan
+    Json
+$$
+
+$section Json tan Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/tan_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool tan_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : tan(p[0])
+    // node_5 : tan(x[0])
+    // node_6 : tan(c[0])
+    // node_7 : tan(p[0]) + tan(x[0]) + tan(c[0])
+    // y[0]   = tan(p[0]) + tan(x[0]) + tan(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'tan_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'tan', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'            } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ -0.1 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // tan(p[0])
+        "       [ 1, 2]                ,\n" // tan(x[0])
+        "       [ 1, 3]                ,\n" // tan(c[0])
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // tan(p[0])+tan(x[0])+tan(c[0])
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = tan(p_0) + tan(x_0) + tan(c_0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant that is in function
+    vector<double> c(1);
+    c[0] = -0.1;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = 0.2;
+    x[0] = 0.3;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = std::tan(p[0]) + std::tan(x[0]) + std::tan(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/tanh_op.cpp b/example/json/tanh_op.cpp
new file mode 100644
index 000000000..ba1fbb90e
--- /dev/null
+++ b/example/json/tanh_op.cpp
@@ -0,0 +1,104 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin json_tanh_op.cpp$$
+$spell
+    tanh
+    Json
+$$
+
+$section Json tanh Operator: Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/tanh_op.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool tanh_op(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    //
+    // AD graph example
+    // node_1 : p[0]
+    // node_2 : x[0]
+    // node_3 : c[0]
+    // node_4 : tanh(p[0])
+    // node_5 : tanh(x[0])
+    // node_6 : tanh(c[0])
+    // node_7 : tanh(p[0]) + tanh(x[0]) + tanh(c[0])
+    // y[0]   = tanh(p[0]) + tanh(x[0]) + tanh(c[0])
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'tanh_op example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'tanh', 'n_arg':1 } ,\n"
+        "       { 'op_code':2, 'name':'sum'             } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 1,\n"
+        "   'n_independent'  : 1,\n"
+        "   'constant_vec'   : 1, [ -0.1 ],\n" // c[0]
+        "   'op_usage_vec'   : 4, [\n"
+        "       [ 1, 1]                ,\n" // tanh(p[0])
+        "       [ 1, 2]                ,\n" // tanh(x[0])
+        "       [ 1, 3]                ,\n" // tanh(c[0])
+        "       [ 2, 1, 3, [4, 5, 6] ] ]\n" // tanh(p[0])+tanh(x[0])+tanh(c[0])
+        "   ,\n"
+        "   'dependent_vec' : 1, [7]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x, p) = tanh(p_0) + tanh(x_0) + tanh(c_0)
+    CppAD::ADFun<double> f;
+    f.from_json(graph);
+    ok &= f.Domain() == 1;
+    ok &= f.Range() == 1;
+    ok &= f.size_dyn_ind() == 1;
+    //
+    // value of constant in function
+    vector<double> c(1);
+    c[0] = -0.1;
+    //
+    // set independent variables and parameters
+    vector<double> p(1), x(1);
+    p[0] = 0.2;
+    x[0] = 0.3;
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    vector<double> y = f.Forward(0, x);
+    //
+    // check result
+    double check = std::tanh(p[0]) + std::tanh(x[0]) + std::tanh(c[0]);
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    // Convert to Json graph and back again
+    graph = f.to_json();
+    f.from_json(graph);
+    //
+    // compute y = f(x, p)
+    f.new_dynamic(p);
+    y = f.Forward(0, x);
+    //
+    // check result
+    ok &= CppAD::NearEqual(y[0], check, eps99, eps99);
+    //
+    return ok;
+}
+// END C++
diff --git a/example/json/to_json.cpp b/example/json/to_json.cpp
new file mode 100644
index 000000000..c42bc283f
--- /dev/null
+++ b/example/json/to_json.cpp
@@ -0,0 +1,101 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin to_json.cpp$$
+$spell
+    Json
+$$
+
+$section ADFun Object Corresponding to Json AD Graph : Example and Test$$
+
+$head Source Code$$
+$srcfile%example/json/to_json.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+
+bool to_json(void)
+{   bool ok = true;
+    using CppAD::vector;
+    using CppAD::AD;
+    //
+    // An AD graph example
+    // node_1 : x[0]
+    // node_2 : x[1]
+    // node_3 : x[0] + x[1]
+    // node_4 : (x[0] + x[1]) * x[1]
+    // y[0]   = (x[0] + x[1]) * x[1]
+    // use single quote to avoid having to escape double quote
+    std::string graph =
+        "{\n"
+        "   'function_name'  : 'to_json example',\n"
+        "   'op_define_vec'  : [ 2, [\n"
+        "       { 'op_code':1, 'name':'add', 'n_arg':2 } ,\n"
+        "       { 'op_code':2, 'name':'mul', 'n_arg':2 } ]\n"
+        "   ],\n"
+        "   'n_dynamic_ind'  : 0,\n"
+        "   'n_independent'  : 2,\n"
+        "   'constant_vec'   : 0, [ ],\n"
+        "   'op_usage_vec'   : 2, [\n"
+        "       [ 1, 1, 2 ] ,\n"
+        "       [ 2, 3, 2 ] ]\n"
+        "   ,\n"
+        "   'dependent_vec' : 1, [4]\n"
+        "}\n";
+    // Convert the single quote to double quote
+    for(size_t i = 0; i < graph.size(); ++i)
+        if( graph[i] == '\'' ) graph[i] = '"';
+    //
+    // f(x) = (x_0 + x_1) * x_1
+    CppAD::ADFun< AD<double> > af;
+    af.from_json(graph);
+    ok &= af.Domain() == 2;
+    ok &= af.Range() == 1;
+    //
+    // Declare independent variables for a new recording
+    vector< AD<double> > ax(2);
+    ax[0] = 1.0;
+    ax[1] = 2.0;
+    CppAD::Independent(ax);
+    //
+    // Compute f(x)
+    af.Forward(0, ax);
+    //
+    // Compute z = f'(x)
+    vector< AD<double> > aw(1), az(2);
+    aw[0] = 1.0;
+    az    = af.Reverse(1, aw);
+    //
+    // define g(x) = f'(x)
+    CppAD::ADFun<double> g(ax, az);
+    //
+    // Convert to Json graph. Convert back to test.
+    graph = g.to_json();
+    g.from_json(graph);
+    //
+    // Evaluate function corresponding to g
+    vector<double> x(2), z(2);
+    x[0] = 3.0;
+    x[1] = 4.0;
+    z = g.Forward(0, x);
+    //
+    // should be derivative of f
+    ok &= z[0] == x[1];
+    ok &= z[1] == x[0] + 2.0 * x[1];
+    //
+    // Uncomment the statement below to see graph corresponding to g
+    // std::cout << graph;
+    return ok;
+}
+// END C++
diff --git a/example/multi_thread/CMakeLists.txt b/example/multi_thread/CMakeLists.txt
index e4fdad5e8..ae5b9d650 100644
--- a/example/multi_thread/CMakeLists.txt
+++ b/example/multi_thread/CMakeLists.txt
@@ -42,61 +42,41 @@ IF ( pthread_lib_path )
     ENDIF ( pthread_ok )
 ENDIF ( pthread_lib_path )
 
-# IF we find a boost multi-threadding library, define the corresponding
-# bthread_lib, bthread_lib_path, and process the bthread subdirectory.
+# Check if boost multi-threading library is avaialble
 IF ( Boost_FOUND )
-    SET(bthread_lib NOTFOUND)
-    FOREACH(idir ${cmake_install_includedirs})
-        FOREACH(ldir ${cmake_install_libdirs})
-            FOREACH(lname boost_thread-mt boost_thread )
-                # abort this search when find a match
-                IF( NOT bthread_lib )
-                    #
-                    SET(CMAKE_REQUIRED_DEFINITIONS "")
-                    SET(CMAKE_REQUIRED_INCLUDES  "${boost_prefix}/${idir}")
-                    SET(CMAKE_REQUIRED_LIBRARIES "${lname}" )
-                    SET(lpath                    "${boost_prefix}/${ldir}" )
-                    SET(CMAKE_REQUIRED_FLAGS     "-L${lpath}" )
-                    # CHECK_CXX_SOURCE_RUNS(source variable)
-                    SET(source "
+    SET(CMAKE_REQUIRED_DEFINITIONS "")
+    SET(CMAKE_REQUIRED_FLAGS       "")
+    SET(CMAKE_REQUIRED_INCLUDES    "${Boost_INCLUDE_DIRS}")
+    SET(CMAKE_REQUIRED_LIBRARIES   "${Boost_LIBRARIES}")
+    SET(source "
 # include <boost/thread.hpp>
 int main(void)
 {   boost::barrier wait(1);
     return 0;
-}"                  )
-                    SET(flag ${idir}_${ldir}_${lname}_ok )
-                    STRING( REGEX REPLACE "-" "_" flag ${flag})
-                    IF( DEFINED ${flag} )
-                        MESSAGE( ERROR
-                            "${flag} is defined before expected"
-                        )
-                    ENDIF( DEFINED ${flag} )
-                    CHECK_CXX_SOURCE_RUNS("${source}" ${flag} )
-                    IF ( ${flag} )
-                        SET(bthread_lib      ${lname} )
-                        SET(bthread_lib_path ${lpath} )
-                    ENDIF ( ${flag} )
-                ENDIF( NOT bthread_lib )
-            ENDFOREACH(lname boost_thread boost_thread-mt)
-        ENDFOREACH(ldir ${cmake_install_liddirs})
-    ENDFOREACH(idir ${cmake_install_includedirs})
+}"
+    )
+    IF( DEFINED boost_multi_thread_ok )
+        MESSAGE( ERROR "boost_multi_thread_ok is defined before expected" )
+    ENDIF( DEFINED boost_multi_thread_ok )
+    CHECK_CXX_SOURCE_RUNS("${source}" boost_multi_thread_ok )
     #
-    IF( bthread_lib )
+    IF( boost_multi_thread_ok )
         ADD_SUBDIRECTORY(bthread)
-        MESSAGE(STATUS
-        "boost multi-threading library = ${bthread_lib_path}/${bthread_lib}"
-        )
-    ELSE( bthread_lib )
-        MESSAGE(STATUS "Could not find boost multi-threading library")
-    ENDIF( bthread_lib )
+    ENDIF( boost_multi_thread_ok )
+    #
 ENDIF ( Boost_FOUND )
 
 IF( NOT( "${check_example_multi_thread_depends}" STREQUAL "" ) )
+    #
     # check_example_multi_thread
-    ADD_CUSTOM_TARGET(check_example_multi_thread DEPENDS ${check_example_multi_thread_depends})
+    ADD_CUSTOM_TARGET(
+        check_example_multi_thread
+        DEPENDS ${check_example_multi_thread_depends}
+    )
     MESSAGE(STATUS "make check_example_multi_thread: available")
-
+    #
     # Change check depends in parent environment
     add_to_list(check_depends check_example_multi_thread)
     SET(check_depends "${check_depends}" PARENT_SCOPE)
+    #
 ENDIF( NOT( "${check_example_multi_thread_depends}" STREQUAL "" ) )
diff --git a/example/multi_thread/bthread/CMakeLists.txt b/example/multi_thread/bthread/CMakeLists.txt
index 9acded600..207bd52b4 100644
--- a/example/multi_thread/bthread/CMakeLists.txt
+++ b/example/multi_thread/bthread/CMakeLists.txt
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -22,23 +22,23 @@ SET(source_list ../thread_test.cpp
     ${CMAKE_SOURCE_DIR}/speed/src/microsoft_timer.cpp
     ../team_example.cpp
     ../harmonic.cpp
-    ../multi_atomic.cpp
-    ../multi_checkpoint.cpp
+    ../multi_atomic_two.cpp
+    ../multi_atomic_three.cpp
+    ../multi_chkpoint_one.cpp
+    ../multi_chkpoint_two.cpp
     ../multi_newton.cpp
     a11c_bthread.cpp
     simple_ad_bthread.cpp
     team_bthread.cpp
 )
-set_compile_flags( example_multi_thread_bthread "${cppad_debug_which}" "${source_list}" )
+set_compile_flags(
+    example_multi_thread_bthread "${cppad_debug_which}" "${source_list}"
+)
 #
 ADD_EXECUTABLE( example_multi_thread_bthread EXCLUDE_FROM_ALL ${source_list} )
 
-# Paths in which the linker will search for libraries,
-# only applies to targets created after it is called
-LINK_DIRECTORIES( ${bthread_lib_path} )
-
 # List of libraries to be linked into the specified target
-TARGET_LINK_LIBRARIES(example_multi_thread_bthread ${bthread_lib})
+TARGET_LINK_LIBRARIES(example_multi_thread_bthread ${Boost_LIBRARIES})
 
 # Add the check_example_multi_thread_bthread target
 ADD_CUSTOM_TARGET(check_example_multi_thread_bthread
@@ -48,5 +48,9 @@ ADD_CUSTOM_TARGET(check_example_multi_thread_bthread
 MESSAGE(STATUS "make check_example_multi_thread_bthread: available")
 
 # Change check depends in parent environment
-add_to_list(check_example_multi_thread_depends check_example_multi_thread_bthread)
-SET(check_example_multi_thread_depends "${check_example_multi_thread_depends}" PARENT_SCOPE)
+add_to_list(
+    check_example_multi_thread_depends check_example_multi_thread_bthread
+)
+SET(check_example_multi_thread_depends
+    "${check_example_multi_thread_depends}" PARENT_SCOPE
+)
diff --git a/example/multi_thread/makefile.am b/example/multi_thread/makefile.am
index 3fb486d29..b9b0f9051 100644
--- a/example/multi_thread/makefile.am
+++ b/example/multi_thread/makefile.am
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -57,9 +57,9 @@ SHARED_SRC = \
 	team_example.cpp  team_example.hpp \
 \
 	harmonic.omh     harmonic.cpp      harmonic.hpp \
-	multi_atomic.omh multi_atomic.cpp  multi_atomic.hpp \
+	multi_atomic_two.omh multi_atomic_two.cpp  multi_atomic_two.hpp \
 	multi_newton.omh multi_newton.cpp  multi_newton.hpp \
-	multi_checkpoint.omh   multi_checkpoint.cpp    multi_checkpoint.hpp
+	multi_chkpoint_one.omh   multi_chkpoint_one.cpp    multi_chkpoint_one.hpp
 #
 bthread_test_SOURCES = \
 	$(SHARED_SRC) \
diff --git a/example/multi_thread/makefile.in b/example/multi_thread/makefile.in
index 0a7523d76..3fd05e0b2 100644
--- a/example/multi_thread/makefile.in
+++ b/example/multi_thread/makefile.in
@@ -1,7 +1,7 @@
-# makefile.in generated by automake 1.15.1 from makefile.am.
+# makefile.in generated by automake 1.16.1 from makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -103,8 +103,8 @@ CONFIG_CLEAN_VPATH_FILES =
 @CppAD_BTHREAD_TRUE@am__EXEEXT_2 = bthread_test$(EXEEXT)
 @CppAD_PTHREAD_TRUE@am__EXEEXT_3 = pthread_test$(EXEEXT)
 am__objects_1 = thread_test.$(OBJEXT) team_example.$(OBJEXT) \
-	harmonic.$(OBJEXT) multi_atomic.$(OBJEXT) \
-	multi_newton.$(OBJEXT) multi_checkpoint.$(OBJEXT)
+	harmonic.$(OBJEXT) multi_atomic_two.$(OBJEXT) \
+	multi_newton.$(OBJEXT) multi_chkpoint_one.$(OBJEXT)
 am__dirstamp = $(am__leading_dot)dirstamp
 am_bthread_test_OBJECTS = $(am__objects_1) \
 	bthread/team_bthread.$(OBJEXT) bthread/a11c_bthread.$(OBJEXT) \
@@ -142,7 +142,20 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = 
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/harmonic.Po \
+	./$(DEPDIR)/multi_atomic_two.Po \
+	./$(DEPDIR)/multi_chkpoint_one.Po ./$(DEPDIR)/multi_newton.Po \
+	./$(DEPDIR)/team_example.Po ./$(DEPDIR)/thread_test.Po \
+	bthread/$(DEPDIR)/a11c_bthread.Po \
+	bthread/$(DEPDIR)/simple_ad_bthread.Po \
+	bthread/$(DEPDIR)/team_bthread.Po \
+	openmp/$(DEPDIR)/a11c_openmp.Po \
+	openmp/$(DEPDIR)/simple_ad_openmp.Po \
+	openmp/$(DEPDIR)/team_openmp.Po \
+	pthread/$(DEPDIR)/a11c_pthread.Po \
+	pthread/$(DEPDIR)/simple_ad_pthread.Po \
+	pthread/$(DEPDIR)/team_pthread.Po
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -227,7 +240,7 @@ CXX_FLAGS = @CXX_FLAGS@
 CYGPATH_W = @CYGPATH_W@
 
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -406,9 +419,9 @@ SHARED_SRC = \
 	team_example.cpp  team_example.hpp \
 \
 	harmonic.omh     harmonic.cpp      harmonic.hpp \
-	multi_atomic.omh multi_atomic.cpp  multi_atomic.hpp \
+	multi_atomic_two.omh multi_atomic_two.cpp  multi_atomic_two.hpp \
 	multi_newton.omh multi_newton.cpp  multi_newton.hpp \
-	multi_checkpoint.omh   multi_checkpoint.cpp    multi_checkpoint.hpp
+	multi_chkpoint_one.omh   multi_chkpoint_one.cpp    multi_chkpoint_one.hpp
 
 #
 bthread_test_SOURCES = \
@@ -454,8 +467,8 @@ makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
 	  *config.status*) \
 	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -527,21 +540,27 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/harmonic.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi_atomic.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi_checkpoint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi_newton.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/team_example.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@bthread/$(DEPDIR)/a11c_bthread.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@bthread/$(DEPDIR)/simple_ad_bthread.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@bthread/$(DEPDIR)/team_bthread.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@openmp/$(DEPDIR)/a11c_openmp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@openmp/$(DEPDIR)/simple_ad_openmp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@openmp/$(DEPDIR)/team_openmp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@pthread/$(DEPDIR)/a11c_pthread.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@pthread/$(DEPDIR)/simple_ad_pthread.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@pthread/$(DEPDIR)/team_pthread.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/harmonic.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi_atomic_two.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi_chkpoint_one.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi_newton.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/team_example.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread_test.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@bthread/$(DEPDIR)/a11c_bthread.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@bthread/$(DEPDIR)/simple_ad_bthread.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@bthread/$(DEPDIR)/team_bthread.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@openmp/$(DEPDIR)/a11c_openmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@openmp/$(DEPDIR)/simple_ad_openmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@openmp/$(DEPDIR)/team_openmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@pthread/$(DEPDIR)/a11c_pthread.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@pthread/$(DEPDIR)/simple_ad_pthread.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@pthread/$(DEPDIR)/team_pthread.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+	@$(MKDIR_P) $(@D)
+	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -611,7 +630,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -687,7 +709,21 @@ clean: clean-am
 clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf ./$(DEPDIR) bthread/$(DEPDIR) openmp/$(DEPDIR) pthread/$(DEPDIR)
+		-rm -f ./$(DEPDIR)/harmonic.Po
+	-rm -f ./$(DEPDIR)/multi_atomic_two.Po
+	-rm -f ./$(DEPDIR)/multi_chkpoint_one.Po
+	-rm -f ./$(DEPDIR)/multi_newton.Po
+	-rm -f ./$(DEPDIR)/team_example.Po
+	-rm -f ./$(DEPDIR)/thread_test.Po
+	-rm -f bthread/$(DEPDIR)/a11c_bthread.Po
+	-rm -f bthread/$(DEPDIR)/simple_ad_bthread.Po
+	-rm -f bthread/$(DEPDIR)/team_bthread.Po
+	-rm -f openmp/$(DEPDIR)/a11c_openmp.Po
+	-rm -f openmp/$(DEPDIR)/simple_ad_openmp.Po
+	-rm -f openmp/$(DEPDIR)/team_openmp.Po
+	-rm -f pthread/$(DEPDIR)/a11c_pthread.Po
+	-rm -f pthread/$(DEPDIR)/simple_ad_pthread.Po
+	-rm -f pthread/$(DEPDIR)/team_pthread.Po
 	-rm -f makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -733,7 +769,21 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR) bthread/$(DEPDIR) openmp/$(DEPDIR) pthread/$(DEPDIR)
+		-rm -f ./$(DEPDIR)/harmonic.Po
+	-rm -f ./$(DEPDIR)/multi_atomic_two.Po
+	-rm -f ./$(DEPDIR)/multi_chkpoint_one.Po
+	-rm -f ./$(DEPDIR)/multi_newton.Po
+	-rm -f ./$(DEPDIR)/team_example.Po
+	-rm -f ./$(DEPDIR)/thread_test.Po
+	-rm -f bthread/$(DEPDIR)/a11c_bthread.Po
+	-rm -f bthread/$(DEPDIR)/simple_ad_bthread.Po
+	-rm -f bthread/$(DEPDIR)/team_bthread.Po
+	-rm -f openmp/$(DEPDIR)/a11c_openmp.Po
+	-rm -f openmp/$(DEPDIR)/simple_ad_openmp.Po
+	-rm -f openmp/$(DEPDIR)/team_openmp.Po
+	-rm -f pthread/$(DEPDIR)/a11c_pthread.Po
+	-rm -f pthread/$(DEPDIR)/simple_ad_pthread.Po
+	-rm -f pthread/$(DEPDIR)/team_pthread.Po
 	-rm -f makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -753,7 +803,7 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
 	clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \
 	distclean distclean-compile distclean-generic distclean-tags \
 	distdir dvi dvi-am html html-am info info-am install \
diff --git a/example/multi_thread/multi_atomic_three.cpp b/example/multi_thread/multi_atomic_three.cpp
new file mode 100644
index 000000000..c69a8339a
--- /dev/null
+++ b/example/multi_thread/multi_atomic_three.cpp
@@ -0,0 +1,681 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+
+/*
+$begin multi_atomic_three_user$$
+$spell
+    au
+    const
+    ADvector
+    num
+    itr
+$$
+
+$section Defines a atomic_three Operation that Computes Square Root$$
+
+$head Syntax$$
+$codei%atomic_user %a_square_root%
+%$$
+$icode%a_square_root%(%au%, %ay%)%$$
+
+$head Purpose$$
+This atomic function operation computes a square root using Newton's method.
+It is meant to be very inefficient in order to demonstrate timing results.
+
+$head au$$
+This argument has prototype
+$codei%
+    const %ADvector%& %au%
+%$$
+where $icode ADvector$$ is a
+$cref/simple vector class/SimpleVector/$$ with elements
+of type $code AD<double>$$.
+The size of $icode au$$ is three.
+
+$subhead num_itr$$
+We use the notation
+$codei%
+    %num_itr% = size_t( Integer( %au%[0] ) )
+%$$
+for the number of Newton iterations in the computation of the square root
+function.  The component $icode%au%[0]%$$ must be a
+$cref/parameter/glossary/Parameter/$$.
+
+$subhead y_initial$$
+We use the notation
+$codei%
+    %y_initial% = %au%[1]
+%$$
+for the initial value of the Newton iterate.
+
+$subhead y_squared$$
+We use the notation
+$codei%
+    %y_squared% = %au%[2]
+%$$
+for the value we are taking the square root of.
+
+$head ay$$
+This argument has prototype
+$codei%
+    %ADvector%& %ay%
+%$$
+The size of $icode ay$$ is one and
+$icode%ay%[0]%$$ is the square root of $icode y_squared$$.
+
+$head Limitations$$
+Only zero order forward mode is implements for the
+$code atomic_user$$ class.
+
+$head Source$$
+$srcfile%example/multi_thread/multi_atomic_three.cpp%0
+    %// BEGIN USER C++%// END USER C++%
+1%$$
+
+$end
+*/
+// BEGIN USER C++
+// includes used by all source code in multi_atomic_three.cpp file
+# include <cppad/cppad.hpp>
+# include "multi_atomic_three.hpp"
+# include "team_thread.hpp"
+//
+namespace {
+using CppAD::thread_alloc;                // multi-threading memory allocator
+using CppAD::vector;                      // uses thread_alloc
+typedef CppAD::ad_type_enum ad_type_enum; // constant, dynamic or variable
+
+class atomic_user : public CppAD::atomic_three<double> {
+public:
+    // ctor
+    atomic_user(void)
+    : CppAD::atomic_three<double>("atomic_square_root")
+    { }
+private:
+    // for_type
+    virtual bool for_type(
+        const vector<double>&        parameter_u ,
+        const vector<ad_type_enum>&  type_u      ,
+        vector<ad_type_enum>&        type_y      )
+    {   bool ok = parameter_u.size() == 3;
+        ok     &= type_u.size() == 3;
+        ok     &= type_y.size() == 1;
+        if( ! ok )
+            return false;
+        ok     &= type_u[0] < CppAD::variable_enum;
+        if( ! ok )
+            return false;
+        type_y[0] = std::max( type_u[0], type_u[1] );
+        type_y[0] = std::max( type_y[0], type_u[2] );
+        //
+        return true;
+    }
+    // forward
+    virtual bool forward(
+        const vector<double>&        parameter_u ,
+        const vector<ad_type_enum>&  type_u      ,
+        size_t                       need_y      ,
+        size_t                       order_low   ,
+        size_t                       order_up    ,
+        const vector<double>&        taylor_u    ,
+        vector<double>&              taylor_y    )
+    {
+# ifndef NDEBUG
+        size_t n = taylor_u.size() / (order_up + 1);
+        size_t m = taylor_y.size() / (order_up + 1);
+        assert( n == 3 );
+        assert( m == 1 );
+# endif
+        // only implementing zero order forward for this example
+        if( order_up != 0 )
+            return false;
+
+        // extract components of argument vector
+        size_t num_itr    = size_t( taylor_u[0] );
+        double y_initial  = taylor_u[1];
+        double y_squared  = taylor_u[2];
+
+        // Use Newton's method to solve f(y) = y^2 = y_squared
+        double y_itr = y_initial;
+        for(size_t itr = 0; itr < num_itr; itr++)
+        {   // solve (y - y_itr) * f'(y_itr) = y_squared - y_itr^2
+            double fp_itr = 2.0 * y_itr;
+            y_itr         = y_itr + (y_squared - y_itr * y_itr) / fp_itr;
+        }
+
+        // return the Newton approximation for f(y) = y_squared
+        taylor_y[0] = y_itr;
+        return true;
+    }
+};
+}
+// END USER C++
+/*
+$begin multi_atomic_three_common$$
+$spell
+$$
+
+$section Multi-Threaded atomic_three Common Information$$
+
+$head Purpose$$
+This source code defines the common variables that are used by
+the $codei%multi_atomic_three_%name%$$ functions.
+
+$head Source$$
+$srcfile%example/multi_thread/multi_atomic_three.cpp%0
+    %// BEGIN COMMON C++%// END COMMON C++%
+1%$$
+
+$end
+*/
+// BEGIN COMMON C++
+namespace {
+    // Number of threads, set by multi_atomic_three_time
+    // (zero means one thread with no multi-threading setup)
+    size_t num_threads_ = 0;
+
+    // Number of Newton iterations, set by multi_atomic_three_time
+    size_t num_itr_;
+
+    // We can use one atomic_atomic function for all threads because
+    // there is no member data that gets changed during worker call.
+    // This needs to stay in scope for as long as a recording will use it.
+    // We cannot be in parallel mode when this object is created or deleted.
+    // We use a pointer so that there is no left over memory in thread zero.
+    atomic_user* a_square_root_ = 0;
+
+    // structure with information for one thread
+    typedef struct {
+        // used by worker to compute the square root, set by multi_atomic_three_setup
+        CppAD::ADFun<double>* fun;
+        //
+        // value we are computing square root of, set by multi_atomic_three_setup
+        vector<double>* y_squared;
+        //
+        // square root, set by worker
+        vector<double>* square_root;
+        //
+        // false if an error occurs, true otherwise, set by worker
+        bool ok;
+    } work_one_t;
+    //
+    // Vector with information for all threads
+    // (uses pointers instead of values to avoid false sharing)
+    // allocated by multi_atomic_three_setup, freed by multi_atomic_three_takedown
+    work_one_t* work_all_[CPPAD_MAX_NUM_THREADS];
+}
+// END COMMON C++
+/*
+-------------------------------------------------------------------------------
+$begin multi_atomic_three_setup$$
+$spell
+    const
+    CppAD
+    bool
+$$
+
+$section Multi-Threaded atomic_three Set Up$$.
+
+$head Syntax$$
+$icode%ok% = multi_atomic_three_setup(%y_squared%)%$$
+
+$head Purpose$$
+This routine splits up the computation into the individual threads.
+
+$head Thread$$
+It is assumed that this function is called by thread zero
+and all the other threads are blocked (waiting).
+
+$head y_squared$$
+This argument has prototype
+$codei%
+    const vector<double>& %y_squared%
+%$$
+and its size is equal to the number of equations to solve.
+It is the values that we are computing the square root of.
+
+$head ok$$
+This return value has prototype
+$codei%
+    bool %ok%
+%$$
+If it is false,
+$code multi_atomic_three_setup$$ detected an error.
+
+$head Source$$
+$srcfile%example/multi_thread/multi_atomic_three.cpp%0
+    %// BEGIN SETUP C++%// END SETUP C++%
+1%$$
+
+$end
+*/
+// BEGIN SETUP C++
+namespace {
+bool multi_atomic_three_setup(const vector<double>& y_squared)
+{   using CppAD::AD;
+    size_t num_threads = std::max(num_threads_, size_t(1));
+    bool   ok          = num_threads == thread_alloc::num_threads();
+    ok                &= thread_alloc::thread_num() == 0;
+    //
+    // declare independent variable variable vector
+    vector< AD<double> > ax(1);
+    ax[0] = 2.0;
+    CppAD::Independent(ax);
+    //
+    // argument and result for atomic function
+    vector< AD<double> > au(3), ay(1);
+    au[0] = AD<double>( num_itr_ ); // num_itr
+    au[1] = ax[0];                  // y_initial
+    au[2] = ax[0];                  // y_squared
+    // put atomic function operation in recording
+    (*a_square_root_)(au, ay);
+    //
+    // f(u) = sqrt(u)
+    CppAD::ADFun<double> fun(ax, ay);
+    //
+    // number of square roots for each thread
+    size_t per_thread = (y_squared.size() + num_threads - 1) / num_threads;
+    size_t y_index    = 0;
+    //
+    for(size_t thread_num = 0; thread_num < num_threads; thread_num++)
+    {   // allocate separate memory for each thread to avoid false sharing
+        size_t min_bytes(sizeof(work_one_t)), cap_bytes;
+        void* v_ptr = thread_alloc::get_memory(min_bytes, cap_bytes);
+        work_all_[thread_num] = static_cast<work_one_t*>(v_ptr);
+        //
+        // Run constructor on work_all_[thread_num]->fun
+        work_all_[thread_num]->fun = new CppAD::ADFun<double>;
+        //
+        // Run constructor on work_all_[thread_num] vectors
+        work_all_[thread_num]->y_squared = new vector<double>;
+        work_all_[thread_num]->square_root = new vector<double>;
+        //
+        // Each worker gets a separate copy of fun. This is necessary because
+        // the Taylor coefficients will be set by each thread.
+        *(work_all_[thread_num]->fun) = fun;
+        //
+        // values we are computing square root of for this thread
+        ok &=  0 == work_all_[thread_num]->y_squared->size();
+        for(size_t i = 0; i < per_thread; i++)
+        if( y_index < y_squared.size() )
+            work_all_[thread_num]->y_squared->push_back(y_squared[y_index++]);
+        //
+        // set to false in case this thread's worker does not get called
+        work_all_[thread_num]->ok = false;
+    }
+    ok &= y_index == y_squared.size();
+    //
+    return ok;
+}
+}
+// END SETUP C++
+/*
+------------------------------------------------------------------------------
+$begin multi_atomic_three_worker$$
+$spell
+$$
+
+$section Multi-Threaded atomic_three Worker$$
+
+$head Purpose$$
+This routine does the computation for one thread.
+
+$head Source$$
+$srcfile%example/multi_thread/multi_atomic_three.cpp%0
+    %// BEGIN WORKER C++%// END WORKER C++%
+1%$$
+
+$end
+*/
+// BEGIN WORKER C++
+namespace {
+void multi_atomic_three_worker(void)
+{   size_t thread_num  = thread_alloc::thread_num();
+    size_t num_threads = std::max(num_threads_, size_t(1));
+    bool   ok          = thread_num < num_threads;
+    //
+    vector<double> x(1), y(1);
+    size_t n = work_all_[thread_num]->y_squared->size();
+    work_all_[thread_num]->square_root->resize(n);
+    for(size_t i = 0; i < n; i++)
+    {   x[0] = (* work_all_[thread_num]->y_squared )[i];
+        y    = work_all_[thread_num]->fun->Forward(0, x);
+        //
+        (* work_all_[thread_num]->square_root )[i] = y[0];
+    }
+    work_all_[thread_num]->ok             = ok;
+}
+}
+// END WORKER C++
+/*
+------------------------------------------------------------------------------
+$begin multi_atomic_three_takedown$$
+$spell
+    CppAD
+    bool
+$$
+
+$section Multi-Threaded atomic_three Take Down$$
+
+$head Syntax$$
+$icode%ok% = multi_atomic_three_takedown(%square_root%)%$$
+
+$head Purpose$$
+This routine gathers up the results for each thread and
+frees memory that was allocated by $cref multi_atomic_three_setup$$.
+
+$head Thread$$
+It is assumed that this function is called by thread zero
+and all the other threads are blocked (waiting).
+
+$head square_root$$
+This argument has prototype
+$codei%
+    vector<double>& %square_root%
+%$$
+The input value of $icode square_root$$ does not matter.
+Upon return,
+it has the same size and is the element by element square root of
+$cref/y_squared/multi_atomic_three_setup/y_squared/$$.
+
+$head ok$$
+This return value has prototype
+$codei%
+    bool %ok%
+%$$
+If it is false,
+$code multi_atomic_three_takedown$$ detected an error.
+
+$head Source$$
+$srcfile%example/multi_thread/multi_atomic_three.cpp%0
+    %// BEGIN TAKEDOWN C++%// END TAKEDOWN C++%
+1%$$
+
+$end
+*/
+// BEGIN TAKEDOWN C++
+namespace {
+bool multi_atomic_three_takedown(vector<double>& square_root)
+{   bool ok            = true;
+    ok                &= thread_alloc::thread_num() == 0;
+    size_t num_threads = std::max(num_threads_, size_t(1));
+    //
+    // extract square roots in original order
+    square_root.resize(0);
+    for(size_t thread_num = 0; thread_num < num_threads; thread_num++)
+    {   // results for this thread
+        size_t n = work_all_[thread_num]->square_root->size();
+        for(size_t i = 0; i < n; i++)
+            square_root.push_back((* work_all_[thread_num]->square_root )[i]);
+    }
+    //
+    // go down so that free memory for other threads before memory for master
+    size_t thread_num = num_threads;
+    while(thread_num--)
+    {   // check that this tread was ok with the work it did
+        ok  &= work_all_[thread_num]->ok;
+        //
+        // run destructor on vector object for this thread
+        delete work_all_[thread_num]->y_squared;
+        delete work_all_[thread_num]->square_root;
+        //
+        // run destructor on function object for this thread
+        delete work_all_[thread_num]->fun;
+        //
+        // delete problem specific information
+        void* v_ptr = static_cast<void*>( work_all_[thread_num] );
+        thread_alloc::return_memory( v_ptr );
+        //
+        // check that there is no longer any memory inuse by this thread
+        if( thread_num > 0 )
+        {   ok &= 0 == thread_alloc::inuse(thread_num);
+            //
+            // return all memory being held for future use by this thread
+            thread_alloc::free_available(thread_num);
+        }
+    }
+    return ok;
+}
+}
+// END TAKEDOWN C++
+/*
+$begin multi_atomic_three_run$$
+$spell
+    const
+    CppAD
+    bool
+$$
+
+$section Run Multi-Threaded atomic_three Calculation$$
+
+$head Syntax$$
+$icode%ok% = multi_atomic_three_run(%y_squared%, %square_root%)%$$
+
+$head Thread$$
+It is assumed that this function is called by thread zero
+and all the other threads are blocked (waiting).
+
+$head y_squared$$
+This argument has prototype
+$codei%
+    const vector<double>& %y_squared%
+%$$
+and its size is equal to the number of threads.
+It is the values that we are computing the square root of.
+
+$head square_root$$
+This argument has prototype
+$codei%
+    vector<double>& %square_root%
+%$$
+The input value of $icode square_root$$ does not matter.
+Upon return,
+it has the same size and
+is the element by element square root of $icode y_squared$$.
+
+$head ok$$
+This return value has prototype
+$codei%
+    bool %ok%
+%$$
+If it is false,
+$code multi_atomic_three_run$$ detected an error.
+
+$head Source$$
+$srcfile%example/multi_thread/multi_atomic_three.cpp%0
+    %// BEGIN RUN C++%// END RUN C++%
+1%$$
+
+$end
+------------------------------------------------------------------------------
+*/
+// BEGIN RUN C++
+namespace {
+bool multi_atomic_three_run(
+    const vector<double>& y_squared  ,
+    vector<double>&      square_root )
+{
+    bool ok = true;
+    ok     &= thread_alloc::thread_num() == 0;
+
+    // setup the work for multi-threading
+    ok &= multi_atomic_three_setup(y_squared);
+
+    // now do the work for each thread
+    if( num_threads_ > 0 )
+        team_work( multi_atomic_three_worker );
+    else
+        multi_atomic_three_worker();
+
+    // combine the result for each thread and takedown the multi-threading.
+    ok &= multi_atomic_three_takedown(square_root);
+
+    return ok;
+}
+}
+// END RUN C++
+/*
+------------------------------------------------------------------------------
+$begin multi_atomic_three_time$$
+$spell
+    num
+    alloc
+    bool
+    CppAD
+$$
+
+$section Timing Test for Multi-Threaded atomic_three Calculation$$
+
+$head Syntax$$
+$icode%ok% = multi_atomic_three_time(
+    %time_out%, %test_time%, %num_threads%, %num_solve%
+)%$$
+
+
+$head Thread$$
+It is assumed that this function is called by thread zero in sequential
+mode; i.e., not $cref/in_parallel/ta_in_parallel/$$.
+
+$head time_out$$
+This argument has prototype
+$codei%
+    double& %time_out%
+%$$
+Its input value of the argument does not matter.
+Upon return it is the number of wall clock seconds
+used by $cref multi_atomic_three_run$$.
+
+$head test_time$$
+This argument has prototype
+$codei%
+    double %test_time%
+%$$
+and is the minimum amount of wall clock time that the test should take.
+The number of repeats for the test will be increased until this time
+is reached.
+The reported $icode time_out$$ is the total wall clock time divided by the
+number of repeats.
+
+$head num_threads$$
+This argument has prototype
+$codei%
+    size_t %num_threads%
+%$$
+It specifies the number of threads that are available for this test.
+If it is zero, the test is run without the multi-threading environment and
+$codei%
+    1 == thread_alloc::num_threads()
+%$$
+If it is non-zero, the test is run with the multi-threading and
+$codei%
+    %num_threads% = thread_alloc::num_threads()
+%$$
+
+$head num_solve$$
+This specifies the number of square roots that will be solved for.
+
+$head ok$$
+The return value has prototype
+$codei%
+    bool %ok%
+%$$
+If it is true,
+$code harmonic_time$$ passed the correctness test and
+$code multi_atomic_three_time$$ did not detect an error.
+Otherwise it is false.
+
+$end
+*/
+
+// BEGIN TIME C++
+namespace {
+    // values we are taking the square root of
+    vector<double> y_squared_;
+
+    // results of the square root calculations
+    vector<double> square_root_;
+    //
+    void test_once(void)
+    {   bool ok = multi_atomic_three_run(y_squared_, square_root_);
+        if( ! ok )
+        {   std::cerr << "multi_atomic_three_run: error" << std::endl;
+            exit(1);
+        }
+        return;
+    }
+    //
+    void test_repeat(size_t repeat)
+    {   size_t i;
+        for(i = 0; i < repeat; i++)
+            test_once();
+        return;
+    }
+}
+// This is the only routine that is accessible outside of this file
+bool multi_atomic_three_time(
+    double& time_out, double test_time, size_t num_threads, size_t num_solve
+)
+{   bool ok = true;
+    //
+    size_t initial_inuse = thread_alloc::inuse(0);
+
+    // number of threads, zero for no multi-threading
+    num_threads_ = num_threads;
+
+    // number of Newton iterations
+    num_itr_ = 20;
+
+    // values we are talking the square root of
+    y_squared_.resize(num_solve);
+    for(size_t i_solve = 0; i_solve < num_solve; i_solve++)
+        y_squared_[i_solve] = double(i_solve) + 2.0;
+
+    // must create a_square_root_ sequential mode
+    a_square_root_ = new atomic_user;
+
+    // create team of threads
+    ok &= thread_alloc::in_parallel() == false;
+    if( num_threads > 0 )
+    {   team_create(num_threads);
+        ok &= num_threads == thread_alloc::num_threads();
+    }
+    else
+    {   ok &= 1 == thread_alloc::num_threads();
+    }
+
+    // run the test case and set the time return value
+    time_out = CppAD::time_test(test_repeat, test_time);
+
+    // destroy team of threads
+    if( num_threads > 0 )
+        team_destroy();
+    ok &= thread_alloc::in_parallel() == false;
+
+    // must delete a_square_root_ in sequential mode
+    delete a_square_root_;
+
+    // correctness check
+    ok &= square_root_.size() == num_solve;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    for(size_t i = 0; i < num_solve; i++)
+    {   double check = std::sqrt( y_squared_[i] );
+        ok          &= std::fabs( square_root_[i] / check - 1.0 ) <= eps99;
+    }
+    y_squared_.clear();
+    square_root_.clear();
+    //
+    // check that no static variables in this file are holding onto memory
+    ok &= initial_inuse == thread_alloc::inuse(0);
+    //
+    return ok;
+}
+// END TIME C++
diff --git a/example/multi_thread/multi_checkpoint.hpp b/example/multi_thread/multi_atomic_three.hpp
similarity index 74%
rename from example/multi_thread/multi_checkpoint.hpp
rename to example/multi_thread/multi_atomic_three.hpp
index b4efc10ef..ca8b1592d 100644
--- a/example/multi_thread/multi_checkpoint.hpp
+++ b/example/multi_thread/multi_atomic_three.hpp
@@ -1,7 +1,7 @@
-# ifndef CPPAD_EXAMPLE_MULTI_THREAD_MULTI_CHECKPOINT_HPP
-# define CPPAD_EXAMPLE_MULTI_THREAD_MULTI_CHECKPOINT_HPP
+# ifndef CPPAD_EXAMPLE_MULTI_THREAD_MULTI_ATOMIC_THREE_HPP
+# define CPPAD_EXAMPLE_MULTI_THREAD_MULTI_ATOMIC_THREE_HPP
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -12,7 +12,7 @@ in the Eclipse Public License, Version 2.0 are satisfied:
       GNU General Public License, Version 2.0 or later.
 ---------------------------------------------------------------------------- */
 
-bool multi_checkpoint_time(
+bool multi_atomic_three_time(
     double& time_out, double test_time, size_t num_threads, size_t num_solve
 );
 
diff --git a/example/multi_thread/multi_atomic.omh b/example/multi_thread/multi_atomic_three.omh
old mode 100755
new mode 100644
similarity index 71%
rename from example/multi_thread/multi_atomic.omh
rename to example/multi_thread/multi_atomic_three.omh
index 0bcc2930c..b090bd653
--- a/example/multi_thread/multi_atomic.omh
+++ b/example/multi_thread/multi_atomic_three.omh
@@ -1,5 +1,5 @@
 -------------------------------------------------------------------------------
-  CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+  CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
   CppAD is distributed under the terms of the
                Eclipse Public License Version 2.0.
@@ -9,19 +9,19 @@
   in the Eclipse Public License, Version 2.0 are satisfied:
         GNU General Public License, Version 2.0 or later.
 -------------------------------------------------------------------------------
-$begin multi_atomic.cpp$$
+$begin multi_atomic_three.cpp$$
 $spell
     cpp
 $$
 
-$section Multi-Threading User Atomic Example / Test$$
+$section Multi-Threading atomic_three Example / Test$$
 
 $head Source File$$
 All of the routines below are located in the file
 $codep
-    example/multi_thread/multi_atomic.cpp
+    example/multi_thread/multi_atomic_three.cpp
 $$
 
-$childtable%example/multi_thread/multi_atomic.cpp%$$
+$childtable%example/multi_thread/multi_atomic_three.cpp%$$
 
 $end
diff --git a/example/multi_thread/multi_atomic.cpp b/example/multi_thread/multi_atomic_two.cpp
similarity index 86%
rename from example/multi_thread/multi_atomic.cpp
rename to example/multi_thread/multi_atomic_two.cpp
index 62512659a..155cc9b47 100644
--- a/example/multi_thread/multi_atomic.cpp
+++ b/example/multi_thread/multi_atomic_two.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -11,7 +11,7 @@ in the Eclipse Public License, Version 2.0 are satisfied:
 ---------------------------------------------------------------------------- */
 
 /*
-$begin multi_atomic_user$$
+$begin multi_atomic_two_user$$
 $spell
     au
     const
@@ -20,7 +20,7 @@ $spell
     itr
 $$
 
-$section Defines a User Atomic Operation that Computes Square Root$$
+$section Defines a atomic_two Operation that Computes Square Root$$
 
 $head Syntax$$
 $codei%atomic_user %a_square_root%
@@ -77,16 +77,16 @@ Only zero order forward mode is implements for the
 $code atomic_user$$ class.
 
 $head Source$$
-$srcfile%example/multi_thread/multi_atomic.cpp%0
+$srcfile%example/multi_thread/multi_atomic_two.cpp%0
     %// BEGIN USER C++%// END USER C++%
 1%$$
 
 $end
 */
 // BEGIN USER C++
-// includes used by all source code in multi_atomic.cpp file
+// includes used by all source code in multi_atomic_two.cpp file
 # include <cppad/cppad.hpp>
-# include "multi_atomic.hpp"
+# include "multi_atomic_two.hpp"
 # include "team_thread.hpp"
 //
 namespace {
@@ -147,18 +147,18 @@ private:
 }
 // END USER C++
 /*
-$begin multi_atomic_common$$
+$begin multi_atomic_two_common$$
 $spell
 $$
 
-$section Multi-Threaded User Atomic Common Information$$
+$section Multi-Threaded atomic_two Common Information$$
 
 $head Purpose$$
 This source code defines the common variables that are used by
-the $codei%multi_atomic_%name%$$ functions.
+the $codei%multi_atomic_two_%name%$$ functions.
 
 $head Source$$
-$srcfile%example/multi_thread/multi_atomic.cpp%0
+$srcfile%example/multi_thread/multi_atomic_two.cpp%0
     %// BEGIN COMMON C++%// END COMMON C++%
 1%$$
 
@@ -166,11 +166,11 @@ $end
 */
 // BEGIN COMMON C++
 namespace {
-    // Number of threads, set by multi_atomic_time
+    // Number of threads, set by multi_atomic_two_time
     // (zero means one thread with no multi-threading setup)
     size_t num_threads_ = 0;
 
-    // Number of Newton iterations, set by multi_atomic_time
+    // Number of Newton iterations, set by multi_atomic_two_time
     size_t num_itr_;
 
     // We can use one atomic_atomic function for all threads because
@@ -182,10 +182,10 @@ namespace {
 
     // structure with information for one thread
     typedef struct {
-        // used by worker to compute the square root, set by multi_atomic_setup
+        // used by worker to compute the square root, set by multi_atomic_two_setup
         CppAD::ADFun<double>* fun;
         //
-        // value we are computing square root of, set by multi_atomic_setup
+        // value we are computing square root of, set by multi_atomic_two_setup
         vector<double>* y_squared;
         //
         // square root, set by worker
@@ -197,23 +197,23 @@ namespace {
     //
     // Vector with information for all threads
     // (uses pointers instead of values to avoid false sharing)
-    // allocated by multi_atomic_setup, freed by multi_atomic_takedown
+    // allocated by multi_atomic_two_setup, freed by multi_atomic_two_takedown
     work_one_t* work_all_[CPPAD_MAX_NUM_THREADS];
 }
 // END COMMON C++
 /*
 -------------------------------------------------------------------------------
-$begin multi_atomic_setup$$
+$begin multi_atomic_two_setup$$
 $spell
     const
     CppAD
     bool
 $$
 
-$section Multi-Threaded User Atomic Set Up$$.
+$section Multi-Threaded atomic_two Set Up$$.
 
 $head Syntax$$
-$icode%ok% = multi_atomic_setup(%y_squared%)%$$
+$icode%ok% = multi_atomic_two_setup(%y_squared%)%$$
 
 $head Purpose$$
 This routine splits up the computation into the individual threads.
@@ -236,10 +236,10 @@ $codei%
     bool %ok%
 %$$
 If it is false,
-$code multi_atomic_setup$$ detected an error.
+$code multi_atomic_two_setup$$ detected an error.
 
 $head Source$$
-$srcfile%example/multi_thread/multi_atomic.cpp%0
+$srcfile%example/multi_thread/multi_atomic_two.cpp%0
     %// BEGIN SETUP C++%// END SETUP C++%
 1%$$
 
@@ -247,7 +247,7 @@ $end
 */
 // BEGIN SETUP C++
 namespace {
-bool multi_atomic_setup(const vector<double>& y_squared)
+bool multi_atomic_two_setup(const vector<double>& y_squared)
 {   using CppAD::AD;
     size_t num_threads = std::max(num_threads_, size_t(1));
     bool   ok          = num_threads == thread_alloc::num_threads();
@@ -307,17 +307,17 @@ bool multi_atomic_setup(const vector<double>& y_squared)
 // END SETUP C++
 /*
 ------------------------------------------------------------------------------
-$begin multi_atomic_worker$$
+$begin multi_atomic_two_worker$$
 $spell
 $$
 
-$section Multi-Threaded User Atomic Worker$$
+$section Multi-Threaded atomic_two Worker$$
 
 $head Purpose$$
 This routine does the computation for one thread.
 
 $head Source$$
-$srcfile%example/multi_thread/multi_atomic.cpp%0
+$srcfile%example/multi_thread/multi_atomic_two.cpp%0
     %// BEGIN WORKER C++%// END WORKER C++%
 1%$$
 
@@ -325,7 +325,7 @@ $end
 */
 // BEGIN WORKER C++
 namespace {
-void multi_atomic_worker(void)
+void multi_atomic_two_worker(void)
 {   size_t thread_num  = thread_alloc::thread_num();
     size_t num_threads = std::max(num_threads_, size_t(1));
     bool   ok          = thread_num < num_threads;
@@ -345,20 +345,20 @@ void multi_atomic_worker(void)
 // END WORKER C++
 /*
 ------------------------------------------------------------------------------
-$begin multi_atomic_takedown$$
+$begin multi_atomic_two_takedown$$
 $spell
     CppAD
     bool
 $$
 
-$section Multi-Threaded User Atomic Take Down$$
+$section Multi-Threaded atomic_two Take Down$$
 
 $head Syntax$$
-$icode%ok% = multi_atomic_takedown(%square_root%)%$$
+$icode%ok% = multi_atomic_two_takedown(%square_root%)%$$
 
 $head Purpose$$
 This routine gathers up the results for each thread and
-frees memory that was allocated by $cref multi_atomic_setup$$.
+frees memory that was allocated by $cref multi_atomic_two_setup$$.
 
 $head Thread$$
 It is assumed that this function is called by thread zero
@@ -372,7 +372,7 @@ $codei%
 The input value of $icode square_root$$ does not matter.
 Upon return,
 it has the same size and is the element by element square root of
-$cref/y_squared/multi_atomic_setup/y_squared/$$.
+$cref/y_squared/multi_atomic_two_setup/y_squared/$$.
 
 $head ok$$
 This return value has prototype
@@ -380,10 +380,10 @@ $codei%
     bool %ok%
 %$$
 If it is false,
-$code multi_atomic_takedown$$ detected an error.
+$code multi_atomic_two_takedown$$ detected an error.
 
 $head Source$$
-$srcfile%example/multi_thread/multi_atomic.cpp%0
+$srcfile%example/multi_thread/multi_atomic_two.cpp%0
     %// BEGIN TAKEDOWN C++%// END TAKEDOWN C++%
 1%$$
 
@@ -391,7 +391,7 @@ $end
 */
 // BEGIN TAKEDOWN C++
 namespace {
-bool multi_atomic_takedown(vector<double>& square_root)
+bool multi_atomic_two_takedown(vector<double>& square_root)
 {   bool ok            = true;
     ok                &= thread_alloc::thread_num() == 0;
     size_t num_threads = std::max(num_threads_, size_t(1));
@@ -435,17 +435,17 @@ bool multi_atomic_takedown(vector<double>& square_root)
 }
 // END TAKEDOWN C++
 /*
-$begin multi_atomic_run$$
+$begin multi_atomic_two_run$$
 $spell
     const
     CppAD
     bool
 $$
 
-$section Run Multi-Threaded User Atomic Calculation$$
+$section Run Multi-Threaded atomic_two Calculation$$
 
 $head Syntax$$
-$icode%ok% = multi_atomic_run(%y_squared%, %square_root%)%$$
+$icode%ok% = multi_atomic_two_run(%y_squared%, %square_root%)%$$
 
 $head Thread$$
 It is assumed that this function is called by thread zero
@@ -475,10 +475,10 @@ $codei%
     bool %ok%
 %$$
 If it is false,
-$code multi_atomic_run$$ detected an error.
+$code multi_atomic_two_run$$ detected an error.
 
 $head Source$$
-$srcfile%example/multi_thread/multi_atomic.cpp%0
+$srcfile%example/multi_thread/multi_atomic_two.cpp%0
     %// BEGIN RUN C++%// END RUN C++%
 1%$$
 
@@ -487,7 +487,7 @@ $end
 */
 // BEGIN RUN C++
 namespace {
-bool multi_atomic_run(
+bool multi_atomic_two_run(
     const vector<double>& y_squared  ,
     vector<double>&      square_root )
 {
@@ -495,16 +495,16 @@ bool multi_atomic_run(
     ok     &= thread_alloc::thread_num() == 0;
 
     // setup the work for multi-threading
-    ok &= multi_atomic_setup(y_squared);
+    ok &= multi_atomic_two_setup(y_squared);
 
     // now do the work for each thread
     if( num_threads_ > 0 )
-        team_work( multi_atomic_worker );
+        team_work( multi_atomic_two_worker );
     else
-        multi_atomic_worker();
+        multi_atomic_two_worker();
 
     // combine the result for each thread and takedown the multi-threading.
-    ok &= multi_atomic_takedown(square_root);
+    ok &= multi_atomic_two_takedown(square_root);
 
     return ok;
 }
@@ -512,7 +512,7 @@ bool multi_atomic_run(
 // END RUN C++
 /*
 ------------------------------------------------------------------------------
-$begin multi_atomic_time$$
+$begin multi_atomic_two_time$$
 $spell
     num
     alloc
@@ -520,10 +520,10 @@ $spell
     CppAD
 $$
 
-$section Timing Test for Multi-Threaded User Atomic Calculation$$
+$section Timing Test for Multi-Threaded atomic_two Calculation$$
 
 $head Syntax$$
-$icode%ok% = multi_atomic_time(
+$icode%ok% = multi_atomic_two_time(
     %time_out%, %test_time%, %num_threads%, %num_solve%
 )%$$
 
@@ -539,7 +539,7 @@ $codei%
 %$$
 Its input value of the argument does not matter.
 Upon return it is the number of wall clock seconds
-used by $cref multi_atomic_run$$.
+used by $cref multi_atomic_two_run$$.
 
 $head test_time$$
 This argument has prototype
@@ -577,7 +577,7 @@ $codei%
 %$$
 If it is true,
 $code harmonic_time$$ passed the correctness test and
-$code multi_atomic_time$$ did not detect an error.
+$code multi_atomic_two_time$$ did not detect an error.
 Otherwise it is false.
 
 $end
@@ -592,9 +592,9 @@ namespace {
     vector<double> square_root_;
     //
     void test_once(void)
-    {   bool ok = multi_atomic_run(y_squared_, square_root_);
+    {   bool ok = multi_atomic_two_run(y_squared_, square_root_);
         if( ! ok )
-        {   std::cerr << "multi_atomic_run: error" << std::endl;
+        {   std::cerr << "multi_atomic_two_run: error" << std::endl;
             exit(1);
         }
         return;
@@ -608,7 +608,7 @@ namespace {
     }
 }
 // This is the only routine that is accessible outside of this file
-bool multi_atomic_time(
+bool multi_atomic_two_time(
     double& time_out, double test_time, size_t num_threads, size_t num_solve
 )
 {   bool ok = true;
diff --git a/example/multi_thread/multi_atomic.hpp b/example/multi_thread/multi_atomic_two.hpp
similarity index 74%
rename from example/multi_thread/multi_atomic.hpp
rename to example/multi_thread/multi_atomic_two.hpp
index da7d87e96..a2ee6dee2 100644
--- a/example/multi_thread/multi_atomic.hpp
+++ b/example/multi_thread/multi_atomic_two.hpp
@@ -1,7 +1,7 @@
-# ifndef CPPAD_EXAMPLE_MULTI_THREAD_MULTI_ATOMIC_HPP
-# define CPPAD_EXAMPLE_MULTI_THREAD_MULTI_ATOMIC_HPP
+# ifndef CPPAD_EXAMPLE_MULTI_THREAD_MULTI_ATOMIC_TWO_HPP
+# define CPPAD_EXAMPLE_MULTI_THREAD_MULTI_ATOMIC_TWO_HPP
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -12,7 +12,7 @@ in the Eclipse Public License, Version 2.0 are satisfied:
       GNU General Public License, Version 2.0 or later.
 ---------------------------------------------------------------------------- */
 
-bool multi_atomic_time(
+bool multi_atomic_two_time(
     double& time_out, double test_time, size_t num_threads, size_t num_solve
 );
 
diff --git a/example/multi_thread/multi_atomic_two.omh b/example/multi_thread/multi_atomic_two.omh
new file mode 100755
index 000000000..a53483dcf
--- /dev/null
+++ b/example/multi_thread/multi_atomic_two.omh
@@ -0,0 +1,30 @@
+-------------------------------------------------------------------------------
+  CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+  CppAD is distributed under the terms of the
+               Eclipse Public License Version 2.0.
+
+  This Source Code may also be made available under the following
+  Secondary License when the conditions for such availability set forth
+  in the Eclipse Public License, Version 2.0 are satisfied:
+        GNU General Public License, Version 2.0 or later.
+-------------------------------------------------------------------------------
+$begin multi_atomic_two.cpp$$
+$spell
+    cpp
+$$
+
+$section Multi-Threading atomic_two Example / Test$$
+
+$head Deprecated 2019-08-05$$
+This example is deprecated, use $cref multi_atomic_three.cpp$$ instead.
+
+$head Source File$$
+All of the routines below are located in the file
+$codep
+    example/multi_thread/multi_atomic_two.cpp
+$$
+
+$childtable%example/multi_thread/multi_atomic_two.cpp%$$
+
+$end
diff --git a/example/multi_thread/multi_checkpoint.cpp b/example/multi_thread/multi_chkpoint_one.cpp
similarity index 85%
rename from example/multi_thread/multi_checkpoint.cpp
rename to example/multi_thread/multi_chkpoint_one.cpp
index f6fb4f09d..80c1fb626 100644
--- a/example/multi_thread/multi_checkpoint.cpp
+++ b/example/multi_thread/multi_chkpoint_one.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -11,8 +11,9 @@ in the Eclipse Public License, Version 2.0 are satisfied:
 ---------------------------------------------------------------------------- */
 
 /*
-$begin multi_checkpoint_algo$$
+$begin multi_chkpoint_one_algo$$
 $spell
+    chkpoint
     au
     const
     ADvector
@@ -21,7 +22,7 @@ $spell
     algo
 $$
 
-$section Defines an Algorithm that Computes Square Root$$
+$section chkpoint_one Algorithm that Computes Square Root$$
 
 $head Syntax$$
 $icode%checkpoint_algo%(%au%, %ay%)%$$
@@ -63,16 +64,16 @@ The size of $icode ay$$ is one and
 $icode%ay%[0]%$$ is the square root of $icode y_squared$$.
 
 $head Source$$
-$srcfile%example/multi_thread/multi_checkpoint.cpp%0
+$srcfile%example/multi_thread/multi_chkpoint_one.cpp%0
     %// BEGIN ALGO C++%// END ALGO C++%
 1%$$
 
 $end
 */
 // BEGIN ALGO C++
-// includes used by all source code in multi_checkpoint.cpp file
+// includes used by all source code in multi_chkpoint_one.cpp file
 # include <cppad/cppad.hpp>
-# include "multi_checkpoint.hpp"
+# include "multi_chkpoint_one.hpp"
 # include "team_thread.hpp"
 //
 namespace {
@@ -102,18 +103,19 @@ namespace {
 // END ALGO C++
 
 /*
-$begin multi_checkpoint_common$$
+$begin multi_chkpoint_one_common$$
 $spell
+    chkpoint
 $$
 
-$section Multi-Threaded Checkpoint Common Information$$
+$section Multi-Threaded chkpoint_one Common Information$$
 
 $head Purpose$$
 This source code defines the common variables that are used by
-the $codei%multi_checkpoint_%name%$$ functions.
+the $codei%multi_chkpoint_one_%name%$$ functions.
 
 $head Source$$
-$srcfile%example/multi_thread/multi_checkpoint.cpp%0
+$srcfile%example/multi_thread/multi_chkpoint_one.cpp%0
     %// BEGIN COMMON C++%// END COMMON C++%
 1%$$
 
@@ -121,7 +123,7 @@ $end
 */
 // BEGIN COMMON C++
 namespace {
-    // Number of threads, set by multi_checkpoint_time
+    // Number of threads, set by multi_chkpoint_one_time
     // (zero means one thread with no multi-threading setup)
     size_t num_threads_ = 0;
 
@@ -135,10 +137,10 @@ namespace {
     // structure with information for one thread
     typedef struct {
         // used by worker to compute the square root,
-        // set by multi_checkpoint_setup
+        // set by multi_chkpoint_one_setup
         CppAD::ADFun<double>* fun;
         //
-        // value we are computing square root of, set by multi_checkpoint_setup
+        // value we are computing square root of, set by multi_chkpoint_one_setup
         vector<double>* y_squared;
         //
         // square root, set by worker
@@ -150,23 +152,24 @@ namespace {
     //
     // Vector with information for all threads
     // (uses pointers instead of values to avoid false sharing)
-    // allocated by multi_checkpoint_setup, freed by multi_checkpoint_takedown
+    // allocated by multi_chkpoint_one_setup, freed by multi_chkpoint_one_takedown
     work_one_t* work_all_[CPPAD_MAX_NUM_THREADS];
 }
 // END COMMON C++
 /*
 -------------------------------------------------------------------------------
-$begin multi_checkpoint_setup$$
+$begin multi_chkpoint_one_setup$$
 $spell
+    chkpoint
     const
     CppAD
     bool
 $$
 
-$section Multi-Threaded Checkpoint Set Up$$.
+$section Multi-Threaded chkpoint_one Set Up$$.
 
 $head Syntax$$
-$icode%ok% = multi_checkpoint_setup(%y_squared%)%$$
+$icode%ok% = multi_chkpoint_one_setup(%y_squared%)%$$
 
 $head Purpose$$
 This routine splits up the computation into the individual threads.
@@ -189,10 +192,10 @@ $codei%
     bool %ok%
 %$$
 If it is false,
-$code multi_checkpoint_setup$$ detected an error.
+$code multi_chkpoint_one_setup$$ detected an error.
 
 $head Source$$
-$srcfile%example/multi_thread/multi_checkpoint.cpp%0
+$srcfile%example/multi_thread/multi_chkpoint_one.cpp%0
     %// BEGIN SETUP C++%// END SETUP C++%
 1%$$
 
@@ -200,7 +203,7 @@ $end
 */
 // BEGIN SETUP C++
 namespace {
-bool multi_checkpoint_setup(const vector<double>& y_squared)
+bool multi_chkpoint_one_setup(const vector<double>& y_squared)
 {   size_t num_threads = std::max(num_threads_, size_t(1));
     bool   ok          = num_threads == thread_alloc::num_threads();
     ok                &= thread_alloc::thread_num() == 0;
@@ -259,17 +262,18 @@ bool multi_checkpoint_setup(const vector<double>& y_squared)
 // END SETUP C++
 /*
 ------------------------------------------------------------------------------
-$begin multi_checkpoint_worker$$
+$begin multi_chkpoint_one_worker$$
 $spell
+    chkpoint
 $$
 
-$section Multi-Threaded Checkpoint Worker$$
+$section Multi-Threaded chkpoint_one Worker$$
 
 $head Purpose$$
 This routine does the computation for one thread.
 
 $head Source$$
-$srcfile%example/multi_thread/multi_checkpoint.cpp%0
+$srcfile%example/multi_thread/multi_chkpoint_one.cpp%0
     %// BEGIN WORKER C++%// END WORKER C++%
 1%$$
 
@@ -277,7 +281,7 @@ $end
 */
 // BEGIN WORKER C++
 namespace {
-void multi_checkpoint_worker(void)
+void multi_chkpoint_one_worker(void)
 {   size_t thread_num  = thread_alloc::thread_num();
     size_t num_threads = std::max(num_threads_, size_t(1));
     bool   ok          = thread_num < num_threads;
@@ -297,20 +301,21 @@ void multi_checkpoint_worker(void)
 // END WORKER C++
 /*
 ------------------------------------------------------------------------------
-$begin multi_checkpoint_takedown$$
+$begin multi_chkpoint_one_takedown$$
 $spell
+    chkpoint
     CppAD
     bool
 $$
 
-$section Multi-Threaded Checkpoint Take Down$$
+$section Multi-Threaded chkpoint_one Take Down$$
 
 $head Syntax$$
-$icode%ok% = multi_checkpoint_takedown(%square_root%)%$$
+$icode%ok% = multi_chkpoint_one_takedown(%square_root%)%$$
 
 $head Purpose$$
 This routine gathers up the results for each thread and
-frees memory that was allocated by $cref multi_checkpoint_setup$$.
+frees memory that was allocated by $cref multi_chkpoint_one_setup$$.
 
 $head Thread$$
 It is assumed that this function is called by thread zero
@@ -324,7 +329,7 @@ $codei%
 The input value of $icode square_root$$ does not matter.
 Upon return,
 it has the same size and is the element by element square root of
-$cref/y_squared/multi_checkpoint_setup/y_squared/$$.
+$cref/y_squared/multi_chkpoint_one_setup/y_squared/$$.
 
 $head ok$$
 This return value has prototype
@@ -332,10 +337,10 @@ $codei%
     bool %ok%
 %$$
 If it is false,
-$code multi_checkpoint_takedown$$ detected an error.
+$code multi_chkpoint_one_takedown$$ detected an error.
 
 $head Source$$
-$srcfile%example/multi_thread/multi_checkpoint.cpp%0
+$srcfile%example/multi_thread/multi_chkpoint_one.cpp%0
     %// BEGIN TAKEDOWN C++%// END TAKEDOWN C++%
 1%$$
 
@@ -343,7 +348,7 @@ $end
 */
 // BEGIN TAKEDOWN C++
 namespace {
-bool multi_checkpoint_takedown(vector<double>& square_root)
+bool multi_chkpoint_one_takedown(vector<double>& square_root)
 {   bool ok            = true;
     ok                &= thread_alloc::thread_num() == 0;
     size_t num_threads = std::max(num_threads_, size_t(1));
@@ -389,17 +394,18 @@ bool multi_checkpoint_takedown(vector<double>& square_root)
 }
 // END TAKEDOWN C++
 /*
-$begin multi_checkpoint_run$$
+$begin multi_chkpoint_one_run$$
 $spell
+    chkpoint
     const
     CppAD
     bool
 $$
 
-$section Run Multi-Threaded Checkpoint Calculation$$
+$section Run Multi-Threaded chkpoint_one Calculation$$
 
 $head Syntax$$
-$icode%ok% = multi_checkpoint_run(%y_squared%, %square_root%)%$$
+$icode%ok% = multi_chkpoint_one_run(%y_squared%, %square_root%)%$$
 
 $head Thread$$
 It is assumed that this function is called by thread zero
@@ -429,10 +435,10 @@ $codei%
     bool %ok%
 %$$
 If it is false,
-$code multi_checkpoint_run$$ detected an error.
+$code multi_chkpoint_one_run$$ detected an error.
 
 $head Source$$
-$srcfile%example/multi_thread/multi_checkpoint.cpp%0
+$srcfile%example/multi_thread/multi_chkpoint_one.cpp%0
     %// BEGIN RUN C++%// END RUN C++%
 1%$$
 
@@ -441,7 +447,7 @@ $end
 */
 // BEGIN RUN C++
 namespace {
-bool multi_checkpoint_run(
+bool multi_chkpoint_one_run(
     const vector<double>& y_squared  ,
     vector<double>&      square_root )
 {
@@ -449,16 +455,16 @@ bool multi_checkpoint_run(
     ok     &= thread_alloc::thread_num() == 0;
 
     // setup the work for multi-threading
-    ok &= multi_checkpoint_setup(y_squared);
+    ok &= multi_chkpoint_one_setup(y_squared);
 
     // now do the work for each thread
     if( num_threads_ > 0 )
-        team_work( multi_checkpoint_worker );
+        team_work( multi_chkpoint_one_worker );
     else
-        multi_checkpoint_worker();
+        multi_chkpoint_one_worker();
 
     // combine the result for each thread and takedown the multi-threading.
-    ok &= multi_checkpoint_takedown(square_root);
+    ok &= multi_chkpoint_one_takedown(square_root);
 
     return ok;
 }
@@ -466,18 +472,19 @@ bool multi_checkpoint_run(
 // END RUN C++
 /*
 ------------------------------------------------------------------------------
-$begin multi_checkpoint_time$$
+$begin multi_chkpoint_one_time$$
 $spell
+    chkpoint
     num
     alloc
     bool
     CppAD
 $$
 
-$section Timing Test for Multi-Threaded Checkpoint Calculation$$
+$section Timing Test for Multi-Threaded chkpoint_one Calculation$$
 
 $head Syntax$$
-$icode%ok% = multi_checkpoint_time(
+$icode%ok% = multi_chkpoint_one_time(
     %time_out%, %test_time%, %num_threads%, %num_solve%
 )%$$
 
@@ -493,7 +500,7 @@ $codei%
 %$$
 Its input value of the argument does not matter.
 Upon return it is the number of wall clock seconds
-used by $cref multi_checkpoint_run$$.
+used by $cref multi_chkpoint_one_run$$.
 
 $head test_time$$
 This argument has prototype
@@ -531,7 +538,7 @@ $codei%
 %$$
 If it is true,
 $code harmonic_time$$ passed the correctness test and
-$code multi_checkpoint_time$$ did not detect an error.
+$code multi_chkpoint_one_time$$ did not detect an error.
 Otherwise it is false.
 
 $end
@@ -546,9 +553,9 @@ namespace {
     vector<double> square_root_;
     //
     void test_once(void)
-    {   bool ok = multi_checkpoint_run(y_squared_, square_root_);
+    {   bool ok = multi_chkpoint_one_run(y_squared_, square_root_);
         if( ! ok )
-        {   std::cerr << "multi_checkpoint_run: error" << std::endl;
+        {   std::cerr << "multi_chkpoint_one_run: error" << std::endl;
             exit(1);
         }
         return;
@@ -562,7 +569,7 @@ namespace {
     }
 }
 // This is the only routine that is accessible outside of this file
-bool multi_checkpoint_time(
+bool multi_chkpoint_one_time(
     double& time_out, double test_time, size_t num_threads, size_t num_solve
 )
 {   bool ok = true;
diff --git a/example/multi_thread/multi_chkpoint_one.hpp b/example/multi_thread/multi_chkpoint_one.hpp
new file mode 100644
index 000000000..8c77e98f7
--- /dev/null
+++ b/example/multi_thread/multi_chkpoint_one.hpp
@@ -0,0 +1,19 @@
+# ifndef CPPAD_EXAMPLE_MULTI_THREAD_MULTI_CHKPOINT_ONE_HPP
+# define CPPAD_EXAMPLE_MULTI_THREAD_MULTI_CHKPOINT_ONE_HPP
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+
+bool multi_chkpoint_one_time(
+    double& time_out, double test_time, size_t num_threads, size_t num_solve
+);
+
+# endif
diff --git a/example/multi_thread/multi_chkpoint_one.omh b/example/multi_thread/multi_chkpoint_one.omh
new file mode 100755
index 000000000..e76ba68c8
--- /dev/null
+++ b/example/multi_thread/multi_chkpoint_one.omh
@@ -0,0 +1,31 @@
+-------------------------------------------------------------------------------
+  CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+  CppAD is distributed under the terms of the
+               Eclipse Public License Version 2.0.
+
+  This Source Code may also be made available under the following
+  Secondary License when the conditions for such availability set forth
+  in the Eclipse Public License, Version 2.0 are satisfied:
+        GNU General Public License, Version 2.0 or later.
+-------------------------------------------------------------------------------
+$begin multi_chkpoint_one.cpp$$
+$spell
+    chkpoint
+    cpp
+$$
+
+$section Multi-Threading chkpoint_one Example / Test$$
+
+$head Deprecated 2019-08-06$$
+The example has been deprecated, use $cref multi_chkpoint_two.cpp$$ instead.
+
+$head Source File$$
+All of the routines below are located in the file
+$codep
+    example/multi_thread/multi_chkpoint_one.cpp
+$$
+
+$childtable%example/multi_thread/multi_chkpoint_one.cpp%$$
+
+$end
diff --git a/example/multi_thread/multi_chkpoint_two.cpp b/example/multi_thread/multi_chkpoint_two.cpp
new file mode 100644
index 000000000..e4428188f
--- /dev/null
+++ b/example/multi_thread/multi_chkpoint_two.cpp
@@ -0,0 +1,646 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+
+/*
+$begin multi_chkpoint_two_algo$$
+$spell
+    chkpoint
+    au
+    const
+    ADvector
+    num
+    itr
+    algo
+$$
+
+$section chkpoint_two Algorithm that Computes Square Root$$
+
+$head Syntax$$
+$icode%checkpoint_algo%(%au%, %ay%)%$$
+
+$head Purpose$$
+This algorithm computes a square root using Newton's method.
+It is meant to be very inefficient in order to demonstrate timing results.
+
+$head au$$
+This argument has prototype
+$codei%
+    const %ADvector%& %au%
+%$$
+where $icode ADvector$$ is a
+$cref/simple vector class/SimpleVector/$$ with elements
+of type $code AD<double>$$.
+The size of $icode au$$ is three.
+
+$subhead y_initial$$
+We use the notation
+$codei%
+    %y_initial% = %au%[0]
+%$$
+for the initial value of the Newton iterate.
+
+$subhead y_squared$$
+We use the notation
+$codei%
+    %y_squared% = %au%[1]
+%$$
+for the value we are taking the square root of.
+
+$head ay$$
+This argument has prototype
+$codei%
+    %ADvector%& %ay%
+%$$
+The size of $icode ay$$ is one and
+$icode%ay%[0]%$$ is the square root of $icode y_squared$$.
+
+$head Source$$
+$srcfile%example/multi_thread/multi_chkpoint_two.cpp%0
+    %// BEGIN ALGO C++%// END ALGO C++%
+1%$$
+
+$end
+*/
+// BEGIN ALGO C++
+// includes used by all source code in multi_chkpoint_two.cpp file
+# include <cppad/cppad.hpp>
+# include "multi_chkpoint_two.hpp"
+# include "team_thread.hpp"
+//
+namespace {
+    using CppAD::thread_alloc; // fast multi-threading memory allocator
+    using CppAD::vector;       // uses thread_alloc
+    //
+    typedef CppAD::AD<double> a_double;
+
+    void checkpoint_algo(const vector<a_double>& au , vector<a_double>& ay)
+    {
+        // extract components of argument vector
+        a_double y_initial  = au[0];
+        a_double y_squared  = au[1];
+
+        // Use Newton's method to solve f(y) = y^2 = y_squared
+        a_double y_itr = y_initial;
+        for(size_t itr = 0; itr < 20; itr++)
+        {   // solve (y - y_itr) * f'(y_itr) = y_squared - y_itr^2
+            a_double fp_itr = 2.0 * y_itr;
+            y_itr           = y_itr + (y_squared - y_itr * y_itr) / fp_itr;
+        }
+
+        // return the Newton approximation for f(y) = y_squared
+        ay[0] = y_itr;
+    }
+}
+// END ALGO C++
+
+/*
+$begin multi_chkpoint_two_common$$
+$spell
+    chkpoint
+$$
+
+$section Multi-Threaded chkpoint_two Common Information$$
+
+$head Purpose$$
+This source code defines the common variables that are used by
+the $codei%multi_chkpoint_two_%name%$$ functions.
+
+$head Source$$
+$srcfile%example/multi_thread/multi_chkpoint_two.cpp%0
+    %// BEGIN COMMON C++%// END COMMON C++%
+1%$$
+
+$end
+*/
+// BEGIN COMMON C++
+namespace {
+    // Number of threads, set by multi_chkpoint_two_time
+    // (zero means one thread with no multi-threading setup)
+    size_t num_threads_ = 0;
+
+    // We can use one checkpoint function for all threads because
+    // there is no member data that gets changed during worker call.
+    // This needs to stay in scope for as long as a recording will use it.
+    // We cannot be in parallel mode when this object is created or deleted.
+    // We use a pointer so that there is no left over memory in thread zero.
+    CppAD::chkpoint_two<double>* a_square_root_ = CPPAD_NULL;
+
+    // structure with information for one thread
+    typedef struct {
+        // used by worker to compute the square root,
+        // set by multi_chkpoint_two_setup
+        CppAD::ADFun<double>* fun;
+        //
+        // value we are computing square root of, set by multi_chkpoint_two_setup
+        vector<double>* y_squared;
+        //
+        // square root, set by worker
+        vector<double>* square_root;
+        //
+        // false if an error occurs, true otherwise, set by worker
+        bool ok;
+    } work_one_t;
+    //
+    // Vector with information for all threads
+    // (uses pointers instead of values to avoid false sharing)
+    // allocated by multi_chkpoint_two_setup, freed by multi_chkpoint_two_takedown
+    work_one_t* work_all_[CPPAD_MAX_NUM_THREADS];
+}
+// END COMMON C++
+/*
+-------------------------------------------------------------------------------
+$begin multi_chkpoint_two_setup$$
+$spell
+    chkpoint
+    const
+    CppAD
+    bool
+$$
+
+$section Multi-Threaded chkpoint_two Set Up$$.
+
+$head Syntax$$
+$icode%ok% = multi_chkpoint_two_setup(%y_squared%)%$$
+
+$head Purpose$$
+This routine splits up the computation into the individual threads.
+
+$head Thread$$
+It is assumed that this function is called by thread zero
+and all the other threads are blocked (waiting).
+
+$head y_squared$$
+This argument has prototype
+$codei%
+    const vector<double>& %y_squared%
+%$$
+and its size is equal to the number of equations to solve.
+It is the values that we are computing the square root of.
+
+$head ok$$
+This return value has prototype
+$codei%
+    bool %ok%
+%$$
+If it is false,
+$code multi_chkpoint_two_setup$$ detected an error.
+
+$head Source$$
+$srcfile%example/multi_thread/multi_chkpoint_two.cpp%0
+    %// BEGIN SETUP C++%// END SETUP C++%
+1%$$
+
+$end
+*/
+// BEGIN SETUP C++
+namespace {
+bool multi_chkpoint_two_setup(const vector<double>& y_squared)
+{   size_t num_threads = std::max(num_threads_, size_t(1));
+    bool   ok          = num_threads == thread_alloc::num_threads();
+    ok                &= thread_alloc::thread_num() == 0;
+    //
+    // declare independent variable variable vector
+    vector<a_double> ax(1);
+    ax[0] = 2.0;
+    CppAD::Independent(ax);
+    //
+    // argument and result for checkpoint algorithm
+    vector<a_double> au(2), ay(1);
+    au[0] = ax[0];                  // y_initial
+    au[1] = ax[0];                  // y_squared
+
+    // put user checkpoint function in recording
+    (*a_square_root_)(au, ay);
+
+    // f(u) = sqrt(u)
+    CppAD::ADFun<double> fun(ax, ay);
+    //
+    // number of square roots for each thread
+    size_t per_thread = (y_squared.size() + num_threads - 1) / num_threads;
+    size_t y_index    = 0;
+    //
+    for(size_t thread_num = 0; thread_num < num_threads; thread_num++)
+    {   // allocate separate memory for each thread to avoid false sharing
+        size_t min_bytes(sizeof(work_one_t)), cap_bytes;
+        void* v_ptr = thread_alloc::get_memory(min_bytes, cap_bytes);
+        work_all_[thread_num] = static_cast<work_one_t*>(v_ptr);
+        //
+        // Run constructor on work_all_[thread_num]->fun
+        work_all_[thread_num]->fun = new CppAD::ADFun<double>;
+        //
+        // Run constructor on work_all_[thread_num] vectors
+        work_all_[thread_num]->y_squared = new vector<double>;
+        work_all_[thread_num]->square_root = new vector<double>;
+        //
+        // Each worker gets a separate copy of fun. This is necessary because
+        // the Taylor coefficients will be set by each thread.
+        *(work_all_[thread_num]->fun) = fun;
+        //
+        // values we are computing square root of for this thread
+        ok &=  0 == work_all_[thread_num]->y_squared->size();
+        for(size_t i = 0; i < per_thread; i++)
+        if( y_index < y_squared.size() )
+            work_all_[thread_num]->y_squared->push_back(y_squared[y_index++]);
+        //
+        // set to false in case this thread's worker does not get called
+        work_all_[thread_num]->ok = false;
+    }
+    ok &= y_index == y_squared.size();
+    //
+    return ok;
+}
+}
+// END SETUP C++
+/*
+------------------------------------------------------------------------------
+$begin multi_chkpoint_two_worker$$
+$spell
+    chkpoint
+$$
+
+$section Multi-Threaded chkpoint_two Worker$$
+
+$head Purpose$$
+This routine does the computation for one thread.
+
+$head Source$$
+$srcfile%example/multi_thread/multi_chkpoint_two.cpp%0
+    %// BEGIN WORKER C++%// END WORKER C++%
+1%$$
+
+$end
+*/
+// BEGIN WORKER C++
+namespace {
+void multi_chkpoint_two_worker(void)
+{   size_t thread_num  = thread_alloc::thread_num();
+    size_t num_threads = std::max(num_threads_, size_t(1));
+    bool   ok          = thread_num < num_threads;
+    //
+    vector<double> x(1), y(1);
+    size_t n = work_all_[thread_num]->y_squared->size();
+    work_all_[thread_num]->square_root->resize(n);
+    for(size_t i = 0; i < n; i++)
+    {   x[0] = (* work_all_[thread_num]->y_squared )[i];
+        y    = work_all_[thread_num]->fun->Forward(0, x);
+        //
+        (* work_all_[thread_num]->square_root )[i] = y[0];
+    }
+    work_all_[thread_num]->ok             = ok;
+}
+}
+// END WORKER C++
+/*
+------------------------------------------------------------------------------
+$begin multi_chkpoint_two_takedown$$
+$spell
+    chkpoint
+    CppAD
+    bool
+$$
+
+$section Multi-Threaded chkpoint_two Take Down$$
+
+$head Syntax$$
+$icode%ok% = multi_chkpoint_two_takedown(%square_root%)%$$
+
+$head Purpose$$
+This routine gathers up the results for each thread and
+frees memory that was allocated by $cref multi_chkpoint_two_setup$$.
+
+$head Thread$$
+It is assumed that this function is called by thread zero
+and all the other threads are blocked (waiting).
+
+$head square_root$$
+This argument has prototype
+$codei%
+    vector<double>& %square_root%
+%$$
+The input value of $icode square_root$$ does not matter.
+Upon return,
+it has the same size and is the element by element square root of
+$cref/y_squared/multi_chkpoint_two_setup/y_squared/$$.
+
+$head ok$$
+This return value has prototype
+$codei%
+    bool %ok%
+%$$
+If it is false,
+$code multi_chkpoint_two_takedown$$ detected an error.
+
+$head Source$$
+$srcfile%example/multi_thread/multi_chkpoint_two.cpp%0
+    %// BEGIN TAKEDOWN C++%// END TAKEDOWN C++%
+1%$$
+
+$end
+*/
+// BEGIN TAKEDOWN C++
+namespace {
+bool multi_chkpoint_two_takedown(vector<double>& square_root)
+{   bool ok            = true;
+    ok                &= thread_alloc::thread_num() == 0;
+    size_t num_threads = std::max(num_threads_, size_t(1));
+    //
+    // extract square roots in original order
+    square_root.resize(0);
+    for(size_t thread_num = 0; thread_num < num_threads; thread_num++)
+    {   // results for this thread
+        size_t n = work_all_[thread_num]->square_root->size();
+        for(size_t i = 0; i < n; i++)
+            square_root.push_back((* work_all_[thread_num]->square_root )[i]);
+    }
+    //
+    // go down so that free memory for other threads before memory for master
+    size_t thread_num = num_threads;
+    while(thread_num--)
+    {   // check that this tread was ok with the work it did
+        ok  &= work_all_[thread_num]->ok;
+        //
+        // run destructor on vector object for this thread
+        delete work_all_[thread_num]->y_squared;
+        delete work_all_[thread_num]->square_root;
+        //
+        // run destructor on function object for this thread
+        delete work_all_[thread_num]->fun;
+        //
+        // delete problem specific information
+        void* v_ptr = static_cast<void*>( work_all_[thread_num] );
+        thread_alloc::return_memory( v_ptr );
+        //
+        // Note that checkpoint object has memory connect to each thread
+        // thread_alloc::inuse(thread_num) cannot be zero until it is deleted
+        if( thread_num > 0 )
+        {   ok &= thread_alloc::inuse(thread_num) > 0;
+            //
+            // return all memory that is not in use and
+            // but being held for future use by this thread
+            thread_alloc::free_available(thread_num);
+        }
+    }
+    return ok;
+}
+}
+// END TAKEDOWN C++
+/*
+$begin multi_chkpoint_two_run$$
+$spell
+    chkpoint
+    const
+    CppAD
+    bool
+$$
+
+$section Run Multi-Threaded chkpoint_two Calculation$$
+
+$head Syntax$$
+$icode%ok% = multi_chkpoint_two_run(%y_squared%, %square_root%)%$$
+
+$head Thread$$
+It is assumed that this function is called by thread zero
+and all the other threads are blocked (waiting).
+
+$head y_squared$$
+This argument has prototype
+$codei%
+    const vector<double>& %y_squared%
+%$$
+and its size is equal to the number of threads.
+It is the values that we are computing the square root of.
+
+$head square_root$$
+This argument has prototype
+$codei%
+    vector<double>& %square_root%
+%$$
+The input value of $icode square_root$$ does not matter.
+Upon return,
+it has the same size and
+is the element by element square root of $icode y_squared$$.
+
+$head ok$$
+This return value has prototype
+$codei%
+    bool %ok%
+%$$
+If it is false,
+$code multi_chkpoint_two_run$$ detected an error.
+
+$head Source$$
+$srcfile%example/multi_thread/multi_chkpoint_two.cpp%0
+    %// BEGIN RUN C++%// END RUN C++%
+1%$$
+
+$end
+------------------------------------------------------------------------------
+*/
+// BEGIN RUN C++
+namespace {
+bool multi_chkpoint_two_run(
+    const vector<double>& y_squared  ,
+    vector<double>&      square_root )
+{
+    bool ok = true;
+    ok     &= thread_alloc::thread_num() == 0;
+
+    // setup the work for multi-threading
+    ok &= multi_chkpoint_two_setup(y_squared);
+
+    // now do the work for each thread
+    if( num_threads_ > 0 )
+        team_work( multi_chkpoint_two_worker );
+    else
+        multi_chkpoint_two_worker();
+
+    // combine the result for each thread and takedown the multi-threading.
+    ok &= multi_chkpoint_two_takedown(square_root);
+
+    return ok;
+}
+}
+// END RUN C++
+/*
+------------------------------------------------------------------------------
+$begin multi_chkpoint_two_time$$
+$spell
+    chkpoint
+    num
+    alloc
+    bool
+    CppAD
+$$
+
+$section Timing Test for Multi-Threaded chkpoint_two Calculation$$
+
+$head Syntax$$
+$icode%ok% = multi_chkpoint_two_time(
+    %time_out%, %test_time%, %num_threads%, %num_solve%
+)%$$
+
+
+$head Thread$$
+It is assumed that this function is called by thread zero in sequential
+mode; i.e., not $cref/in_parallel/ta_in_parallel/$$.
+
+$head time_out$$
+This argument has prototype
+$codei%
+    double& %time_out%
+%$$
+Its input value of the argument does not matter.
+Upon return it is the number of wall clock seconds
+used by $cref multi_chkpoint_two_run$$.
+
+$head test_time$$
+This argument has prototype
+$codei%
+    double %test_time%
+%$$
+and is the minimum amount of wall clock time that the test should take.
+The number of repeats for the test will be increased until this time
+is reached.
+The reported $icode time_out$$ is the total wall clock time divided by the
+number of repeats.
+
+$head num_threads$$
+This argument has prototype
+$codei%
+    size_t %num_threads%
+%$$
+It specifies the number of threads that are available for this test.
+If it is zero, the test is run without the multi-threading environment and
+$codei%
+    1 == thread_alloc::num_threads()
+%$$
+If it is non-zero, the test is run with the multi-threading and
+$codei%
+    %num_threads% = thread_alloc::num_threads()
+%$$
+
+$head num_solve$$
+This specifies the number of square roots that will be solved for.
+
+$head ok$$
+The return value has prototype
+$codei%
+    bool %ok%
+%$$
+If it is true,
+$code harmonic_time$$ passed the correctness test and
+$code multi_chkpoint_two_time$$ did not detect an error.
+Otherwise it is false.
+
+$end
+*/
+
+// BEGIN TIME C++
+namespace {
+    // values we are taking the square root of
+    vector<double> y_squared_;
+
+    // results of the square root calculations
+    vector<double> square_root_;
+    //
+    void test_once(void)
+    {   bool ok = multi_chkpoint_two_run(y_squared_, square_root_);
+        if( ! ok )
+        {   std::cerr << "multi_chkpoint_two_run: error" << std::endl;
+            exit(1);
+        }
+        return;
+    }
+    //
+    void test_repeat(size_t repeat)
+    {   size_t i;
+        for(i = 0; i < repeat; i++)
+            test_once();
+        return;
+    }
+}
+// This is the only routine that is accessible outside of this file
+bool multi_chkpoint_two_time(
+    double& time_out, double test_time, size_t num_threads, size_t num_solve
+)
+{   bool ok = true;
+    //
+    size_t initial_inuse = thread_alloc::inuse(0);
+
+    // number of threads, zero for no multi-threading
+    num_threads_ = num_threads;
+
+    // values we are talking the square root of
+    y_squared_.resize(num_solve);
+    for(size_t i_solve = 0; i_solve < num_solve; i_solve++)
+        y_squared_[i_solve] = double(i_solve) + 2.0;
+
+    // create a_square_root_ in sequential mode
+    {   // create corresponding ADFun inside block so it gets destroyed
+        // and does not have thread_alloc memory inuse at the end
+        vector<a_double> au(2), ay(1);
+        au[0] = 2.0;
+        au[1] = 2.0;
+        CppAD::Independent(au);
+        checkpoint_algo(au, ay);
+        CppAD::ADFun<double> fun(au, ay);
+        //
+        // create chkpoint_two version of algorithm
+        const char* name      = "square_root";
+        bool internal_bool    = false;
+        bool use_hes_sparsity = false;
+        bool use_base2ad      = false;
+        bool use_in_parallel  = true;
+        a_square_root_ = new CppAD::chkpoint_two<double>( fun, name,
+            internal_bool, use_hes_sparsity, use_base2ad, use_in_parallel
+        );
+    }
+
+    // create team of threads
+    ok &= thread_alloc::in_parallel() == false;
+    if( num_threads > 0 )
+    {   team_create(num_threads);
+        ok &= num_threads == thread_alloc::num_threads();
+    }
+    else
+    {   ok &= 1 == thread_alloc::num_threads();
+    }
+
+    // run the test case and set the time return value
+    time_out = CppAD::time_test(test_repeat, test_time);
+
+    // destroy team of threads
+    if( num_threads > 0 )
+        team_destroy();
+    ok &= thread_alloc::in_parallel() == false;
+
+    // must delete a_square_root_ in sequential mode
+    delete a_square_root_;
+
+    // correctness check
+    ok &= square_root_.size() == num_solve;
+    double eps99 = 99.0 * std::numeric_limits<double>::epsilon();
+    for(size_t i = 0; i < num_solve; i++)
+    {   double check = std::sqrt( y_squared_[i] );
+        ok          &= std::fabs( square_root_[i] / check - 1.0 ) <= eps99;
+    }
+    //
+    // free memory in CppAD vectors that are still in scope
+    y_squared_.clear();
+    square_root_.clear();
+    //
+    // check that no static variables in this file are holding onto memory
+    ok &= initial_inuse == thread_alloc::inuse(0);
+    //
+    return ok;
+}
+// END TIME C++
diff --git a/example/multi_thread/multi_chkpoint_two.hpp b/example/multi_thread/multi_chkpoint_two.hpp
new file mode 100644
index 000000000..05a489509
--- /dev/null
+++ b/example/multi_thread/multi_chkpoint_two.hpp
@@ -0,0 +1,19 @@
+# ifndef CPPAD_EXAMPLE_MULTI_THREAD_MULTI_CHKPOINT_TWO_HPP
+# define CPPAD_EXAMPLE_MULTI_THREAD_MULTI_CHKPOINT_TWO_HPP
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+
+bool multi_chkpoint_two_time(
+    double& time_out, double test_time, size_t num_threads, size_t num_solve
+);
+
+# endif
diff --git a/example/multi_thread/multi_checkpoint.omh b/example/multi_thread/multi_chkpoint_two.omh
old mode 100755
new mode 100644
similarity index 70%
rename from example/multi_thread/multi_checkpoint.omh
rename to example/multi_thread/multi_chkpoint_two.omh
index ba516846d..1ee84b6c2
--- a/example/multi_thread/multi_checkpoint.omh
+++ b/example/multi_thread/multi_chkpoint_two.omh
@@ -1,5 +1,5 @@
 -------------------------------------------------------------------------------
-  CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+  CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
   CppAD is distributed under the terms of the
                Eclipse Public License Version 2.0.
@@ -9,19 +9,20 @@
   in the Eclipse Public License, Version 2.0 are satisfied:
         GNU General Public License, Version 2.0 or later.
 -------------------------------------------------------------------------------
-$begin multi_checkpoint.cpp$$
+$begin multi_chkpoint_two.cpp$$
 $spell
+    chkpoint
     cpp
 $$
 
-$section Multi-Threading Checkpoint Example / Test$$
+$section Multi-Threading chkpoint_two Example / Test$$
 
 $head Source File$$
 All of the routines below are located in the file
 $codep
-    example/multi_thread/multi_checkpoint.cpp
+    example/multi_thread/multi_chkpoint_two.cpp
 $$
 
-$childtable%example/multi_thread/multi_checkpoint.cpp%$$
+$childtable%example/multi_thread/multi_chkpoint_two.cpp%$$
 
 $end
diff --git a/example/multi_thread/openmp/CMakeLists.txt b/example/multi_thread/openmp/CMakeLists.txt
index a6a6446ae..7fee8e945 100644
--- a/example/multi_thread/openmp/CMakeLists.txt
+++ b/example/multi_thread/openmp/CMakeLists.txt
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -26,8 +26,10 @@ SET(source_list ../thread_test.cpp
     ${CMAKE_SOURCE_DIR}/speed/src/microsoft_timer.cpp
     ../team_example.cpp
     ../harmonic.cpp
-    ../multi_atomic.cpp
-    ../multi_checkpoint.cpp
+    ../multi_atomic_two.cpp
+    ../multi_atomic_three.cpp
+    ../multi_chkpoint_one.cpp
+    ../multi_chkpoint_two.cpp
     ../multi_newton.cpp
     a11c_openmp.cpp
     simple_ad_openmp.cpp
diff --git a/example/multi_thread/pthread/CMakeLists.txt b/example/multi_thread/pthread/CMakeLists.txt
index c8085dd7c..156890e29 100644
--- a/example/multi_thread/pthread/CMakeLists.txt
+++ b/example/multi_thread/pthread/CMakeLists.txt
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -22,8 +22,10 @@ SET(source_list ../thread_test.cpp
     ${CMAKE_SOURCE_DIR}/speed/src/microsoft_timer.cpp
     ../team_example.cpp
     ../harmonic.cpp
-    ../multi_atomic.cpp
-    ../multi_checkpoint.cpp
+    ../multi_atomic_two.cpp
+    ../multi_atomic_three.cpp
+    ../multi_chkpoint_one.cpp
+    ../multi_chkpoint_two.cpp
     ../multi_newton.cpp
     a11c_pthread.cpp
     simple_ad_pthread.cpp
diff --git a/example/multi_thread/test.sh b/example/multi_thread/test.sh
index 4d2610b2c..d84b18df4 100755
--- a/example/multi_thread/test.sh
+++ b/example/multi_thread/test.sh
@@ -1,6 +1,6 @@
 #! /bin/sh -e
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -58,7 +58,7 @@ next_program
 next_program
 echo
 # test_time=1 max_thread=4, num_solve=100
-./$program multi_atomic 1 4 100
+./$program multi_atomic_two 1 4 100
 next_program
 echo
 # test_time= 2 max_thread=4, num_zero=20, num_sub=30, num_sum=500, use_ad=true
diff --git a/example/multi_thread/thread_test.cpp b/example/multi_thread/thread_test.cpp
index 2ed4f3e8a..c4289294c 100644
--- a/example/multi_thread/thread_test.cpp
+++ b/example/multi_thread/thread_test.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -21,6 +21,7 @@ $spell
     pthreads
     openmp
     bthread
+    chkpoint
 $$
 
 
@@ -41,7 +42,7 @@ $code bthread$$, $code pthread$$, or $code openmp$$ respectively.
 
 $head program$$
 We use the notation $icode program$$ for
-$icode%
+$codei%
      example_multi_thread_%threading%
 %$$
 
@@ -62,10 +63,15 @@ $codei%.
 ./%program% simple_ad
 ./%program% team_example
 ./%program% harmonic     %test_time% %max_threads% %mega_sum%
-./%program% multi_atomic %test_time% %max_threads% %num_solve%
+./%program% atomic_two   %test_time% %max_threads% %num_solve%
+./%program% atomic_three %test_time% %max_threads% %num_solve%
+./%program% chkpoint_one %test_time% %max_threads% %num_solve%
+./%program% chkpoint_two %test_time% %max_threads% %num_solve%
 ./%program% multi_newton %test_time% %max_threads% \
     %num_zero% %num_sub% %num_sum% %use_ad%
 %$$
+We refer to the values $code a11c$$, ... , $code multi_newton$$
+as the $icode test_case$$ below.
 
 $children%
     example/multi_thread/openmp/a11c_openmp.cpp%
@@ -78,52 +84,49 @@ $children%
 
     example/multi_thread/team_example.cpp%
     example/multi_thread/harmonic.omh%
-    example/multi_thread/multi_atomic.omh%
-    example/multi_thread/multi_checkpoint.omh%
+    example/multi_thread/multi_atomic_three.omh%
+    example/multi_thread/multi_chkpoint_two.omh%
     example/multi_thread/multi_newton.omh%
 
     example/multi_thread/team_thread.hpp
 %$$
 
 $head a11c$$
-The examples
+The $icode test_case$$ $code a11c$$ runs the examples
 $cref a11c_openmp.cpp$$,
 $cref a11c_bthread.cpp$$, and
-$cref a11c_pthread.cpp$$
-demonstrate simple multi-threading,
-without algorithmic differentiation.
+$cref a11c_pthread.cpp$$.
+These cases demonstrate simple multi-threading,
+without algorithmic differentiation, using
+OpenMP, boost threads and pthreads respectively.
 
 $head simple_ad$$
-The examples
+The $icode test_case$$ $code simple_ad$$ runs the examples
 $cref simple_ad_openmp.cpp$$,
 $cref simple_ad_bthread.cpp$$,
 and
-$cref simple_ad_pthread.cpp$$
-demonstrate simple multi-threading,
+$cref simple_ad_pthread.cpp$$.
+These cases demonstrate simple multi-threading,
 with algorithmic differentiation, using
 OpenMP, boost threads and pthreads respectively.
 
 $head team_example$$
-The $cref team_example.cpp$$ routine
-demonstrates simple multi-threading with algorithmic differentiation
+The $icode test_case$$ $code team_example$$ runs the
+$cref team_example.cpp$$ example.
+This case demonstrates simple multi-threading with algorithmic differentiation
 and using a $cref/team of threads/team_thread.hpp/$$.
 
-$comment ------------------------------------------------------------------- $$
-
-$head harmonic$$
-The $cref harmonic_time$$ routine
-preforms a timing test for a multi-threading
-example without algorithmic differentiation using a team of threads.
-
-$subhead test_time$$
-Is the minimum amount of wall clock time that the test should take.
+$head test_time$$
+All of the other cases include the $icode test_time$$ argument.
+This is the minimum amount of wall clock time that the test should take.
 The number of repeats for the test will be increased until this time
 is reached.
 The reported time is the total wall clock time divided by the
 number of repeats.
 
 $subhead max_threads$$
-If the argument $icode max_threads$$ is a non-negative integer specifying
+All of the other cases include the $icode max_threads$$ argument.
+This is a non-negative integer specifying
 the maximum number of threads to use for the test.
 The specified test is run with the following number of threads:
 $codei%
@@ -131,61 +134,51 @@ $codei%
 %$$
 The value of zero corresponds to not using the multi-threading system.
 
+$comment ------------------------------------------------------------------- $$
+
+$head harmonic$$
+The $icode test_case$$ $code harmonic$$ runs the
+$cref harmonic_time$$ example.
+This is a timing test for a multi-threading
+example without algorithmic differentiation using a team of threads.
+
 $subhead mega_sum$$
 The command line argument $icode mega_sum$$
 is an integer greater than or equal one and has the same meaning as in
 $cref/harmonic_time/harmonic_time/mega_sum/$$.
+
 $comment ------------------------------------------------------------------- $$
 
-$head multi_atomic$$
-The $cref multi_atomic_time$$ routine
-preforms a timing test for a multi-threading
+$head Atomic and Checkpoint$$
+The $icode test_case$$ values
+$code atomic_two$$,
+$code atomic_three$$,
+$code chkpoint_one$$,
+$code chkpoint_two$$,
+all run the same problem.
+These cases preforms a timing test for a multi-threading
 example without algorithmic differentiation using a team of threads.
-
-$subhead test_time$$
-Is the minimum amount of wall clock time that the test should take.
-The number of repeats for the test will be increased until this time
-is reached.
-The reported time is the total wall clock time divided by the
-number of repeats.
-
-$subhead max_threads$$
-If the argument $icode max_threads$$ is a non-negative integer specifying
-the maximum number of threads to use for the test.
-The specified test is run with the following number of threads:
-$codei%
-    %num_threads% = 0 , %...% , %max_threads%
-%$$
-The value of zero corresponds to not using the multi-threading system.
+$table
+$icode test_case$$   $cnext Documentation                  $rnext
+$code atomic_two$$   $cnext $cref multi_atomic_two.cpp$$   $rnext
+$code atomic_three$$ $cnext $cref multi_atomic_three.cpp$$ $rnext
+$code chkpoint_one$$ $cnext $cref multi_chkpoint_one.cpp$$ $rnext
+$code chkpoint_two$$ $cnext $cref multi_chkpoint_two.cpp$$
+$tend
 
 $subhead num_solve$$
 The command line argument $icode num_solve$$
 is an integer specifying the number of solves; see
-$cref/num_solve/multi_atomic_time/num_solve/$$ in $code multi_atomic_time$$.
+$cref/num_solve/multi_atomic_two_time/num_solve/$$ in $code multi_atomic_two_time$$.
 
 $comment ------------------------------------------------------------------- $$
 
 $head multi_newton$$
-The $cref multi_newton_time$$ routine
-preforms a timing test for a multi-threading
+The $icode test_case$$ $code multi_newton$$  runs the
+$cref multi_newton.cpp$$ example.
+This preforms a timing test for a multi-threading
 example with algorithmic differentiation using a team of threads.
 
-$subhead test_time$$
-Is the minimum amount of wall clock time that the test should take.
-The number of repeats for the test will be increased until this time
-is reached.
-The reported time is the total wall clock time divided by the
-number of repeats.
-
-$subhead max_threads$$
-If the argument $icode max_threads$$ is a non-negative integer specifying
-the maximum number of threads to use for the test.
-The specified test is run with the following number of threads:
-$codei%
-    %num_threads% = 0 , %...% , %max_threads%
-%$$
-The value of zero corresponds to not using the multi-threading system.
-
 $subhead num_zero$$
 The command line argument $icode num_zero$$
 is an integer greater than or equal two and has the same meaning as in
@@ -231,8 +224,10 @@ $end
 # include "team_thread.hpp"
 # include "team_example.hpp"
 # include "harmonic.hpp"
-# include "multi_atomic.hpp"
-# include "multi_checkpoint.hpp"
+# include "multi_atomic_two.hpp"
+# include "multi_atomic_three.hpp"
+# include "multi_chkpoint_one.hpp"
+# include "multi_chkpoint_two.hpp"
 # include "multi_newton.hpp"
 
 extern bool a11c(void);
@@ -271,15 +266,18 @@ int main(int argc, char *argv[])
 
     // commnd line usage message
     const char* usage =
-    "./<thread>_test a11c\n"
-    "./<thread>_test simple_ad\n"
-    "./<thread>_test team_example\n"
-    "./<thread>_test harmonic     test_time max_threads mega_sum\n"
-    "./<thread>_test multi_atomic test_time max_threads num_solve\n"
-    "./<thread>_test checkpoint   test_time max_threads num_solve\n"
-    "./<thread>_test multi_newton test_time max_threads \\\n"
+    "./<program> a11c\n"
+    "./<program> simple_ad\n"
+    "./<program> team_example\n"
+    "./<program> harmonic     test_time max_threads mega_sum\n"
+    "./<program> atomic_two   test_time max_threads num_solve\n"
+    "./<program> atomic_three test_time max_threads num_solve\n"
+    "./<program> chkpoint_one test_time max_threads num_solve\n"
+    "./<program> chkpoint_two test_time max_threads num_solve\n"
+    "./<program> multi_newton test_time max_threads \\\n"
     "   num_zero num_sub num_sum use_ad\\\n"
-    "where <thread> is bthread, openmp, or pthread";
+    "where <program> is example_multi_thread_<threading>\n"
+    "and <threading> is bthread, openmp, or pthread";
 
     // command line argument values (assign values to avoid compiler warnings)
     size_t num_zero=0, num_sub=0, num_sum=0;
@@ -315,12 +313,18 @@ int main(int argc, char *argv[])
     bool run_simple_ad    = std::strcmp(test_name, "simple_ad")        == 0;
     bool run_team_example = std::strcmp(test_name, "team_example")     == 0;
     bool run_harmonic     = std::strcmp(test_name, "harmonic")         == 0;
-    bool run_multi_atomic = std::strcmp(test_name, "multi_atomic")     == 0;
-    bool run_checkpoint   = std::strcmp(test_name, "checkpoint")       == 0;
+    bool run_atomic_two   = std::strcmp(test_name, "atomic_two")       == 0;
+    bool run_atomic_three = std::strcmp(test_name, "atomic_three")     == 0;
+    bool run_chkpoint_one = std::strcmp(test_name, "chkpoint_one")     == 0;
+    bool run_chkpoint_two = std::strcmp(test_name, "chkpoint_two")     == 0;
     bool run_multi_newton = std::strcmp(test_name, "multi_newton")     == 0;
     if( run_a11c || run_simple_ad || run_team_example )
         ok = (argc == 2);
-    else if( run_harmonic || run_multi_atomic || run_checkpoint )
+    else if( run_harmonic
+    || run_atomic_two
+    || run_atomic_three
+    || run_chkpoint_one
+    || run_chkpoint_two )
         ok = (argc == 5);
     else if( run_multi_newton )
         ok = (argc == 8);
@@ -367,7 +371,10 @@ int main(int argc, char *argv[])
             "run: mega_sum is less than one"
         );
     }
-    else if( run_multi_atomic || run_checkpoint )
+    else if( run_atomic_two
+    || run_atomic_three
+    || run_chkpoint_one
+    || run_chkpoint_two )
     {   // num_solve
         num_solve = arg2size_t( *++argv, 1,
             "run: num_solve is less than one"
@@ -415,15 +422,24 @@ int main(int argc, char *argv[])
         bool this_ok;
 
         // run the requested test
-        if( run_harmonic ) this_ok =
-            harmonic_time(time_out, test_time, num_threads, mega_sum);
-        else if( run_multi_atomic ) this_ok =
-            multi_atomic_time(time_out, test_time, num_threads, num_solve);
-        else if( run_checkpoint ) this_ok =
-            multi_checkpoint_time(time_out, test_time, num_threads, num_solve);
+        if( run_harmonic ) this_ok = harmonic_time(
+            time_out, test_time, num_threads, mega_sum
+        );
+        else if( run_atomic_two ) this_ok = multi_atomic_two_time(
+            time_out, test_time, num_threads, num_solve
+        );
+        else if( run_atomic_three ) this_ok = multi_atomic_three_time(
+            time_out, test_time, num_threads, num_solve
+        );
+        else if( run_chkpoint_one ) this_ok = multi_chkpoint_one_time(
+            time_out, test_time, num_threads, num_solve
+        );
+        else if( run_chkpoint_two ) this_ok = multi_chkpoint_two_time(
+            time_out, test_time, num_threads, num_solve
+        );
         else
-        {   this_ok = run_multi_newton;
-            this_ok &= multi_newton_time(
+        {   assert( run_multi_newton);
+            this_ok = multi_newton_time(
                 time_out                ,
                 test_time               ,
                 num_threads             ,
diff --git a/example/optimize/CMakeLists.txt b/example/optimize/CMakeLists.txt
index bbd87eb89..82c838ae0 100644
--- a/example/optimize/CMakeLists.txt
+++ b/example/optimize/CMakeLists.txt
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -12,16 +12,20 @@
 # Build the example/optimize directory tests
 #
 #
+# BEGIN_SORT_THIS_LINE_PLUS_2
 SET(source_list
-    conditional_skip.cpp
     compare_op.cpp
+    conditional_skip.cpp
     cumulative_sum.cpp
     forward_active.cpp
     nest_conditional.cpp
-    print_for.cpp
     optimize.cpp
+    optimize_twice.cpp
+    print_for.cpp
     reverse_active.cpp
 )
+# END_SORT_THIS_LINE_MINUS_2
+
 set_compile_flags( example_optimize "${cppad_debug_which}" "${source_list}" )
 #
 ADD_EXECUTABLE(example_optimize EXCLUDE_FROM_ALL ${source_list})
diff --git a/example/optimize/compare_op.cpp b/example/optimize/compare_op.cpp
index 84a03f2ad..2fdd53de2 100644
--- a/example/optimize/compare_op.cpp
+++ b/example/optimize/compare_op.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -12,7 +12,7 @@ in the Eclipse Public License, Version 2.0 are satisfied:
 /*
 $begin optimize_compare_op.cpp$$
 
-$section Example Optimization and Comparison Operators$$
+$section Optimize Comparison Operators: Example and Test$$
 
 $head See Also$$
 $cref cond_exp.cpp$$
@@ -104,11 +104,13 @@ bool compare_op(void)
 
         // create f: x -> y and stop tape recording
         CppAD::ADFun<double> f(ax, ay);
+        ok &= f.size_order() == 1; // this constructor does 0 order forward
         ok &= f.size_var() == before.n_var;
         ok &= f.size_op() == before.n_op;
 
         // Optimize the operation sequence
         f.optimize(options);
+        ok &= f.size_order() == 0; // 0 order forward not present
         ok &= f.size_var() == after.n_var;
         ok &= f.size_op() == after.n_op;
 
diff --git a/example/optimize/conditional_skip.cpp b/example/optimize/conditional_skip.cpp
index 1cb8e101f..546420f8d 100644
--- a/example/optimize/conditional_skip.cpp
+++ b/example/optimize/conditional_skip.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -12,7 +12,7 @@ in the Eclipse Public License, Version 2.0 are satisfied:
 /*
 $begin optimize_conditional_skip.cpp$$
 
-$section Example Optimization and Conditional Expressions$$
+$section Optimize Conditional Expressions: Example and Test$$
 
 $head See Also$$
 $cref cond_exp.cpp$$
@@ -111,11 +111,13 @@ bool conditional_skip(void)
 
         // create f: x -> y and stop tape recording
         CppAD::ADFun<double> f(ax, ay);
+        ok &= f.size_order() == 1; // this constructor does 0 order forward
         ok &= f.size_var() == before.n_var;
         ok &= f.size_op()  == before.n_op;
 
         // Optimize the operation sequence
         f.optimize(options);
+        ok &= f.size_order() == 0; // 0 order forward not present
         ok &= f.size_var() == after.n_var;
         ok &= f.size_op()  == after.n_op;
 
diff --git a/example/optimize/cumulative_sum.cpp b/example/optimize/cumulative_sum.cpp
index 5c0ea12fe..5a1fd17b3 100644
--- a/example/optimize/cumulative_sum.cpp
+++ b/example/optimize/cumulative_sum.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -12,7 +12,7 @@ in the Eclipse Public License, Version 2.0 are satisfied:
 /*
 $begin optimize_cumulative_sum.cpp$$
 
-$section Example Optimization and Cumulative Sum Operations$$
+$section Optimize Cumulative Sum Operations: Example and Test$$
 
 
 $srcfile%example/optimize/cumulative_sum.cpp%0%// BEGIN C++%// END C++%1%$$
@@ -84,11 +84,13 @@ bool cumulative_sum(void)
 
     // create f: x -> y and stop tape recording
     CppAD::ADFun<double> f(ax, ay);
+    ok &= f.size_order() == 1; // this constructor does 0 order forward
     ok &= f.size_var() == before.n_var;
     ok &= f.size_op()  == before.n_op;
 
     // Optimize the operation sequence
     f.optimize();
+    ok &= f.size_order() == 0; // 0 order forward not present
     ok &= f.size_var() == after.n_var;
     ok &= f.size_op()  == after.n_op;
 
diff --git a/example/optimize/forward_active.cpp b/example/optimize/forward_active.cpp
index 0a15eee08..5ff4f088d 100644
--- a/example/optimize/forward_active.cpp
+++ b/example/optimize/forward_active.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -12,7 +12,7 @@ in the Eclipse Public License, Version 2.0 are satisfied:
 /*
 $begin optimize_forward_active.cpp$$
 
-$section Example Optimization and Forward Activity Analysis$$
+$section Optimize Forward Activity Analysis: Example and Test$$
 
 $srcfile%example/optimize/forward_active.cpp%0%// BEGIN C++%// END C++%1%$$
 
@@ -111,6 +111,7 @@ bool forward_active(void)
 
     // create f: x -> y and stop tape recording
     CppAD::ADFun<double> f(ax, ay);
+    ok &= f.size_order() == 1; // this constructor does 0 order forward
     ok &= f.size_var() == before.n_var;
     ok &= f.size_op()  == before.n_op;
 
@@ -118,6 +119,7 @@ bool forward_active(void)
     // Note that, for this case, all the optimization was done during
     // the recording and there is no benifit to the optimization.
     f.optimize();
+    ok &= f.size_order() == 0; // 0 order forward not present
     ok &= f.size_var() == after.n_var;
     ok &= f.size_op()  == after.n_op;
 
diff --git a/example/optimize/makefile.am b/example/optimize/makefile.am
index b4c0c777f..deded9ce3 100644
--- a/example/optimize/makefile.am
+++ b/example/optimize/makefile.am
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -31,7 +31,8 @@ optimize_SOURCES   = \
 	nest_conditional.cpp \
 	optimize.cpp \
 	print_for.cpp \
-	reverse_active.cpp
+	reverse_active.cpp \
+	optimize_twice.cpp
 
 test: check
 	./optimize
diff --git a/example/optimize/makefile.in b/example/optimize/makefile.in
index 0b20370df..4517e297b 100644
--- a/example/optimize/makefile.in
+++ b/example/optimize/makefile.in
@@ -1,7 +1,7 @@
-# makefile.in generated by automake 1.15.1 from makefile.am.
+# makefile.in generated by automake 1.16.1 from makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -100,7 +100,8 @@ CONFIG_CLEAN_VPATH_FILES =
 am_optimize_OBJECTS = compare_op.$(OBJEXT) conditional_skip.$(OBJEXT) \
 	cumulative_sum.$(OBJEXT) forward_active.$(OBJEXT) \
 	nest_conditional.$(OBJEXT) optimize.$(OBJEXT) \
-	print_for.$(OBJEXT) reverse_active.$(OBJEXT)
+	print_for.$(OBJEXT) reverse_active.$(OBJEXT) \
+	optimize_twice.$(OBJEXT)
 optimize_OBJECTS = $(am_optimize_OBJECTS)
 optimize_LDADD = $(LDADD)
 AM_V_P = $(am__v_P_@AM_V@)
@@ -117,7 +118,12 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = 
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/compare_op.Po \
+	./$(DEPDIR)/conditional_skip.Po ./$(DEPDIR)/cumulative_sum.Po \
+	./$(DEPDIR)/forward_active.Po ./$(DEPDIR)/nest_conditional.Po \
+	./$(DEPDIR)/optimize.Po ./$(DEPDIR)/optimize_twice.Po \
+	./$(DEPDIR)/print_for.Po ./$(DEPDIR)/reverse_active.Po
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -188,7 +194,7 @@ CXX_FLAGS = @CXX_FLAGS@
 CYGPATH_W = @CYGPATH_W@
 
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -352,7 +358,8 @@ optimize_SOURCES = \
 	nest_conditional.cpp \
 	optimize.cpp \
 	print_for.cpp \
-	reverse_active.cpp
+	reverse_active.cpp \
+	optimize_twice.cpp
 
 all: all-am
 
@@ -375,8 +382,8 @@ makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
 	  *config.status*) \
 	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -401,14 +408,21 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compare_op.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conditional_skip.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cumulative_sum.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/forward_active.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nest_conditional.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/optimize.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_for.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reverse_active.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compare_op.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conditional_skip.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cumulative_sum.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/forward_active.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nest_conditional.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/optimize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/optimize_twice.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_for.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reverse_active.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+	@$(MKDIR_P) $(@D)
+	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -478,7 +492,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -548,7 +565,15 @@ clean: clean-am
 clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/compare_op.Po
+	-rm -f ./$(DEPDIR)/conditional_skip.Po
+	-rm -f ./$(DEPDIR)/cumulative_sum.Po
+	-rm -f ./$(DEPDIR)/forward_active.Po
+	-rm -f ./$(DEPDIR)/nest_conditional.Po
+	-rm -f ./$(DEPDIR)/optimize.Po
+	-rm -f ./$(DEPDIR)/optimize_twice.Po
+	-rm -f ./$(DEPDIR)/print_for.Po
+	-rm -f ./$(DEPDIR)/reverse_active.Po
 	-rm -f makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -594,7 +619,15 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/compare_op.Po
+	-rm -f ./$(DEPDIR)/conditional_skip.Po
+	-rm -f ./$(DEPDIR)/cumulative_sum.Po
+	-rm -f ./$(DEPDIR)/forward_active.Po
+	-rm -f ./$(DEPDIR)/nest_conditional.Po
+	-rm -f ./$(DEPDIR)/optimize.Po
+	-rm -f ./$(DEPDIR)/optimize_twice.Po
+	-rm -f ./$(DEPDIR)/print_for.Po
+	-rm -f ./$(DEPDIR)/reverse_active.Po
 	-rm -f makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -614,7 +647,7 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
 	clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \
 	distclean distclean-compile distclean-generic distclean-tags \
 	distdir dvi dvi-am html html-am info info-am install \
diff --git a/example/optimize/nest_conditional.cpp b/example/optimize/nest_conditional.cpp
index bfff10cc5..8dd7409db 100644
--- a/example/optimize/nest_conditional.cpp
+++ b/example/optimize/nest_conditional.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -12,7 +12,7 @@ in the Eclipse Public License, Version 2.0 are satisfied:
 /*
 $begin optimize_nest_conditional.cpp$$
 
-$section Example Optimization and Nested Conditional Expressions$$
+$section Optimize Nested Conditional Expressions: Example and Test$$
 
 $head See Also$$
 $cref cond_exp.cpp$$
@@ -118,11 +118,13 @@ bool nest_conditional(void)
 
         // create f: x -> y and stop tape recording
         CppAD::ADFun<double> f(ax, ay);
+        ok &= f.size_order() == 1; // this constructor does 0 order forward
         ok &= f.size_var() == before.n_var;
         ok &= f.size_op()  == before.n_op;
 
         // Optimize the operation sequence
         f.optimize(options);
+        ok &= f.size_order() == 0; // 0 order forward not present
         ok &= f.size_var() == after.n_var;
         ok &= f.size_op()  == after.n_op;
 
diff --git a/example/optimize/optimize.cpp b/example/optimize/optimize.cpp
index 88743c57a..8a984cc2c 100644
--- a/example/optimize/optimize.cpp
+++ b/example/optimize/optimize.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -29,6 +29,7 @@ extern bool forward_active(void);
 extern bool nest_conditional(void);
 extern bool print_for(void);
 extern bool reverse_active(void);
+extern bool optimize_twice(void);
 
 // main program that runs all the tests
 int main(void)
@@ -46,6 +47,7 @@ int main(void)
     Run( nest_conditional,    "nest_conditional"   );
     Run( print_for,           "print_for"          );
     Run( reverse_active,      "reverse_active"     );
+    Run( optimize_twice,         "re_optimize"        );
     //
     // check for memory leak
     bool memory_ok = CppAD::thread_alloc::free_all();
diff --git a/example/optimize/optimize_twice.cpp b/example/optimize/optimize_twice.cpp
new file mode 100644
index 000000000..d00b48a4f
--- /dev/null
+++ b/example/optimize/optimize_twice.cpp
@@ -0,0 +1,85 @@
+/* --------------------------------------------------------------------------
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
+
+CppAD is distributed under the terms of the
+             Eclipse Public License Version 2.0.
+
+This Source Code may also be made available under the following
+Secondary License when the conditions for such availability set forth
+in the Eclipse Public License, Version 2.0 are satisfied:
+      GNU General Public License, Version 2.0 or later.
+---------------------------------------------------------------------------- */
+/*
+$begin optimize_twice.cpp$$
+$spell
+    CppAD
+$$
+
+$section Optimizing Twice: Example and Test$$
+
+$head Discussion$$
+Before 2019-06-28, optimizing twice was not supported and would fail
+if cumulative sum operators were present after the first optimization.
+This is now supported but it is not expected to have much benefit.
+If you find a case where it does have a benefit, please inform the CppAD
+developers of this.
+
+$srcfile%example/optimize/optimize_twice.cpp%0%// BEGIN C++%// END C++%1%$$
+
+$end
+*/
+// BEGIN C++
+# include <cppad/cppad.hpp>
+bool optimize_twice(void)
+{   bool ok = true;
+    using CppAD::AD;
+    using CppAD::vector;
+
+    size_t n = 3;
+    vector< AD<double> > ax(n);
+    for(size_t j = 0; j < n; ++j)
+        ax[j] = 0.0;
+    Independent(ax);
+    //
+    AD<double> asum = 0.0;
+    for(size_t j = 0; j < n; ++j)
+        asum += ax[j];
+    //
+    vector< AD<double> > ay(1);
+    ay[0] = asum * asum;
+    //
+    // This method of recording the function does not do a 0 order forward
+    CppAD::ADFun<double> f;
+    f.Dependent(ax, ay);
+    ok &= f.size_order() == 0;
+    size_t size_var = f.size_var();
+    //
+    f.optimize(); // creates a cumulative sum operator
+    ok &= f.size_var() <= size_var - (n - 2);
+    size_var = f.size_var();
+    //
+    f.optimize(); // optimizes a function with a cumulative sum operator
+    ok &= f.size_var() == size_var; // no benefit expected by second optimize
+    //
+    // zero order forward
+    vector<double> x(n), y(1);
+    double sum = 0.0;
+    for(size_t j = 0; j < n; ++j)
+    {   x[j]  = double(j + 1);
+        sum  += x[j];
+    }
+    y     = f.Forward(0, x);
+    double check = sum * sum;
+    ok &= y[0] == check;
+    //
+    vector<double> w(1), dx(n);
+    w[0] = 1.0;
+    dx   = f.Reverse(1, w);
+    //
+    for(size_t j = 0; j < n; ++j)
+        ok &= dx[j] == 2.0 * sum;
+    //
+    return ok;
+}
+
+// END C++
diff --git a/example/optimize/print_for.cpp b/example/optimize/print_for.cpp
index 74e1307a3..49d104670 100644
--- a/example/optimize/print_for.cpp
+++ b/example/optimize/print_for.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -16,7 +16,7 @@ $spell
     Cpp
 $$
 
-$section Example Optimization and Print Forward Operators$$
+$section Optimize Print Forward Operators: Example and Test$$
 
 $srcfile%example/optimize/print_for.cpp%0%// BEGIN C++%// END C++%1%$$
 
@@ -98,11 +98,13 @@ bool print_for(void)
 
         // create f: x -> y and stop tape recording
         CppAD::ADFun<double> f(ax, ay);
+        ok &= f.size_order() == 1; // this constructor does 0 order forward
         ok &= f.size_var() == before.n_var;
         ok &= f.size_op() == before.n_op;
 
         // Optimize the operation sequence
         f.optimize(options);
+        ok &= f.size_order() == 0; // 0 order forward not present
         ok &= f.size_var() == after.n_var;
         ok &= f.size_op() == after.n_op;
 
diff --git a/example/optimize/reverse_active.cpp b/example/optimize/reverse_active.cpp
index 565757f7e..270545361 100644
--- a/example/optimize/reverse_active.cpp
+++ b/example/optimize/reverse_active.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -12,7 +12,7 @@ in the Eclipse Public License, Version 2.0 are satisfied:
 /*
 $begin optimize_reverse_active.cpp$$
 
-$section Example Optimization and Reverse Activity Analysis$$
+$section Optimize Reverse Activity Analysis: Example and Test$$
 
 $srcfile%example/optimize/reverse_active.cpp%0%// BEGIN C++%// END C++%1%$$
 
@@ -85,11 +85,13 @@ bool reverse_active(void)
 
     // create f: x -> y and stop tape recording
     CppAD::ADFun<double> f(ax, ay);
+    ok &= f.size_order() == 1; // this constructor does 0 order forward
     ok &= f.size_var() == before.n_var;
     ok &= f.size_op()  == before.n_op;
 
     // Optimize the operation sequence
     f.optimize();
+    ok &= f.size_order() == 0; // 0 order forward not present
     ok &= f.size_var() == after.n_var;
     ok &= f.size_op()  == after.n_op;
 
diff --git a/example/print_for/makefile.in b/example/print_for/makefile.in
index c4039ae32..0e8234060 100644
--- a/example/print_for/makefile.in
+++ b/example/print_for/makefile.in
@@ -1,7 +1,7 @@
-# makefile.in generated by automake 1.15.1 from makefile.am.
+# makefile.in generated by automake 1.16.1 from makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -114,7 +114,8 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = 
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/print_for.Po
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -366,8 +367,8 @@ makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
 	  *config.status*) \
 	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -392,7 +393,13 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_for.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_for.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+	@$(MKDIR_P) $(@D)
+	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -462,7 +469,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -532,7 +542,7 @@ clean: clean-am
 clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/print_for.Po
 	-rm -f makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -578,7 +588,7 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/print_for.Po
 	-rm -f makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -598,7 +608,7 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
 	clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \
 	distclean distclean-compile distclean-generic distclean-tags \
 	distdir dvi dvi-am html html-am info info-am install \
diff --git a/example/sparse/makefile.in b/example/sparse/makefile.in
index 12b28e3d3..62b7627c1 100644
--- a/example/sparse/makefile.in
+++ b/example/sparse/makefile.in
@@ -1,7 +1,7 @@
-# makefile.in generated by automake 1.15.1 from makefile.am.
+# makefile.in generated by automake 1.16.1 from makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -139,7 +139,24 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = 
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/colpack_hes.Po \
+	./$(DEPDIR)/colpack_hessian.Po ./$(DEPDIR)/colpack_jac.Po \
+	./$(DEPDIR)/colpack_jacobian.Po ./$(DEPDIR)/conj_grad.Po \
+	./$(DEPDIR)/dependency.Po ./$(DEPDIR)/for_hes_sparsity.Po \
+	./$(DEPDIR)/for_jac_sparsity.Po ./$(DEPDIR)/for_sparse_hes.Po \
+	./$(DEPDIR)/for_sparse_jac.Po ./$(DEPDIR)/rc_sparsity.Po \
+	./$(DEPDIR)/rev_hes_sparsity.Po \
+	./$(DEPDIR)/rev_jac_sparsity.Po ./$(DEPDIR)/rev_sparse_hes.Po \
+	./$(DEPDIR)/rev_sparse_jac.Po ./$(DEPDIR)/sparse.Po \
+	./$(DEPDIR)/sparse2eigen.Po ./$(DEPDIR)/sparse_hes.Po \
+	./$(DEPDIR)/sparse_hessian.Po ./$(DEPDIR)/sparse_jac_for.Po \
+	./$(DEPDIR)/sparse_jac_rev.Po ./$(DEPDIR)/sparse_jacobian.Po \
+	./$(DEPDIR)/sparse_sub_hes.Po ./$(DEPDIR)/sparsity_sub.Po \
+	./$(DEPDIR)/sub_sparse_hes.Po ./$(DEPDIR)/subgraph_hes2jac.Po \
+	./$(DEPDIR)/subgraph_jac_rev.Po \
+	./$(DEPDIR)/subgraph_reverse.Po \
+	./$(DEPDIR)/subgraph_sparsity.Po
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -421,8 +438,8 @@ makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
 	  *config.status*) \
 	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -447,35 +464,41 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colpack_hes.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colpack_hessian.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colpack_jac.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colpack_jacobian.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conj_grad.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dependency.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/for_hes_sparsity.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/for_jac_sparsity.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/for_sparse_hes.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/for_sparse_jac.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rc_sparsity.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_hes_sparsity.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_jac_sparsity.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_sparse_hes.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_sparse_jac.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse2eigen.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_hes.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_hessian.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_jac_for.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_jac_rev.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_jacobian.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_sub_hes.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparsity_sub.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sub_sparse_hes.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subgraph_hes2jac.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subgraph_jac_rev.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subgraph_reverse.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subgraph_sparsity.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colpack_hes.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colpack_hessian.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colpack_jac.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colpack_jacobian.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conj_grad.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dependency.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/for_hes_sparsity.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/for_jac_sparsity.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/for_sparse_hes.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/for_sparse_jac.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rc_sparsity.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_hes_sparsity.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_jac_sparsity.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_sparse_hes.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rev_sparse_jac.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse2eigen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_hes.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_hessian.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_jac_for.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_jac_rev.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_jacobian.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_sub_hes.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparsity_sub.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sub_sparse_hes.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subgraph_hes2jac.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subgraph_jac_rev.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subgraph_reverse.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subgraph_sparsity.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+	@$(MKDIR_P) $(@D)
+	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -545,7 +568,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -615,7 +641,35 @@ clean: clean-am
 clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/colpack_hes.Po
+	-rm -f ./$(DEPDIR)/colpack_hessian.Po
+	-rm -f ./$(DEPDIR)/colpack_jac.Po
+	-rm -f ./$(DEPDIR)/colpack_jacobian.Po
+	-rm -f ./$(DEPDIR)/conj_grad.Po
+	-rm -f ./$(DEPDIR)/dependency.Po
+	-rm -f ./$(DEPDIR)/for_hes_sparsity.Po
+	-rm -f ./$(DEPDIR)/for_jac_sparsity.Po
+	-rm -f ./$(DEPDIR)/for_sparse_hes.Po
+	-rm -f ./$(DEPDIR)/for_sparse_jac.Po
+	-rm -f ./$(DEPDIR)/rc_sparsity.Po
+	-rm -f ./$(DEPDIR)/rev_hes_sparsity.Po
+	-rm -f ./$(DEPDIR)/rev_jac_sparsity.Po
+	-rm -f ./$(DEPDIR)/rev_sparse_hes.Po
+	-rm -f ./$(DEPDIR)/rev_sparse_jac.Po
+	-rm -f ./$(DEPDIR)/sparse.Po
+	-rm -f ./$(DEPDIR)/sparse2eigen.Po
+	-rm -f ./$(DEPDIR)/sparse_hes.Po
+	-rm -f ./$(DEPDIR)/sparse_hessian.Po
+	-rm -f ./$(DEPDIR)/sparse_jac_for.Po
+	-rm -f ./$(DEPDIR)/sparse_jac_rev.Po
+	-rm -f ./$(DEPDIR)/sparse_jacobian.Po
+	-rm -f ./$(DEPDIR)/sparse_sub_hes.Po
+	-rm -f ./$(DEPDIR)/sparsity_sub.Po
+	-rm -f ./$(DEPDIR)/sub_sparse_hes.Po
+	-rm -f ./$(DEPDIR)/subgraph_hes2jac.Po
+	-rm -f ./$(DEPDIR)/subgraph_jac_rev.Po
+	-rm -f ./$(DEPDIR)/subgraph_reverse.Po
+	-rm -f ./$(DEPDIR)/subgraph_sparsity.Po
 	-rm -f makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -661,7 +715,35 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/colpack_hes.Po
+	-rm -f ./$(DEPDIR)/colpack_hessian.Po
+	-rm -f ./$(DEPDIR)/colpack_jac.Po
+	-rm -f ./$(DEPDIR)/colpack_jacobian.Po
+	-rm -f ./$(DEPDIR)/conj_grad.Po
+	-rm -f ./$(DEPDIR)/dependency.Po
+	-rm -f ./$(DEPDIR)/for_hes_sparsity.Po
+	-rm -f ./$(DEPDIR)/for_jac_sparsity.Po
+	-rm -f ./$(DEPDIR)/for_sparse_hes.Po
+	-rm -f ./$(DEPDIR)/for_sparse_jac.Po
+	-rm -f ./$(DEPDIR)/rc_sparsity.Po
+	-rm -f ./$(DEPDIR)/rev_hes_sparsity.Po
+	-rm -f ./$(DEPDIR)/rev_jac_sparsity.Po
+	-rm -f ./$(DEPDIR)/rev_sparse_hes.Po
+	-rm -f ./$(DEPDIR)/rev_sparse_jac.Po
+	-rm -f ./$(DEPDIR)/sparse.Po
+	-rm -f ./$(DEPDIR)/sparse2eigen.Po
+	-rm -f ./$(DEPDIR)/sparse_hes.Po
+	-rm -f ./$(DEPDIR)/sparse_hessian.Po
+	-rm -f ./$(DEPDIR)/sparse_jac_for.Po
+	-rm -f ./$(DEPDIR)/sparse_jac_rev.Po
+	-rm -f ./$(DEPDIR)/sparse_jacobian.Po
+	-rm -f ./$(DEPDIR)/sparse_sub_hes.Po
+	-rm -f ./$(DEPDIR)/sparsity_sub.Po
+	-rm -f ./$(DEPDIR)/sub_sparse_hes.Po
+	-rm -f ./$(DEPDIR)/subgraph_hes2jac.Po
+	-rm -f ./$(DEPDIR)/subgraph_jac_rev.Po
+	-rm -f ./$(DEPDIR)/subgraph_reverse.Po
+	-rm -f ./$(DEPDIR)/subgraph_sparsity.Po
 	-rm -f makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -681,7 +763,7 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
 	clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \
 	distclean distclean-compile distclean-generic distclean-tags \
 	distdir dvi dvi-am html html-am info info-am install \
diff --git a/example/sparse/sparse_jac_for.cpp b/example/sparse/sparse_jac_for.cpp
index 0565cb034..be1792e8c 100644
--- a/example/sparse/sparse_jac_for.cpp
+++ b/example/sparse/sparse_jac_for.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -111,10 +111,10 @@ bool sparse_jac_for(void)
     CppAD::sparse_jac_work work;
     std::string coloring = "cppad";
     size_t group_max = 10;
-    size_t n_sweep = f.sparse_jac_for(
+    size_t n_color = f.sparse_jac_for(
         group_max, x, subset, pattern_jac, coloring, work
     );
-    ok &= n_sweep == 2;
+    ok &= n_color == 2;
     //
     const s_vector row( subset.row() );
     const s_vector col( subset.col() );
@@ -133,10 +133,10 @@ bool sparse_jac_for(void)
     pattern_row3.set(1, 3, 2);    // row[1] = 3, col[1] = 2
     sparse_rcv<s_vector, d_vector> subset_row3( pattern_row3 );
     work.clear();
-    n_sweep = f.sparse_jac_for(
+    n_color = f.sparse_jac_for(
         group_max, x, subset_row3, pattern_jac, coloring, work
     );
-    ok &= n_sweep == 2;
+    ok &= n_color == 2;
     //
     const s_vector row_row3( subset_row3.row() );
     const s_vector col_row3( subset_row3.col() );
diff --git a/example/sparse/subgraph_hes2jac.cpp b/example/sparse/subgraph_hes2jac.cpp
index 4b574cd33..d52f369b7 100644
--- a/example/sparse/subgraph_hes2jac.cpp
+++ b/example/sparse/subgraph_hes2jac.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -30,11 +30,9 @@ $end
 bool subgraph_hes2jac(void)
 {   bool ok = true;
     using CppAD::NearEqual;
-    typedef CppAD::AD<double>                      a1double;
-    typedef CppAD::AD<a1double>                    a2double;
+    typedef CppAD::AD<double>                      a_double;
     typedef CPPAD_TESTVECTOR(double)               d_vector;
-    typedef CPPAD_TESTVECTOR(a1double)             a1vector;
-    typedef CPPAD_TESTVECTOR(a2double)             a2vector;
+    typedef CPPAD_TESTVECTOR(a_double)             a_vector;
     typedef CPPAD_TESTVECTOR(size_t)               s_vector;
     typedef CPPAD_TESTVECTOR(bool)                 b_vector;
     typedef CppAD::sparse_rcv<s_vector, d_vector>  sparse_matrix;
@@ -47,47 +45,45 @@ bool subgraph_hes2jac(void)
     for(size_t j = 0; j < n; j++)
         x[j] = double(j + 2);
     //
-    // a1double version of x
-    a1vector a1x(n);
+    // a_double version of x
+    a_vector ax(n);
     for(size_t j = 0; j < n; j++)
-        a1x[j] = x[j];
-    //
-    // a2double version of x
-    a2vector a2x(n);
-    for(size_t j = 0; j < n; j++)
-        a2x[j] = a1x[j];
+        ax[j] = x[j];
     //
     // declare independent variables and starting recording
-    CppAD::Independent(a2x);
+    CppAD::Independent(ax);
     //
-    // a2double version of y = f(x) = 5 * x0 * x1 + sum_j xj^3
+    // a_double version of y = f(x) = 5 * x0 * x1 + sum_j xj^3
     size_t m = 1;
-    a2vector a2y(m);
-    a2y[0] = 5.0 * a2x[0] * a2x[1];
+    a_vector ay(m);
+    ay[0] = 5.0 * ax[0] * ax[1];
     for(size_t j = 0; j < n; j++)
-        a2y[0] += a2x[j] * a2x[j] * a2x[j];
+        ay[0] += ax[j] * ax[j] * ax[j];
     //
-    // create a1double version of f: x -> y and stop tape recording
+    // create double version of f: x -> y and stop tape recording
     // (without executing zero order forward calculation)
-    CppAD::ADFun<a1double> a1f;
-    a1f.Dependent(a2x, a2y);
+    CppAD::ADFun<double> f;
+    f.Dependent(ax, ay);
     //
     // Optimize this function to reduce future computations.
     // Perhaps only one optimization at the end would be faster.
-    a1f.optimize();
+    f.optimize();
+    //
+    // create a_double version of f
+    CppAD::ADFun<a_double, double> af = f.base2ad();
     //
     // declare independent variables and start recording g(x) = f'(x)
-    Independent(a1x);
+    Independent(ax);
     //
     // Use one reverse mode pass to compute z = f'(x)
-    a1vector a1w(m), a1z(n);
-    a1w[0] = 1.0;
-    a1f.Forward(0, a1x);
-    a1z = a1f.Reverse(1, a1w);
+    a_vector aw(m), az(n);
+    aw[0] = 1.0;
+    af.Forward(0, ax);
+    az = af.Reverse(1, aw);
     //
     // create double version of g : x -> f'(x)
     CppAD::ADFun<double> g;
-    g.Dependent(a1x, a1z);
+    g.Dependent(ax, az);
     ok &= g.size_random() == 0;
     //
     // Optimize this function to reduce future computations.
diff --git a/example/utility/CMakeLists.txt b/example/utility/CMakeLists.txt
index 6038eb27e..9c989df19 100644
--- a/example/utility/CMakeLists.txt
+++ b/example/utility/CMakeLists.txt
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 #
 # CppAD is distributed under the terms of the
 #              Eclipse Public License Version 2.0.
@@ -10,6 +10,7 @@
 #       GNU General Public License, Version 2.0 or later.
 # -----------------------------------------------------------------------------
 #
+# BEGIN_SORT_THIS_LINE_PLUS_2
 SET(source_list
     check_numeric_type.cpp
     check_simple_vector.cpp
@@ -37,6 +38,8 @@ SET(source_list
     utility.cpp
     vector_bool.cpp
 )
+# END_SORT_THIS_LINE_MINUS_2
+
 set_compile_flags( example_utility "${cppad_debug_which}" "${source_list}" )
 #
 ADD_EXECUTABLE(example_utility EXCLUDE_FROM_ALL ${source_list})
diff --git a/example/utility/cppad_vector.cpp b/example/utility/cppad_vector.cpp
index d626f62b9..3c8fd04ff 100644
--- a/example/utility/cppad_vector.cpp
+++ b/example/utility/cppad_vector.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -18,6 +18,10 @@ $$
 
 $section CppAD::vector Template Class: Example and Test$$
 
+$head Purpose$$
+This is an example and test of the features of the
+$cref CppAD_vector$$ class that are not included in the
+$cref SimpleVector$$ concept.
 
 $srcfile%example/utility/cppad_vector.cpp%0%// BEGIN C++%// END C++%1%$$
 
@@ -26,88 +30,148 @@ $end
 // BEGIN C++
 
 # include <cppad/utility/vector.hpp>
+# include <cppad/utility/error_handler.hpp>
 # include <cppad/utility/check_simple_vector.hpp>
 # include <sstream> // sstream and string are used to test output operation
 # include <string>
+# include <algorithm>
+
+namespace {
+    void myhandler(
+        bool known       ,
+        int  line        ,
+        const char *file ,
+        const char *exp  ,
+        const char *msg  )
+    {   // error handler must not return, so throw an exception
+        throw line;
+    }
+}
 
 bool CppAD_vector(void)
 {   bool ok = true;
     using CppAD::vector;     // so can use vector instead of CppAD::vector
-    typedef double Type;     // change double to test other types
+    typedef double Scalar;   // change double to test other types
 
     // check Simple Vector specifications
-    CppAD::CheckSimpleVector< Type, vector<Type> >();
-
-    vector<Type> x;          // default constructor
-    ok &= (x.size() == 0);
-
-    x.resize(2);             // resize and set element assignment
-    ok &= (x.size() == 2);
-    x[0] = Type(1);
-    x[1] = Type(2);
-
-    vector<Type> y(2);       // sizing constructor
-    ok &= (y.size() == 2);
-
-    const vector<Type> z(x); // copy constructor and const element access
-    ok &= (z.size() == 2);
-    ok &= ( (z[0] == Type(1)) && (z[1] == Type(2)) );
-
-    x[0] = Type(2);          // modify, assignment changes x
-    ok &= (x[0] == Type(2));
-
-    x = y = z;               // vector assignment
-    ok &= ( (x[0] == Type(1)) && (x[1] == Type(2)) );
-    ok &= ( (y[0] == Type(1)) && (y[1] == Type(2)) );
-    ok &= ( (z[0] == Type(1)) && (z[1] == Type(2)) );
+    CppAD::CheckSimpleVector< Scalar, vector<Scalar> >();
+
+    // assignment returns reference for use in other assignments
+    vector<Scalar> vec(2), other(2), another(2);
+    another[0] = Scalar(1);
+    another[1] = Scalar(2);
+    vec = other = another;
+    for(size_t i = 0; i < 2; ++i)
+    {   ok &= vec[i] == other[i];
+        ok &= vec[i] == another[i];
+    }
 
     // test of output
     std::string        correct= "{ 1, 2 }";
     std::string        str;
     std::ostringstream buf;
-    buf << z;
+    buf << vec;
     str = buf.str();
     ok &= (str == correct);
 
-    // test resize(1), resize(0), capacity, and clear
-    size_t i = x.capacity();
-    ok      &= i >= 2;
-    x.resize(1);
-    ok      &= x[0] == Type(1);
-    ok      &= i == x.capacity();
-    x.resize(0);
-    ok      &= i == x.capacity();
-    x.clear();
-    ok      &= 0 == x.capacity();
-
-    // test of push_back scalar and capacity
-    size_t N = 100;
-    for(i = 0; i < N; i++)
-    {   size_t old_capacity = x.capacity();
-        x.push_back( Type(i) );
-        ok &= (i+1) == x.size();
-        ok &= i < x.capacity();
-        ok &= (i == old_capacity) || old_capacity == x.capacity();
-    }
-    for(i = 0; i < N; i++)
-        ok &= ( x[i] == Type(i) );
-
-    // test of data
-    Type* data = x.data();
-    for(i = 0; i < N; i++)
-    {   ok &= data[i] == Type(i);
-        data[i] = Type(N - i);
-        ok &= x[i] == Type(N - i);
+    // swap
+    other[0] = vec[0] + 1;
+    vec.swap(other);
+    ok  &= vec[0] == other[0] + 1;
+
+    // clear
+    vec.clear();
+    ok &= vec.size() == 0;
+    ok &= vec.capacity() == 0;
+
+    // push_back scalar and changes in capacity
+    size_t n = 100;
+    size_t old_capacity = vec.capacity();
+    for(size_t i = 0; i < n; i++)
+    {   vec.push_back( Scalar(n - i) );
+        ok &= (i+1) == vec.size();
+        ok &= i < vec.capacity();
+        ok &= old_capacity == vec.capacity() || i == old_capacity;
+        old_capacity = vec.capacity();
     }
+    for(size_t i = 0; i < n; i++)
+        ok &= ( vec[i] == Scalar(n - i) );
 
     // test of push_vector
-    x.push_vector(x);
-    ok &= (x.size() == 2 * N);
-    for(i = 0; i < N; i++)
-    {   ok &= x[i] == Type(N - i);
-        ok &= x[i+N] == Type(N - i);
+    vec.push_vector(vec);
+    ok &= (vec.size() == 2 * n);
+    for(size_t i = 0; i < n; i++)
+    {   ok &= vec[i]      == Scalar(n - i);
+        ok &= vec[i + n]  == Scalar(n - i);
     }
 
+    // resize perserves elements when new size less than capacity
+    ok &= n < vec.capacity();
+    vec.resize(n);
+    for(size_t i = 0; i < n; i++)
+        ok &= vec[i] == Scalar(n - i);
+
+    // vector assignment OK when target has size zero
+    other.resize(0);
+    other = vec;
+
+    // create a const vector equal to vec
+    const vector<Scalar> cvec = vec;
+
+    // sort of vec (will reverse order of elements for this case)
+    std::sort(vec.begin(), vec.end());
+    for(size_t i = 0; i < n ; ++i)
+        ok &= vec[i] == Scalar(i + 1);
+
+    // use data pointer to sort using pointers instead of iterators
+    std::sort(other.data(), other.data() + other.size());
+    for(size_t i = 0; i < n ; ++i)
+        ok &= other[i] == Scalar(i + 1);
+
+    // test direct use of iterator and const_iterator
+    typedef vector<Scalar>::iterator       iterator;
+    typedef vector<Scalar>::const_iterator const_iterator;
+    iterator        itr = vec.begin(); // increasing order
+    const_iterator citr = cvec.end();  // decreasing order
+    while( itr != vec.end() )
+    {   --citr;
+        ok &= *itr == *citr;
+        ++itr;
+    }
+    // conversion from iterator to const_iterator
+    citr = vec.begin();
+    ok  &= *citr == vec[0];
+
+    // Replace the default CppAD error handler with myhandler (defined above).
+    // This replacement is in effect until info drops out of scope.
+    CppAD::ErrorHandler info(myhandler);
+
+# ifndef NDEBUG
+    // -----------------------------------------------------------------------
+    // check that size mismatch throws an exception when NDEBUG not defined
+    other.resize(0);
+    bool detected_error = false;
+    try
+    {   another = other; }
+    catch(int line)
+    {   detected_error = true; }
+    ok &= detected_error;
+    // -----------------------------------------------------------------------
+    // check that iterator access out of range generates an error
+    itr = vec.begin();
+    ok  &= *itr == Scalar(1);  // this access OK
+    detected_error = false;
+    try
+    {   vec.clear();
+        // The iterator knows that the vector has changed and that
+        // this access is no longer valid
+        *itr;
+    }
+    catch(int line)
+    {   detected_error = true; }
+    ok &= detected_error;
+    // -----------------------------------------------------------------------
+# endif
 
     return ok;
 }
diff --git a/example/utility/makefile.in b/example/utility/makefile.in
index 382fb344f..820969da5 100644
--- a/example/utility/makefile.in
+++ b/example/utility/makefile.in
@@ -1,7 +1,7 @@
-# makefile.in generated by automake 1.15.1 from makefile.am.
+# makefile.in generated by automake 1.16.1 from makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -124,7 +124,20 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = 
 depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/check_numeric_type.Po \
+	./$(DEPDIR)/check_simple_vector.Po ./$(DEPDIR)/cppad_vector.Po \
+	./$(DEPDIR)/error_handler.Po ./$(DEPDIR)/index_sort.Po \
+	./$(DEPDIR)/lu_factor.Po ./$(DEPDIR)/lu_invert.Po \
+	./$(DEPDIR)/lu_solve.Po ./$(DEPDIR)/nan.Po \
+	./$(DEPDIR)/near_equal.Po ./$(DEPDIR)/ode_err_control.Po \
+	./$(DEPDIR)/ode_err_maxabs.Po ./$(DEPDIR)/ode_gear.Po \
+	./$(DEPDIR)/ode_gear_control.Po ./$(DEPDIR)/romberg_mul.Po \
+	./$(DEPDIR)/romberg_one.Po ./$(DEPDIR)/runge45_1.Po \
+	./$(DEPDIR)/set_union.Po ./$(DEPDIR)/simple_vector.Po \
+	./$(DEPDIR)/sparse_rc.Po ./$(DEPDIR)/sparse_rcv.Po \
+	./$(DEPDIR)/thread_alloc.Po ./$(DEPDIR)/to_string.Po \
+	./$(DEPDIR)/utility.Po ./$(DEPDIR)/vector_bool.Po
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -399,8 +412,8 @@ makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
 	  *config.status*) \
 	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
 	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
 	esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -425,31 +438,37 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_numeric_type.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_simple_vector.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cppad_vector.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error_handler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/index_sort.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lu_factor.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lu_invert.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lu_solve.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nan.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/near_equal.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_err_control.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_err_maxabs.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_gear.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_gear_control.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/romberg_mul.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/romberg_one.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runge45_1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_union.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple_vector.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_rc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_rcv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread_alloc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/to_string.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utility.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector_bool.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_numeric_type.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_simple_vector.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cppad_vector.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error_handler.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/index_sort.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lu_factor.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lu_invert.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lu_solve.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nan.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/near_equal.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_err_control.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_err_maxabs.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_gear.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ode_gear_control.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/romberg_mul.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/romberg_one.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runge45_1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_union.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple_vector.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_rc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_rcv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread_alloc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/to_string.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utility.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector_bool.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+	@$(MKDIR_P) $(@D)
+	@echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -519,7 +538,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -589,7 +611,31 @@ clean: clean-am
 clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/check_numeric_type.Po
+	-rm -f ./$(DEPDIR)/check_simple_vector.Po
+	-rm -f ./$(DEPDIR)/cppad_vector.Po
+	-rm -f ./$(DEPDIR)/error_handler.Po
+	-rm -f ./$(DEPDIR)/index_sort.Po
+	-rm -f ./$(DEPDIR)/lu_factor.Po
+	-rm -f ./$(DEPDIR)/lu_invert.Po
+	-rm -f ./$(DEPDIR)/lu_solve.Po
+	-rm -f ./$(DEPDIR)/nan.Po
+	-rm -f ./$(DEPDIR)/near_equal.Po
+	-rm -f ./$(DEPDIR)/ode_err_control.Po
+	-rm -f ./$(DEPDIR)/ode_err_maxabs.Po
+	-rm -f ./$(DEPDIR)/ode_gear.Po
+	-rm -f ./$(DEPDIR)/ode_gear_control.Po
+	-rm -f ./$(DEPDIR)/romberg_mul.Po
+	-rm -f ./$(DEPDIR)/romberg_one.Po
+	-rm -f ./$(DEPDIR)/runge45_1.Po
+	-rm -f ./$(DEPDIR)/set_union.Po
+	-rm -f ./$(DEPDIR)/simple_vector.Po
+	-rm -f ./$(DEPDIR)/sparse_rc.Po
+	-rm -f ./$(DEPDIR)/sparse_rcv.Po
+	-rm -f ./$(DEPDIR)/thread_alloc.Po
+	-rm -f ./$(DEPDIR)/to_string.Po
+	-rm -f ./$(DEPDIR)/utility.Po
+	-rm -f ./$(DEPDIR)/vector_bool.Po
 	-rm -f makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -635,7 +681,31 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
+		-rm -f ./$(DEPDIR)/check_numeric_type.Po
+	-rm -f ./$(DEPDIR)/check_simple_vector.Po
+	-rm -f ./$(DEPDIR)/cppad_vector.Po
+	-rm -f ./$(DEPDIR)/error_handler.Po
+	-rm -f ./$(DEPDIR)/index_sort.Po
+	-rm -f ./$(DEPDIR)/lu_factor.Po
+	-rm -f ./$(DEPDIR)/lu_invert.Po
+	-rm -f ./$(DEPDIR)/lu_solve.Po
+	-rm -f ./$(DEPDIR)/nan.Po
+	-rm -f ./$(DEPDIR)/near_equal.Po
+	-rm -f ./$(DEPDIR)/ode_err_control.Po
+	-rm -f ./$(DEPDIR)/ode_err_maxabs.Po
+	-rm -f ./$(DEPDIR)/ode_gear.Po
+	-rm -f ./$(DEPDIR)/ode_gear_control.Po
+	-rm -f ./$(DEPDIR)/romberg_mul.Po
+	-rm -f ./$(DEPDIR)/romberg_one.Po
+	-rm -f ./$(DEPDIR)/runge45_1.Po
+	-rm -f ./$(DEPDIR)/set_union.Po
+	-rm -f ./$(DEPDIR)/simple_vector.Po
+	-rm -f ./$(DEPDIR)/sparse_rc.Po
+	-rm -f ./$(DEPDIR)/sparse_rcv.Po
+	-rm -f ./$(DEPDIR)/thread_alloc.Po
+	-rm -f ./$(DEPDIR)/to_string.Po
+	-rm -f ./$(DEPDIR)/utility.Po
+	-rm -f ./$(DEPDIR)/vector_bool.Po
 	-rm -f makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -655,7 +725,7 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
 	clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \
 	distclean distclean-compile distclean-generic distclean-tags \
 	distdir dvi dvi-am html html-am info info-am install \
diff --git a/example/utility/vector_bool.cpp b/example/utility/vector_bool.cpp
index 332811b34..6304a915a 100644
--- a/example/utility/vector_bool.cpp
+++ b/example/utility/vector_bool.cpp
@@ -1,5 +1,5 @@
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -26,7 +26,7 @@ $end
 */
 // BEGIN C++
 
-# include <cppad/utility/vector.hpp>
+# include <cppad/utility/vector_bool.hpp>
 # include <cppad/utility/check_simple_vector.hpp>
 # include <sstream> // sstream and string are used to test output operation
 # include <string>
@@ -35,6 +35,10 @@ bool vectorBool(void)
 {   bool ok = true;
     using CppAD::vectorBool;
 
+    // is that boolvector is
+    // a simple vector class with elements of type bool
+    CppAD::CheckSimpleVector< bool, vectorBool >();
+
     vectorBool x;          // default constructor
     ok &= (x.size() == 0);
 
@@ -46,7 +50,12 @@ bool vectorBool(void)
     vectorBool y(2);       // sizing constructor
     ok &= (y.size() == 2);
 
-    const vectorBool z(x); // copy constructor and const element access
+    // swap
+    y.swap(x);
+    ok &= y[0] == false;
+    ok &= y[1] == true;
+
+    const vectorBool z(y); // copy constructor and const element access
     ok &= (z.size() == 2);
     ok &= ( (z[0] == false) && (z[1] == true) );
 
@@ -97,10 +106,6 @@ bool vectorBool(void)
     for(i = 0; i < 100; i++)
         ok &= ( x[i] == ((i % 3) != 0) );
 
-    // is that boolvector is
-    // a simple vector class with elements of type bool
-    CppAD::CheckSimpleVector< bool, vectorBool >();
-
     return ok;
 }
 
diff --git a/include/cppad/CMakeLists.txt b/include/cppad/CMakeLists.txt
index 7b2b68f8c..3b6939f2e 100644
--- a/include/cppad/CMakeLists.txt
+++ b/include/cppad/CMakeLists.txt
@@ -221,9 +221,10 @@ ENDFOREACH( cmake_var )
 # -----------------------------------------------------------------------------
 # check that cppad_max_num_threads is >= 4
 #
-SET(CMAKE_REQUIRED_INCLUDES  "")
-SET(CMAKE_REQUIRED_LIBRARIES "")
-SET(CMAKE_REQUIRED_FLAGS     )
+SET(CMAKE_REQUIRED_DERINITIONS "")
+SET(CMAKE_REQUIRED_INCLUDES    "")
+SET(CMAKE_REQUIRED_LIBRARIES   "")
+SET(CMAKE_REQUIRED_FLAGS       "")
 SET(source "
 int main(void)
 {   const char* number = \"${cppad_max_num_threads}\";
@@ -244,7 +245,12 @@ int main(void)
 }
 " )
 # Using CHECK_CXX_SOURCE_RUNS directly (instead of check_source_runs).
-CHECK_CXX_SOURCE_RUNS("${source}" cppad_max_num_threads_is_integer_ge_4)
+IF( DEFINED cppad_max_num_threads_is_integer_ge_4 )
+    MESSAGE( ERROR
+        "cppad_max_num_threads_is_integer_ge_4 is defined before expected"
+    )
+ENDIF( DEFINED cppad_max_num_threads_is_integer_ge_4 )
+CHECK_CXX_SOURCE_RUNS("${source}" cppad_max_num_threads_is_integer_ge_4 )
 IF( NOT cppad_max_num_threads_is_integer_ge_4 )
     MESSAGE(FATAL_ERROR
     "cppad_max_num_threads is not an integer greater than or equal 4"
diff --git a/include/cppad/configure.hpp.in b/include/cppad/configure.hpp.in
index 28276da4d..6b382dd73 100644
--- a/include/cppad/configure.hpp.in
+++ b/include/cppad/configure.hpp.in
@@ -1,7 +1,7 @@
 # ifndef CPPAD_CONFIGURE_HPP
 # define CPPAD_CONFIGURE_HPP
 /* --------------------------------------------------------------------------
-CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
+CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-19 Bradley M. Bell
 
 CppAD is distributed under the terms of the
              Eclipse Public License Version 2.0.
@@ -13,