Vincent Lefevre wrote in
<[email protected]>:
|On 2024-01-05 13:47:25 +0100, Aurélie Tisson (BastaPrint) wrote:
|> The same calculation gives me 2 different values : 0.993013 0.860892
|> wheras it should give 0.993013 only (tells GCC).
|
|Well, your code is not portable.
You are the mathematician.
But *i* thought it was a request to release 0.9.28, given that tcc
of 20231230 gets the stuff correct?
|> #include <stdio.h>
|> #include <math.h>
|> int main(){
|> double s = .7;
|> double a = (1. - .1 * s) / (1. + .1 * s);
| ^^^^^^^^^^^ ^^^^^^^^^^^
|> double b = pow(a, .05);
|> double c = pow( ((1. - .1 * s) / (1. + .1 * s)), .05);
| ^^^^^^^^^^^ ^^^^^^^^^^^
|
|> printf("%f %f \n", b, c);
|>}
|
|You should not depend on contraction of FP expressions.
|Here, GCC may generate a FMA, which generally increases
|the accuracy of the results.
I am overly happy there is no floating-point in my code.
Never in the past, not today. (Anything which was there was
thrown away.) Yay.
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel