precompute some graph data
calculate x once per value