News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Fork of QD (2.3.17) dll

Started by TimoVJL, August 12, 2017, 09:23:20 AM

Previous topic - Next topic

jack

hello TimoVJL
I tested c_dd_dll_ms and here's what I found
c_dd_add   ok
c_dd_sub   ok
c_dd_mul   ok
c_dd_div   ok
c_dd_sqr   ok
c_dd_sqrt   ok
c_dd_write   ok
c_dd_read   ok
the trig, log and exp functions give wrong results, c_dd_atan gives right result only for arg=1, c_dd_tan is missing.
sorry for the bad report, I just thought that you might like to have some feedback. :)

jack

#16
hello TimoVJL
I didn't think about this earlier, but this type of arithmetic is sensitive to the FPU setting, remember that in the original code there were two functions to set the FPU flags, I bet that's where the problem is, or if you can coerce the compiler to use sse2 instructions then you should be ok.

jj2007

Quote from: jack on August 29, 2017, 08:49:35 PMthis type of arithmetic is sensitive to the FPU setting, remember that in the original code there were two functions to set the FPU flags, I bet that's where the problem is, or if you can coerce the compiler to use sse2 instructions then you should be ok.

But don't forget LDMXCSR ;)

jack

#18
hello TimoVJL
you are getting close, however there's a bug in dd_to_digits, if dd_variable.x[0] = 0.1 and dd_variable.x[1] = -5.551115123125983e-018 then you get an error and crash.
Quote
(dd_to_digits): can't compute exponent.
the trigs seem to be ok, but only made a very simple test.

jack

#19
there's a problem with dd_cos, if dd_x = 1/n , n=11, 12, 13 ... then dd_cos fails, for dd_x=1/11 the result is
Quote
                                   dd_x.x[0]                               dd_x[1]
cos(1/11)            0.9958706137005629          0.9958706137005629
it should be something like
Quote
cos(1/11)            0.9958706137005629         -4.772639498746044e-017
[edit] dd_log is not working

jack

I did a loop from -70 to 70 and used mpfr for verification, for log/exp the loop was from 1 to 70
sin, cos, tan, atan, log and exp are ok, not sure about the hyperbolic functions.

jack

dd_atanh(dd_tanh(x)) from 1 to 19 ok, above 19 dd_atanh says "Argument out of domain."

jack

we really need a good test suite to check the functions in the supported range, the hyperbolic functions are trickier to check.

jack

I made a small test and the trigs -not including hyperbolic- , log and exp seem to be ok
I have been doing my testing in freebasic because I am more familiar with it than C.