ffc team mailing list archive
-
ffc team
-
Mailing list archive
-
Message #01727
Re: -fprecision!=15
Hi Jake,
Snarky answer:
If you print out 32 digits of a 16-digit number, well you get what you ask
for :)
Better answer:
The -fprecision flag tells how many digits to print to file, not how many to
compute. FFC does all of its work in double-precision floating point
arithmetic (native Python floating point numbers) and has no facilities for
arbitrary or extended precision. If you need the higher precision, you
might try looking at SyFi, which works in symbolic arithmetic and so should
be able to generate more accurate numbers after it gets done.
Regards,
Rob Kirby
On Wed, Aug 20, 2008 at 11:08 AM, Ostien, Jakob T <jtostie@xxxxxxxxxx>wrote:
> Hi,
>
> Just for fun I tried to compile a form with -fprecision=32, to see if that
> would impact a problem I was seeing. The generated code was not what I
> expected.
>
> For example, using the default, the factor 1/3 is represented as:
> 0.333333333333333
>
> But for -fprecision=32 (for the same form) 1/3 becomes
> 0.33333333333333331482961625624739
>
> Obviously that latter isn't really that much better than the former.
>
> Is this known? I can only guess what's happening, anyone have a solid
> idea? Possibly (hopefully) its an environment issue that I can fix locally.
>
> Jake
>
>
> _______________________________________________
> FFC-dev mailing list
> FFC-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/ffc-dev
>
References