Active to Passive

Active to Passive (A2P) conversions occur when AADC’s active types (idouble, ibool, iint) are converted to their passive counterparts (double, bool, int64_t). These conversions are critical points in AADC workflows because they can affect both valuation accuracy and automatic differentiation correctness.

Overview

Key Concepts:

  • Active types: idouble, ibool, iint - track computations for AD
  • Passive types: double, bool, int64_t - standard C++ types
  • A2P conversion: Converting active to passive, potentially breaking AD chain

Why It Matters:

  • Conversions can create incomplete valuation graphs
  • Derivative chains may be broken at conversion points
  • Not all conversions are problematic - AADC helps identify which ones need attention

Quick Example:

idouble price(100.0);
price.markAsInput();

// Explicit conversion required (safe, tracked)
double passive_price = AAD_PASSIVE(price);

// Use iIf() instead of if/else for stochastic conditions
idouble result = iIf(price > strike, price - strike, 0.0);

This is a preview of the Active to Passive documentation.

The full documentation includes detailed conversion tables, detection and control mechanisms, conversion monitoring APIs, debugger integration, common scenarios and solutions, and best practices for development and legacy integration.

Contact us to request a demo version and get access to the complete documentation.