1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright 2026 Regit.io — Nicolas Koenig
// SPDX-License-Identifier: Apache-2.0
//! Market-coordinate conversion conventions.
/// Converts implied volatility to total implied variance, `vol² × t`.
///
/// This infallible kernel assumes finite, non-negative `vol` and finite,
/// non-negative `t`; it propagates IEEE non-finite results outside that domain
/// or the representable range.
///
/// # Examples
///
/// ```
/// use regit_svi::total_variance_from_vol;
///
/// assert!((total_variance_from_vol(0.20, 2.0) - 0.08).abs() < 1e-15);
/// ```
/// Converts strike and forward to log-moneyness, `ln(strike / forward)`.
///
/// The logarithms are taken before subtraction so a representable strike and
/// forward do not spuriously overflow in their ratio.
/// Both inputs must be finite and strictly positive; IEEE `NaN` or infinity
/// propagates when those preconditions fail or the result is out of range.
///
/// # Examples
///
/// ```
/// use regit_svi::log_moneyness;
///
/// assert!(log_moneyness(100.0, 100.0).abs() < 1e-15);
/// assert!(log_moneyness(1e308, 1e-308).is_finite());
/// ```
// Validated fixtures use contextual expectations.