aboutsummaryrefslogtreecommitdiff
path: root/lib/std/math/complex/exp.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-04-28 13:34:38 -0400
committerGitHub <noreply@github.com>2022-04-28 13:34:38 -0400
commit360ecc1a2f72967f3a3882b3327e130bdc4e18c0 (patch)
treec02dfab372e5b79bc2130d666c5e0a0e5cb3af2e /lib/std/math/complex/exp.zig
parentd5fcb509881e1b022d2bcef303b53b4f67db1c9a (diff)
parent11911f55a73a49e2fda85bddd38d1993b93547c9 (diff)
downloadzig-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/exp.zig')
-rw-r--r--lib/std/math/complex/exp.zig20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/std/math/complex/exp.zig b/lib/std/math/complex/exp.zig
index ce25025ded..84ee251d0e 100644
--- a/lib/std/math/complex/exp.zig
+++ b/lib/std/math/complex/exp.zig
@@ -33,13 +33,13 @@ fn exp32(z: Complex(f32)) Complex(f32) {
const hy = @bitCast(u32, y) & 0x7fffffff;
// cexp(x + i0) = exp(x) + i0
if (hy == 0) {
- return Complex(f32).init(math.exp(x), y);
+ return Complex(f32).init(@exp(x), y);
}
const hx = @bitCast(u32, x);
// cexp(0 + iy) = cos(y) + isin(y)
if ((hx & 0x7fffffff) == 0) {
- return Complex(f32).init(math.cos(y), math.sin(y));
+ return Complex(f32).init(@cos(y), @sin(y));
}
if (hy >= 0x7f800000) {
@@ -63,8 +63,8 @@ fn exp32(z: Complex(f32)) Complex(f32) {
// - x = +-inf
// - x = nan
else {
- const exp_x = math.exp(x);
- return Complex(f32).init(exp_x * math.cos(y), exp_x * math.sin(y));
+ const exp_x = @exp(x);
+ return Complex(f32).init(exp_x * @cos(y), exp_x * @sin(y));
}
}
@@ -81,7 +81,7 @@ fn exp64(z: Complex(f64)) Complex(f64) {
// cexp(x + i0) = exp(x) + i0
if (hy | ly == 0) {
- return Complex(f64).init(math.exp(x), y);
+ return Complex(f64).init(@exp(x), y);
}
const fx = @bitCast(u64, x);
@@ -90,7 +90,7 @@ fn exp64(z: Complex(f64)) Complex(f64) {
// cexp(0 + iy) = cos(y) + isin(y)
if ((hx & 0x7fffffff) | lx == 0) {
- return Complex(f64).init(math.cos(y), math.sin(y));
+ return Complex(f64).init(@cos(y), @sin(y));
}
if (hy >= 0x7ff00000) {
@@ -114,13 +114,13 @@ fn exp64(z: Complex(f64)) Complex(f64) {
// - x = +-inf
// - x = nan
else {
- const exp_x = math.exp(x);
- return Complex(f64).init(exp_x * math.cos(y), exp_x * math.sin(y));
+ const exp_x = @exp(x);
+ return Complex(f64).init(exp_x * @cos(y), exp_x * @sin(y));
}
}
test "complex.cexp32" {
- const tolerance_f32 = math.sqrt(math.floatEps(f32));
+ const tolerance_f32 = @sqrt(math.floatEps(f32));
{
const a = Complex(f32).init(5, 3);
@@ -140,7 +140,7 @@ test "complex.cexp32" {
}
test "complex.cexp64" {
- const tolerance_f64 = math.sqrt(math.floatEps(f64));
+ const tolerance_f64 = @sqrt(math.floatEps(f64));
{
const a = Complex(f64).init(5, 3);