FPAvisual: A tool for visualizing the effects of floating-point finite-precision arithmetic

Document Type

Conference Proceeding

Publication Date

6-15-2014

Department

Department of Computer Science

Abstract

FPAvisual: A Tool for Visualizing the Effects of Floating-Point Finite-Precision Arithmetic Abstract: Many students in science and engineering do not realize how program correctness may be impacted when floating-point finite precision arithmetic is used. In this paper, we present FPAvisual, a visualization tool that helps instructors teach the reasons for the inaccuracies caused by floating-point arithmetic (FPA), their impact and significance in programs, and the techniques to prevent errors from propagating. FPAvisual contains four components, namely Associative Law,Pentagon, Roots, and the Sine Function. Associative Law demonstrates how algebraically equivalent formulas computed by changing the order of operations can yield different results. Pentagon demonstrates that accumulation of errors emanating from finite precision in geometriccomputations may result in large positional errors. Roots shows that the solution for a quadratic equation will be incorrect when two numbers that need to be subtracted are very close inmagnitude or when one is much larger than the other. The program presents possible solutions to these subtraction problems. The Sine Function component shows that results vary when the same infinite series for sine is used but computed in different ways. These four components allow the users set up parameters of the specific problem represented, trace the results step by step, see when differences in results start to occur, and visualize how errors accumulate. They help students understand the ubiquity of issues with FPA, realize the significance of FPA in a multitude of contexts, and compare the methods to minimize the negative effects of FPA. FPAvisual has been classroom tested and evaluated by computer science students. We report our findings in this paper.

Publisher's Statement

© American Society for Engineering Education, 2014. Publisher’s version of record: https://peer.asee.org/20518

Publication Title

2014 ASEE Annual Conference & Exposition

Share

COinS