Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Asin_Internal()

static void System.Numerics.Complex.Asin_Internal ( double x,
double y,
out double b,
out double bPrime,
out double v )
inlinestaticprivate

Definition at line 452 of file Complex.cs.

453 {
455 {
456 b = -1.0;
457 bPrime = x / y;
458 double num;
459 double num2;
460 if (x < y)
461 {
462 num = x;
463 num2 = y;
464 }
465 else
466 {
467 num = y;
468 num2 = x;
469 }
470 double num3 = num / num2;
471 v = s_log2 + Math.Log(num2) + 0.5 * Log1P(num3 * num3);
472 return;
473 }
474 double num4 = Hypot(x + 1.0, y);
475 double num5 = Hypot(x - 1.0, y);
476 double num6 = (num4 + num5) * 0.5;
477 b = x / num6;
478 if (b > 0.75)
479 {
480 if (x <= 1.0)
481 {
482 double num7 = (y * y / (num4 + (x + 1.0)) + (num5 + (1.0 - x))) * 0.5;
483 bPrime = x / Math.Sqrt((num6 + x) * num7);
484 }
485 else
486 {
487 double num8 = (1.0 / (num4 + (x + 1.0)) + 1.0 / (num5 + (x - 1.0))) * 0.5;
488 bPrime = x / y / Math.Sqrt((num6 + x) * num8);
489 }
490 }
491 else
492 {
493 bPrime = -1.0;
494 }
495 if (num6 < 1.5)
496 {
497 if (x < 1.0)
498 {
499 double num9 = (1.0 / (num4 + (x + 1.0)) + 1.0 / (num5 + (1.0 - x))) * 0.5;
500 double num10 = y * y * num9;
501 v = Log1P(num10 + y * Math.Sqrt(num9 * (num6 + 1.0)));
502 }
503 else
504 {
505 double num11 = (y * y / (num4 + (x + 1.0)) + (num5 + (x - 1.0))) * 0.5;
506 v = Log1P(num11 + Math.Sqrt(num11 * (num6 + 1.0)));
507 }
508 }
509 else
510 {
511 v = Math.Log(num6 + Math.Sqrt((num6 - 1.0) * (num6 + 1.0)));
512 }
513 }
static double Log1P(double x)
Definition Complex.cs:272
static readonly double s_asinOverflowThreshold
Definition Complex.cs:22
static readonly double s_log2
Definition Complex.cs:24
static double Hypot(double a, double b)
Definition Complex.cs:244

References System.Numerics.Complex.Hypot(), System.Math.Log(), System.Numerics.Complex.Log1P(), System.Numerics.Complex.s_asinOverflowThreshold, System.Numerics.Complex.s_log2, and System.Math.Sqrt().

Referenced by System.Numerics.Complex.Acos(), and System.Numerics.Complex.Asin().