authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-12-22 13:14:07-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-12-22 13:14:07-05:00
loge44a11341d21a14441c5607efa04b9c1be9baf5a
treee7e99f962ae1cda44b0fd8ec27a1e37ea933a918
parent0e7fb69bea4d2b50ab352b71de87a563b57a645a

std.math: remove unnecessary inline calls and

workaround windows 32 bit test failure See #537

31 files changed, 71 insertions(+), 71 deletions(-)

std/math/acos.zig+2-2
...@@ -8,8 +8,8 @@ const assert = @import("../debug.zig").assert;...@@ -8,8 +8,8 @@ const assert = @import("../debug.zig").assert;
8pub fn acos(x: var) -> @typeOf(x) {8pub fn acos(x: var) -> @typeOf(x) {
9 const T = @typeOf(x);9 const T = @typeOf(x);
10 return switch (T) {10 return switch (T) {
11 f32 => @inlineCall(acos32, x),11 f32 => acos32(x),
12 f64 => @inlineCall(acos64, x),12 f64 => acos64(x),
13 else => @compileError("acos not implemented for " ++ @typeName(T)),13 else => @compileError("acos not implemented for " ++ @typeName(T)),
14 };14 };
15}15}
std/math/acosh.zig+2-2
...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;
10pub fn acosh(x: var) -> @typeOf(x) {10pub fn acosh(x: var) -> @typeOf(x) {
11 const T = @typeOf(x);11 const T = @typeOf(x);
12 return switch (T) {12 return switch (T) {
13 f32 => @inlineCall(acosh32, x),13 f32 => acosh32(x),
14 f64 => @inlineCall(acosh64, x),14 f64 => acosh64(x),
15 else => @compileError("acosh not implemented for " ++ @typeName(T)),15 else => @compileError("acosh not implemented for " ++ @typeName(T)),
16 };16 };
17}17}
std/math/asin.zig+2-2
...@@ -9,8 +9,8 @@ const assert = @import("../debug.zig").assert;...@@ -9,8 +9,8 @@ const assert = @import("../debug.zig").assert;
9pub fn asin(x: var) -> @typeOf(x) {9pub fn asin(x: var) -> @typeOf(x) {
10 const T = @typeOf(x);10 const T = @typeOf(x);
11 return switch (T) {11 return switch (T) {
12 f32 => @inlineCall(asin32, x),12 f32 => asin32(x),
13 f64 => @inlineCall(asin64, x),13 f64 => asin64(x),
14 else => @compileError("asin not implemented for " ++ @typeName(T)),14 else => @compileError("asin not implemented for " ++ @typeName(T)),
15 };15 };
16}16}
std/math/asinh.zig+2-2
...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;
10pub fn asinh(x: var) -> @typeOf(x) {10pub fn asinh(x: var) -> @typeOf(x) {
11 const T = @typeOf(x);11 const T = @typeOf(x);
12 return switch (T) {12 return switch (T) {
13 f32 => @inlineCall(asinh32, x),13 f32 => asinh32(x),
14 f64 => @inlineCall(asinh64, x),14 f64 => asinh64(x),
15 else => @compileError("asinh not implemented for " ++ @typeName(T)),15 else => @compileError("asinh not implemented for " ++ @typeName(T)),
16 };16 };
17}17}
std/math/atan.zig+11-11
...@@ -9,8 +9,8 @@ const assert = @import("../debug.zig").assert;...@@ -9,8 +9,8 @@ const assert = @import("../debug.zig").assert;
9pub fn atan(x: var) -> @typeOf(x) {9pub fn atan(x: var) -> @typeOf(x) {
10 const T = @typeOf(x);10 const T = @typeOf(x);
11 return switch (T) {11 return switch (T) {
12 f32 => @inlineCall(atan32, x),12 f32 => atan32(x),
13 f64 => @inlineCall(atan64, x),13 f64 => atan64(x),
14 else => @compileError("atan not implemented for " ++ @typeName(T)),14 else => @compileError("atan not implemented for " ++ @typeName(T)),
15 };15 };
16}16}
...@@ -99,11 +99,11 @@ fn atan32(x_: f32) -> f32 {...@@ -99,11 +99,11 @@ fn atan32(x_: f32) -> f32 {
99 const s1 = z * (aT[0] + w * (aT[2] + w * aT[4]));99 const s1 = z * (aT[0] + w * (aT[2] + w * aT[4]));
100 const s2 = w * (aT[1] + w * aT[3]);100 const s2 = w * (aT[1] + w * aT[3]);
101101
102 if (id == null) {102 if (id) |id_value| {
103 return x - x * (s1 + s2);103 const zz = atanhi[id_value] - ((x * (s1 + s2) - atanlo[id_value]) - x);
104 } else {
105 const zz = atanhi[??id] - ((x * (s1 + s2) - atanlo[??id]) - x);
106 return if (sign != 0) -zz else zz;104 return if (sign != 0) -zz else zz;
105 } else {
106 return x - x * (s1 + s2);
107 }107 }
108}108}
109109
...@@ -198,16 +198,16 @@ fn atan64(x_: f64) -> f64 {...@@ -198,16 +198,16 @@ fn atan64(x_: f64) -> f64 {
198 const s1 = z * (aT[0] + w * (aT[2] + w * (aT[4] + w * (aT[6] + w * (aT[8] + w * aT[10])))));198 const s1 = z * (aT[0] + w * (aT[2] + w * (aT[4] + w * (aT[6] + w * (aT[8] + w * aT[10])))));
199 const s2 = w * (aT[1] + w * (aT[3] + w * (aT[5] + w * (aT[7] + w * aT[9]))));199 const s2 = w * (aT[1] + w * (aT[3] + w * (aT[5] + w * (aT[7] + w * aT[9]))));
200200
201 if (id == null) {201 if (id) |id_value| {
202 return x - x * (s1 + s2);202 const zz = atanhi[id_value] - ((x * (s1 + s2) - atanlo[id_value]) - x);
203 } else {
204 const zz = atanhi[??id] - ((x * (s1 + s2) - atanlo[??id]) - x);
205 return if (sign != 0) -zz else zz;203 return if (sign != 0) -zz else zz;
204 } else {
205 return x - x * (s1 + s2);
206 }206 }
207}207}
208208
209test "math.atan" {209test "math.atan" {
210 assert(atan(f32(0.2)) == atan32(0.2));210 assert(@bitCast(u32, atan(f32(0.2))) == @bitCast(u32, atan32(0.2)));
211 assert(atan(f64(0.2)) == atan64(0.2));211 assert(atan(f64(0.2)) == atan64(0.2));
212}212}
213213
std/math/atan2.zig+2-2
...@@ -23,8 +23,8 @@ const assert = @import("../debug.zig").assert;...@@ -23,8 +23,8 @@ const assert = @import("../debug.zig").assert;
2323
24fn atan2(comptime T: type, x: T, y: T) -> T {24fn atan2(comptime T: type, x: T, y: T) -> T {
25 return switch (T) {25 return switch (T) {
26 f32 => @inlineCall(atan2_32, x, y),26 f32 => atan2_32(x, y),
27 f64 => @inlineCall(atan2_64, x, y),27 f64 => atan2_64(x, y),
28 else => @compileError("atan2 not implemented for " ++ @typeName(T)),28 else => @compileError("atan2 not implemented for " ++ @typeName(T)),
29 };29 };
30}30}
std/math/atanh.zig+2-2
...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;
10pub fn atanh(x: var) -> @typeOf(x) {10pub fn atanh(x: var) -> @typeOf(x) {
11 const T = @typeOf(x);11 const T = @typeOf(x);
12 return switch (T) {12 return switch (T) {
13 f32 => @inlineCall(atanh_32, x),13 f32 => atanh_32(x),
14 f64 => @inlineCall(atanh_64, x),14 f64 => atanh_64(x),
15 else => @compileError("atanh not implemented for " ++ @typeName(T)),15 else => @compileError("atanh not implemented for " ++ @typeName(T)),
16 };16 };
17}17}
std/math/cbrt.zig+2-2
...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;
10pub fn cbrt(x: var) -> @typeOf(x) {10pub fn cbrt(x: var) -> @typeOf(x) {
11 const T = @typeOf(x);11 const T = @typeOf(x);
12 return switch (T) {12 return switch (T) {
13 f32 => @inlineCall(cbrt32, x),13 f32 => cbrt32(x),
14 f64 => @inlineCall(cbrt64, x),14 f64 => cbrt64(x),
15 else => @compileError("cbrt not implemented for " ++ @typeName(T)),15 else => @compileError("cbrt not implemented for " ++ @typeName(T)),
16 };16 };
17}17}
std/math/ceil.zig+2-2
...@@ -11,8 +11,8 @@ const assert = @import("../debug.zig").assert;...@@ -11,8 +11,8 @@ const assert = @import("../debug.zig").assert;
11pub fn ceil(x: var) -> @typeOf(x) {11pub fn ceil(x: var) -> @typeOf(x) {
12 const T = @typeOf(x);12 const T = @typeOf(x);
13 return switch (T) {13 return switch (T) {
14 f32 => @inlineCall(ceil32, x),14 f32 => ceil32(x),
15 f64 => @inlineCall(ceil64, x),15 f64 => ceil64(x),
16 else => @compileError("ceil not implemented for " ++ @typeName(T)),16 else => @compileError("ceil not implemented for " ++ @typeName(T)),
17 };17 };
18}18}
std/math/copysign.zig+2-2
...@@ -3,8 +3,8 @@ const assert = @import("../debug.zig").assert;...@@ -3,8 +3,8 @@ const assert = @import("../debug.zig").assert;
33
4pub fn copysign(comptime T: type, x: T, y: T) -> T {4pub fn copysign(comptime T: type, x: T, y: T) -> T {
5 return switch (T) {5 return switch (T) {
6 f32 => @inlineCall(copysign32, x, y),6 f32 => copysign32(x, y),
7 f64 => @inlineCall(copysign64, x, y),7 f64 => copysign64(x, y),
8 else => @compileError("copysign not implemented for " ++ @typeName(T)),8 else => @compileError("copysign not implemented for " ++ @typeName(T)),
9 };9 };
10}10}
std/math/cos.zig+2-2
...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;
10pub fn cos(x: var) -> @typeOf(x) {10pub fn cos(x: var) -> @typeOf(x) {
11 const T = @typeOf(x);11 const T = @typeOf(x);
12 return switch (T) {12 return switch (T) {
13 f32 => @inlineCall(cos32, x),13 f32 => cos32(x),
14 f64 => @inlineCall(cos64, x),14 f64 => cos64(x),
15 else => @compileError("cos not implemented for " ++ @typeName(T)),15 else => @compileError("cos not implemented for " ++ @typeName(T)),
16 };16 };
17}17}
std/math/cosh.zig+2-2
...@@ -12,8 +12,8 @@ const assert = @import("../debug.zig").assert;...@@ -12,8 +12,8 @@ const assert = @import("../debug.zig").assert;
12pub fn cosh(x: var) -> @typeOf(x) {12pub fn cosh(x: var) -> @typeOf(x) {
13 const T = @typeOf(x);13 const T = @typeOf(x);
14 return switch (T) {14 return switch (T) {
15 f32 => @inlineCall(cosh32, x),15 f32 => cosh32(x),
16 f64 => @inlineCall(cosh64, x),16 f64 => cosh64(x),
17 else => @compileError("cosh not implemented for " ++ @typeName(T)),17 else => @compileError("cosh not implemented for " ++ @typeName(T)),
18 };18 };
19}19}
std/math/exp.zig+2-2
...@@ -9,8 +9,8 @@ const assert = @import("../debug.zig").assert;...@@ -9,8 +9,8 @@ const assert = @import("../debug.zig").assert;
9pub fn exp(x: var) -> @typeOf(x) {9pub fn exp(x: var) -> @typeOf(x) {
10 const T = @typeOf(x);10 const T = @typeOf(x);
11 return switch (T) {11 return switch (T) {
12 f32 => @inlineCall(exp32, x),12 f32 => exp32(x),
13 f64 => @inlineCall(exp64, x),13 f64 => exp64(x),
14 else => @compileError("exp not implemented for " ++ @typeName(T)),14 else => @compileError("exp not implemented for " ++ @typeName(T)),
15 };15 };
16}16}
std/math/exp2.zig+2-2
...@@ -9,8 +9,8 @@ const assert = @import("../debug.zig").assert;...@@ -9,8 +9,8 @@ const assert = @import("../debug.zig").assert;
9pub fn exp2(x: var) -> @typeOf(x) {9pub fn exp2(x: var) -> @typeOf(x) {
10 const T = @typeOf(x);10 const T = @typeOf(x);
11 return switch (T) {11 return switch (T) {
12 f32 => @inlineCall(exp2_32, x),12 f32 => exp2_32(x),
13 f64 => @inlineCall(exp2_64, x),13 f64 => exp2_64(x),
14 else => @compileError("exp2 not implemented for " ++ @typeName(T)),14 else => @compileError("exp2 not implemented for " ++ @typeName(T)),
15 };15 };
16}16}
std/math/expm1.zig+2-2
...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;
10pub fn expm1(x: var) -> @typeOf(x) {10pub fn expm1(x: var) -> @typeOf(x) {
11 const T = @typeOf(x);11 const T = @typeOf(x);
12 return switch (T) {12 return switch (T) {
13 f32 => @inlineCall(expm1_32, x),13 f32 => expm1_32(x),
14 f64 => @inlineCall(expm1_64, x),14 f64 => expm1_64(x),
15 else => @compileError("exp1m not implemented for " ++ @typeName(T)),15 else => @compileError("exp1m not implemented for " ++ @typeName(T)),
16 };16 };
17}17}
std/math/fabs.zig+2-2
...@@ -9,8 +9,8 @@ const assert = @import("../debug.zig").assert;...@@ -9,8 +9,8 @@ const assert = @import("../debug.zig").assert;
9pub fn fabs(x: var) -> @typeOf(x) {9pub fn fabs(x: var) -> @typeOf(x) {
10 const T = @typeOf(x);10 const T = @typeOf(x);
11 return switch (T) {11 return switch (T) {
12 f32 => @inlineCall(fabs32, x),12 f32 => fabs32(x),
13 f64 => @inlineCall(fabs64, x),13 f64 => fabs64(x),
14 else => @compileError("fabs not implemented for " ++ @typeName(T)),14 else => @compileError("fabs not implemented for " ++ @typeName(T)),
15 };15 };
16}16}
std/math/floor.zig+2-2
...@@ -11,8 +11,8 @@ const math = @import("index.zig");...@@ -11,8 +11,8 @@ const math = @import("index.zig");
11pub fn floor(x: var) -> @typeOf(x) {11pub fn floor(x: var) -> @typeOf(x) {
12 const T = @typeOf(x);12 const T = @typeOf(x);
13 return switch (T) {13 return switch (T) {
14 f32 => @inlineCall(floor32, x),14 f32 => floor32(x),
15 f64 => @inlineCall(floor64, x),15 f64 => floor64(x),
16 else => @compileError("floor not implemented for " ++ @typeName(T)),16 else => @compileError("floor not implemented for " ++ @typeName(T)),
17 };17 };
18}18}
std/math/fma.zig+2-2
...@@ -3,8 +3,8 @@ const assert = @import("../debug.zig").assert;...@@ -3,8 +3,8 @@ const assert = @import("../debug.zig").assert;
33
4pub fn fma(comptime T: type, x: T, y: T, z: T) -> T {4pub fn fma(comptime T: type, x: T, y: T, z: T) -> T {
5 return switch (T) {5 return switch (T) {
6 f32 => @inlineCall(fma32, x, y, z),6 f32 => fma32(x, y, z),
7 f64 => @inlineCall(fma64, x, y ,z),7 f64 => fma64(x, y ,z),
8 else => @compileError("fma not implemented for " ++ @typeName(T)),8 else => @compileError("fma not implemented for " ++ @typeName(T)),
9 };9 };
10}10}
std/math/frexp.zig+2-2
...@@ -19,8 +19,8 @@ pub const frexp64_result = frexp_result(f64);...@@ -19,8 +19,8 @@ pub const frexp64_result = frexp_result(f64);
19pub fn frexp(x: var) -> frexp_result(@typeOf(x)) {19pub fn frexp(x: var) -> frexp_result(@typeOf(x)) {
20 const T = @typeOf(x);20 const T = @typeOf(x);
21 return switch (T) {21 return switch (T) {
22 f32 => @inlineCall(frexp32, x),22 f32 => frexp32(x),
23 f64 => @inlineCall(frexp64, x),23 f64 => frexp64(x),
24 else => @compileError("frexp not implemented for " ++ @typeName(T)),24 else => @compileError("frexp not implemented for " ++ @typeName(T)),
25 };25 };
26}26}
std/math/hypot.zig+2-2
...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;
1010
11pub fn hypot(comptime T: type, x: T, y: T) -> T {11pub fn hypot(comptime T: type, x: T, y: T) -> T {
12 return switch (T) {12 return switch (T) {
13 f32 => @inlineCall(hypot32, x, y),13 f32 => hypot32(x, y),
14 f64 => @inlineCall(hypot64, x, y),14 f64 => hypot64(x, y),
15 else => @compileError("hypot not implemented for " ++ @typeName(T)),15 else => @compileError("hypot not implemented for " ++ @typeName(T)),
16 };16 };
17}17}
std/math/ilogb.zig+2-2
...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;
10pub fn ilogb(x: var) -> i32 {10pub fn ilogb(x: var) -> i32 {
11 const T = @typeOf(x);11 const T = @typeOf(x);
12 return switch (T) {12 return switch (T) {
13 f32 => @inlineCall(ilogb32, x),13 f32 => ilogb32(x),
14 f64 => @inlineCall(ilogb64, x),14 f64 => ilogb64(x),
15 else => @compileError("ilogb not implemented for " ++ @typeName(T)),15 else => @compileError("ilogb not implemented for " ++ @typeName(T)),
16 };16 };
17}17}
std/math/log1p.zig+2-2
...@@ -12,8 +12,8 @@ const assert = @import("../debug.zig").assert;...@@ -12,8 +12,8 @@ const assert = @import("../debug.zig").assert;
12pub fn log1p(x: var) -> @typeOf(x) {12pub fn log1p(x: var) -> @typeOf(x) {
13 const T = @typeOf(x);13 const T = @typeOf(x);
14 return switch (T) {14 return switch (T) {
15 f32 => @inlineCall(log1p_32, x),15 f32 => log1p_32(x),
16 f64 => @inlineCall(log1p_64, x),16 f64 => log1p_64(x),
17 else => @compileError("log1p not implemented for " ++ @typeName(T)),17 else => @compileError("log1p not implemented for " ++ @typeName(T)),
18 };18 };
19}19}
std/math/modf.zig+2-2
...@@ -18,8 +18,8 @@ pub const modf64_result = modf_result(f64);...@@ -18,8 +18,8 @@ pub const modf64_result = modf_result(f64);
18pub fn modf(x: var) -> modf_result(@typeOf(x)) {18pub fn modf(x: var) -> modf_result(@typeOf(x)) {
19 const T = @typeOf(x);19 const T = @typeOf(x);
20 return switch (T) {20 return switch (T) {
21 f32 => @inlineCall(modf32, x),21 f32 => modf32(x),
22 f64 => @inlineCall(modf64, x),22 f64 => modf64(x),
23 else => @compileError("modf not implemented for " ++ @typeName(T)),23 else => @compileError("modf not implemented for " ++ @typeName(T)),
24 };24 };
25}25}
std/math/round.zig+2-2
...@@ -11,8 +11,8 @@ const math = @import("index.zig");...@@ -11,8 +11,8 @@ const math = @import("index.zig");
11pub fn round(x: var) -> @typeOf(x) {11pub fn round(x: var) -> @typeOf(x) {
12 const T = @typeOf(x);12 const T = @typeOf(x);
13 return switch (T) {13 return switch (T) {
14 f32 => @inlineCall(round32, x),14 f32 => round32(x),
15 f64 => @inlineCall(round64, x),15 f64 => round64(x),
16 else => @compileError("round not implemented for " ++ @typeName(T)),16 else => @compileError("round not implemented for " ++ @typeName(T)),
17 };17 };
18}18}
std/math/scalbn.zig+2-2
...@@ -4,8 +4,8 @@ const assert = @import("../debug.zig").assert;...@@ -4,8 +4,8 @@ const assert = @import("../debug.zig").assert;
4pub fn scalbn(x: var, n: i32) -> @typeOf(x) {4pub fn scalbn(x: var, n: i32) -> @typeOf(x) {
5 const T = @typeOf(x);5 const T = @typeOf(x);
6 return switch (T) {6 return switch (T) {
7 f32 => @inlineCall(scalbn32, x, n),7 f32 => scalbn32(x, n),
8 f64 => @inlineCall(scalbn64, x, n),8 f64 => scalbn64(x, n),
9 else => @compileError("scalbn not implemented for " ++ @typeName(T)),9 else => @compileError("scalbn not implemented for " ++ @typeName(T)),
10 };10 };
11}11}
std/math/signbit.zig+2-2
...@@ -4,8 +4,8 @@ const assert = @import("../debug.zig").assert;...@@ -4,8 +4,8 @@ const assert = @import("../debug.zig").assert;
4pub fn signbit(x: var) -> bool {4pub fn signbit(x: var) -> bool {
5 const T = @typeOf(x);5 const T = @typeOf(x);
6 return switch (T) {6 return switch (T) {
7 f32 => @inlineCall(signbit32, x),7 f32 => signbit32(x),
8 f64 => @inlineCall(signbit64, x),8 f64 => signbit64(x),
9 else => @compileError("signbit not implemented for " ++ @typeName(T)),9 else => @compileError("signbit not implemented for " ++ @typeName(T)),
10 };10 };
11}11}
std/math/sin.zig+2-2
...@@ -11,8 +11,8 @@ const assert = @import("../debug.zig").assert;...@@ -11,8 +11,8 @@ const assert = @import("../debug.zig").assert;
11pub fn sin(x: var) -> @typeOf(x) {11pub fn sin(x: var) -> @typeOf(x) {
12 const T = @typeOf(x);12 const T = @typeOf(x);
13 return switch (T) {13 return switch (T) {
14 f32 => @inlineCall(sin32, x),14 f32 => sin32(x),
15 f64 => @inlineCall(sin64, x),15 f64 => sin64(x),
16 else => @compileError("sin not implemented for " ++ @typeName(T)),16 else => @compileError("sin not implemented for " ++ @typeName(T)),
17 };17 };
18}18}
std/math/sinh.zig+2-2
...@@ -12,8 +12,8 @@ const expo2 = @import("expo2.zig").expo2;...@@ -12,8 +12,8 @@ const expo2 = @import("expo2.zig").expo2;
12pub fn sinh(x: var) -> @typeOf(x) {12pub fn sinh(x: var) -> @typeOf(x) {
13 const T = @typeOf(x);13 const T = @typeOf(x);
14 return switch (T) {14 return switch (T) {
15 f32 => @inlineCall(sinh32, x),15 f32 => sinh32(x),
16 f64 => @inlineCall(sinh64, x),16 f64 => sinh64(x),
17 else => @compileError("sinh not implemented for " ++ @typeName(T)),17 else => @compileError("sinh not implemented for " ++ @typeName(T)),
18 };18 };
19}19}
std/math/tan.zig+2-2
...@@ -11,8 +11,8 @@ const assert = @import("../debug.zig").assert;...@@ -11,8 +11,8 @@ const assert = @import("../debug.zig").assert;
11pub fn tan(x: var) -> @typeOf(x) {11pub fn tan(x: var) -> @typeOf(x) {
12 const T = @typeOf(x);12 const T = @typeOf(x);
13 return switch (T) {13 return switch (T) {
14 f32 => @inlineCall(tan32, x),14 f32 => tan32(x),
15 f64 => @inlineCall(tan64, x),15 f64 => tan64(x),
16 else => @compileError("tan not implemented for " ++ @typeName(T)),16 else => @compileError("tan not implemented for " ++ @typeName(T)),
17 };17 };
18}18}
std/math/tanh.zig+2-2
...@@ -12,8 +12,8 @@ const expo2 = @import("expo2.zig").expo2;...@@ -12,8 +12,8 @@ const expo2 = @import("expo2.zig").expo2;
12pub fn tanh(x: var) -> @typeOf(x) {12pub fn tanh(x: var) -> @typeOf(x) {
13 const T = @typeOf(x);13 const T = @typeOf(x);
14 return switch (T) {14 return switch (T) {
15 f32 => @inlineCall(tanh32, x),15 f32 => tanh32(x),
16 f64 => @inlineCall(tanh64, x),16 f64 => tanh64(x),
17 else => @compileError("tanh not implemented for " ++ @typeName(T)),17 else => @compileError("tanh not implemented for " ++ @typeName(T)),
18 };18 };
19}19}
std/math/trunc.zig+2-2
...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;...@@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert;
10pub fn trunc(x: var) -> @typeOf(x) {10pub fn trunc(x: var) -> @typeOf(x) {
11 const T = @typeOf(x);11 const T = @typeOf(x);
12 return switch (T) {12 return switch (T) {
13 f32 => @inlineCall(trunc32, x),13 f32 => trunc32(x),
14 f64 => @inlineCall(trunc64, x),14 f64 => trunc64(x),
15 else => @compileError("trunc not implemented for " ++ @typeName(T)),15 else => @compileError("trunc not implemented for " ++ @typeName(T)),
16 };16 };
17}17}