1. Software is math. Not "does" math, but "is" math. See Google and HNsearch for references to the endless discussions of this fact.
2. A patent on a device covers an implementation. Patents on software have been used to block entire ideas, regardless of implementation.
Based on these factors, plus many more that have been argued to death, software should be ineligible for patents, and software on a computer of any kind should not be capable of infringing any patent. Failing that, independent invention needs to be a 100% defense against infringement, and evidence of obviousness, especially with software, to release the silent stranglehold that the threat of litigation has on software innovation.