{"id":1461,"date":"2022-05-26T10:24:00","date_gmt":"2022-05-26T10:24:00","guid":{"rendered":"https:\/\/nag.com\/?post_type=insights&#038;p=1012"},"modified":"2023-07-05T10:17:24","modified_gmt":"2023-07-05T10:17:24","slug":"ad-myths-debunked-ad-will-infect-all-my-other-libraries","status":"publish","type":"insights","link":"https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/","title":{"rendered":"AD Myths Debunked: AD Will Infect All My Other Libraries"},"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            <p>This post is part of the\u00a0AD Myths Debunked series.<\/p>\n<p>You\u2019ve heard implementing Automatic Differentiation into your project will get you first and second-order sensitivities faster. Much faster. But you\u2019ve also heard you will need to modify your whole code base, including every single library, which means other internal users of said libraries will need to understand AD as well, right? That sounds too intrusive, so you don\u2019t pursue the idea much further.\u00a0\u00a0<\/p>\n<p>This is another story we have heard many times over the years. So, the questions are&#8230; Can you get a proof of concept (POC)? Can you apply AD to a library that contains code parts you would like to leave untouched? Can you implement AD in your library without affecting other users? The answer to all of these questions is \u2018Yes\u2019.<\/p>\n<p>Let\u2019s look at two very commonly found situations:<\/p>\n<ol>\n<li>A proof of concept, or \u2018PoC\u2019, can be a great way of understanding quickly the benefits of AD, and the ease with which it can be implemented. When working on a PoC, we inherently use a small but reasonable subset of the client\u2019s library. \u00a0Manual and tool-based dependency analysis can help extract the relevant subset of the code to do this. Of course, having the PoC up and running quickly is important. Our experience helps us to efficiently implement AD to ensure a rapid, informed, and expert assessment of the impact of AD.\u00a0Additionally, our AD tools have APIs to easily transform between active and passive data, which makes interfaces between AD code and non AD code possible. Together with smart code design decisions and modern C++ features (like templates and lambdas), this is a powerful technique to avoid unnecessary expansion of AD into other libraries. \u00a0<\/li>\n<li>If the library you\u2019re working on is embedded by internal users into other libraries that are unaware of AD, clean data encapsulation is possible to hide AD completely, while still exploiting its benefits in your library. With our support, internal users will only see the runtime and accuracy benefits, staying clear of any AD-related business.<br \/>&nbsp;<\/li>\n<\/ol>\n<p><span class=\"nag-n-override\" style=\"margin-left: 0 !important;\"><i>n<\/i><\/span>AG\u2019s AD toolset has been developed and enhanced over the last 12 years and it builds upon a further 10 years of AD R&amp;D experience in C++ (even longer in Fortran!). We know that details matter. Applying AD to only a subset of the code base is part of our day-to-day work and we&#8217;ve not come across a single case we couldn&#8217;t handle. \u00a0<\/p>\n<p>Myths are narratives, which might sound like truths, but by talking through these in some detail and sharing our experiences, we hope to help businesses navigate these issues. Results matter, myths should not.<\/p>\n        <\/div>\n    <\/div>\n<\/div>\n\n\n<div class=\"gbc-title-banner tac tac-lg tac-xl\" style='background-size: contain; border-radius: 0px; '>\n    <div class=\"container\" style='background-size: contain; 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='https:\/\/nag.com\/insights\/' style='background-color: #ff7d21ff; color: #ffffffff; border-radius: 30px; font-weight: 600; ' class='btn mr-1  ' >More Insights <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>Can you get a proof of concept (POC)? Can you apply AD to a library that contains code parts you would like to leave untouched? Can you implement AD in your library without affecting other users? The answer to all of these questions is \u2018Yes\u2019.<\/p>\n","protected":false},"author":5,"featured_media":988,"parent":0,"menu_order":0,"template":"","meta":{"content-type":"","footnotes":""},"post-tag":[16,25],"class_list":["post-1461","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>AD Myths Debunked: AD Will Infect All My Other Libraries - 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\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AD Myths Debunked: AD Will Infect All My Other Libraries - nAG\" \/>\n<meta property=\"og:description\" content=\"Can you get a proof of concept (POC)? Can you apply AD to a library that contains code parts you would like to leave untouched? Can you implement AD in your library without affecting other users? The answer to all of these questions is \u2018Yes\u2019.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/\" \/>\n<meta property=\"og:site_name\" content=\"nAG\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-05T10:17:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/nag.com\/wp-content\/uploads\/2023\/05\/Blog_Post-Myth-1-1024x576.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"576\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\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\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/\",\"url\":\"https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/\",\"name\":\"AD Myths Debunked: AD Will Infect All My Other Libraries - nAG\",\"isPartOf\":{\"@id\":\"https:\/\/nag.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/nag.com\/wp-content\/uploads\/2023\/05\/Blog_Post-Myth-1.png\",\"datePublished\":\"2022-05-26T10:24:00+00:00\",\"dateModified\":\"2023-07-05T10:17:24+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/#primaryimage\",\"url\":\"https:\/\/nag.com\/wp-content\/uploads\/2023\/05\/Blog_Post-Myth-1.png\",\"contentUrl\":\"https:\/\/nag.com\/wp-content\/uploads\/2023\/05\/Blog_Post-Myth-1.png\",\"width\":5333,\"height\":3000,\"caption\":\"Automatic Differentiation\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/#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\":\"AD Myths Debunked: AD Will Infect All My Other Libraries\"}]},{\"@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":"AD Myths Debunked: AD Will Infect All My Other Libraries - 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\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/","og_locale":"en_US","og_type":"article","og_title":"AD Myths Debunked: AD Will Infect All My Other Libraries - nAG","og_description":"Can you get a proof of concept (POC)? Can you apply AD to a library that contains code parts you would like to leave untouched? Can you implement AD in your library without affecting other users? The answer to all of these questions is \u2018Yes\u2019.","og_url":"https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/","og_site_name":"nAG","article_modified_time":"2023-07-05T10:17:24+00:00","og_image":[{"width":1024,"height":576,"url":"https:\/\/nag.com\/wp-content\/uploads\/2023\/05\/Blog_Post-Myth-1-1024x576.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@NAGTalk","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/","url":"https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/","name":"AD Myths Debunked: AD Will Infect All My Other Libraries - nAG","isPartOf":{"@id":"https:\/\/nag.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/#primaryimage"},"image":{"@id":"https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/#primaryimage"},"thumbnailUrl":"https:\/\/nag.com\/wp-content\/uploads\/2023\/05\/Blog_Post-Myth-1.png","datePublished":"2022-05-26T10:24:00+00:00","dateModified":"2023-07-05T10:17:24+00:00","breadcrumb":{"@id":"https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/#primaryimage","url":"https:\/\/nag.com\/wp-content\/uploads\/2023\/05\/Blog_Post-Myth-1.png","contentUrl":"https:\/\/nag.com\/wp-content\/uploads\/2023\/05\/Blog_Post-Myth-1.png","width":5333,"height":3000,"caption":"Automatic Differentiation"},{"@type":"BreadcrumbList","@id":"https:\/\/nag.com\/insights\/ad-myths-debunked-ad-will-infect-all-my-other-libraries\/#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":"AD Myths Debunked: AD Will Infect All My Other Libraries"}]},{"@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\/1461","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":6,"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/insights\/1461\/revisions"}],"predecessor-version":[{"id":2998,"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/insights\/1461\/revisions\/2998"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/media\/988"}],"wp:attachment":[{"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/media?parent=1461"}],"wp:term":[{"taxonomy":"post-tag","embeddable":true,"href":"https:\/\/nag.com\/wp-json\/wp\/v2\/post-tag?post=1461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}