[cfp-interest 3391] Re: Math Functions in Programming Languages Standards
Paul Zimmermann
Paul.Zimmermann at inria.fr
Sat Feb 15 23:54:24 PST 2025
Hi David,
I agree with you. I don't know the arguments for standardizing linear
interpolation, but I would prefer operations like a*b+c*d to be
standardized, which would be very useful to compute products of
complex numbers.
Also, what would be the semantics of the new functions? Would correct rounding
be required?
Paul
> Date: Thu, 13 Feb 2025 15:18:42 -0800 (PST)
> From: David Hough CFP <pcfp at oakapple.net>
>
>
> Here is a draft of a response to my very long-standing action item for
> recommendations to C about C++ midpoint and linear interpolation.
>
> https://754r.ucbtest.org/background/math-functions-languages.txt
>
> Math Functions in Programming Languages Standards
>
> Question:
> C++ proposes to standardize midpoint and linear interpolation functions.
> Should C follow?
>
> General comments:
> Programming language standards are big and getting bigger. It seems likely
> that not all standards groups have equal expertise in what functions
> applications require.
>
> If they are going to put additional functions in programming language
> standards, how do they decide which ones are worthwhile?
>
> Perhaps they should limit themselves to new functions that can be
> implemented in a single instruction no more complex than an FMA.
> Or to new functions that are the solutions to very simple differential
> equations (e.g. exp/sin/cos), and their inverses - especially avoiding new
> transcendental functions - note that in floating-point arithmetic,
> the results of x**y and kindred functions are always algebraic numbers
> rather than transcendental numbers.
>
> LAPACK, or even the BLAS, are very widely used, but that doesn't make them
> good candidates for language standardization. There are other groups
> better equipped to do that work.
>
> Specific comments:
> If I had been present at Creation, I would have advised putting gamma or
> lgamma or bessel functions in C. But here they are, and there's little to
> be gained by taking them out.
>
> Note that midpoint, in binary, is hardly different from a normal subtraction,
> and would easily make a simple machine instruction. But that ease does
> not apply to any other radix, 10 or 16 in particular.
>
> That case against linear interpolation is even stronger.
>
> One benefit of standardization is uniformity of syntax. But uniformity of
> semantics is even more important, especially for exceptions. But different
> application areas have vastly different requirements for exceptions. Perhaps
> the semantics are best specified by application-oriented groups rather than
> language committees.
>
> Conclusion:
> My suggestion for C would be to not standardize midpoint and linear
> interpolation, but if it is done, limit the specification to syntax and
> just those semantics that all stakeholders can agree on.
>
> _______________________________________________
> cfp-interest mailing list
> cfp-interest at oakapple.net
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest
>
More information about the cfp-interest
mailing list