{"id":1456,"date":"2023-01-27T16:13:00","date_gmt":"2023-01-27T16:13:00","guid":{"rendered":"https:\/\/nag.com\/?post_type=insights&#038;p=963"},"modified":"2023-07-04T16:31:33","modified_gmt":"2023-07-04T16:31:33","slug":"pioneering-automatic-differentiation-code-generation","status":"publish","type":"insights","link":"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/","title":{"rendered":"Pioneering Automatic Differentiation: Code Generation"},"content":{"rendered":"<div class=\"container content-area-default \">\n    <div class=\"row justify-content--center\">\n        <div class=\"col-12 col-md-10 col-lg-8 col-xl-6\">\n            <h3>Fastest runtimes yet with <span class=\"nag-n-override\" style=\"margin-left: 0 !important;\"><i>n<\/i><\/span>AG\u2019s Automatic Differentiation tool dco\/c++<\/h3>\n<p>Many readers will be aware that Adjoint Automatic Differentiation (AAD) is a computer science technique for computing derivatives. Used correctly, AAD calculates derivatives much faster, and much more accurately than alternative methods.\u00a0<\/p>\n<p><span class=\"nag-n-override\" style=\"margin-left: 0 !important;\"><i>n<\/i><\/span>AG continues to innovate in the area of Automatic Differentiation through its collaboration with leading computer scientists from\u00a0<em>RWTH Aachen<\/em>\u00a0and further afield with the latest update to its cutting-edge product. <span class=\"nag-n-override\" style=\"margin-left: 0 !important;\"><i>n<\/i><\/span>AG provides a feature-rich, comprehensive, and powerful C++ AD header library, including Adjoint AD, called dco\/c++ that has addressed client needs for more than a decade.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-964 size-full\" src=\"https:\/\/nag.com\/wp-content\/uploads\/2023\/05\/codegen-tables-01.jpg\" alt=\"Code generation runtime\" width=\"5001\" height=\"2613\" \/><br \/><em>Fig. 1<\/em><\/p>\n<p><span class=\"nag-n-override\" style=\"margin-left: 0 !important;\"><i>n<\/i><\/span>AG\u2019s Automatic Differentiation tool dco\/c++ now includes:<\/p>\n<h3>Code Generation<\/h3>\n<div class=\"field field--name-field-paragraph-text field--type-text-long field--label-hidden field--item\">\n<h4>What is it?<\/h4>\n<p>A hybrid technology that combines the efficiency of source transformation with the flexibility and ease of use of an operator overloading tool, with support for primal, tangent and adjoint code.\u00a0<\/p>\n<p>This means our latest AD technology supports all combinations of scalar and vector modes for computing first and higher derivatives and does so more efficiently than ever before.\u00a0<\/p>\n<h4>What does this mean?<\/h4>\n<p>Ultimately, this means first and\u00a0<strong>higher-order derivatives 2-10x faster\u00a0<em>(<\/em><\/strong><em>see fig. 1 &#8211; taken from\u00a0Faster Risk Calculation: Next Generation dco\/c++\u00a0technical poster &#8211;\u00a0<a title=\"NAG Faster Risk Calculation\" href=\"https:\/\/nag.com\/technical-posters\/faster-risk-calculation-next-generation-dco-c\/\" target=\"_blank\" rel=\"noopener\">here<\/a>)<\/em><strong>\u00a0<\/strong>\u00a0than with our previous versions and up to\u00a0<strong>36,000x faster than alternative methods<\/strong>. But how?\u00a0<\/p>\n<p>Operator overloading techniques for C++ have proven to be successful, robust, and easy to use. This is because they rely on the C++ standard and work with the entire feature set of the language. The C++ compiler ensures applicability and long-term maintainability.\u00a0<\/p>\n<p>Source transformation is an excellent way of generating extremely efficient derivative codes. Why? Source transformation tools have two advantages: in the transformation step and in the compilation step. In the transformation step, they can implement optimizations based on properties of the underlying differentiation rules. In addition, in the compilation step, the built-in optimization passes of steadily advancing compilers are simply inherited. Showstoppers usually: Applicability and maintainability.\u00a0<\/p>\n<p>We have combined both approaches in our new dynamic code generation: we use overloading techniques to generate a representation of the program in memory, and unparse the various modes (primal, tangent, adjoint) into a C++ file. The dynamic nature of this approach (building the representation at run time) introduces an important constraint on the code to be differentiated &#8211; the control flow is not allowed to depend on input data. We overcome this constraint for branches with smart use of modern C++ features such as lambda expressions, in combination with classical elements from the preprocessor. With that, our advanced approach has made source transformation more accessible than ever.\u00a0<\/p>\n<p>Users will benefit from the new method delivering robustness and computational efficiency, which in turn can mean a large computational time and cost saving.\u00a0<\/p>\n<p><strong><span class=\"nag-n-override\" style=\"margin-left: 0 !important;\"><i>n<\/i><\/span>AG continues to provide its customers with the most advanced, effective algorithmic methods, with unrivalled support<\/strong>. dco\/c++ now provides accurate derivatives for optimization, risk, and many other medium to large-scale problems in almost any field, including Finance, Motorsport, Aerospace, Biomedical, Marine, and Civil Engineering.\u202f\u00a0<\/p>\n<p>This solution delivers the speed and accuracy needed in complex problems for faster, auspicious, more confident decision-making.\u00a0<strong>With <span class=\"nag-n-override\" style=\"margin-left: 0 !important;\"><i>n<\/i><\/span>AG expertise and support you get the maximum value from dco\/c++ , in the most rapid time frame.\u200b\u00a0<\/strong><\/p>\n<p>These updates are the result of more than 12 years of research and development\u00a0and all our solutions are stringently tested, expertly supported, and backed by over 50 years of experience.<\/p>\n<p><strong>Contact us now to learn more about <span class=\"nag-n-override\" style=\"margin-left: 0 !important;\"><i>n<\/i><\/span>AG\u2019s Automatic Differentiation products and services, and talk to our experts about how it can help you.\u00a0<\/strong><\/p>\n<\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n\n<div class=\"gbc-title-banner tac tac-lg tac-xl\" style='border-radius: 0px; '>\n    <div class=\"container\" style='border-radius: 0px; '>\n        <div class=\"row justify-content--center\" >\n            <div class=\"col-12\"  >\n                <div class=\"wrap pv-4 \" style=\"0pxbackground-color: \">\n                                <div class=\"col-12 col-md-10 col-lg-8 col-xl-6  banner-content\"  >\n    \n                    \n                    <div class=\"mt-1 mb-1 content\"><\/div>\n\n                    \n                    <a href='#' style='background-color: #ff7d21ff; color: #ffffffff; border-radius: 30px; font-weight: 600; ' class='btn mr-1  ' >Contact us <i class='fas fa-angle-right'><\/i><\/a>                <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"nag-n-override\" style=\"margin-left: 0 !important;\"><i>n<\/i><\/span>AG\u2019s Automatic Differentiation tool dco\/c++ now includes Code Generation, A hybrid technology that combines the efficiency of source transformation with the flexibility and ease of use of an operator overloading tool, with support for primal, tangent and adjoint code. This means our latest AD technology supports all combinations of scalar and vector modes for computing first and higher derivatives and does so more efficiently than ever before.<\/p>\n","protected":false},"author":5,"featured_media":967,"parent":0,"menu_order":0,"template":"","meta":{"content-type":"","footnotes":""},"post-tag":[16],"class_list":["post-1456","insights","type-insights","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Pioneering Automatic Differentiation: Code Generation - nAG<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Pioneering Automatic Differentiation: Code Generation - nAG\" \/>\n<meta property=\"og:description\" content=\"NAG\u2019s Automatic Differentiation tool dco\/c++ now includes Code Generation, A hybrid technology that combines the efficiency of source transformation with the flexibility and ease of use of an operator overloading tool, with support for primal, tangent and adjoint code. This means our latest AD technology supports all combinations of scalar and vector modes for computing first and higher derivatives and does so more efficiently than ever before.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/\" \/>\n<meta property=\"og:site_name\" content=\"nAG\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-04T16:31:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/nag.com\/wp-content\/uploads\/2023\/05\/pexels-peng-liu-169647.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1805\" \/>\n\t<meta property=\"og:image:height\" content=\"1205\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@NAGTalk\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/\",\"url\":\"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/\",\"name\":\"Pioneering Automatic Differentiation: Code Generation - nAG\",\"isPartOf\":{\"@id\":\"https:\/\/nag.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/nag.com\/wp-content\/uploads\/2023\/05\/pexels-peng-liu-169647.jpg\",\"datePublished\":\"2023-01-27T16:13:00+00:00\",\"dateModified\":\"2023-07-04T16:31:33+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/#primaryimage\",\"url\":\"https:\/\/nag.com\/wp-content\/uploads\/2023\/05\/pexels-peng-liu-169647.jpg\",\"contentUrl\":\"https:\/\/nag.com\/wp-content\/uploads\/2023\/05\/pexels-peng-liu-169647.jpg\",\"width\":1805,\"height\":1205},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/nag.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Insights\",\"item\":\"https:\/\/nag.com\/insights\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Pioneering Automatic Differentiation: Code Generation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/nag.com\/#website\",\"url\":\"https:\/\/nag.com\/\",\"name\":\"NAG\",\"description\":\"Robust, trusted numerical software and computational expertise.\",\"publisher\":{\"@id\":\"https:\/\/nag.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/nag.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/nag.com\/#organization\",\"name\":\"Numerical Algorithms Group\",\"alternateName\":\"NAG\",\"url\":\"https:\/\/nag.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/nag.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/nag.com\/wp-content\/uploads\/2023\/11\/NAG-Logo.png\",\"contentUrl\":\"https:\/\/nag.com\/wp-content\/uploads\/2023\/11\/NAG-Logo.png\",\"width\":1244,\"height\":397,\"caption\":\"Numerical Algorithms Group\"},\"image\":{\"@id\":\"https:\/\/nag.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/NAGTalk\",\"https:\/\/www.linkedin.com\/company\/nag\/\",\"https:\/\/www.youtube.com\/user\/NumericalAlgorithms\",\"https:\/\/github.com\/numericalalgorithmsgroup\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Pioneering Automatic Differentiation: Code Generation - nAG","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/","og_locale":"en_US","og_type":"article","og_title":"Pioneering Automatic Differentiation: Code Generation - nAG","og_description":"NAG\u2019s Automatic Differentiation tool dco\/c++ now includes Code Generation, A hybrid technology that combines the efficiency of source transformation with the flexibility and ease of use of an operator overloading tool, with support for primal, tangent and adjoint code. This means our latest AD technology supports all combinations of scalar and vector modes for computing first and higher derivatives and does so more efficiently than ever before.","og_url":"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/","og_site_name":"nAG","article_modified_time":"2023-07-04T16:31:33+00:00","og_image":[{"width":1805,"height":1205,"url":"https:\/\/nag.com\/wp-content\/uploads\/2023\/05\/pexels-peng-liu-169647.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_site":"@NAGTalk","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/","url":"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/","name":"Pioneering Automatic Differentiation: Code Generation - nAG","isPartOf":{"@id":"https:\/\/nag.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/#primaryimage"},"image":{"@id":"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/#primaryimage"},"thumbnailUrl":"https:\/\/nag.com\/wp-content\/uploads\/2023\/05\/pexels-peng-liu-169647.jpg","datePublished":"2023-01-27T16:13:00+00:00","dateModified":"2023-07-04T16:31:33+00:00","breadcrumb":{"@id":"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/#primaryimage","url":"https:\/\/nag.com\/wp-content\/uploads\/2023\/05\/pexels-peng-liu-169647.jpg","contentUrl":"https:\/\/nag.com\/wp-content\/uploads\/2023\/05\/pexels-peng-liu-169647.jpg","width":1805,"height":1205},{"@type":"BreadcrumbList","@id":"https:\/\/nag.com\/insights\/pioneering-automatic-differentiation-code-generation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/nag.com\/"},{"@type":"ListItem","position":2,"name":"Insights","item":"https:\/\/nag.com\/insights\/"},{"@type":"ListItem","position":3,"name":"Pioneering Automatic Differentiation: Code Generation"}]},{"@type":"WebSite","@id":"https:\/\/nag.com\/#website","url":"https:\/\/nag.com\/","name":"NAG","description":"Robust, trusted numerical software and computational expertise.","publisher":{"@id":"https:\/\/nag.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nag.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/nag.com\/#organization","name":"Numerical Algorithms Group","alternateName":"NAG","url":"https:\/\/nag.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nag.com\/#\/schema\/logo\/image\/","url":"https:\/\/nag.com\/wp-content\/uploads\/2023\/11\/NAG-Logo.png","contentUrl":"https:\/\/nag.com\/wp-content\/uploads\/2023\/11\/NAG-Logo.png","width":1244,"height":397,"caption":"Numerical Algorithms Group"},"image":{"@id":"https:\/\/nag.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/NAGTalk","https:\/\/www.linkedin.com\/company\/nag\/","https:\/\/www.youtube.com\/user\/NumericalAlgorithms","https:\/\/github.com\/numericalalgorithmsgroup"]}]}},"_links":{"self":[{"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/insights\/1456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/insights"}],"about":[{"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/types\/insights"}],"author":[{"embeddable":true,"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/users\/5"}],"version-history":[{"count":8,"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/insights\/1456\/revisions"}],"predecessor-version":[{"id":2917,"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/insights\/1456\/revisions\/2917"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/media\/967"}],"wp:attachment":[{"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/media?parent=1456"}],"wp:term":[{"taxonomy":"post-tag","embeddable":true,"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/post-tag?post=1456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}