Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

If I have not seen so far it is because I stood in giant's footsteps.


devel / comp.lang.c / Radians Or Degrees?

SubjectAuthor
* Radians Or Degrees?Lawrence D'Oliveiro
+* Re: Radians Or Degrees?James Kuyper
|`* Re: Radians Or Degrees?Michael S
| `* Re: Radians Or Degrees?Lawrence D'Oliveiro
|  `* Re: Radians Or Degrees?Steven G. Kargl
|   `* Re: Radians Or Degrees?Lawrence D'Oliveiro
|    `* Re: Radians Or Degrees?Steven G. Kargl
|     `* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      +* Re: Radians Or Degrees?Michael S
|      |+- Re: Radians Or Degrees?Lawrence D'Oliveiro
|      |+* Re: Radians Or Degrees?MitchAlsup1
|      ||`* Re: Radians Or Degrees?Steven G. Kargl
|      || +* Re: Radians Or Degrees?Chris M. Thomasson
|      || |`* Re: Radians Or Degrees?Chris M. Thomasson
|      || | `* Re: Radians Or Degrees?MitchAlsup1
|      || |  `* Re: Radians Or Degrees?Chris M. Thomasson
|      || |   `* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      || |    `* Re: Radians Or Degrees?Chris M. Thomasson
|      || |     `* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      || |      `* Re: Radians Or Degrees?Chris M. Thomasson
|      || |       +- Re: Radians Or Degrees?Lawrence D'Oliveiro
|      || |       `- Re: Radians Or Degrees?Chris M. Thomasson
|      || +* Re: Radians Or Degrees?MitchAlsup1
|      || |`* Re: Radians Or Degrees?Terje Mathisen
|      || | `* Re: Radians Or Degrees?Michael S
|      || |  +* Re: Radians Or Degrees?MitchAlsup1
|      || |  |+* Re: Radians Or Degrees?MitchAlsup1
|      || |  ||`- Re: Radians Or Degrees?Terje Mathisen
|      || |  |+* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      || |  ||+- Re: Radians Or Degrees?Chris M. Thomasson
|      || |  ||`* Re: Radians Or Degrees?MitchAlsup1
|      || |  || `* Re: Radians Or Degrees?Chris M. Thomasson
|      || |  ||  `- Re: Radians Or Degrees?Chris M. Thomasson
|      || |  |`- Re: Radians Or Degrees?Michael S
|      || |  +* Re: Radians Or Degrees?Terje Mathisen
|      || |  |+* Re: Radians Or Degrees?Michael S
|      || |  ||`* Re: Radians Or Degrees?MitchAlsup1
|      || |  || `- Re: Radians Or Degrees?Terje Mathisen
|      || |  |`* Re: Radians Or Degrees?Chris M. Thomasson
|      || |  | +* Re: Radians Or Degrees?Chris M. Thomasson
|      || |  | |`- Re: Radians Or Degrees?Chris M. Thomasson
|      || |  | +* Re: Radians Or Degrees?Keith Thompson
|      || |  | |+* Re: Radians Or Degrees?Chris M. Thomasson
|      || |  | ||`* Re: Radians Or Degrees?Chris M. Thomasson
|      || |  | || `* Re: Radians Or Degrees?Keith Thompson
|      || |  | ||  `* Re: Radians Or Degrees?Chris M. Thomasson
|      || |  | ||   `- Re: Radians Or Degrees?Chris M. Thomasson
|      || |  | |`* Re: Radians Or Degrees?MitchAlsup1
|      || |  | | `* Re: Radians Or Degrees?Michael S
|      || |  | |  `* Re: Radians Or Degrees?MitchAlsup1
|      || |  | |   +- Re: Radians Or Degrees?Scott Lurndal
|      || |  | |   +- Re: Radians Or Degrees?Michael S
|      || |  | |   `* Re: Radians Or Degrees?Keith Thompson
|      || |  | |    +* Re: Radians Or Degrees?bart
|      || |  | |    |`* Re: Radians Or Degrees?Keith Thompson
|      || |  | |    | `* Re: Radians Or Degrees?bart
|      || |  | |    |  `* Re: Radians Or Degrees?Keith Thompson
|      || |  | |    |   `- Re: Radians Or Degrees?David Brown
|      || |  | |    `* Re: Radians Or Degrees?Michael S
|      || |  | |     +- Re: Radians Or Degrees?Michael S
|      || |  | |     `* Re: Radians Or Degrees?bart
|      || |  | |      `- Re: Radians Or Degrees?Michael S
|      || |  | `- Re: Radians Or Degrees?Chris M. Thomasson
|      || |  `* Re: Radians Or Degrees?Stefan Monnier
|      || |   `* Re: Radians Or Degrees?MitchAlsup1
|      || |    `* Re: Radians Or Degrees?Stefan Monnier
|      || |     +* Re: Radians Or Degrees?Michael S
|      || |     |+* Re: Radians Or Degrees?Stefan Monnier
|      || |     ||`* Re: Radians Or Degrees?MitchAlsup1
|      || |     || `* Re: Radians Or Degrees?Terje Mathisen
|      || |     ||  `* Re: Radians Or Degrees?Michael S
|      || |     ||   +- Re: Radians Or Degrees?MitchAlsup1
|      || |     ||   `- Re: Radians Or Degrees?Terje Mathisen
|      || |     |+* Re: Radians Or Degrees?Steven G. Kargl
|      || |     ||`- Re: Radians Or Degrees?MitchAlsup1
|      || |     |`* Re: Radians Or Degrees?MitchAlsup1
|      || |     | `- Re: Radians Or Degrees?Michael S
|      || |     +* Re: Radians Or Degrees?MitchAlsup1
|      || |     |`- Re: Radians Or Degrees?Stefan Monnier
|      || |     `- Re: Radians Or Degrees?Terje Mathisen
|      || `* Re: Radians Or Degrees?Michael S
|      ||  `* Re: Radians Or Degrees?MitchAlsup1
|      ||   `* Re: Radians Or Degrees?Steven G. Kargl
|      ||    +* Re: Radians Or Degrees?MitchAlsup1
|      ||    |+* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      ||    ||`* Re: Radians Or Degrees?Steven G. Kargl
|      ||    || +* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      ||    || |`* Re: Radians Or Degrees?Steven G. Kargl
|      ||    || | `- Re: Radians Or Degrees?Kaz Kylheku
|      ||    || `* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      ||    ||  `* Re: Radians Or Degrees?Steven G. Kargl
|      ||    ||   `- Re: Radians Or Degrees?MitchAlsup1
|      ||    |`- Re: Radians Or Degrees?Steven G. Kargl
|      ||    +* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      ||    |+* Re: Radians Or Degrees?Ben Bacarisse
|      ||    ||`* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      ||    || `* Re: Radians Or Degrees?Ben Bacarisse
|      ||    ||  +* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      ||    ||  |`* Re: Radians Or Degrees?Ben Bacarisse
|      ||    ||  | +* Re: Radians Or Degrees?Kaz Kylheku
|      ||    ||  | |`* Re: Radians Or Degrees?Ben Bacarisse
|      ||    ||  | `* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      ||    ||  `- Re: Radians Or Degrees?Tim Rentsch
|      ||    |+- Re: Radians Or Degrees?Kaz Kylheku
|      ||    |`* Re: Radians Or Degrees?James Kuyper
|      ||    `* Re: Radians Or Degrees?Terje Mathisen
|      |`- Re: Radians Or Degrees?Terje Mathisen
|      `* Re: Radians Or Degrees?Steven G. Kargl
+* Re: Radians Or Degrees?fir
+* Re: Radians Or Degrees?Malcolm McLean
+- Re: Radians Or Degrees?David Brown
`* Re: Radians Or Degrees?Blue-Maned_Hawk

Pages:1234567
Re: Radians Or Degrees?

<ur8ajp$2itt$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35111&group=comp.lang.c#35111

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.c
Subject: Re: Radians Or Degrees?
Date: Thu, 22 Feb 2024 21:25:28 +0100
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <ur8ajp$2itt$1@dont-email.me>
References: <ur5trn$3d64t$1@dont-email.me>
<pan$d0f42$eeb000fb$9b95dafc$a5a80129@invalid.invalid>
<ur76he$3qbhl$2@dont-email.me> <ur87th$1rr1$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 22 Feb 2024 20:25:29 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b944c989a7c120a87937e3067ed7510d";
logging-data="84925"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19lQs0+UWEvLSBqTMF9Vs7M"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:BboTNgHP6X+QIPSI1wcSC9q/0Yo=
In-Reply-To: <ur87th$1rr1$2@dont-email.me>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Thu, 22 Feb 2024 20:25 UTC

On 22.02.2024 20:39, Lawrence D'Oliveiro wrote:
> On Thu, 22 Feb 2024 11:09:50 +0100, David Brown wrote:
>
>> And while degrees were created by people, rather than something
>> fundamental in the mathematics, the number of divisions was picked
>> carefully for particular properties (lots of divisors).
>
> I know base-360 is supposed to have come from the Babylonians. But
> consider: you get exactly the same range of exact divisors (2, 3, 5, and
> powers and products thereof) with base-30.

Not the range of the unique divisors alone might be relevant but also
the number of duplicate divisors. As integer 30 is not dividable by 4
(which is a very common partition!), for example, but 360 is...

$ factor 360 30
360: 2 2 2 3 3 5 => 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ...
30: 2 3 5 => 2, 3, 5, 6, 10, 15

Mind that David wrote about "particular properties (lots of divisors)";
and 4 is (while not a prime) yet a [in practice very common] divisor.

Janis

Re: Radians Or Degrees?

<ur8chu$2vbd$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35112&group=comp.lang.c#35112

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: Radians Or Degrees?
Date: Thu, 22 Feb 2024 20:58:38 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <ur8chu$2vbd$1@dont-email.me>
References: <ur5trn$3d64t$1@dont-email.me>
<pan$d0f42$eeb000fb$9b95dafc$a5a80129@invalid.invalid>
<ur76he$3qbhl$2@dont-email.me> <ur87th$1rr1$2@dont-email.me>
<ur8ajp$2itt$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 22 Feb 2024 20:58:38 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0628152959bd9fc4f57a17e17cabba1f";
logging-data="97645"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FInthwnj8S19I7zPwltjU"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:WAoSiwee0ngLOt3WBjld8JhZ+lk=
 by: Lawrence D'Oliv - Thu, 22 Feb 2024 20:58 UTC

On Thu, 22 Feb 2024 21:25:28 +0100, Janis Papanagnou wrote:

> Not the range of the unique divisors alone might be relevant but also
> the number of duplicate divisors. As integer 30 is not dividable by 4
> (which is a very common partition!), for example, but 360 is...

Doesn’t matter, because a fraction with a divisor that is any power of 2
is exactly representable in base-30.

Re: Radians Or Degrees?

<ur8ctk$2vbd$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35113&group=comp.lang.c#35113

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: Radians Or Degrees?
Date: Thu, 22 Feb 2024 21:04:52 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <ur8ctk$2vbd$2@dont-email.me>
References: <ur5trn$3d64t$1@dont-email.me> <ur5v05$3ccut$1@dont-email.me>
<20240222015920.00000260@yahoo.com> <ur69j9$3ftgj$3@dont-email.me>
<ur86eg$1aip$1@dont-email.me> <ur88e4$1rr1$5@dont-email.me>
<ur8a2p$2446$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 22 Feb 2024 21:04:52 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0628152959bd9fc4f57a17e17cabba1f";
logging-data="97645"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+K9DQh5kx20nHfbi5B4yAP"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:jQYRTiB72r9F738OL9KCMmDSGbQ=
 by: Lawrence D'Oliv - Thu, 22 Feb 2024 21:04 UTC

On Thu, 22 Feb 2024 20:16:25 -0000 (UTC), Steven G. Kargl wrote:

> Apparently, you missed the part about argument reduction. For sinpi(x),
> it is fairly easy to reduce x = n + r with n an integer and r in [0,1).
> For the extended interval, x in [0,2^23], there are roughly 2^23 values
> with r = 0.5; and thus, sinpi(x) = 1 exactly. There are no such values
> for sin(x), and argument reduction for sin(x) is much more involved.

You are working with approximations anyway. That those approximations
happen to exactly equal some random value seems irrelevant.

> As to real-world use, how about any physical phenomena where one is
> interest in resonance frequencies of the system. For a simple example
> see https://www.feynmanlectures.caltech.edu/I_49.html where one might
> write f(x) = sin(kx) = sin(pi * (2*x/L)) with L a length of say a
> clamped string.

I don’t see a formula anything like that anywhere on that page. On the
other hand, I see lots of use of “ω” symbols, representing frequencies in
radians per second.

> There are also uses with computing other functions, e.g., the true gamma
> function via the Euler reflection formula.
>
> gamma(x) * gamma(1 - x) = pi / sin(pi * x) = pi / sinpi(x)

π radians = half a circle. Are there any other examples of the usefulness
of half-circles as an angle unit? As opposed to the dozens or hundreds of
examples of the usefulness of radians as an angle unit?

Re: Radians Or Degrees?

<87jzmwb301.fsf@bsb.me.uk>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35114&group=comp.lang.c#35114

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.usenet@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: Radians Or Degrees?
Date: Thu, 22 Feb 2024 21:30:54 +0000
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <87jzmwb301.fsf@bsb.me.uk>
References: <ur5trn$3d64t$1@dont-email.me> <ur605r$3fe50$1@i2pn2.org>
<ur69i3$3ftgj$2@dont-email.me> <87plwobmjm.fsf@bsb.me.uk>
<ur7p3f$3ues9$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="622cd877baa6337b8bb2a001e9f575d2";
logging-data="108947"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RQoaVZlC2Knmj333z+uZxqLD2w1D4bzc="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:KqsacftR0aCpqMlzfvFK2ThE5EU=
sha1:vHVk3Fp1090z/Zqr86Q06FAIhGs=
X-BSB-Auth: 1.cc8c70edc7cdc3c1a748.20240222213054GMT.87jzmwb301.fsf@bsb.me.uk
 by: Ben Bacarisse - Thu, 22 Feb 2024 21:30 UTC

David Brown <david.brown@hesbynett.no> writes:

> On 22/02/2024 15:28, Ben Bacarisse wrote:
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>
>>> On Thu, 22 Feb 2024 00:15:47 +0100, fir wrote:
>>>
>>>> if someone knows the reason why "6.28" radians are expected to better
>>>> than "1.0" 'circkles' in both mathemathics and assembly tell me - as i
>>>> dont know the reason
>>>
>>> It’s because trig calculations are most naturally done in radians. E.g.
>>> the approximation
>>>
>>> sin x ≅ tan x ≅ x as x → 0
>>>
>>> works only if x is in radians.
>> No, that applies to lots of angle measures.
>
> The Taylor expansion of sin x near 0 is x + O(x³), as is that of tan x. So
> for any angle measure with a scale factor k (such as k = π/180 for
> degrees), the Taylor expansions for sin(kx) and tan(kx) are both k.x +
> O(x³).

Er, ok...

> Thus as x tends to 0, sin(kx) / tan(kx) tends to 1, but sin(kx)/x tends to
> k. It only tends to 1 if k is 1, i.e., we are working in radians.

.... or you could work from the fact that sin'(kx) = k cos(kx).

> I don't think that this (that sin(x)/x tends to 1 as x tends to 0) is a
> particularly good justification for using radians, however - the calculus
> argument is much better IMHO.

I think it's a very similar argument, but you hid it from yourself with
Taylor series.

--
Ben.

Re: Radians Or Degrees?

<20240222233838.0000572f@yahoo.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35115&group=comp.lang.c#35115

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: already5chosen@yahoo.com (Michael S)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Thu, 22 Feb 2024 23:39:12 +0200
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <20240222233838.0000572f@yahoo.com>
References: <ur5trn$3d64t$1@dont-email.me>
<ur5v05$3ccut$1@dont-email.me>
<20240222015920.00000260@yahoo.com>
<ur69j9$3ftgj$3@dont-email.me>
<ur86eg$1aip$1@dont-email.me>
<ur88e4$1rr1$5@dont-email.me>
<ur8a2p$2446$1@dont-email.me>
<ur8ctk$2vbd$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: dont-email.me; posting-host="559df66cb8659c1930c85fc4e7abe7f7";
logging-data="109139"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18qCjeKBEBlvK0RKIoedpPTA63e8OS/aMo="
Cancel-Lock: sha1:QcGtaQTq7c8il7h9JmMT9iq4VlA=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
 by: Michael S - Thu, 22 Feb 2024 21:39 UTC

On Thu, 22 Feb 2024 21:04:52 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:

> On Thu, 22 Feb 2024 20:16:25 -0000 (UTC), Steven G. Kargl wrote:
>
> > Apparently, you missed the part about argument reduction. For
> > sinpi(x), it is fairly easy to reduce x = n + r with n an integer
> > and r in [0,1). For the extended interval, x in [0,2^23], there are
> > roughly 2^23 values with r = 0.5; and thus, sinpi(x) = 1 exactly.
> > There are no such values for sin(x), and argument reduction for
> > sin(x) is much more involved.
>
> You are working with approximations anyway. That those approximations
> happen to exactly equal some random value seems irrelevant.
>
> > As to real-world use, how about any physical phenomena where one is
> > interest in resonance frequencies of the system. For a simple
> > example see https://www.feynmanlectures.caltech.edu/I_49.html where
> > one might write f(x) = sin(kx) = sin(pi * (2*x/L)) with L a length
> > of say a clamped string.
>
> I don’t see a formula anything like that anywhere on that page. On
> the other hand, I see lots of use of “ω” symbols, representing
> frequencies in radians per second.
>
> > There are also uses with computing other functions, e.g., the true
> > gamma function via the Euler reflection formula.
> >
> > gamma(x) * gamma(1 - x) = pi / sin(pi * x) = pi / sinpi(x)
>
> π radians = half a circle. Are there any other examples of the
> usefulness of half-circles as an angle unit? As opposed to the dozens
> or hundreds of examples of the usefulness of radians as an angle unit?

In digital signal processing circle-based units are pretty much always
more natural than radians.
For specific case of 1/2 circle, I can't see where it can be used
directly.
From algorithmic perspective, full circle looks like the most obvious
choice.
From [binary floating point] numerical properties perspective, 1/8th of
the circle (==pi/4 radians = 45 degrees) is probably the best option
for a library routine, because for sin() its derivative at 0 is closest
to 1 among all powers of two which means that loss of precision
near 0 is very similar for input and for output. But this advantage
does not sound like particularly big deal.

Re: Radians Or Degrees?

<ur8fds$3jjr$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35116&group=comp.lang.c#35116

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: Radians Or Degrees?
Date: Thu, 22 Feb 2024 21:47:40 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <ur8fds$3jjr$1@dont-email.me>
References: <ur5trn$3d64t$1@dont-email.me> <ur5v05$3ccut$1@dont-email.me>
<20240222015920.00000260@yahoo.com> <ur69j9$3ftgj$3@dont-email.me>
<ur86eg$1aip$1@dont-email.me> <ur88e4$1rr1$5@dont-email.me>
<ur8a2p$2446$1@dont-email.me> <ur8ctk$2vbd$2@dont-email.me>
<20240222233838.0000572f@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 22 Feb 2024 21:47:40 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0628152959bd9fc4f57a17e17cabba1f";
logging-data="118395"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/WFLo3TyNYC2G0Eob0FTQk"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:RvM+abP6BE18xKFLViYy18KrgH8=
 by: Lawrence D'Oliv - Thu, 22 Feb 2024 21:47 UTC

On Thu, 22 Feb 2024 23:39:12 +0200, Michael S wrote:

> In digital signal processing circle-based units are pretty much always
> more natural than radians.

You’ll notice that my scheme makes it easy to add support for any kind of
unit you want, just by defining the appropriate multiplier constant.
You’ll see I already included CIRCLE (somebody suggested the alternative
name TURN) in my examples.

Re: Radians Or Degrees?

<ur8gn0$3jkj$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35117&group=comp.lang.c#35117

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: sgk@REMOVEtroutmask.apl.washington.edu (Steven G. Kargl)
Newsgroups: comp.lang.c
Subject: Re: Radians Or Degrees?
Date: Thu, 22 Feb 2024 22:09:36 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <ur8gn0$3jkj$1@dont-email.me>
References: <ur5trn$3d64t$1@dont-email.me> <ur5v05$3ccut$1@dont-email.me>
<20240222015920.00000260@yahoo.com> <ur69j9$3ftgj$3@dont-email.me>
<ur86eg$1aip$1@dont-email.me> <ur88e4$1rr1$5@dont-email.me>
<ur8a2p$2446$1@dont-email.me> <ur8ctk$2vbd$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 22 Feb 2024 22:09:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="8979f066b84407740f1e160576e63f84";
logging-data="118419"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/xgnrRgkehAwFOHpNU6z4g"
User-Agent: Pan/0.145 (Duplicitous mercenary valetism; d7e168a
git.gnome.org/pan2)
Cancel-Lock: sha1:j1RuNahlyLXUV7bR3ZUMowfIWqA=
 by: Steven G. Kargl - Thu, 22 Feb 2024 22:09 UTC

On Thu, 22 Feb 2024 21:04:52 +0000, Lawrence D'Oliveiro wrote:

> On Thu, 22 Feb 2024 20:16:25 -0000 (UTC), Steven G. Kargl wrote:
>
>> Apparently, you missed the part about argument reduction. For sinpi(x),
>> it is fairly easy to reduce x = n + r with n an integer and r in [0,1).
>> For the extended interval, x in [0,2^23], there are roughly 2^23 values
>> with r = 0.5; and thus, sinpi(x) = 1 exactly. There are no such values
>> for sin(x), and argument reduction for sin(x) is much more involved.
>
> You are working with approximations anyway. That those approximations
> happen to exactly equal some random value seems irrelevant.
>

These aren't some random values for individuals dealing
with wave propagation and resonances phenomena. Here's
a better example for you, cospi(1234.5) = 0, exactly. The
two closest single precision floating numbers that bracket
this zero are
cos(0x1.e4c96ap+11) = 1.94140221e-03f
cos(0x1.e4c97ap+11) = -1.17215250e-05f

--
steve

Re: Radians Or Degrees?

<ur8htr$45cu$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35118&group=comp.lang.c#35118

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: Radians Or Degrees?
Date: Thu, 22 Feb 2024 22:30:19 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <ur8htr$45cu$1@dont-email.me>
References: <ur5trn$3d64t$1@dont-email.me> <ur5v05$3ccut$1@dont-email.me>
<20240222015920.00000260@yahoo.com> <ur69j9$3ftgj$3@dont-email.me>
<ur86eg$1aip$1@dont-email.me> <ur88e4$1rr1$5@dont-email.me>
<ur8a2p$2446$1@dont-email.me> <ur8ctk$2vbd$2@dont-email.me>
<ur8gn0$3jkj$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 22 Feb 2024 22:30:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0628152959bd9fc4f57a17e17cabba1f";
logging-data="136606"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/MwoYOHGpL8KZs7RapEzkw"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:sCOtAAdA71BwE+yCIlX5SNKn5Wc=
 by: Lawrence D'Oliv - Thu, 22 Feb 2024 22:30 UTC

On Thu, 22 Feb 2024 22:09:36 -0000 (UTC), Steven G. Kargl wrote:

> On Thu, 22 Feb 2024 21:04:52 +0000, Lawrence D'Oliveiro wrote:
>
>> You are working with approximations anyway. That those approximations
>> happen to exactly equal some random value seems irrelevant.
>>
> These aren't some random values for individuals dealing with wave
> propagation and resonances phenomena. Here's a better example for you,
> cospi(1234.5) = 0, exactly. The two closest single precision floating
> numbers that bracket this zero are cos(0x1.e4c96ap+11) =
> 1.94140221e-03f cos(0x1.e4c97ap+11) = -1.17215250e-05f

Is that in binary or decimal? Remember that IEEE754 has the option for
both.

Re: Radians Or Degrees?

<20240223005602.00006ff1@yahoo.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35119&group=comp.lang.c#35119

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: already5chosen@yahoo.com (Michael S)
Newsgroups: comp.lang.c
Subject: Re: Radians Or Degrees?
Date: Fri, 23 Feb 2024 00:56:02 +0200
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <20240223005602.00006ff1@yahoo.com>
References: <ur5trn$3d64t$1@dont-email.me>
<ur5v05$3ccut$1@dont-email.me>
<20240222015920.00000260@yahoo.com>
<ur69j9$3ftgj$3@dont-email.me>
<ur86eg$1aip$1@dont-email.me>
<ur88e4$1rr1$5@dont-email.me>
<ur8a2p$2446$1@dont-email.me>
<ur8ctk$2vbd$2@dont-email.me>
<ur8gn0$3jkj$1@dont-email.me>
<ur8htr$45cu$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="559df66cb8659c1930c85fc4e7abe7f7";
logging-data="131275"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19G1e1b9tuhGIXILY0p5NaHmlz9Pl0wtT0="
Cancel-Lock: sha1:wKghBxYaxRDvCJPygaJXVRwQkvQ=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
 by: Michael S - Thu, 22 Feb 2024 22:56 UTC

On Thu, 22 Feb 2024 22:30:19 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:

> On Thu, 22 Feb 2024 22:09:36 -0000 (UTC), Steven G. Kargl wrote:
>
> > On Thu, 22 Feb 2024 21:04:52 +0000, Lawrence D'Oliveiro wrote:
> >
> >> You are working with approximations anyway. That those
> >> approximations happen to exactly equal some random value seems
> >> irrelevant.
> > These aren't some random values for individuals dealing with wave
> > propagation and resonances phenomena. Here's a better example for
> > you, cospi(1234.5) = 0, exactly. The two closest single precision
> > floating numbers that bracket this zero are cos(0x1.e4c96ap+11) =
> > 1.94140221e-03f cos(0x1.e4c97ap+11) = -1.17215250e-05f
>
> Is that in binary or decimal? Remember that IEEE754 has the option
> for both.

IIRC, IEEE-754 has no option for *single precision* decimal FP.

Besides, I hope that you were trolling, you should know very well
that nobody uses DFP for science or engineering.

Re: Radians Or Degrees?

<3b2e86cdb0ee8785b4405ab10871c5ca@www.novabbs.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35120&group=comp.lang.c#35120

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup1)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Thu, 22 Feb 2024 22:57:20 +0000
Organization: Rocksolid Light
Message-ID: <3b2e86cdb0ee8785b4405ab10871c5ca@www.novabbs.org>
References: <ur5trn$3d64t$1@dont-email.me> <ur5v05$3ccut$1@dont-email.me> <20240222015920.00000260@yahoo.com> <ur69j9$3ftgj$3@dont-email.me> <ur86eg$1aip$1@dont-email.me> <ur88e4$1rr1$5@dont-email.me> <ur8a2p$2446$1@dont-email.me> <ur8ctk$2vbd$2@dont-email.me> <20240222233838.0000572f@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="3773592"; mail-complaints-to="usenet@i2pn2.org";
posting-account="PGd4t4cXnWwgUWG9VtTiCsm47oOWbHLcTr4rYoM0Edo";
User-Agent: Rocksolid Light
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Site: $2y$10$iD.5G9ucgGIA0d5l3UKjKedpF9gSs1EIblLOc34guc7Eqw8elRsDq
X-Rslight-Posting-User: ac58ceb75ea22753186dae54d967fed894c3dce8
 by: MitchAlsup1 - Thu, 22 Feb 2024 22:57 UTC

Michael S wrote:

> On Thu, 22 Feb 2024 21:04:52 -0000 (UTC)
> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:

>> On Thu, 22 Feb 2024 20:16:25 -0000 (UTC), Steven G. Kargl wrote:
>>
>> > Apparently, you missed the part about argument reduction. For
>> > sinpi(x), it is fairly easy to reduce x = n + r with n an integer
>> > and r in [0,1).

You are better off with r in [-½,+½]

>> For the extended interval, x in [0,2^23], there are
>> > roughly 2^23 values with r = 0.5; and thus, sinpi(x) = 1 exactly.
>> > There are no such values for sin(x), and argument reduction for
>> > sin(x) is much more involved.

I have a patent on doing argument reduction for sin(x) in 4 cycles...that
is as good as Payne-Haneok argument reduction over -infinity..+infinity
>>
>> You are working with approximations anyway. That those approximations
>> happen to exactly equal some random value seems irrelevant.
>>
>> > As to real-world use, how about any physical phenomena where one is
>> > interest in resonance frequencies of the system. For a simple
>> > example see https://www.feynmanlectures.caltech.edu/I_49.html where
>> > one might write f(x) = sin(kx) = sin(pi * (2*x/L)) with L a length
>> > of say a clamped string.
>>
>> I don’t see a formula anything like that anywhere on that page. On
>> the other hand, I see lots of use of “ω” symbols, representing
>> frequencies in radians per second.
>>
>> > There are also uses with computing other functions, e.g., the true
>> > gamma function via the Euler reflection formula.
>> >
>> > gamma(x) * gamma(1 - x) = pi / sin(pi * x) = pi / sinpi(x)

I would not have expected for the magnitude of gamma(x) * gamma(1 - x)
to be always greater than than pi....but there it is.

>>
>> π radians = half a circle. Are there any other examples of the
>> usefulness of half-circles as an angle unit? As opposed to the dozens
>> or hundreds of examples of the usefulness of radians as an angle unit?

> In digital signal processing circle-based units are pretty much always
> more natural than radians.
> For specific case of 1/2 circle, I can't see where it can be used
> directly.
> From algorithmic perspective, full circle looks like the most obvious
> choice.
> From [binary floating point] numerical properties perspective, 1/8th of
> the circle (==pi/4 radians = 45 degrees) is probably the best option
> for a library routine, because for sin() its derivative at 0 is closest
> to 1 among all powers of two which means that loss of precision
> near 0 is very similar for input and for output. But this advantage
> does not sound like particularly big deal.

I should remind that my patents include methods for calculating sin()
and cos() in 18 cycles, sinpi() and cospi() in 14 cycles while achieving
an accuracy n the 0.5002-bits of error. All of this is in HW, and all
carried out in precision wider than IEEE 754 with a bunch of HW tricks
not available to SW.

At this performance level, let the algorithms wanting pi based trigonometry
have it and those wanting unit based trigonometry have it too. Let program-
mers use what is easiest for them.

Re: Radians Or Degrees?

<ur8jri$4icu$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35121&group=comp.lang.c#35121

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: Radians Or Degrees?
Date: Thu, 22 Feb 2024 23:03:14 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 6
Message-ID: <ur8jri$4icu$1@dont-email.me>
References: <ur5trn$3d64t$1@dont-email.me> <ur5v05$3ccut$1@dont-email.me>
<20240222015920.00000260@yahoo.com> <ur69j9$3ftgj$3@dont-email.me>
<ur86eg$1aip$1@dont-email.me> <ur88e4$1rr1$5@dont-email.me>
<ur8a2p$2446$1@dont-email.me> <ur8ctk$2vbd$2@dont-email.me>
<ur8gn0$3jkj$1@dont-email.me> <ur8htr$45cu$1@dont-email.me>
<20240223005602.00006ff1@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 22 Feb 2024 23:03:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1c30df426ba638bd6ae2f81f1dfd3d68";
logging-data="149918"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/lg918io0iuotzE2chy6nR"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:fx4TKXGxBiMTqpzKrjFV/krZEOI=
 by: Lawrence D'Oliv - Thu, 22 Feb 2024 23:03 UTC

On Fri, 23 Feb 2024 00:56:02 +0200, Michael S wrote:

> Besides, I hope that you were trolling, you should know very well that
> nobody uses DFP for science or engineering.

You forget that the last “E” in “IEEE” stands for “engineering”.

Re: Radians Or Degrees?

<ur8nud$4n1r$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35122&group=comp.lang.c#35122

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: sgk@REMOVEtroutmask.apl.washington.edu (Steven G. Kargl)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Fri, 23 Feb 2024 00:13:02 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 74
Message-ID: <ur8nud$4n1r$1@dont-email.me>
References: <ur5trn$3d64t$1@dont-email.me> <ur5v05$3ccut$1@dont-email.me>
<20240222015920.00000260@yahoo.com> <ur69j9$3ftgj$3@dont-email.me>
<ur86eg$1aip$1@dont-email.me> <ur88e4$1rr1$5@dont-email.me>
<ur8a2p$2446$1@dont-email.me> <ur8ctk$2vbd$2@dont-email.me>
<20240222233838.0000572f@yahoo.com>
<3b2e86cdb0ee8785b4405ab10871c5ca@www.novabbs.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 23 Feb 2024 00:13:02 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="00c4cb51edd0196936b101fc78c8792d";
logging-data="154683"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/a1J3aOXJesmBB0WG1vgZp"
User-Agent: Pan/0.145 (Duplicitous mercenary valetism; d7e168a
git.gnome.org/pan2)
Cancel-Lock: sha1:1NLL4Pxx77gotU5+YOrRNrHs6Vs=
 by: Steven G. Kargl - Fri, 23 Feb 2024 00:13 UTC

On Thu, 22 Feb 2024 22:57:20 +0000, MitchAlsup1 wrote:

> Michael S wrote:
>
>> On Thu, 22 Feb 2024 21:04:52 -0000 (UTC)
>> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>
>>> On Thu, 22 Feb 2024 20:16:25 -0000 (UTC), Steven G. Kargl wrote:
>>>
>>> > Apparently, you missed the part about argument reduction. For
>>> > sinpi(x), it is fairly easy to reduce x = n + r with n an integer
>>> > and r in [0,1).
>
> You are better off with r in [-½,+½]

Partial implementation details for single precision C code (trying
to keep this on topic for c.l.c) are at
https://cgit.freebsd.org/src/tree/lib/msun/src/s_sinpif.c

One uses sinpi(-|x|) = -sinpi(|x|), which natually gets one to
r = x - floor(x) in [0,1). One then uses kernels for sin() and
cos() to do the actual computation.

r in [0,0.25) is ksin(r).
r in [0.25,0.5) is kcos(0.5-r).
r in [0.5,0.75) is kcos(r - 0.5).
r in [0.75,1) is ksin(1 - r).

>>> For the extended interval, x in [0,2^23], there are
>>> > roughly 2^23 values with r = 0.5; and thus, sinpi(x) = 1 exactly.
>>> > There are no such values for sin(x), and argument reduction for
>>> > sin(x) is much more involved.
>
> I have a patent on doing argument reduction for sin(x) in 4 cycles...that
> is as good as Payne-Haneok argument reduction over -infinity..+infinity

By a strange coincidence, I have the Payn-Hanek paper on the
top of stack of papers on my desk. Still need to internalize
the details.

(much trimmed for brevity)

>> In digital signal processing circle-based units are pretty much always
>> more natural than radians.
>> For specific case of 1/2 circle, I can't see where it can be used
>> directly.
>> From algorithmic perspective, full circle looks like the most obvious
>> choice.
>> From [binary floating point] numerical properties perspective, 1/8th of
>> the circle (==pi/4 radians = 45 degrees) is probably the best option
>> for a library routine, because for sin() its derivative at 0 is closest
>> to 1 among all powers of two which means that loss of precision
>> near 0 is very similar for input and for output. But this advantage
>> does not sound like particularly big deal.
>
> I should remind that my patents include methods for calculating sin()
> and cos() in 18 cycles, sinpi() and cospi() in 14 cycles while achieving
> an accuracy n the 0.5002-bits of error. All of this is in HW, and all
> carried out in precision wider than IEEE 754 with a bunch of HW tricks
> not available to SW.
>
> At this performance level, let the algorithms wanting pi based trigonometry
> have it and those wanting unit based trigonometry have it too. Let program-
> mers use what is easiest for them.

Agreed a programmer should use what is required by the problem
that they are solving. I'll note that SW implementations have
their sets of tricks (e.g., use of double-double arithmetic to
achieve double precision).

--
steve

Re: Radians Or Degrees?

<ur8q2k$5nfr$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35123&group=comp.lang.c#35123

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Thu, 22 Feb 2024 16:49:25 -0800
Organization: A noiseless patient Spider
Lines: 82
Message-ID: <ur8q2k$5nfr$1@dont-email.me>
References: <ur5trn$3d64t$1@dont-email.me> <ur5v05$3ccut$1@dont-email.me>
<20240222015920.00000260@yahoo.com> <ur69j9$3ftgj$3@dont-email.me>
<ur86eg$1aip$1@dont-email.me> <ur88e4$1rr1$5@dont-email.me>
<ur8a2p$2446$1@dont-email.me> <ur8ctk$2vbd$2@dont-email.me>
<20240222233838.0000572f@yahoo.com>
<3b2e86cdb0ee8785b4405ab10871c5ca@www.novabbs.org>
<ur8nud$4n1r$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 23 Feb 2024 00:49:24 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="59f8a5d379a676625decc575bcbd250b";
logging-data="187899"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Vy9V8jqPWYI/r3Yl5+oJHFYwNpnvrWCM="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:3EJcNmhgdjJHPWAfM4Z2CX1gB1I=
Content-Language: en-US
In-Reply-To: <ur8nud$4n1r$1@dont-email.me>
 by: Chris M. Thomasson - Fri, 23 Feb 2024 00:49 UTC

On 2/22/2024 4:13 PM, Steven G. Kargl wrote:
> On Thu, 22 Feb 2024 22:57:20 +0000, MitchAlsup1 wrote:
>
>> Michael S wrote:
>>
>>> On Thu, 22 Feb 2024 21:04:52 -0000 (UTC)
>>> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>>
>>>> On Thu, 22 Feb 2024 20:16:25 -0000 (UTC), Steven G. Kargl wrote:
>>>>
>>>>> Apparently, you missed the part about argument reduction. For
>>>>> sinpi(x), it is fairly easy to reduce x = n + r with n an integer
>>>>> and r in [0,1).
>>
>> You are better off with r in [-½,+½]
>
> Partial implementation details for single precision C code (trying
> to keep this on topic for c.l.c) are at
> https://cgit.freebsd.org/src/tree/lib/msun/src/s_sinpif.c
>
> One uses sinpi(-|x|) = -sinpi(|x|), which natually gets one to
> r = x - floor(x) in [0,1). One then uses kernels for sin() and
> cos() to do the actual computation.
>
> r in [0,0.25) is ksin(r).
> r in [0.25,0.5) is kcos(0.5-r).
> r in [0.5,0.75) is kcos(r - 0.5).
> r in [0.75,1) is ksin(1 - r).
>
>>>> For the extended interval, x in [0,2^23], there are
>>>>> roughly 2^23 values with r = 0.5; and thus, sinpi(x) = 1 exactly.
>>>>> There are no such values for sin(x), and argument reduction for
>>>>> sin(x) is much more involved.
>>
>> I have a patent on doing argument reduction for sin(x) in 4 cycles...that
>> is as good as Payne-Haneok argument reduction over -infinity..+infinity
>
> By a strange coincidence, I have the Payn-Hanek paper on the
> top of stack of papers on my desk. Still need to internalize
> the details.
>
> (much trimmed for brevity)
>
>
>>> In digital signal processing circle-based units are pretty much always
>>> more natural than radians.
>>> For specific case of 1/2 circle, I can't see where it can be used
>>> directly.
>>> From algorithmic perspective, full circle looks like the most obvious
>>> choice.
>>> From [binary floating point] numerical properties perspective, 1/8th of
>>> the circle (==pi/4 radians = 45 degrees) is probably the best option
>>> for a library routine, because for sin() its derivative at 0 is closest
>>> to 1 among all powers of two which means that loss of precision
>>> near 0 is very similar for input and for output. But this advantage
>>> does not sound like particularly big deal.
>>
>> I should remind that my patents include methods for calculating sin()
>> and cos() in 18 cycles, sinpi() and cospi() in 14 cycles while achieving
>> an accuracy n the 0.5002-bits of error. All of this is in HW, and all
>> carried out in precision wider than IEEE 754 with a bunch of HW tricks
>> not available to SW.
>>
>> At this performance level, let the algorithms wanting pi based trigonometry
>> have it and those wanting unit based trigonometry have it too. Let program-
>> mers use what is easiest for them.
>
> Agreed a programmer should use what is required by the problem
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Indeed! :^)

> that they are solving. I'll note that SW implementations have
> their sets of tricks (e.g., use of double-double arithmetic to
> achieve double precision).
>

Use some form of arbitrary precision if you want to get to:

A 10^4141 zoom mset zoom!? It must took many hours to render... ;^)

https://youtu.be/Xjy_HSUujaw

Re: Radians Or Degrees?

<ur8qlp$5nfr$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35124&group=comp.lang.c#35124

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Thu, 22 Feb 2024 16:59:37 -0800
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <ur8qlp$5nfr$2@dont-email.me>
References: <ur5trn$3d64t$1@dont-email.me> <ur5v05$3ccut$1@dont-email.me>
<20240222015920.00000260@yahoo.com> <ur69j9$3ftgj$3@dont-email.me>
<ur86eg$1aip$1@dont-email.me> <ur88e4$1rr1$5@dont-email.me>
<ur8a2p$2446$1@dont-email.me> <ur8ctk$2vbd$2@dont-email.me>
<20240222233838.0000572f@yahoo.com>
<3b2e86cdb0ee8785b4405ab10871c5ca@www.novabbs.org>
<ur8nud$4n1r$1@dont-email.me> <ur8q2k$5nfr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 23 Feb 2024 00:59:37 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="59f8a5d379a676625decc575bcbd250b";
logging-data="187899"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/V6BKpgRjTHlMAkCGRHrvTQbE9eFcfg0w="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:3HkxsSGldC1RsO2gsgMPuZNRGfY=
Content-Language: en-US
In-Reply-To: <ur8q2k$5nfr$1@dont-email.me>
 by: Chris M. Thomasson - Fri, 23 Feb 2024 00:59 UTC

On 2/22/2024 4:49 PM, Chris M. Thomasson wrote:
[...]> Use some form of arbitrary precision if you want to get to:
>
> A 10^4141 zoom mset zoom!? It must took many hours to render... ;^)
>
> https://youtu.be/Xjy_HSUujaw

A 10^275 zoom:

https://youtu.be/0jGaio87u3A

Re: Radians Or Degrees?

<pan$8cca5$260d9c48$85b89c95$5f7324e0@invalid.invalid>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35125&group=comp.lang.c#35125

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!bluemanedhawk.eternal-september.org!.POSTED!not-for-mail
From: bluemanedhawk@invalid.invalid (Blue-Maned_Hawk)
Newsgroups: comp.lang.c
Subject: Re: Radians Or Degrees?
Date: Fri, 23 Feb 2024 02:15:22 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <pan$8cca5$260d9c48$85b89c95$5f7324e0@invalid.invalid>
References: <ur5trn$3d64t$1@dont-email.me>
<pan$d0f42$eeb000fb$9b95dafc$a5a80129@invalid.invalid>
<ur76he$3qbhl$2@dont-email.me>
<pan$5c05a$cb7911ea$a633ce06$f80aee8e@invalid.invalid>
<ur85o7$1aq8$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 23 Feb 2024 02:15:22 -0000 (UTC)
Injection-Info: bluemanedhawk.eternal-september.org; posting-host="ef94523ea24569311fff6355cce38ea7";
logging-data="217880"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19tyv0Rb3WXZ5n62TtemkZjVsCfC4AGFmU="
User-Agent: Pan/0.154 (Izium; 517acf4)
Cancel-Lock: sha1:VjqemdGGxd4QcLj1YTeiwPzaJmM=
X-Face: Llanfair­pwllgwyng
yll
­gogeryÂÃ
? ?­chwyrnÂÂÂÂÂÂ
­drobwll­llanÃ
‚Ã
ƒƒƒ‚­tysilioÂÂÂÃ
‚­gogo­goch
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACh0lEQVRYw71Z21bD
MAzzevbfkr4cHjrSXJyL044+MDa6WLEl2SkvkrZ1AbAvXO+bUGSCPYnsuIVGMpm
ZLnjX718GhAKNsp8lON2F9VrhELwIgJlBepkZjA78rVK+FkmNhEJK76UsJlz8+E
rJsjrpYouhLo/SC6qPHgakFOR8wV9+8rCfO/I/oVnmUZUp42/LW2XkLj9TCFNM9
jp5g2EmHZgpYZjCOkYU7sXVogRylJqpdggoFLG1g09Flah/7kErCxzR9HgXPYsq
0glb9cxjIz2Vsk9AmAoCSxECpD713joMKjQqLAtmMqJmXjdVvlMnMQCVITotJd1
z+fh1f1NNo+vuc1KnhWUmY7t03vydTud9BbXCtN3L2PL3bK7JCNG0GHzuZxafyB
fxevCxpm1vrwZltqw6SILCcdoCE6PGQC8wZWDA9Or7Qp5s3lAZezys0nDazs9S9
R0TjwEiksRxLkNPC1NMMWPs1bj0Ei0Yuo+JVtFLuzP1NRJ16qXWN8DhhtmS4PDg
O6mqRxs4bEJrYt087mSIow/1VzW2oFlMQuiuIy/KsUagvhdw6hSjJGlIavbLF8x
j3X47bccLcUSi0dkWh1nUZNhANT1tHKUXrNxNLbd9KPb9wDDVrKwmPQMOPQ1oy6
k5I1DwzDeRJd3jVIhDAUxq3ngzJG4CCkNXZxZVMcjefoK2J0gUY2S3rxz/RuTFx
2zHd9U+obimJXMG4edsk/2j5pTU5G1MmzbRLxkfq5EiT1GGsidvMGzi+1goGb2l
GCrN+nGnV8xj3q3JLRDVPL96vUc7Z4aJ3TN1mVqWAMJMfG+Jxh6TQqP+92iZkCU
xtglds1AB6r0aiSHKcnFck+p/c/0CbacFLQcajGcAAAAASUVORK5CYII=
 by: Blue-Maned_Hawk - Fri, 23 Feb 2024 02:15 UTC

David Brown wrote:

> On 22/02/2024 16:29, Blue-Maned_Hawk wrote:
>> David Brown wrote:
>>
>>> On 22/02/2024 09:27, Blue-Maned_Hawk wrote:
>>>>
>>>> Radians is the only angle unit which is not arbitrary.
>>>>
>>>>
>>>>
>>> No, it is not. "Turns" are also not arbitrary, and are also
>>> mathematically fundamental.
>>
>> That is a good point that i had not thought about. Thank you.
>>
>>> And while degrees were created by people, rather than something
>>> fundamental in the mathematics, the number of divisions was picked
>>> carefully for particular properties (lots of divisors). And since
>>> degrees are a well-established and commonly known angle unit, using
>>> them is not arbitrary. Even gradians were defined that way for good
>>> reasons.
>>> So these units are not arbitrary - even though they were defined by
>>> humans and not mathematics.
>>
>> I do not see how this is not still completely arbitrary.
>>
>>
> "Arbitrary" means that you picked something without any particular
> reason, and could just as well have picked something else. We use base
> ten - that is not arbitrary, it is based on the number of fingers we
> have. The Babylonians and Sumerians liked 5, 12 and 60 - also not
> arbitrary, but picked as numbers with a lot of convenient factors. The
> French revolutionists picked 400 for gradians, because 100 parts in a
> right angle fit well with their new metric system, which fit well with
> our standard number base. And one gradian of arc on a map corresponds
> almost exactly to 100 km in distance - also very intentional, and not
> arbitrary.
>
> From a purely mathematical viewpoint, these units are arbitrary - but
> from a human and historical viewpoint, they are not.

Then in that case, it sounds like they are either irrationally natural-
human-centric or irrationally steeped in tradition.

--
Blue-Maned_Hawk│shortens to
Hawk│/
blu.mɛin.dÊ°ak/
│he/him/his/himself/Mr.
blue-maned_hawk.srht.site
Tradition is the reason for doing something there's no longer any good
reason for doing.

Re: Radians Or Degrees?

<ur8vk0$6phl$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35126&group=comp.lang.c#35126

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: Radians Or Degrees?
Date: Fri, 23 Feb 2024 02:24:00 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <ur8vk0$6phl$1@dont-email.me>
References: <ur5trn$3d64t$1@dont-email.me>
<pan$d0f42$eeb000fb$9b95dafc$a5a80129@invalid.invalid>
<ur76he$3qbhl$2@dont-email.me>
<pan$5c05a$cb7911ea$a633ce06$f80aee8e@invalid.invalid>
<ur85o7$1aq8$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 23 Feb 2024 02:24:00 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1c30df426ba638bd6ae2f81f1dfd3d68";
logging-data="222773"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/30kPLU3s26HwZ7+041s/6"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:Vrl9rCtG8Gk9FI+GtYgZhn19SeI=
 by: Lawrence D'Oliv - Fri, 23 Feb 2024 02:24 UTC

On Thu, 22 Feb 2024 20:02:30 +0100, David Brown wrote:

> The French revolutionists picked 400 for gradians, because 100 parts in
> a right angle fit well with their new metric system, which fit well with
> our standard number base.

I wondered where they came from. But that reinforces my point, that
supporting even little-known units like these are very easy with my
scheme, requiring only the definition of a single conversion factor.

Re: Radians Or Degrees?

<936a852388e7e4414cb7e529da7095ea@www.novabbs.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35127&group=comp.lang.c#35127

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup1)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Fri, 23 Feb 2024 02:28:07 +0000
Organization: Rocksolid Light
Message-ID: <936a852388e7e4414cb7e529da7095ea@www.novabbs.org>
References: <ur5trn$3d64t$1@dont-email.me> <ur5v05$3ccut$1@dont-email.me> <20240222015920.00000260@yahoo.com> <ur69j9$3ftgj$3@dont-email.me> <ur86eg$1aip$1@dont-email.me> <ur88e4$1rr1$5@dont-email.me> <ur8a2p$2446$1@dont-email.me> <ur8ctk$2vbd$2@dont-email.me> <20240222233838.0000572f@yahoo.com> <3b2e86cdb0ee8785b4405ab10871c5ca@www.novabbs.org> <ur8nud$4n1r$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="3790182"; mail-complaints-to="usenet@i2pn2.org";
posting-account="PGd4t4cXnWwgUWG9VtTiCsm47oOWbHLcTr4rYoM0Edo";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$8Cm9lSVrzDDAczKkg1ao7OhHtjE2fHX9kp49QMFOYg8wf77CO2rx6
X-Rslight-Posting-User: ac58ceb75ea22753186dae54d967fed894c3dce8
X-Spam-Checker-Version: SpamAssassin 4.0.0
 by: MitchAlsup1 - Fri, 23 Feb 2024 02:28 UTC

Steven G. Kargl wrote:

> On Thu, 22 Feb 2024 22:57:20 +0000, MitchAlsup1 wrote:

>> Michael S wrote:
>>
>>> On Thu, 22 Feb 2024 21:04:52 -0000 (UTC)
>>> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>>
>>>> On Thu, 22 Feb 2024 20:16:25 -0000 (UTC), Steven G. Kargl wrote:
>>>>
>>>> > Apparently, you missed the part about argument reduction. For
>>>> > sinpi(x), it is fairly easy to reduce x = n + r with n an integer
>>>> > and r in [0,1).
>>
>> You are better off with r in [-½,+½]

> Partial implementation details for single precision C code (trying
> to keep this on topic for c.l.c) are at
> https://cgit.freebsd.org/src/tree/lib/msun/src/s_sinpif.c

> One uses sinpi(-|x|) = -sinpi(|x|), which natually gets one to
> r = x - floor(x) in [0,1). One then uses kernels for sin() and
> cos() to do the actual computation.

> r in [0,0.25) is ksin(r).
> r in [0.25,0.5) is kcos(0.5-r).
> r in [0.5,0.75) is kcos(r - 0.5).
> r in [0.75,1) is ksin(1 - r).

By "better off" I mean you have ½-bit of greater reduced argument precision
when the reduced argument is centered on zero.

>>>> For the extended interval, x in [0,2^23], there are
>>>> > roughly 2^23 values with r = 0.5; and thus, sinpi(x) = 1 exactly.
>>>> > There are no such values for sin(x), and argument reduction for
>>>> > sin(x) is much more involved.
>>
>> I have a patent on doing argument reduction for sin(x) in 4 cycles...that
>> is as good as Payne-Haneok argument reduction over -infinity..+infinity

> By a strange coincidence, I have the Payn-Hanek paper on the
> top of stack of papers on my desk. Still need to internalize
> the details.

Here is the version found in the SUN transcendentals::

static void ReduceFull(double *xp, int *a, double x)
{ Double X = { x };
int ec = X.s.exponent - (1023+33);
int k = (ec + 26) * (607*4) >> 16;
int m = 27*k - ec;
int offset = m >> 3;
x *= 0x1p-400;
double xDekker = x * (0x1p27 + 1);
double x0 = xDekker - (xDekker - x);
double x1 = x - x0;
const double *p0 = &TwoOverPiWithOffset[offset][k]; // 180 DP FP numbers
const double fp0 = p0[0];
const double fp1 = p0[1];
const double fp2 = p0[2];
const double fp3 = p0[3];
const double f0 = x1 * fp0 + fp1 * x0;
double f = x1 * fp1 + fp2 * x0;
const double fi = f0 + f;
static const double IntegerBias = 0x1.8p52;
Double Fi = { fi + IntegerBias };
*a = Fi.s.significand2;
double fint = Fi.d - IntegerBias;
const double fp4 = p0[4];
const double fp5 = p0[5];
const double fp6 = p0[6];
f = f0 - fint + f;
f += x1 * fp2 + fp3 * x0;
f += x1 * fp3 + fp4 * x0;
f += x1 * fp4 + fp5 * x0;
f += x1 * fp5 + fp6 * x0;
*xp = f * 0x3.243F6A8885A3p-1;
}

Which I can do in 4 cycles in HW !! {{I happen to have this on hand to explain how
I can do this in HW in 4 cycles......}}

I should also note that the conversion of f back into *xp looses ¼-bit of precision.

> (much trimmed for brevity)

>>> In digital signal processing circle-based units are pretty much always
>>> more natural than radians.
>>> For specific case of 1/2 circle, I can't see where it can be used
>>> directly.
>>> From algorithmic perspective, full circle looks like the most obvious
>>> choice.
>>> From [binary floating point] numerical properties perspective, 1/8th of
>>> the circle (==pi/4 radians = 45 degrees) is probably the best option
>>> for a library routine, because for sin() its derivative at 0 is closest
>>> to 1 among all powers of two which means that loss of precision
>>> near 0 is very similar for input and for output. But this advantage
>>> does not sound like particularly big deal.
>>
>> I should remind that my patents include methods for calculating sin()
>> and cos() in 18 cycles, sinpi() and cospi() in 14 cycles while achieving
>> an accuracy n the 0.5002-bits of error. All of this is in HW, and all
>> carried out in precision wider than IEEE 754 with a bunch of HW tricks
>> not available to SW.
>>
>> At this performance level, let the algorithms wanting pi based trigonometry
>> have it and those wanting unit based trigonometry have it too. Let program-
>> mers use what is easiest for them.

> Agreed a programmer should use what is required by the problem
> that they are solving. I'll note that SW implementations have
> their sets of tricks (e.g., use of double-double arithmetic to
> achieve double precision).

To get near IEEE desired precision, one HAS TO use more than 754 precision.

Re: Radians Or Degrees?

<a2a5c98883cafb6ab19668403b2dfb15@www.novabbs.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35128&group=comp.lang.c#35128

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup1)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Fri, 23 Feb 2024 02:42:23 +0000
Organization: Rocksolid Light
Message-ID: <a2a5c98883cafb6ab19668403b2dfb15@www.novabbs.org>
References: <ur5trn$3d64t$1@dont-email.me> <ur5v05$3ccut$1@dont-email.me> <20240222015920.00000260@yahoo.com> <ur69j9$3ftgj$3@dont-email.me> <ur86eg$1aip$1@dont-email.me> <ur88e4$1rr1$5@dont-email.me> <ur8a2p$2446$1@dont-email.me> <ur8ctk$2vbd$2@dont-email.me> <20240222233838.0000572f@yahoo.com> <3b2e86cdb0ee8785b4405ab10871c5ca@www.novabbs.org> <ur8nud$4n1r$1@dont-email.me> <ur8q2k$5nfr$1@dont-email.me> <ur8qlp$5nfr$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="3791231"; mail-complaints-to="usenet@i2pn2.org";
posting-account="PGd4t4cXnWwgUWG9VtTiCsm47oOWbHLcTr4rYoM0Edo";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$bwNQs.w60ObgkWOAz7Osp.a3j33oH36IXbguzsswpOfKWoUBTmE/a
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Posting-User: ac58ceb75ea22753186dae54d967fed894c3dce8
 by: MitchAlsup1 - Fri, 23 Feb 2024 02:42 UTC

Chris M. Thomasson wrote:

> On 2/22/2024 4:49 PM, Chris M. Thomasson wrote:
> [...]> Use some form of arbitrary precision if you want to get to:
>>
>> A 10^4141 zoom mset zoom!? It must took many hours to render... ;^)
>>
>> https://youtu.be/Xjy_HSUujaw

> A 10^275 zoom:

> https://youtu.be/0jGaio87u3A

Argument reduction zoom::

COS( 6381956970095103×2^797) = -4.68716592425462761112×10-19

You can argue all you want about whether this has any significance, but
it happens to be the value closest to that radian argument when performed
with infinite precision.

Re: Radians Or Degrees?

<ur9k0a$e8cn$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35129&group=comp.lang.c#35129

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Radians Or Degrees?
Date: Fri, 23 Feb 2024 09:11:53 +0100
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <ur9k0a$e8cn$1@dont-email.me>
References: <ur5trn$3d64t$1@dont-email.me> <ur605r$3fe50$1@i2pn2.org>
<ur69i3$3ftgj$2@dont-email.me> <87plwobmjm.fsf@bsb.me.uk>
<ur7p3f$3ues9$1@dont-email.me> <87jzmwb301.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 23 Feb 2024 08:11:54 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ac448fa51747d03c5665515ef71ac4aa";
logging-data="467351"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198n5aZbwQIvVm12dKkrk1hIDued6wJ37g="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:ZWKfaQ9Vumv7HBMU7xa0Z82TVLM=
Content-Language: en-GB
In-Reply-To: <87jzmwb301.fsf@bsb.me.uk>
 by: David Brown - Fri, 23 Feb 2024 08:11 UTC

On 22/02/2024 22:30, Ben Bacarisse wrote:
> David Brown <david.brown@hesbynett.no> writes:
>
>> On 22/02/2024 15:28, Ben Bacarisse wrote:
>>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>>
>>>> On Thu, 22 Feb 2024 00:15:47 +0100, fir wrote:
>>>>
>>>>> if someone knows the reason why "6.28" radians are expected to better
>>>>> than "1.0" 'circkles' in both mathemathics and assembly tell me - as i
>>>>> dont know the reason
>>>>
>>>> It’s because trig calculations are most naturally done in radians. E.g.
>>>> the approximation
>>>>
>>>> sin x ≅ tan x ≅ x as x → 0
>>>>
>>>> works only if x is in radians.
>>> No, that applies to lots of angle measures.
>>
>> The Taylor expansion of sin x near 0 is x + O(x³), as is that of tan x. So
>> for any angle measure with a scale factor k (such as k = π/180 for
>> degrees), the Taylor expansions for sin(kx) and tan(kx) are both k.x +
>> O(x³).
>
> Er, ok...
>
>> Thus as x tends to 0, sin(kx) / tan(kx) tends to 1, but sin(kx)/x tends to
>> k. It only tends to 1 if k is 1, i.e., we are working in radians.
>
> ... or you could work from the fact that sin'(kx) = k cos(kx).
>
>> I don't think that this (that sin(x)/x tends to 1 as x tends to 0) is a
>> particularly good justification for using radians, however - the calculus
>> argument is much better IMHO.
>
> I think it's a very similar argument, but you hid it from yourself with
> Taylor series.
>

There are many ways to see these things. Personally I think it's quite
clear and easy to understand that if you have a polynomial (finite or
infinite and converging), then its behaviour as you approach zero will
be that of the lowest order terms. But I really can't say what might be
the simplest viewpoint for others.

Re: Radians Or Degrees?

<ur9k95$e8cn$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35130&group=comp.lang.c#35130

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Radians Or Degrees?
Date: Fri, 23 Feb 2024 09:16:37 +0100
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <ur9k95$e8cn$2@dont-email.me>
References: <ur5trn$3d64t$1@dont-email.me>
<pan$d0f42$eeb000fb$9b95dafc$a5a80129@invalid.invalid>
<ur76he$3qbhl$2@dont-email.me>
<pan$5c05a$cb7911ea$a633ce06$f80aee8e@invalid.invalid>
<ur85o7$1aq8$1@dont-email.me> <ur8vk0$6phl$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 23 Feb 2024 08:16:38 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ac448fa51747d03c5665515ef71ac4aa";
logging-data="467351"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19+gb137tBfLJQnpaFit+7KIBpOwZH+mGg="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:ADMtw4esXCyHnJ4bx9EqfZVWo3w=
In-Reply-To: <ur8vk0$6phl$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Fri, 23 Feb 2024 08:16 UTC

On 23/02/2024 03:24, Lawrence D'Oliveiro wrote:
> On Thu, 22 Feb 2024 20:02:30 +0100, David Brown wrote:
>
>> The French revolutionists picked 400 for gradians, because 100 parts in
>> a right angle fit well with their new metric system, which fit well with
>> our standard number base.
>
> I wondered where they came from. But that reinforces my point, that
> supporting even little-known units like these are very easy with my
> scheme, requiring only the definition of a single conversion factor.

I agree with your approach - with the proviso that implementations that
are specialised for a particular angle measurement might be more
efficient, more accurate, or have greater range than simply scaling the
argument to radians and using radian-based trig functions. Numerical
floating point calculations on finite systems do not quite follow the
simple rules of real number mathematics, unfortunately.

But your approach (which is what most people use if they want trig in
degrees) gives a lot of flexibility for very little cost.

Re: Radians Or Degrees?

<ur9l8f$egmh$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35131&group=comp.lang.c#35131

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Radians Or Degrees?
Date: Fri, 23 Feb 2024 09:33:18 +0100
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <ur9l8f$egmh$1@dont-email.me>
References: <ur5trn$3d64t$1@dont-email.me>
<pan$d0f42$eeb000fb$9b95dafc$a5a80129@invalid.invalid>
<ur76he$3qbhl$2@dont-email.me> <ur87th$1rr1$2@dont-email.me>
<ur8ajp$2itt$1@dont-email.me> <ur8chu$2vbd$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 23 Feb 2024 08:33:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ac448fa51747d03c5665515ef71ac4aa";
logging-data="475857"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19/dl3Yl80vyFkn1oz795GBkKla7DTS6/g="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:Y0FTQLq8SnsRLMhfDasbQLJHj78=
In-Reply-To: <ur8chu$2vbd$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Fri, 23 Feb 2024 08:33 UTC

On 22/02/2024 21:58, Lawrence D'Oliveiro wrote:
> On Thu, 22 Feb 2024 21:25:28 +0100, Janis Papanagnou wrote:
>
>> Not the range of the unique divisors alone might be relevant but also
>> the number of duplicate divisors. As integer 30 is not dividable by 4
>> (which is a very common partition!), for example, but 360 is...
>
> Doesn’t matter, because a fraction with a divisor that is any power of 2
> is exactly representable in base-30.

That's true, but the Sumerians and Babylonians did not have decimal (or
rather trigesimal for base 30 - or sexagesimal for base 60) points. I
don't think they made much use of fractions at all, but moved on to
smaller units (dividing a degree into 60 minutes, and minutes into 60
seconds). That kept everything in integers.

It's not just the Babylonians that prefer integers - so does everyone
else. Would you rather that right-angled isosceles triangles had 45°
angles, or 3.75° angles?

Re: Radians Or Degrees?

<ur9qcv$fkhb$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35132&group=comp.lang.c#35132

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: terje.mathisen@tmsw.no (Terje Mathisen)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Fri, 23 Feb 2024 11:01:02 +0100
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <ur9qcv$fkhb$1@dont-email.me>
References: <ur5trn$3d64t$1@dont-email.me> <ur5v05$3ccut$1@dont-email.me>
<20240222015920.00000260@yahoo.com> <ur69j9$3ftgj$3@dont-email.me>
<ur86eg$1aip$1@dont-email.me> <ur88e4$1rr1$5@dont-email.me>
<ur8a2p$2446$1@dont-email.me> <ur8ctk$2vbd$2@dont-email.me>
<20240222233838.0000572f@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
Injection-Date: Fri, 23 Feb 2024 10:01:03 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e5ab5e3fbb22263c002fe3176ac61602";
logging-data="512555"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/BfZasFmRE4+xZeYmVwzm6ggJYucd/msCN5poEAxdEPQ=="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18.1
Cancel-Lock: sha1:N4Z4RJ+7D47AS3T5PnHriSWtljs=
In-Reply-To: <20240222233838.0000572f@yahoo.com>
 by: Terje Mathisen - Fri, 23 Feb 2024 10:01 UTC

Michael S wrote:
> On Thu, 22 Feb 2024 21:04:52 -0000 (UTC)
> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>>
>> π radians = half a circle. Are there any other examples of the
>> usefulness of half-circles as an angle unit? As opposed to the dozens
>> or hundreds of examples of the usefulness of radians as an angle unit?
>
> In digital signal processing circle-based units are pretty much always
> more natural than radians.
> For specific case of 1/2 circle, I can't see where it can be used
> directly.
> From algorithmic perspective, full circle looks like the most obvious
> choice.
> From [binary floating point] numerical properties perspective, 1/8th of
> the circle (==pi/4 radians = 45 degrees) is probably the best option
> for a library routine, because for sin() its derivative at 0 is closest
> to 1 among all powers of two which means that loss of precision
> near 0 is very similar for input and for output. But this advantage
> does not sound like particularly big deal.

ieee754 defines sinpi() and siblings, but imho it really doesn't matter
if you use circles, half-circles (i.e. sinpi) or some other binary
fraction of a circle: Argument reduction for huge inputs are just as
easy, you might just have to multiply by the corresponding power of two
(i.e. adjust the exponent) before extracting the fractional term.

For sinpi(x) I could do it like this:

if (abs(x) >= two_to_52nd_power) error("Zero significant bits.");
ix = int(x);
x_reduced = x - (double) (ix & ~1);
if (x_reduced < 0.0) x_reduced += 2.0;

but it is probably better to return a value in the [-1.0 .. 1.0> range?

Terje

--
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

Re: Radians Or Degrees?

<ur9qtp$fnm9$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35133&group=comp.lang.c#35133

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: terje.mathisen@tmsw.no (Terje Mathisen)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Fri, 23 Feb 2024 11:10:00 +0100
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <ur9qtp$fnm9$1@dont-email.me>
References: <ur5trn$3d64t$1@dont-email.me> <ur5v05$3ccut$1@dont-email.me>
<20240222015920.00000260@yahoo.com> <ur69j9$3ftgj$3@dont-email.me>
<ur86eg$1aip$1@dont-email.me> <ur88e4$1rr1$5@dont-email.me>
<ur8a2p$2446$1@dont-email.me> <ur8ctk$2vbd$2@dont-email.me>
<20240222233838.0000572f@yahoo.com>
<3b2e86cdb0ee8785b4405ab10871c5ca@www.novabbs.org>
<ur8nud$4n1r$1@dont-email.me>
<936a852388e7e4414cb7e529da7095ea@www.novabbs.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
Injection-Date: Fri, 23 Feb 2024 10:10:01 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e5ab5e3fbb22263c002fe3176ac61602";
logging-data="515785"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Pt3S9+XNEboQSZPztu0gg+P/pTThggyAA6oa+KpwNJg=="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18.1
Cancel-Lock: sha1:/UNnQN5UEOe7iORO0KqETDe57ck=
In-Reply-To: <936a852388e7e4414cb7e529da7095ea@www.novabbs.org>
 by: Terje Mathisen - Fri, 23 Feb 2024 10:10 UTC

MitchAlsup1 wrote:
> Steven G. Kargl wrote:
>> Agreed a programmer should use what is required by the problem
>> that they are solving.  I'll note that SW implementations have
>> their sets of tricks (e.g., use of double-double arithmetic to
>> achieve double precision).
>
> To get near IEEE desired precision, one HAS TO use more than 754 precision.

There are groups who have shown that exactly rounded trancendental
functions are in fact achievable with maybe 3X reduced performance.

There is a suggestion on the table to make that a (probably optional
imho) feature for an upcoming ieee754 revision.

Terje

--
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

Re: Radians Or Degrees?

<ura10f$h2pm$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35134&group=comp.lang.c#35134

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.c
Subject: Re: Radians Or Degrees?
Date: Fri, 23 Feb 2024 12:53:49 +0100
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <ura10f$h2pm$1@dont-email.me>
References: <ur5trn$3d64t$1@dont-email.me>
<pan$d0f42$eeb000fb$9b95dafc$a5a80129@invalid.invalid>
<ur76he$3qbhl$2@dont-email.me> <ur87th$1rr1$2@dont-email.me>
<ur8ajp$2itt$1@dont-email.me> <ur8chu$2vbd$1@dont-email.me>
<ur9l8f$egmh$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 23 Feb 2024 11:53:51 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5ee86eac2b9fb4293bbdaf07b1648050";
logging-data="559926"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19e4+KGaqRgLQBltssTbSCe"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:d2s8BXGdQTsDtC2jPVbZx5vYaU0=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <ur9l8f$egmh$1@dont-email.me>
 by: Janis Papanagnou - Fri, 23 Feb 2024 11:53 UTC

On 23.02.2024 09:33, David Brown wrote:
> On 22/02/2024 21:58, Lawrence D'Oliveiro wrote:
>> On Thu, 22 Feb 2024 21:25:28 +0100, Janis Papanagnou wrote:
>>
>>> Not the range of the unique divisors alone might be relevant but also
>>> the number of duplicate divisors. As integer 30 is not dividable by 4
>>> (which is a very common partition!), for example, but 360 is...
>>
>> Doesn’t matter, because a fraction with a divisor that is any power of 2
>> is exactly representable in base-30.

I don't understand what you mean by "exactly representable", where
the analogon of the numeric e.g. "7.5" is concerned. (I thought we
were talking about the origins, how the choice of 360 came about.)

>
> That's true, but the Sumerians and Babylonians did not have decimal (or
> rather trigesimal for base 30 - or sexagesimal for base 60) points. I
> don't think they made much use of fractions at all, but moved on to
> smaller units (dividing a degree into 60 minutes, and minutes into 60
> seconds). That kept everything in integers.
>
> It's not just the Babylonians that prefer integers - so does everyone
> else. Would you rather that right-angled isosceles triangles had 45°
> angles, or 3.75° angles?
>

The old Greeks certainly didn't have a concept of fractional numbers;
fractions appeared as geometrical partitions (cf. e.g. the problem
of angle trisections); they handled mathematical and physical problems
by geometry (and by integral counting for the more mundane things).

Janis

Re: Radians Or Degrees?

<20240223143250.000012a8@yahoo.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=35135&group=comp.lang.c#35135

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!i2pn.org!paganini.bofh.team!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: already5chosen@yahoo.com (Michael S)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Fri, 23 Feb 2024 14:32:50 +0200
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <20240223143250.000012a8@yahoo.com>
References: <ur5trn$3d64t$1@dont-email.me>
<ur5v05$3ccut$1@dont-email.me>
<20240222015920.00000260@yahoo.com>
<ur69j9$3ftgj$3@dont-email.me>
<ur86eg$1aip$1@dont-email.me>
<ur88e4$1rr1$5@dont-email.me>
<ur8a2p$2446$1@dont-email.me>
<ur8ctk$2vbd$2@dont-email.me>
<20240222233838.0000572f@yahoo.com>
<3b2e86cdb0ee8785b4405ab10871c5ca@www.novabbs.org>
<ur8nud$4n1r$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="c0ffea27d221585a3e71dd205716eca1";
logging-data="542944"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+PZjj1JeqJ5siBONN45CNDzUAEaotEAUw="
Cancel-Lock: sha1:KeCERsmfegVGJ4vPhedPxUlcOZw=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
 by: Michael S - Fri, 23 Feb 2024 12:32 UTC

On Fri, 23 Feb 2024 00:13:02 -0000 (UTC)
"Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> wrote:

> On Thu, 22 Feb 2024 22:57:20 +0000, MitchAlsup1 wrote:
>
> >
> > I have a patent on doing argument reduction for sin(x) in 4
> > cycles...that is as good as Payne-Haneok argument reduction over
> > -infinity..+infinity
>
> By a strange coincidence, I have the Payn-Hanek paper on the
> top of stack of papers on my desk. Still need to internalize
> the details.
>

Payne-Hanek is a right answer to a wrong question.
In science/engineering floating-point number x represents a range
[x-ULP:x+ULP] with hopefully much higher probability of being in range
[x-ULP/2:x+ULP/2]. However in this reduced range probability is flat,
an "exact" x is no worse and no better than any other point within this
range.
Which means that when we look for y=sin(x) then for
scientific/engineering purposes any answer in range*
[sin(x-ULP/2):sin(x+ULP/2)] is as "right" as any other answer. The
right answer to the question "What is a sin() of IEEE-754 binary64
number 1e17?" is "Anything in range [-1:1]". The wise and useful answer
to the same question is "You're holding it wrong".

* in paragraph Sin(x) designates result calculated with infinite
precision.


devel / comp.lang.c / Radians Or Degrees?

Pages:1234567
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor