comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <onewingedshark@gmail.com>
Subject: Re: Question about best practices with numerical functions
Date: Mon, 6 Jul 2020 10:02:39 -0700 (PDT)	[thread overview]
Message-ID: <e7a79ce2-dfb8-4482-96fb-46e1fe81d801o@googlegroups.com> (raw)
In-Reply-To: <fa2c6030-8bed-44c6-b5ed-0e24495a5085o@googlegroups.com>

On Friday, July 3, 2020 at 11:30:53 PM UTC-6, mockturtle wrote:
> 
>    [5] ??? 
> 
> Any suggestions?
One way to do this would be to use fixed-point types:
(1) Convert your input to the fixed-point that has a "good enough" delta for the precision you want.
(2) Run the algorithm.
(3) Convert back to your normal value-type.
This assumes you're using floating-point or integers, but one nice thing about fixed-point is that it has a bounded error when dealing with operations, unlike floating-point. -- I remember some years ago seeing a bug report dealing with floating-point, where the particular error simply couldn't have happened with fixed-point.

  parent reply	other threads:[~2020-07-06 17:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-04  5:30 Question about best practices with numerical functions mockturtle
2020-07-04  7:50 ` Dmitry A. Kazakov
2020-07-04 10:45 ` Nasser M. Abbasi
2020-07-06 17:02 ` Shark8 [this message]
2020-07-06 22:23   ` Dmitry A. Kazakov
2020-07-07  4:52     ` mockturtle
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox