Re: [fpc-pascal] Floating point question

2024-02-15 Thread Florian Klämpfl via fpc-pascal


> Am 16.02.2024 um 08:23 schrieb Ern Aldo via fpc-pascal 
> :
> 
>  Compile-time math needs to be as correct as possible. RUN-time math can 
> worry about performance.

So you are saying when constant propagation is on, an expression should have a 
different result than with constant propagation off?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Floating point question

2024-02-15 Thread Ern Aldo via fpc-pascal
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