Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #69631

Re: routine for angles needed

From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.lang.c
Subject Re: routine for angles needed
Date 2015-09-06 14:02 -0400
Organization Self
Message-ID <55EC7FAD.7050705@verizon.net> (permalink)
References (10 earlier) <kfnr3mcww4j.fsf@x-alumni2.alumni.caltech.edu> <lntwr8v48u.fsf@kst-u.example.com> <msgj3f$apd$1@speranza.aioe.org> <55EC6281.4010500@verizon.net> <87r3mbfqf3.fsf@bsb.me.uk>

Show all headers | View raw


On 09/06/2015 12:44 PM, Ben Bacarisse wrote:
> James Kuyper <jameskuyper@verizon.net> writes:
> 
>> On 09/06/2015 01:31 AM, glen herrmannsfeldt wrote:
>>> Keith Thompson <kst-u@mib.org> wrote:
>>>> Tim Rentsch <txr@alumni.caltech.edu> writes:
>>>>> Robert Wessel <robertwessel2@yahoo.com> writes:
>>>> [...]
>>>>>> Ultimately any sort of decimal encoding has to be less efficient 
>>>>>> than binary encoding, since you invariably end up with "invalid" bit
>>>>>> patterns. [snip]
>>>
>>>>> This isn't right.  Using a decimal base for floating point
>>>>> is not inherently less bit efficient than a binary base.
>>>>> Using a decimal base can be much less convenient than
>>>>> using a binary base, but it is not inherently less bit
>>>>> efficient.  In particular there needn't be any invalid
>>>>> or duplicate bit patterns.
>>>
>>> Bit efficient is a funny term in this context. You can represent
>>> a specific number of real values with a given number of bits.
>>
>> Bit efficiency compares the number of real values representable by the
>> format under discussion, with 2^N, where N is the number of bits
>> required to store the format. If the first number is substantially
>> smaller than the second, the bits are being used inefficiently. This
>> seems a reasonable use of the term.
> 
> It's a bit fuzzy, though, because you need to factor in some idea of the
> utility of the values.  For example, in IEEE FP (what's the proper term
> for this?) there are 2^53 - 2 NaN values in the 64-bit format.  Do these
> count or are all but one of them wasted?  There's some value in having
> multiple NaNs (for example you can signal various kinds of error using
> them) so it's not clear-cut.  And there's a fair few denormals, too.
> Are they proper values or wasted representations?
> 
> And if I remember correctly the IEEE decimal FP format also has a large
> number of infinities.  Having any more than two would seem to be wasting
> representations but I bet someone's already found use for them.

I checked out IEEE 754-2008's decimal64 format mentioned by Glenn. NaN's
and Infinities are not exceptions - most numbers have multiple ways they
can be represented. That's unambiguously inefficient.

> One could settle such questions by saying that the bit-efficiency is the
> number of distinct rational numbers that can be represented divided by
> 2^N.  That rules out infinities, NaNs and any duplicates (usually 0),
> but includes denormals.  That's one way to make it exact, but I'm not
> sure I'd want to include denormals, simply because having a high
> proportion of them is a bad thing.

I will agree that all of these are relevant issues. But the concept
first came into this thread in connection with a description of Binary
Coded Decimal (BCD) (though not mentioned by name), which is
unambiguously somewhat bit-inefficient. An encoding that uses 10*N bits
to store values from 0 to 10^(3*N)-1 is also somewhat inefficient,
though less so. The next level would be to store 0 to 10^28-1 in 93
bits. Every decimal floating point format I'm aware of has some such issue.

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 10:17 -0700
  Re: routine for angles needed Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-02 10:38 -0700
    Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 11:10 -0700
      Re: routine for angles needed Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-02 11:26 -0700
        Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 11:41 -0700
          Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 12:02 -0700
  Re: routine for angles needed Bartc <bc@freeuk.com> - 2015-08-02 18:41 +0100
    Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 11:43 -0700
      Re: routine for angles needed Bartc <bc@freeuk.com> - 2015-08-02 20:00 +0100
        Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 12:04 -0700
          Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 12:10 -0700
            Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 12:24 -0700
              Re: routine for angles needed Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-02 12:32 -0700
                Re: routine for angles needed Bartc <bc@freeuk.com> - 2015-08-02 20:40 +0100
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 12:59 -0700
                Re: routine for angles needed Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-02 13:14 -0700
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 13:39 -0700
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 13:45 -0700
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-03 07:48 -0700
                Re: routine for angles needed Bartc <bc@freeuk.com> - 2015-08-03 17:06 +0100
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-03 09:09 -0700
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-03 09:17 -0700
                Re: routine for angles needed Bartc <bc@freeuk.com> - 2015-08-03 17:48 +0100
                Re: routine for angles needed Keith Thompson <kst-u@mib.org> - 2015-08-03 13:44 -0700
                Re: routine for angles needed Bartc <bc@freeuk.com> - 2015-08-03 23:51 +0100
                Re: routine for angles needed Keith Thompson <kst-u@mib.org> - 2015-08-03 18:30 -0700
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-03 23:11 +0000
                Re: routine for angles needed Bartc <bc@freeuk.com> - 2015-08-04 01:32 +0100
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-04 01:14 +0000
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-08-03 20:26 -0500
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-04 18:24 +0000
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-08-05 01:46 -0500
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-05 18:06 +0000
                Re: routine for angles needed Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-05 11:37 -0700
                Re: routine for angles needed Keith Thompson <kst-u@mib.org> - 2015-09-05 16:24 -0700
                Re: routine for angles needed Richard Damon <Richard@Damon-Family.org> - 2015-09-05 21:01 -0400
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-09-05 23:30 -0500
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-06 05:37 +0000
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-09-07 00:27 -0500
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-06 05:31 +0000
                Re: routine for angles needed James Kuyper <jameskuyper@verizon.net> - 2015-09-06 11:57 -0400
                Re: routine for angles needed Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-09-06 17:44 +0100
                Re: routine for angles needed James Kuyper <jameskuyper@verizon.net> - 2015-09-06 14:02 -0400
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-09-07 00:31 -0500
                Re: routine for angles needed Keith Thompson <kst-u@mib.org> - 2015-09-06 11:59 -0700
                Re: routine for angles needed Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-06 18:04 -0700
                Re: routine for angles needed Keith Thompson <kst-u@mib.org> - 2015-09-06 18:30 -0700
                Re: routine for angles needed Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-06 18:48 -0700
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-09-07 00:44 -0500
                Re: routine for angles needed Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-10 05:44 -0700
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-08-03 20:16 -0500
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-04 01:26 +0000
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-08-05 02:05 -0500
                Re: routine for angles needed Keith Thompson <kst-u@mib.org> - 2015-08-03 18:33 -0700
                Re: routine for angles needed glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-08-04 21:24 +0000
                Re: routine for angles needed Robert Wessel <robertwessel2@yahoo.com> - 2015-08-03 19:41 -0500
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 12:51 -0700
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 12:56 -0700
                Re: routine for angles needed Bartc <bc@freeuk.com> - 2015-08-02 20:57 +0100
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 13:06 -0700
                Re: routine for angles needed Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-02 22:25 +0100
                Re: routine for angles needed Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-02 22:27 +0100
                Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-02 14:40 -0700
  Re: routine for angles needed "Chris M. Thomasson" <nospam@nospam.nospam> - 2015-08-02 19:08 -0700
    Re: routine for angles needed fir <profesor.fir@gmail.com> - 2015-08-03 02:18 -0700
  Re: routine for angles needed danncorbit@gmail.com - 2015-08-12 02:18 -0700
  Re: routine for angles needed bartekltg <bartekltg@gmail.com> - 2015-09-07 05:02 +0200

csiph-web