33 #define _DD_REAL_INIT(A, B) {{A, B}}
41 _DD_REAL_INIT(1.79769313486231570815
e+308, 9.97920154767359795037
e+291);
70 #ifdef DD_C_NAN_IS_CONST
108 }
else if (
y >= 2.0) {
143 dd_error(
"(dd_sqrt): Negative argument.");
182 dd_error(
"(dd_nroot): N must be positive.");
187 dd_error(
"(dd_nroot): Negative argument.");
226 dd_error(
"(dd_npwr): Invalid argument.");
273 {{1.66666666666666657e-01, 9.25185853854297066e-18}},
274 {{4.16666666666666644e-02, 2.31296463463574266e-18}},
275 {{8.33333333333333322e-03, 1.15648231731787138e-19}},
276 {{1.38888888888888894e-03, -5.30054395437357706e-20}},
277 {{1.98412698412698413e-04, 1.72095582934207053e-22}},
278 {{2.48015873015873016e-05, 2.15119478667758816e-23}},
279 {{2.75573192239858925e-06, -1.85839327404647208e-22}},
280 {{2.75573192239858883e-07, 2.37677146222502973e-23}},
281 {{2.50521083854417202e-08, -1.44881407093591197e-24}},
282 {{2.08767569878681002e-09, -1.20734505911325997e-25}},
283 {{1.60590438368216133e-10, 1.25852945887520981e-26}},
284 {{1.14707455977297245e-11, 2.06555127528307454e-28}},
285 {{7.64716373181981641e-13, 7.03872877733453001e-30}},
286 {{4.77947733238738525e-14, 4.39920548583408126e-31}},
287 {{2.81145725434552060e-15, 1.65088427308614326e-31}}
305 const double k = 512.0;
306 const double inv_k = 1.0 / k;
311 if (
a.x[0] <= -709.0) {
315 if (
a.x[0] >= 709.0) {
391 dd_error(
"(dd_log): Non-positive argument.");
407 double la, elam1, ll;
408 if (
a.x[0] <= -1.0) {
413 ll =
log1p(
a.x[1] / (1 +
a.x[0]));
415 ll -= (elam1 -
a.x[0])/(elam1+1);
435 {{-0.028127670288085938, 1.46e-37}},
436 {{0.5127815691121048, -4.248816580490825e-17}},
437 {{-0.0632631785207471, 4.733650586348708e-18}},
438 {{0.01470328560687425, -4.57569727474415e-20}},
439 {{-0.0008675686051689528, 2.340010361165805e-20}},
440 {{8.812635961829116e-05, 2.619804163788941e-21}},
441 {{-2.596308786770631e-06, -1.6196413688647164e-22}},
442 {{1.422669108780046e-07, 1.2956999470135368e-23}},
443 {{-1.5995603306536497e-09, 5.185121944095551e-26}},
444 {{4.526182006900779e-11, -1.9856249941108077e-27}}
449 {{-0.4544126470907431, -2.2553855773661143e-17}},
450 {{0.09682713193619222, -4.961446925746919e-19}},
451 {{-0.012745248725908178, -6.0676821249478945e-19}},
452 {{0.001147361387158326, 1.3575817248483204e-20}},
453 {{-7.370416847725892e-05, 3.720369981570573e-21}},
454 {{3.4087499397791556e-06, -3.3067348191741576e-23}},
455 {{-1.1114024704296196e-07, -3.313361038199987e-24}},
456 {{2.3987051614110847e-09, 1.102474920537503e-25}},
457 {{-2.947734185911159e-11, -9.4795654767864e-28}},
458 {{1.32220659910223e-13, 6.440648413523595e-30}}
478 #define LOG_MAX_VALUE 709.782712893384
500 static const double m_const = 4.6566128730773926e-10;
510 for (
i = 0;
i < 4;
i++,
m *= m_const) {
530 for (
i =
n - 1;
i >= 0;
i--) {
560 for (
i = 1;
i <=
n;
i++) {
570 for (
i = 0;
i < max_iter;
i++) {
582 dd_error(
"(dd_polyroot): Failed to converge.");