aboutsummaryrefslogtreecommitdiff
path: root/lib/std/math/complex/exp.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-07-01 15:52:54 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-07-01 15:52:54 -0700
commitc89dd15e1be4959800dc7092d7dd4375253db7bc (patch)
treeca184ae53592efa21e67128a5f891d642d7f1118 /lib/std/math/complex/exp.zig
parent5466e87fce581f2ef90ac23bb80b1dbc05836fc6 (diff)
parent2360f8c490f3ec684ed64ff28e8c1fade249070b (diff)
downloadzig-c89dd15e1be4959800dc7092d7dd4375253db7bc.tar.gz
zig-c89dd15e1be4959800dc7092d7dd4375253db7bc.zip
Merge remote-tracking branch 'origin/master' into llvm14
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 f2ae28d3fd..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.epsilon(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.epsilon(f64));
+ const tolerance_f64 = @sqrt(math.floatEps(f64));
{
const a = Complex(f64).init(5, 3);