• Radians Or Degrees?

    From Lawrence D'Oliveiro@21:1/5 to All on Wed Feb 21 22:35:35 2024
    What units should be used for angles in trig functions?

    Radians are the most natural unit for most trig calculations, and that’s
    what the library routines in C and many other languages use. However,
    degrees are a more natural unit for humans to input, and to get results
    in.

    Thus, other languages, but not (yet?) C, provide conversion functions. For example, Python has math.radians() for converting degrees to radians, and math.degrees() for going the other way. Java has something similar.

    But I think providing conversion functions is an unnecessarily clumsy way
    of doing it, because for every alternative angle unit, you need two
    functions.

    Better to provide just a single conversion factor. E.g.

    DEG = π / 180

    Now it is easy enough to input angles to a calculation in degrees, e.g.

    sin(45 * DEG)

    And getting outputs in degrees is equally easy, e.g.

    atan2(Y, X) / DEG

    Sometimes it is convenient to work in terms of whole circles (360°):

    CIRCLE = 2 * π

    Thus the examples become:

    sin(CIRCLE / 8)

    and

    atan2(Y, X) / CIRCLE

    Anybody remember “gradians”?

    GRAD = π / 200

    And of course, for completeness, we can have a factor for explicitly
    specifying that you are working radians:

    RAD = 1.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to Lawrence D'Oliveiro on Wed Feb 21 17:55:01 2024
    On 2/21/24 17:35, Lawrence D'Oliveiro wrote:
    What units should be used for angles in trig functions?

    The standard specifies that sin, cos, and tan() take arguments measured
    in radians. Degrees are mentioned only in the context of the complex
    versions of the trig functions, and only for the purpose of mentioning
    that they do NOT take arguments in degrees.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to James Kuyper on Thu Feb 22 01:59:20 2024
    On Wed, 21 Feb 2024 17:55:01 -0500
    James Kuyper <jameskuyper@alumni.caltech.edu> wrote:

    On 2/21/24 17:35, Lawrence D'Oliveiro wrote:
    What units should be used for angles in trig functions?

    The standard specifies that sin, cos, and tan() take arguments
    measured in radians. Degrees are mentioned only in the context of the
    complex versions of the trig functions, and only for the purpose of mentioning that they do NOT take arguments in degrees.


    The latest version of IEEE-754 Standard (or, may be, the one that is
    still in preparation? I don't remember), specifiies additional set of
    trig routines for which argument=1.0 corresponds to 180 degrees (pi
    Radians). The names are SinPi, CosPi etc...
    I find this choice somewhat less logical than 1.0 corresponding to 360
    degrees, but that's a matter of personal taste.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From fir@21:1/5 to Lawrence D'Oliveiro on Thu Feb 22 00:15:47 2024
    Lawrence D'Oliveiro wrote:
    What units should be used for angles in trig functions?

    Radians are the most natural unit for most trig calculations, and that’s what the library routines in C and many other languages use. However,
    degrees are a more natural unit for humans to input, and to get results
    in.

    Thus, other languages, but not (yet?) C, provide conversion functions. For example, Python has math.radians() for converting degrees to radians, and math.degrees() for going the other way. Java has something similar.

    But I think providing conversion functions is an unnecessarily clumsy way
    of doing it, because for every alternative angle unit, you need two functions.

    Better to provide just a single conversion factor. E.g.

    DEG = π / 180

    Now it is easy enough to input angles to a calculation in degrees, e.g.

    sin(45 * DEG)

    And getting outputs in degrees is equally easy, e.g.

    atan2(Y, X) / DEG

    Sometimes it is convenient to work in terms of whole circles (360°):

    CIRCLE = 2 * π

    Thus the examples become:

    sin(CIRCLE / 8)

    and

    atan2(Y, X) / CIRCLE

    Anybody remember “gradians”?

    GRAD = π / 200

    And of course, for completeness, we can have a factor for explicitly specifying that you are working radians:

    RAD = 1.0


    long time i think it should be measured in what you call here circle,
    it is rather in "1" not in "360" nor "2PI" ..in my coding hovevver i use degree360 = 2*PI/360.0

    this what you call circle imo wpuld be better and i doubt in a reason to
    use PI in mathematics yet defien it as 3.14 instead of 6.28 here if this
    value is really needed

    also on assembly level i would like if fsin arguments woyld be not on
    radians but in "1.0" floats

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Michael S on Thu Feb 22 01:55:54 2024
    On Thu, 22 Feb 2024 01:59:20 +0200, Michael S wrote:

    The latest version of IEEE-754 Standard (or, may be, the one that is
    still in preparation? I don't remember), specifiies additional set of
    trig routines for which argument=1.0 corresponds to 180 degrees (pi
    Radians). The names are SinPi, CosPi etc...
    I find this choice somewhat less logical than 1.0 corresponding to 360 degrees, but that's a matter of personal taste.

    Also quite unnecessary to invent a whole set of parallel functions just
    for a different angle unit.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to fir on Thu Feb 22 01:55:15 2024
    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. Also the Euler identity

    ix
    e = cos x + i sin x

    only holds if x is in radians. And so on and so on.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lawrence D'Oliveiro on Thu Feb 22 09:06:54 2024
    On 21/02/2024 23:35, Lawrence D'Oliveiro wrote:
    What units should be used for angles in trig functions?

    Radians are the most natural unit for most trig calculations, and that’s what the library routines in C and many other languages use. However,
    degrees are a more natural unit for humans to input, and to get results
    in.

    Thus, other languages, but not (yet?) C, provide conversion functions. For example, Python has math.radians() for converting degrees to radians, and math.degrees() for going the other way. Java has something similar.

    But I think providing conversion functions is an unnecessarily clumsy way
    of doing it, because for every alternative angle unit, you need two functions.

    Better to provide just a single conversion factor. E.g.

    DEG = π / 180

    Now it is easy enough to input angles to a calculation in degrees, e.g.

    sin(45 * DEG)

    And getting outputs in degrees is equally easy, e.g.

    atan2(Y, X) / DEG >
    Sometimes it is convenient to work in terms of whole circles (360°):

    CIRCLE = 2 * π

    Thus the examples become:

    sin(CIRCLE / 8)

    and

    atan2(Y, X) / CIRCLE

    Anybody remember “gradians”?

    GRAD = π / 200

    And of course, for completeness, we can have a factor for explicitly specifying that you are working radians:

    RAD = 1.0

    This all sounds reasonable to me. I would not bother with GRAD unless
    you are writing code for the French military - despite being common on calculators for a while, it's extremely rare to see it in use.

    If you want a third unit, I'd pick the "Furman", scale factor 2π / 2^16.
    It's the kind of thing you see in embedded systems where you want to
    do your trig with fixed point numbers, integers, table lookups, splines,
    etc., rather than floating point and slow, unnecessarily accurate
    library functions. But it's not so common to see the name, and the
    power of two is not always 16.

    Maybe just TURN = 2π would be more useful?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Blue-Maned_Hawk@21:1/5 to All on Thu Feb 22 08:27:33 2024
    Radians is the only angle unit which is not arbitrary.


    --
    Blue-Maned_Hawk│shortens to Hawk│/ blu.mɛin.dÊ°ak/ │he/him/his/himself/Mr. blue-maned_hawk.srht.site
    Skylights: Trepanning for houses

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lawrence D'Oliveiro on Thu Feb 22 09:32:37 2024
    On 22/02/2024 02:55, Lawrence D'Oliveiro wrote:
    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. Also the Euler identity

    ix
    e = cos x + i sin x

    only holds if x is in radians. And so on and so on.

    From a mathematical standpoint, clearly radians are a far more natural
    choice of unit than anything else for trig. But it is not as certain
    that they are a good choice for programming.

    For implementing "sin", you first have to reduce the value modulo 2π. I
    would have thought it would easier to do that if the units were turns,
    as the modulo reduction would then simply be taking the fractional part
    of the number. You may also want to reduce to a 0°-90°, or 0-π/2 range
    for the main calculation.

    If you are doing with main calculation by Taylor series, radians are the
    nicest units. But I believe it is more common to use Chebyshev
    polynomials, and for that there is no great advantage in radians. It's
    a very long time since I looked at Chebyshevs, but I think your most
    efficient method would be to map 0°-90° to the range -1 to 1 - i.e.,
    centred around 45°. This brings you to an ideal unit of an eighth of a
    turn.

    Turns divided by some power of two would also be ideal for faster but
    less accurate implementations, such as Cordic or tables with linear or
    cubic interpolation.

    From the user viewpoint, radians are a natural unit for a lot of
    applications - as are degrees. Turns, or turns divided by a power of
    two, are also very useful for many applications, but there is no
    consensus about what power of two to use.

    And the user viewpoint is the important one here - the value can be
    scaled before doing the calculations.

    So choice number one for programming languages should be radians, except perhaps for languages aimed at beginners or kids, where degrees might be
    more appropriate. And if you have a second set, degrees would be the
    choice, then followed by turns. (Half turns - SinPi and CosPi - seems
    odd to me.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Malcolm McLean on Thu Feb 22 11:04:20 2024
    On 22/02/2024 10:38, Malcolm McLean wrote:
    On 22/02/2024 08:32, David Brown wrote:

    For implementing "sin", you first have to reduce the value modulo 2π.

    For an efficient implentation yes. But applying the formula to values
    outside the range of 0 - 2PI also produces the correct result if you go
    on for long enough.


    Assuming that "the formula" you are referring to is one of the infinite polynomials for sin, then yes - I think anyone who knows about such
    maths will be aware of that. However, it is pretty much entirely
    irrelevant in the context of computing values for trig functions.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to All on Thu Feb 22 11:09:50 2024
    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.

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ben Bacarisse@21:1/5 to Lawrence D'Oliveiro on Thu Feb 22 14:28:45 2024
    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. Radians are the natural
    angle measure because we want sin' x = cos x and cos' x = -sin x. sin
    and cos are the unique solution to that pair of differential equations
    (with initial conditions sin 0 = 0 and cos 0 = 1).

    Also the Euler identity

    ix
    e = cos x + i sin x

    only holds if x is in radians. And so on and so on.

    Yes, and there's another nod to the calculus here because just as sin an
    cos are (with a minus sign) derivatives of each other, e^x is the
    derivative of itself.

    --
    Ben.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Ben Bacarisse on Thu Feb 22 16:26:39 2024
    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³).

    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.

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Blue-Maned_Hawk@21:1/5 to David Brown on Thu Feb 22 15:29:20 2024
    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.



    --
    Blue-Maned_Hawk│shortens to Hawk│/ blu.mɛin.dÊ°ak/ │he/him/his/himself/Mr. blue-maned_hawk.srht.site
    foldable (once)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Malcolm McLean on Thu Feb 22 16:49:47 2024
    On 2024-02-22, Malcolm McLean <malcolm.arthur.mclean@gmail.com> wrote:
    On 21/02/2024 22:35, Lawrence D'Oliveiro wrote:
    What units should be used for angles in trig functions?

    The derivative of the sine is the cosine and vice versa, but only if you measure in radians.

    Related to b^x being its own derivative w.r.t. x, only if b = e.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steven G. Kargl@21:1/5 to Lawrence D'Oliveiro on Thu Feb 22 19:14:24 2024
    On Thu, 22 Feb 2024 01:55:54 +0000, Lawrence D'Oliveiro wrote:

    On Thu, 22 Feb 2024 01:59:20 +0200, Michael S wrote:

    The latest version of IEEE-754 Standard (or, may be, the one that is
    still in preparation? I don't remember), specifiies additional set of
    trig routines for which argument=1.0 corresponds to 180 degrees (pi
    Radians). The names are SinPi, CosPi etc...
    I find this choice somewhat less logical than 1.0 corresponding to 360
    degrees, but that's a matter of personal taste.

    Also quite unnecessary to invent a whole set of parallel functions just
    for a different angle unit.

    It depends on your numerical requirements. For single precision,
    sinpi(1234.5) = 1 exactly. sin(3.1415926*1234.5) = sin(3878.2961) = 1
    with an error of ULP = 0.0015 and FE_INEXACT raised.

    If you're also trying to implement sinpi(x), sin(x), and sind(x)
    over some extended domain such as x in [0,2^23], then argument
    reduction for sinpi(x) and sind(x) are much easier than for
    sin(x), but still require attention to detail.

    --
    steve

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to All on Thu Feb 22 20:02:30 2024
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to David Brown on Thu Feb 22 19:44:25 2024
    On Thu, 22 Feb 2024 11:09:50 +0100, 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.

    In maths, there are things that are “simple” and “natural”, or not “arbitrary” or “fundamental”.

    For example, the formula for centripetal acceleration can be expressed (a
    = acceleration in ms¯², f = revolutions per second, r = radius in metres)
    as

    a = 4π²f²r

    But if you express the rotational frequency in radians per second

    ω = 2πf

    then the formula becomes significantly simpler:

    a = ω²r

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Steven G. Kargl on Thu Feb 22 19:48:20 2024
    On Thu, 22 Feb 2024 19:14:24 -0000 (UTC), Steven G. Kargl wrote:

    For single precision,
    sinpi(1234.5) = 1 exactly. sin(3.1415926*1234.5) = sin(3878.2961) = 1
    with an error of ULP = 0.0015 and FE_INEXACT raised.

    That seems like a pretty arbitrary example with no earthly real-world use.

    If you're also trying to implement sinpi(x), sin(x), and sind(x)
    over some extended domain such as x in [0,2^23], then argument reduction
    for sinpi(x) and sind(x) are much easier than for sin(x), but still
    require attention to detail.

    Doesn’t CORDIC take care of that?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to David Brown on Thu Feb 22 19:45:46 2024
    On Thu, 22 Feb 2024 16:26:39 +0100, David Brown wrote:

    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.

    These are just two among many examples of calculations being particularly simple(r) in radians.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to David Brown on Thu Feb 22 19:39:29 2024
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Lawrence D'Oliveiro on Thu Feb 22 21:25:28 2024
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steven G. Kargl@21:1/5 to Lawrence D'Oliveiro on Thu Feb 22 20:16:25 2024
    On Thu, 22 Feb 2024 19:48:20 +0000, Lawrence D'Oliveiro wrote:

    On Thu, 22 Feb 2024 19:14:24 -0000 (UTC), Steven G. Kargl wrote:

    For single precision,
    sinpi(1234.5) = 1 exactly. sin(3.1415926*1234.5) = sin(3878.2961) = 1
    with an error of ULP = 0.0015 and FE_INEXACT raised.

    That seems like a pretty arbitrary example with no earthly real-world use.

    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.

    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.

    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)

    If you're also trying to implement sinpi(x), sin(x), and sind(x)
    over some extended domain such as x in [0,2^23], then argument reduction
    for sinpi(x) and sind(x) are much easier than for sin(x), but still
    require attention to detail.

    Doesn’t CORDIC take care of that?

    What does google tell you?

    --
    steve

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Steven G. Kargl on Thu Feb 22 21:04:52 2024
    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Janis Papanagnou on Thu Feb 22 20:58:38 2024
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ben Bacarisse@21:1/5 to David Brown on Thu Feb 22 21:30:54 2024
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Michael S on Thu Feb 22 21:47:40 2024
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steven G. Kargl@21:1/5 to Lawrence D'Oliveiro on Thu Feb 22 22:09:36 2024
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Steven G. Kargl on Thu Feb 22 22:30:19 2024
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to Lawrence D'Oliveiro on Fri Feb 23 00:56:02 2024
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Michael S on Thu Feb 22 23:03:14 2024
    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”.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to David Brown on Fri Feb 23 02:24:00 2024
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Blue-Maned_Hawk@21:1/5 to David Brown on Fri Feb 23 02:15:22 2024
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Ben Bacarisse on Fri Feb 23 09:11:53 2024
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lawrence D'Oliveiro on Fri Feb 23 09:33:18 2024
    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lawrence D'Oliveiro on Fri Feb 23 09:16:37 2024
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to David Brown on Fri Feb 23 12:53:49 2024
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Harnden@21:1/5 to Ben Bacarisse on Fri Feb 23 13:57:42 2024
    On 22/02/2024 14: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. Radians are the natural
    angle measure because we want sin' x = cos x and cos' x = -sin x. sin
    and cos are the unique solution to that pair of differential equations
    (with initial conditions sin 0 = 0 and cos 0 = 1).

    Also the Euler identity

    ix
    e = cos x + i sin x

    only holds if x is in radians. And so on and so on.

    Yes, and there's another nod to the calculus here because just as sin an
    cos are (with a minus sign) derivatives of each other, e^x is the
    derivative of itself.


    And that has the dubious honour of being that last article to make it
    onto google-groups.

    Congratulations, I guess.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Harnden@21:1/5 to Chris M. Thomasson on Fri Feb 23 19:26:16 2024
    On 23/02/2024 19:15, Chris M. Thomasson wrote:
    On 2/23/2024 5:57 AM, Richard Harnden wrote:
    On 22/02/2024 14: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.  Radians are the natural
    angle measure because we want sin' x = cos x and cos' x = -sin x.  sin
    and cos are the unique solution to that pair of differential equations
    (with initial conditions sin 0 = 0 and cos 0 = 1).

    Also the Euler identity

          ix
         e   = cos x + i sin x

    only holds if x is in radians. And so on and so on.

    Yes, and there's another nod to the calculus here because just as sin an >>> cos are (with a minus sign) derivatives of each other, e^x is the
    derivative of itself.


    And that has the dubious honour of being that last article to make it
    onto google-groups.

    No shit? wow.

    For clc, I mean.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Janis Papanagnou on Fri Feb 23 20:23:34 2024
    On Fri, 23 Feb 2024 12:53:49 +0100, Janis Papanagnou 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.

    E.g. using “a” .. “t” to represent the digits with (decimal) values 10 ..
    29 in base-30:

    1 / 2 = 0.f
    1 / 2² = 0.7f
    1 / 2³ = 0.3mf
    1 / 3 = 0.a
    1 / 3² = 0.3a
    1 / 3³ = 0.13a
    1 / 5 = 0.6
    1 / 6 = 0.5

    All those fractions are exact.

    (And all worked out in my head, for better or for worse.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Chris M. Thomasson on Fri Feb 23 22:42:12 2024
    On Fri, 23 Feb 2024 12:28:40 -0800, Chris M. Thomasson wrote:

    So zooming in "deep" on say, something like my MultiJulia IFS work is
    going to require arbitrary precision trig...

    In which case, all these arguments from people saying that particular non- radian angle units are going to squeeze out just that little bit more in significant figures from IEEE754 single or double precision are really
    just irrelevant, aren’t they?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Steven G. Kargl on Fri Feb 23 22:39:57 2024
    On Fri, 23 Feb 2024 20:38:59 -0000 (UTC), Steven G. Kargl wrote:

    Note 2: subnormal values ...

    Why did they bring in the term “subnormal”, anyway? What was wrong with “denormalized”?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Lawrence D'Oliveiro on Fri Feb 23 23:30:41 2024
    On 2024-02-23, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Fri, 23 Feb 2024 20:38:59 -0000 (UTC), Steven G. Kargl wrote:

    Note 2: subnormal values ...

    Why did they bring in the term “subnormal”, anyway? What was wrong with “denormalized”?

    subnormals are subset of denormals. In IEEE 754, the only denormals
    are subnormals. This is because values that are outside of the subnormal
    range have the implicit 1 in the mantissa.

    Suppose you have a binary floating-point representation in which the 1
    in the mantissa must be explicit, e.g.

    101
    1.10100101 x 10

    Then you can have denormals regardless of the exponent value.

    E.g. the above normal number can also be expressed this way:

    110 <-- incremented
    0.110100101 x 10

    ^
    |
    mantissa shifted right, bringing in a zero on the left

    This denormal isn't subnormal, though; the subnormals are those
    denormals which have a magnitude smaller than the smallest normal
    magnitude. Those are the helpful/necessary ones which fill the gap
    between zero and the smallest normals.

    IEEE numbers don't have a zero on the left; the highest bit of the
    mantissa is not represented and is assumed to be 1. As a special hack,
    this implicit 1 assumption is lifted for the subnormals. This behavior
    is turned on when the exponent value is the smallest possible one.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ben Bacarisse@21:1/5 to Lawrence D'Oliveiro on Fri Feb 23 23:16:32 2024
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Fri, 23 Feb 2024 20:38:59 -0000 (UTC), Steven G. Kargl wrote:

    Note 2: subnormal values ...

    Why did they bring in the term “subnormal”, anyway? What was wrong with “denormalized”?

    Greater clarity maybe? After all, the two terms do mean different
    things. In IEEE FP only subnormals can exist, but it surely helps to be
    able to talk about the difference.

    --
    Ben.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Ben Bacarisse on Fri Feb 23 23:44:18 2024
    On Fri, 23 Feb 2024 23:16:32 +0000, Ben Bacarisse wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Fri, 23 Feb 2024 20:38:59 -0000 (UTC), Steven G. Kargl wrote:

    Note 2: subnormal values ...

    Why did they bring in the term “subnormal”, anyway? What was wrong with >> “denormalized”?

    Greater clarity maybe? After all, the two terms do mean different
    things. In IEEE FP only subnormals can exist, but it surely helps to be
    able to talk about the difference.

    I thought they were the same thing: extra numbers inserted in the gap
    between the normalized number closest to zero on each side, to allow for gradual underflow.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Ben Bacarisse on Sat Feb 24 01:19:30 2024
    On Sat, 24 Feb 2024 01:15:58 +0000, Ben Bacarisse wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    I thought they were the same thing: extra numbers inserted in the gap
    between the normalized number closest to zero on each side, to allow
    for gradual underflow.

    Those are subnormal. They are smaller (in magnitude) than the smallest normal. Denormals are simply representations with leading zeros. IEEE
    FP's implicit leading 1 means these (denormals that are not subnormal)
    can't exist in that representation.

    So in IEEE754, they are the same thing. Which is what I thought. So you
    don’t really need two terms for them. Particularly when one of them has certain undesirable ... connotations.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ben Bacarisse@21:1/5 to Lawrence D'Oliveiro on Sat Feb 24 01:27:28 2024
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Sat, 24 Feb 2024 01:15:58 +0000, Ben Bacarisse wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    I thought they were the same thing: extra numbers inserted in the gap
    between the normalized number closest to zero on each side, to allow
    for gradual underflow.

    Those are subnormal. They are smaller (in magnitude) than the smallest
    normal. Denormals are simply representations with leading zeros. IEEE
    FP's implicit leading 1 means these (denormals that are not subnormal)
    can't exist in that representation.

    So in IEEE754, they are the same thing.

    No. I am pretty sure you understand what's been said so you must be
    arguing for the sake of it.

    --
    Ben.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Ben Bacarisse on Sat Feb 24 01:42:34 2024
    On 2024-02-24, Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Sat, 24 Feb 2024 01:15:58 +0000, Ben Bacarisse wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    I thought they were the same thing: extra numbers inserted in the gap
    between the normalized number closest to zero on each side, to allow
    for gradual underflow.

    Those are subnormal. They are smaller (in magnitude) than the smallest
    normal. Denormals are simply representations with leading zeros. IEEE
    FP's implicit leading 1 means these (denormals that are not subnormal)
    can't exist in that representation.

    So in IEEE754, they are the same thing.

    No. I am pretty sure you understand what's been said so you must be
    arguing for the sake of it.

    I have only bicycles in my garage, so in my garage, "bicycles" and
    "vehicles" are the same thing, not just the same set.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ben Bacarisse@21:1/5 to Lawrence D'Oliveiro on Sat Feb 24 01:15:58 2024
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Fri, 23 Feb 2024 23:16:32 +0000, Ben Bacarisse wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Fri, 23 Feb 2024 20:38:59 -0000 (UTC), Steven G. Kargl wrote:

    Note 2: subnormal values ...

    Why did they bring in the term “subnormal”, anyway? What was wrong with >>> “denormalized”?

    Greater clarity maybe? After all, the two terms do mean different
    things. In IEEE FP only subnormals can exist, but it surely helps to be
    able to talk about the difference.

    I thought they were the same thing: extra numbers inserted in the gap
    between the normalized number closest to zero on each side, to allow for gradual underflow.

    Those are subnormal. They are smaller (in magnitude) than the smallest
    normal. Denormals are simply representations with leading zeros. IEEE
    FP's implicit leading 1 means these (denormals that are not subnormal)
    can't exist in that representation.

    --
    Ben.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Ben Bacarisse on Sat Feb 24 02:21:57 2024
    On Sat, 24 Feb 2024 01:27:28 +0000, Ben Bacarisse wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Sat, 24 Feb 2024 01:15:58 +0000, Ben Bacarisse wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    I thought they were the same thing: extra numbers inserted in the gap
    between the normalized number closest to zero on each side, to allow
    for gradual underflow.

    Those are subnormal. They are smaller (in magnitude) than the
    smallest normal. Denormals are simply representations with leading
    zeros. IEEE FP's implicit leading 1 means these (denormals that are
    not subnormal) can't exist in that representation.

    So in IEEE754, they are the same thing.

    No. I am pretty sure you understand what's been said so you must be
    arguing for the sake of it.

    So, give me an example, in IEEE754, of something that is one but not the
    other.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Ben Bacarisse on Fri Feb 23 18:49:17 2024
    Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Fri, 23 Feb 2024 23:16:32 +0000, Ben Bacarisse wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Fri, 23 Feb 2024 20:38:59 -0000 (UTC), Steven G. Kargl wrote:

    Note 2: subnormal values ...

    Why did they bring in the term "subnormal", anyway? What was wrong with >>>> "denormalized"?

    Greater clarity maybe? After all, the two terms do mean different
    things. In IEEE FP only subnormals can exist, but it surely helps to be >>> able to talk about the difference.

    I thought they were the same thing: extra numbers inserted in the gap
    between the normalized number closest to zero on each side, to allow for
    gradual underflow.

    Those are subnormal. They are smaller (in magnitude) than the smallest normal. Denormals are simply representations with leading zeros. IEEE
    FP's implicit leading 1 means these (denormals that are not subnormal)
    can't exist in that representation.

    There is some terminology confusion here. Depending on what
    source is consulted, the term "denormal" has different meanings.
    On Wikipedia, for example, "denormal numbers" redirects to
    "subnormal number". Apparently the IEEE floating point standard
    uses the term differently. Other sources are not consistent.

    Note that the ISO C standard uses and defines the terms "subnormal floating-point numbers" and "unnormalized floating-point numbers",
    as disjoint sets, distinct from normalized floating-point numbers
    (which the ISO C standard also defines). I expect it would help
    the conversation to use these three terms (normalized, subnormal,
    and unnormalized) and no others, since "denormal" or "denormalized"
    seems to mean different things depending on which source is used.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Steven G. Kargl on Sat Feb 24 03:07:26 2024
    On Sat, 24 Feb 2024 02:49:29 -0000 (UTC), Steven G. Kargl wrote:

    On Sat, 24 Feb 2024 02:21:57 +0000, Lawrence D'Oliveiro wrote:

    So, give me an example, in IEEE754, of something that is one but not
    the other.

    Well, that's a conundrum. One cannot give you an example as IEEE 754
    does not describe unnormal numbers.

    No, it’s not a conundrum. It’s just a confirmation of my point that, in IEEE754, you don’t need two words because there is only the single
    concept.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steven G. Kargl@21:1/5 to Lawrence D'Oliveiro on Sat Feb 24 02:49:29 2024
    On Sat, 24 Feb 2024 02:21:57 +0000, Lawrence D'Oliveiro wrote:

    On Sat, 24 Feb 2024 01:27:28 +0000, Ben Bacarisse wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Sat, 24 Feb 2024 01:15:58 +0000, Ben Bacarisse wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    I thought they were the same thing: extra numbers inserted in the
    gap between the normalized number closest to zero on each side, to
    allow for gradual underflow.

    Those are subnormal. They are smaller (in magnitude) than the
    smallest normal. Denormals are simply representations with leading
    zeros. IEEE FP's implicit leading 1 means these (denormals that are
    not subnormal) can't exist in that representation.

    So in IEEE754, they are the same thing.

    No. I am pretty sure you understand what's been said so you must be
    arguing for the sake of it.

    So, give me an example, in IEEE754, of something that is one but not the other.

    Well, that's a conundrum. One cannot give you an example as IEEE 754
    does not describe unnormal numbers.

    See https://en.wikipedia.org/wiki/Subnormal_number

    PS: Yes, I know that page does not tell you what unnormal means.

    --
    steve

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Lawrence D'Oliveiro on Sat Feb 24 03:12:33 2024
    On 2024-02-24, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Sat, 24 Feb 2024 02:49:29 -0000 (UTC), Steven G. Kargl wrote:

    On Sat, 24 Feb 2024 02:21:57 +0000, Lawrence D'Oliveiro wrote:

    So, give me an example, in IEEE754, of something that is one but not
    the other.

    Well, that's a conundrum. One cannot give you an example as IEEE 754
    does not describe unnormal numbers.

    No, it’s not a conundrum.

    Well, it's a subnundrum, which in your case is the same thing
    as a denundrum.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to Lawrence D'Oliveiro on Sat Feb 24 02:25:51 2024
    On 2/23/24 17:39, Lawrence D'Oliveiro wrote:
    On Fri, 23 Feb 2024 20:38:59 -0000 (UTC), Steven G. Kargl wrote:

    Note 2: subnormal values ...

    Why did they bring in the term “subnormal”, anyway? What was wrong with “denormalized”?

    The same thing that's wrong with calling a horse a quadruped. It's
    technically correct, but in a context where it could only be a horse,
    the term "quadruped" is unnecessarily vague. Denormal numbers that are
    not subnormal are called unnormal, and are part of IEEE Decimal Floating
    Point. Decimal floating point types have been an optional feature of C
    since 2020.
    The C standard never uses the term denormal, but it does use unnormal.
    The only thing it does with the term is define it, and allow for the
    presence of such numbers - but nothing that it says about normal or
    subnormal numbers (which is quite a lot) applies to unnormal numbers,
    and that is a deliberate feature of the standard.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to James Kuyper on Sat Feb 24 21:21:33 2024
    On Sat, 24 Feb 2024 02:25:51 -0500, James Kuyper wrote:

    Denormal numbers that are not subnormal are called unnormal, and are
    part of IEEE Decimal Floating Point.

    Interesting, because when I brought up decimal floats in this thread, I
    was accused, by Michael S <already5chosen@yahoo.com>, of “trolling”, on
    the grounds that “nobody uses DFP for science or engineering”.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to Lawrence D'Oliveiro on Sat Feb 24 17:32:47 2024
    On 2/24/24 16:21, Lawrence D'Oliveiro wrote:
    On Sat, 24 Feb 2024 02:25:51 -0500, James Kuyper wrote:

    Denormal numbers that are not subnormal are called unnormal, and are
    part of IEEE Decimal Floating Point.

    Interesting, because when I brought up decimal floats in this thread, I
    was accused, by Michael S <already5chosen@yahoo.com>, of “trolling”, on the grounds that “nobody uses DFP for science or engineering”.

    Yes, that makes sense. Precisely because DFP is not likely to be used
    for this kind of application, it's inappropriate to talk about denormal
    number, because outside of DFP, you're unlikely to run into any denormal numbers that aren't also subnormal.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to James Kuyper on Sat Feb 24 22:50:46 2024
    On Sat, 24 Feb 2024 17:32:47 -0500, James Kuyper wrote:

    Precisely because DFP is not likely to be used for this kind of
    application ...

    But remember why the IEEE decided to formulate a standard for numerics in
    the first place: it’s because your typical (non-computer) engineer is just
    as naïve about numerical techniques as anybody else. IEEE754 was designed
    to reduce many of the unpleasant surprises that bedevilled computer
    arithmetic back in the day (Prof William “Mr IEEE754” Kahan’s foreword to Apple’s Standard Numerics manual, from back in 1987, still makes
    entertaining reading today). But as you know, binary arithmetic still has
    its share of nonintuitive results. So it only seems logical to go to
    decimal arithmetic, as the next step.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Chris M. Thomasson on Sat Feb 24 22:52:17 2024
    On Sat, 24 Feb 2024 12:40:52 -0800, Chris M. Thomasson wrote:

    Think of what type of performance hit one can take if they use double precision on a GPU that supports it in shader programs...

    I don’t know; what kind of “performance hit” would it be?

    Is it time to consider single-precision floats as basically a “legacy” format, a holdover from the days when we couldn’t afford anything better?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ben Bacarisse@21:1/5 to Kaz Kylheku on Sun Feb 25 00:18:33 2024
    Kaz Kylheku <433-929-6894@kylheku.com> writes:

    On 2024-02-24, Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Sat, 24 Feb 2024 01:15:58 +0000, Ben Bacarisse wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    I thought they were the same thing: extra numbers inserted in the gap >>>>> between the normalized number closest to zero on each side, to allow >>>>> for gradual underflow.

    Those are subnormal. They are smaller (in magnitude) than the smallest >>>> normal. Denormals are simply representations with leading zeros. IEEE >>>> FP's implicit leading 1 means these (denormals that are not subnormal) >>>> can't exist in that representation.

    So in IEEE754, they are the same thing.

    No. I am pretty sure you understand what's been said so you must be
    arguing for the sake of it.

    I have only bicycles in my garage, so in my garage, "bicycles" and
    "vehicles" are the same thing, not just the same set.

    I'm not sure what your point is. LD'O wanted to know why "they" brought
    in the more specific term:

    "Why did they bring in the term “subnormal”, anyway? What was wrong
    with “denormalized”?"

    I just suggested they "they" might have chosen to use the more specific
    term "bicycles" for the vehicles in you garage because it's more
    precise. Are you disagreeing or using mockery to support that rather
    obvious idea?

    --
    Ben.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Chris M. Thomasson on Sun Feb 25 06:30:14 2024
    On Sat, 24 Feb 2024 19:26:53 -0800, Chris M. Thomasson wrote:

    think of the following interesting aspect:

    One of many. Have you read the paper “What Every Computer Scientist Should Know About Computer Arithmetic”? Among the examples, it looks at the well- known formula for the quadratic equation:

    -b ± sqrt(b² - 4ac)
    -------------------
    2a

    and considers cases where this will not work well, and where you should
    use the alternative form

    2c
    -------------------
    -b ± sqrt(b² - 4ac)

    instead. (Which has its own cases where it produces poor results, but
    luckily they don’t overlap those for the first form.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to Ben Bacarisse on Sun Feb 25 12:57:48 2024
    On Sun, 25 Feb 2024 00:18:33 +0000
    Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:

    Kaz Kylheku <433-929-6894@kylheku.com> writes:

    On 2024-02-24, Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Sat, 24 Feb 2024 01:15:58 +0000, Ben Bacarisse wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    I thought they were the same thing: extra numbers inserted in
    the gap between the normalized number closest to zero on each
    side, to allow for gradual underflow.

    Those are subnormal. They are smaller (in magnitude) than the
    smallest normal. Denormals are simply representations with
    leading zeros. IEEE FP's implicit leading 1 means these
    (denormals that are not subnormal) can't exist in that
    representation.

    So in IEEE754, they are the same thing.

    No. I am pretty sure you understand what's been said so you must
    be arguing for the sake of it.

    I have only bicycles in my garage, so in my garage, "bicycles" and "vehicles" are the same thing, not just the same set.

    I'm not sure what your point is. LD'O wanted to know why "they"
    brought in the more specific term:

    "Why did they bring in the term “subnormal”, anyway? What was wrong
    with “denormalized”?"

    I just suggested they "they" might have chosen to use the more
    specific term "bicycles" for the vehicles in you garage because it's
    more precise. Are you disagreeing or using mockery to support that
    rather obvious idea?


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Harnden@21:1/5 to Malcolm McLean on Sun Feb 25 13:08:53 2024
    On 25/02/2024 11:19, Malcolm McLean wrote:
    On 22/02/2024 19: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.

    A year has 365 days, and that influenced the idea that there should be
    360 degrees in a circle. But the Babylonians knew that it was 365 or
    close and not 360. So did they think that having 360 degrees was a fundamental, inherent, mathematical property of a circle, or did they not?

    I don't think that's true.

    It's 360 because it divides by {lots}, nothing to do with days in a year.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ben Bacarisse@21:1/5 to Lawrence D'Oliveiro on Sun Feb 25 22:29:41 2024
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Sun, 25 Feb 2024 13:08:53 +0000, Richard Harnden wrote:

    It's 360 because it divides by {lots}, nothing to do with days in a year.

    And you can get all those same divisors with 30.

    You are confusing unique prime factors with divisors. Well, that's what
    you appear to be doing but I suspect another motive altogether.

    --
    Ben.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From bart@21:1/5 to Lawrence D'Oliveiro on Sun Feb 25 23:09:10 2024
    On 25/02/2024 22:21, Lawrence D'Oliveiro wrote:
    On Sun, 25 Feb 2024 13:08:53 +0000, Richard Harnden wrote:

    It's 360 because it divides by {lots}, nothing to do with days in a year.

    And you can get all those same divisors with 30.

    You mean, by dividing a circle into 30 degrees instead of 360?

    30 can't be evenly divided by 4, 8, 9, 12, 18 or 20 for a start.

    The angles of a triangle would add up to 15 degrees; so a right-angled
    triangle would have angles of 7.5 and 3.75 degrees.

    A heading of 270 on a compass would be 22.5 degrees in your scheme, and
    the smallest change of heading, 1 degree, would be 12 degrees using the
    current system.

    Or maybe you mean something else entirely; using base-30 instead of
    base-10? Sure, that's going to be practical!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Richard Harnden on Sun Feb 25 22:21:44 2024
    On Sun, 25 Feb 2024 13:08:53 +0000, Richard Harnden wrote:

    It's 360 because it divides by {lots}, nothing to do with days in a year.

    And you can get all those same divisors with 30.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Ben Bacarisse on Mon Feb 26 21:29:25 2024
    On Sun, 25 Feb 2024 22:29:41 +0000, Ben Bacarisse wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Sun, 25 Feb 2024 13:08:53 +0000, Richard Harnden wrote:

    It's 360 because it divides by {lots}, nothing to do with days in a
    year.

    And you can get all those same divisors with 30.

    You are confusing unique prime factors with divisors.

    No, I’m not. Once you have one occurrence of a prime factor, you get the ability to exactly represent fractions involving all powers of that
    factor, and all products of that factor with other factors.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Keith Thompson on Mon Feb 26 21:32:01 2024
    On Sun, 25 Feb 2024 14:43:33 -0800, Keith Thompson wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Sun, 25 Feb 2024 13:08:53 +0000, Richard Harnden wrote:

    It's 360 because it divides by {lots}, nothing to do with days in a
    year.

    And you can get all those same divisors with 30.

    All except 4, 8, 9, 12, 18, 20, 24, 36, 40, 45, 60, 72, 90, 120, 180,
    and 360.

    All exactly representable in Base-30:

    1 / 4 => 0.7f
    1 / 8 => 0.3mf
    1 / 9 => 0.3a
    1 / 12 => 0.2f
    1 / 18 => 0.1k
    1 / 20 => 0.1f
    1 / 24 => 0.17f
    1 / 36 => 0.0p
    1 / 40 => 0.0mf
    1 / 45 => 0.0k
    1 / 60 => 0.0f
    1 / 72 => 0.0cf
    1 / 90 => 0.0a
    1 / 120 => 0.07f
    1 / 180 => 0.05
    1 / 360 => 0.02f

    No approximations, no recurring digits.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to bart on Mon Feb 26 21:32:41 2024
    On Sun, 25 Feb 2024 23:09:10 +0000, bart wrote:

    30 can't be evenly divided by 4, 8, 9, 12, 18 or 20 for a start.

    Those fractions can be exactly represented in base-30.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From bart@21:1/5 to Lawrence D'Oliveiro on Mon Feb 26 23:01:35 2024
    On 26/02/2024 21:32, Lawrence D'Oliveiro wrote:
    On Sun, 25 Feb 2024 23:09:10 +0000, bart wrote:

    30 can't be evenly divided by 4, 8, 9, 12, 18 or 20 for a start.

    Those fractions can be exactly represented in base-30.

    I've no idea how that would work, or how it would be anything other than
    100 times harder and more impractical than just using radians instead of degrees.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Keith Thompson on Mon Feb 26 23:15:31 2024
    On Mon, 26 Feb 2024 13:44:45 -0800, Keith Thompson wrote:

    It would have saved some time if you had said that in the first place,
    rather than claiming that "you can get all those same divisors with 30".

    Why, what else could you possibly have thought I meant? Dividing by things
    is precisely what fractions are all about.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Keith Thompson on Tue Feb 27 00:55:55 2024
    On Mon, 26 Feb 2024 16:02:17 -0800, Keith Thompson wrote:

    Since it wasn't an important or relevant point in the first place, I'm
    going to drop it, and I suggest you do the same.

    You seem to do that a lot.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to bart on Tue Feb 27 09:59:08 2024
    On 27/02/2024 00:01, bart wrote:
    On 26/02/2024 21:32, Lawrence D'Oliveiro wrote:
    On Sun, 25 Feb 2024 23:09:10 +0000, bart wrote:

    30 can't be evenly divided by 4, 8, 9, 12, 18 or 20 for a start.

    Those fractions can be exactly represented in base-30.

    I've no idea how that would work, or how it would be anything other than
    100 times harder and more impractical than just using radians instead of degrees.

    I know exactly how it would work, but you are absolutely correct that it
    would be harder and far less practical than using 360 degrees, and
    without the mathematical features of radians.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lawrence D'Oliveiro on Tue Feb 27 09:53:38 2024
    On 27/02/2024 00:15, Lawrence D'Oliveiro wrote:
    On Mon, 26 Feb 2024 13:44:45 -0800, Keith Thompson wrote:

    It would have saved some time if you had said that in the first place,
    rather than claiming that "you can get all those same divisors with 30".

    Why, what else could you possibly have thought I meant? Dividing by things
    is precisely what fractions are all about.

    I, for one, thought you were mistaken and confused. It seemed to be the
    more logical explanation (and less unkind than assuming you are trolling
    or intentionally trying to cause confusion), since everyone else was
    clearly talking about divisors as the term is used in mathematics. The "divisors" of an integer "N" are integers that divide wholly into N. 4
    is a divisor of 360, but it is not a divisor of 30. It is /that/ simple.

    No one is particularly interested in decimals here, much less interested
    in some kind of base 30 decimal (which is what you need to make your
    claims correct). And the context was historical - why the Babylonians
    and Sumerians had 360 degrees in a circle. They did not have radix
    points of any kind.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From bart@21:1/5 to Michael S on Sun Mar 17 10:59:46 2024
    On 17/03/2024 09:06, Michael S wrote:
    On Sat, 16 Mar 2024 16:19:11 -0700
    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

    As written, your example does not emphasize that the problem has
    nothing to do with implementation of sinX() library routine.
    It's best illustrated by followup conversation with bart, IMHO 100%
    O.T.


    Actually, the thread topic is the more basic one of whether angles to
    these functions should be specified as degrees or radians.

    In answer to that, I decided long ago (in my language designs) to keep
    them as radians, but allow degrees for constants if written in one of
    these styles like this:

    sin(30°) + cos(60 deg)

    Because, once they're inside a variable:

    sin(alpha) + cos(beta)

    then the unit used is irrelevant.

    As for the value returned from sin() etc, I haven't worried about that
    since last century.

    Except briefly more recently when I had an arbitrary precision floating
    point library and considered whether to add such functions, but
    concluded I didn't have the right skills, experience (of using
    ultra-high precision trig functions) or motivation.

    The first problem was: exactly how accurately should it be generated.
    With ieee754 it's easy, you only have 53 binary digits to fill.

    In my (decimal) library, the default precision for a calculation like
    1.0/3.0 is typically set up to 500 decimal digits, or about 1600 bits, otherwise it will keep going forever (the theoretical limit is 19
    billion decimal digits, or 64 billion bits).

    The second problem was, how do you even calculate sin(x) so that it
    converges to that accuracy within a reasonable amount of time? The
    Taylor series that I used to use wouldn't cut it.

    (Dealing with inputs that are extreme multiples of +/- 2pi radians would
    be an additional difficulty.)

    I decided not to bother with transcendental functions.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to bart on Sun Mar 17 14:15:27 2024
    On Sun, 17 Mar 2024 10:59:46 +0000
    bart <bc@freeuk.com> wrote:

    On 17/03/2024 09:06, Michael S wrote:
    On Sat, 16 Mar 2024 16:19:11 -0700
    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

    As written, your example does not emphasize that the problem has
    nothing to do with implementation of sinX() library routine.
    It's best illustrated by followup conversation with bart, IMHO 100%
    O.T.


    Actually, the thread topic is the more basic one of whether angles to
    these functions should be specified as degrees or radians.


    Degrees can be seen as a form of turn==circle-based units, but for most purposes except interaction with user they are not quite as convenient
    as plain turns or than turns multiplied by some negative power of two.

    In answer to that, I decided long ago (in my language designs) to
    keep them as radians, but allow degrees for constants if written in
    one of these styles like this:

    sin(30°) + cos(60 deg)

    Because, once they're inside a variable:

    sin(alpha) + cos(beta)

    then the unit used is irrelevant.

    As for the value returned from sin() etc, I haven't worried about
    that since last century.

    Except briefly more recently when I had an arbitrary precision
    floating point library and considered whether to add such functions,
    but concluded I didn't have the right skills, experience (of using ultra-high precision trig functions) or motivation.

    The first problem was: exactly how accurately should it be generated.
    With ieee754 it's easy, you only have 53 binary digits to fill.

    In my (decimal) library, the default precision for a calculation like 1.0/3.0 is typically set up to 500 decimal digits, or about 1600
    bits, otherwise it will keep going forever (the theoretical limit is
    19 billion decimal digits, or 64 billion bits).

    The second problem was, how do you even calculate sin(x) so that it converges to that accuracy within a reasonable amount of time? The
    Taylor series that I used to use wouldn't cut it.

    There exist better series than Taylor, but in case of high-precision sin()/cos() they are not MUCH better. Typically, just one term shorter
    than Taylor for a given precision, at most two terms. And quite often
    this additional terms can be done with lower precision (e.g. IEEE
    binary) so in terms of execution time the difference is close to noise.

    The key to faster high-prec sin()/cos() is breaking quarter-circle
    of input into more ranges. For 1600 bits you would almost certainly want
    to do it hierarchically. I never dealt with such high precision myself
    so has no intuition about number of levels. For (much) lower precision I
    used 6 or 7 bits per level of hierarchy, but with 1600 bits I'd think
    that it makes sense to use fewer bit per level in order to keep total
    size of the tables within limits of 2nd-level cache of typical CPU.
    May be, 7 bits on few higher levels and then 1 or 2 bits for the rest?
    Now, too many levels of hierarchy cause the problems of their own, specifically, intermediate calculations would likely need higher
    precision. The trade offs are not simple :(


    (Dealing with inputs that are extreme multiples of +/- 2pi radians
    would be an additional difficulty.)

    I decided not to bother with transcendental functions.


    You can solve most of your problems by integrating MPFR into your
    runtime.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)