diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-04-28 13:34:38 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-28 13:34:38 -0400 |
| commit | 360ecc1a2f72967f3a3882b3327e130bdc4e18c0 (patch) | |
| tree | c02dfab372e5b79bc2130d666c5e0a0e5cb3af2e /lib/std/math/complex/sinh.zig | |
| parent | d5fcb509881e1b022d2bcef303b53b4f67db1c9a (diff) | |
| parent | 11911f55a73a49e2fda85bddd38d1993b93547c9 (diff) | |
| download | zig-360ecc1a2f72967f3a3882b3327e130bdc4e18c0.tar.gz zig-360ecc1a2f72967f3a3882b3327e130bdc4e18c0.zip | |
Merge pull request #11532 from ziglang/compiler-rt-math
compiler-rt math functions reorg
Diffstat (limited to 'lib/std/math/complex/sinh.zig')
| -rw-r--r-- | lib/std/math/complex/sinh.zig | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/std/math/complex/sinh.zig b/lib/std/math/complex/sinh.zig index 851af3e62e..1569565ecc 100644 --- a/lib/std/math/complex/sinh.zig +++ b/lib/std/math/complex/sinh.zig @@ -38,25 +38,25 @@ fn sinh32(z: Complex(f32)) Complex(f32) { } // small x: normal case if (ix < 0x41100000) { - return Complex(f32).init(math.sinh(x) * math.cos(y), math.cosh(x) * math.sin(y)); + return Complex(f32).init(math.sinh(x) * @cos(y), math.cosh(x) * @sin(y)); } // |x|>= 9, so cosh(x) ~= exp(|x|) if (ix < 0x42b17218) { // x < 88.7: exp(|x|) won't overflow - const h = math.exp(math.fabs(x)) * 0.5; - return Complex(f32).init(math.copysign(f32, h, x) * math.cos(y), h * math.sin(y)); + const h = @exp(@fabs(x)) * 0.5; + return Complex(f32).init(math.copysign(f32, h, x) * @cos(y), h * @sin(y)); } // x < 192.7: scale to avoid overflow else if (ix < 0x4340b1e7) { - const v = Complex(f32).init(math.fabs(x), y); + const v = Complex(f32).init(@fabs(x), y); const r = ldexp_cexp(v, -1); return Complex(f32).init(r.re * math.copysign(f32, 1, x), r.im); } // x >= 192.7: result always overflows else { const h = 0x1p127 * x; - return Complex(f32).init(h * math.cos(y), h * h * math.sin(y)); + return Complex(f32).init(h * @cos(y), h * h * @sin(y)); } } @@ -79,7 +79,7 @@ fn sinh32(z: Complex(f32)) Complex(f32) { if (iy >= 0x7f800000) { return Complex(f32).init(x * x, x * (y - y)); } - return Complex(f32).init(x * math.cos(y), math.inf(f32) * math.sin(y)); + return Complex(f32).init(x * @cos(y), math.inf(f32) * @sin(y)); } return Complex(f32).init((x * x) * (y - y), (x + x) * (y - y)); @@ -105,25 +105,25 @@ fn sinh64(z: Complex(f64)) Complex(f64) { } // small x: normal case if (ix < 0x40360000) { - return Complex(f64).init(math.sinh(x) * math.cos(y), math.cosh(x) * math.sin(y)); + return Complex(f64).init(math.sinh(x) * @cos(y), math.cosh(x) * @sin(y)); } // |x|>= 22, so cosh(x) ~= exp(|x|) if (ix < 0x40862e42) { // x < 710: exp(|x|) won't overflow - const h = math.exp(math.fabs(x)) * 0.5; - return Complex(f64).init(math.copysign(f64, h, x) * math.cos(y), h * math.sin(y)); + const h = @exp(@fabs(x)) * 0.5; + return Complex(f64).init(math.copysign(f64, h, x) * @cos(y), h * @sin(y)); } // x < 1455: scale to avoid overflow else if (ix < 0x4096bbaa) { - const v = Complex(f64).init(math.fabs(x), y); + const v = Complex(f64).init(@fabs(x), y); const r = ldexp_cexp(v, -1); return Complex(f64).init(r.re * math.copysign(f64, 1, x), r.im); } // x >= 1455: result always overflows else { const h = 0x1p1023 * x; - return Complex(f64).init(h * math.cos(y), h * h * math.sin(y)); + return Complex(f64).init(h * @cos(y), h * h * @sin(y)); } } @@ -146,7 +146,7 @@ fn sinh64(z: Complex(f64)) Complex(f64) { if (iy >= 0x7ff00000) { return Complex(f64).init(x * x, x * (y - y)); } - return Complex(f64).init(x * math.cos(y), math.inf(f64) * math.sin(y)); + return Complex(f64).init(x * @cos(y), math.inf(f64) * @sin(y)); } return Complex(f64).init((x * x) * (y - y), (x + x) * (y - y)); |
