Compile-time math needs to be as correct as possible. RUN-time math can worry about performance. The whole point of computer programming is to let the machine do the hard work up front.

Regarding optimizations for speed at the expense of mathematical correctness, they need to default to Off, and be switchable to ON for compile-time math. Runtime math *maybe* could default to On, but since this is a change in correctness for program output, it needs to be announced as a much bigger deal as far as source-compatibility with existing code.

On 2024-02-13 06:00, fpc-pascal-requ...@lists.freepascal.org wrote:
the compiler math is ... reducing each term of an expression ... and the answer is not coming out right.

this would result in less efficient code, since all the math will then be done at full precision, which is slower. it is a trade-off between size (=precision) and speed.

[in] compile time math, performance doesn't count
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to