This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch,libgfortran] Simplification of calculation
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: Fortran List <fortran at gcc dot gnu dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 16 May 2009 06:17:40 -0700
- Subject: [patch,libgfortran] Simplification of calculation
This patch is s simplification of a calculation in write_float.def to give some
minor speedup.
Regression tested on x86-64-linux-gnu. NIST tested.
OK for trunk?
2009-05-16 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/37754
* io/write_float.def: Simplify format calculation.
Index: write_float.def
===================================================================
--- write_float.def (revision 147465)
+++ write_float.def (working copy)
@@ -635,8 +635,7 @@ output_float_FMT_G_ ## x (st_parameter_d
GFC_REAL_ ## x temp;\
mid = (low + high) / 2;\
\
- temp = (calculate_exp_ ## x (mid) - \
- 5 * calculate_exp_ ## x (mid - d - 1)) / 10;\
+ temp = calculate_exp_ ## x (mid - 1) * (1 - 1/(2 * exp_d));\
\
if (m < temp)\
{ \