1. A method, comprising; generating, by a processor, an initial graph representation of arithmetic operations specified by ordered programming statements comprising input code, wherein the initial graph representation includes nodes corresponding to the arithmetic operations and edges corresponding to data flow between the nodes; annotating the initial graph representation with predefined attributes to produce a partially annotated graph representation; applying a set of propagation rules to each node within the partially annotation graph representation to produce a fully annotated graph representation; selecting numerical types for each edge within the fully annotated graph representation based on corresponding edge attributes to produce a transformed graph representation; and generating output code based on the transformed graph representation.