In this article, we introduce a new technique for precision tuning. This problem consists of finding the least data types for numerical values such that the result of the computation satisfies some accuracy requirement. State of the art techniques for precision tuning use a try and fail approach. They change the data types of some variables of the program and evaluate the accuracy of the result. Depending on what is obtained, they change more or less data types and repeat the process. Our technique is radically different. Based on semantic equations, we generate an Integer Linear Problem (ILP) from the program source code. Basically, this is done by reasoning on the most significant bit and the number of significant bits of the values which are integer quantities. The integer solution to this problem, computed in polynomial time by a (real) linear programming solver, gives the optimal data types at the bit level. A finer set of semantic equations is also proposed which does not reduce directly to an ILP problem. So we use policy iteration to find the solution. Both techniques have been implemented and we show that our results encompass the results of state of the art tools.
翻译:在此文章中, 我们引入了一种新的精确调试技术 。 这个问题包括找到数字值中最小的数据类型, 这样计算的结果就满足了某些准确性要求。 精密调用艺术状态使用试与失败的方法。 它们改变程序某些变量的数据类型, 并评估结果的准确性。 根据获得的数据类型, 它们或多或少地改变数据类型并重复进程 。 我们的技术是完全不同的 。 根据语义方程, 我们从程序源代码中产生一个 Integer 线性问题( ILP) 。 基本上, 这是通过对数值中最重要的部分和整数中重要部分的推理来完成的 。 这个问题的整数解决方案, 由( 真实的) 线性编程求解器计算, 提供了比特一级的最佳数据类型 。 还提出了精细的语方程方程, 它不会直接降低到 ILP 问题 。 因此我们用政策来找到解决方案 。 这两种技术都得到了应用, 我们显示我们的结果包含艺术工具状态的结果 。