Doesn't the definition of elementary functions rely on symbolic calculous?

61 views
Skip to first unread message

Lucien Grondin

unread,
Sep 25, 2023, 8:50:52 AM9/25/23
to Unum Computing
When the standard talks about real numbers, I assume it talks about actual real numbers, that is including irrational ones.

So for instance for sqrt(2), we are supposed to use sqrt(2) as it is, that is without any approximation, and feed it to the rounding algorihm, section 4.1.

I see how it's possible but it sounds kind of hard without a CAS.  And it's not just about sqrt, we have to do something similar for all functions, don't we?

John Gustafson

unread,
Sep 26, 2023, 10:23:22 AM9/26/23
to Lucien Grondin, Unum Computing
I've recently been going through the Standard, line by line, and realized that it needs to be reworded regarding "evaluated exactly and then rounded" as comes up in the definition of "fused", for example.

It is only necessary to evaluate a function to enough bits of precision that the way it rounds is determined. As written, the Standard implies that you first evaluate a function to an infinite number of bits! This is the way all math libraries work. 

The Table-Maker's Dilemma (TMD) is that for transcendental functions (log, exponential, trig and inverse trig), the number of bits required to find the correct rounding can be arbitrarily large. There are two ways to deal with this… the method of Ziv, where you evaluate to several extra bits and only in the uncommon cases where you still can't tell which way it rounds, re-evaluate to even more bits, and so on until you find the correct rounding… or the Minefield Method, greatly preferred, where the locations of hard-to-round values are known in advance and the approximation is designed to produce correct rounding.

Functions like sqrt are algebraic, that is, the results can be expressed as the root of a polynomial with integer coefficients. It is always possible to find the correct rounding for such functions with predictable resources, so those are not a big problem like TMD.

John

--
You received this message because you are subscribed to the Google Groups "Unum Computing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unum-computin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/unum-computing/04fbf8e6-a655-479f-8b7c-56a316acfa0bn%40googlegroups.com.

Oscar Smith

unread,
Sep 26, 2023, 10:48:45 AM9/26/23
to Unum Computing
> Functions like sqrt are algebraic, that is, the results can be expressed as the root of a polynomial with integer coefficients. It is always possible to find the correct rounding for such functions with predictable resources

Do you have a reference for this? This is a theorem I haven't seen before.

Lucien Grondin

unread,
Sep 26, 2023, 2:57:56 PM9/26/23
to Unum Computing
Thanks for clarifying. 

For what it's worth, I actually like that the standard assumes that you must calculate exact values before rounding.  Whether or not that requires further explanations in the standard, I don't know.  I, for one, needed one though.  Thanks. 
Reply all
Reply to author
Forward
0 new messages