Lazy compute to avoid bottleneck in case of double inputs.