Vincent Magnin

Results 94 comments of Vincent Magnin

> 2\. Let's start using external libraries optionally to implement as many formats as we can. The C GdkPixbuf library can save files in "jpeg", "png", "tiff", "ico" or "bmp":...

There is a`cbrt()` function in Java, described here: https://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Math.html#cbrt(double) > Returns the cube root of a double value. For positive finite x, cbrt(-x) == -cbrt(x); that is, the cube root...

@ivan-pi A simple implementation could be something like: ```fortran module functions use iso_fortran_env, only: dp=>real64 implicit none contains pure real(dp) function cbrt(x) real(dp), intent(in) :: x cbrt = sign(abs(x)**(1.0_dp /...

Very counter-intuitive... We don't know what do exactly the compilers. With -O3 there is probably inlining in cbrt2(). Considering only ifort, my cbrt2() does not change with negative values. Normal....

Precision loss with very big and small values: ```fortran x = 1d300 print *, x, cbrt(x), cbrt(x)*cbrt(x)*cbrt(x) x = 1d-300 print *, x, cbrt(x), cbrt(x)*cbrt(x)*cbrt(x) ``` ``` 1.0000000000000001E+300 9.9999999999998719E+099 9.9999999999996154E+299...

@LKedward thank you, very interesting! Yes, if the sign is always changing ifort can't use vectors with the branching version... It's amazing to see what such a simple example can...

It reveals also the limits of benchmarking: one implementation could be better with some compilers, some CPU but not with other (Intel, AMD, ARM...). And worse, one implementation could be...

> different numerical implementations may also have different edge-case behaviours such as loss of precision which are worth being aware of. It implies that if a "naive" implementation is used...

MyST may also be useful to port the Rosetta Stone part of Fortran90.org, see issue https://github.com/fortran-lang/webpage/issues/112

> So we can then convert the tutorials to Jupyter notebooks (literally powered by LFortran), and they will be rendered correctly. Pandoc does not seem to handle MyST format yet....