3 JSValue
liba_mf_gauss(JSContext
*ctx
, JSValueConst this_val
, int argc
, JSValueConst
*argv
)
7 double arg
[] = {0, 0, 0};
8 for (i
= 0; i
< A_LEN(arg
); ++i
)
10 if (JS_ToFloat64(ctx
, &arg
[i
], argv
[i
])) { return JS_EXCEPTION
; }
14 x
= a_mf_gauss((a_float
)arg
[0], (a_float
)arg
[1], (a_float
)arg
[2]);
15 return JS_NewFloat64(ctx
, (double)x
);
18 JSValue
liba_mf_gauss2(JSContext
*ctx
, JSValueConst this_val
, int argc
, JSValueConst
*argv
)
22 double arg
[] = {0, 0, 0, 0, 0};
23 for (i
= 0; i
< A_LEN(arg
); ++i
)
25 if (JS_ToFloat64(ctx
, &arg
[i
], argv
[i
])) { return JS_EXCEPTION
; }
29 x
= a_mf_gauss2((a_float
)arg
[0], (a_float
)arg
[1], (a_float
)arg
[2], (a_float
)arg
[3], (a_float
)arg
[4]);
30 return JS_NewFloat64(ctx
, (double)x
);
33 JSValue
liba_mf_gbell(JSContext
*ctx
, JSValueConst this_val
, int argc
, JSValueConst
*argv
)
37 double arg
[] = {0, 0, 0, 0};
38 for (i
= 0; i
< A_LEN(arg
); ++i
)
40 if (JS_ToFloat64(ctx
, &arg
[i
], argv
[i
])) { return JS_EXCEPTION
; }
44 x
= a_mf_gbell((a_float
)arg
[0], (a_float
)arg
[1], (a_float
)arg
[2], (a_float
)arg
[3]);
45 return JS_NewFloat64(ctx
, (double)x
);
48 JSValue
liba_mf_sig(JSContext
*ctx
, JSValueConst this_val
, int argc
, JSValueConst
*argv
)
52 double arg
[] = {0, 0, 0};
53 for (i
= 0; i
< A_LEN(arg
); ++i
)
55 if (JS_ToFloat64(ctx
, &arg
[i
], argv
[i
])) { return JS_EXCEPTION
; }
59 x
= a_mf_sig((a_float
)arg
[0], (a_float
)arg
[1], (a_float
)arg
[2]);
60 return JS_NewFloat64(ctx
, (double)x
);
63 JSValue
liba_mf_dsig(JSContext
*ctx
, JSValueConst this_val
, int argc
, JSValueConst
*argv
)
67 double arg
[] = {0, 0, 0, 0, 0};
68 for (i
= 0; i
< A_LEN(arg
); ++i
)
70 if (JS_ToFloat64(ctx
, &arg
[i
], argv
[i
])) { return JS_EXCEPTION
; }
74 x
= a_mf_dsig((a_float
)arg
[0], (a_float
)arg
[1], (a_float
)arg
[2], (a_float
)arg
[3], (a_float
)arg
[4]);
75 return JS_NewFloat64(ctx
, (double)x
);
78 JSValue
liba_mf_psig(JSContext
*ctx
, JSValueConst this_val
, int argc
, JSValueConst
*argv
)
82 double arg
[] = {0, 0, 0, 0, 0};
83 for (i
= 0; i
< A_LEN(arg
); ++i
)
85 if (JS_ToFloat64(ctx
, &arg
[i
], argv
[i
])) { return JS_EXCEPTION
; }
89 x
= a_mf_psig((a_float
)arg
[0], (a_float
)arg
[1], (a_float
)arg
[2], (a_float
)arg
[3], (a_float
)arg
[4]);
90 return JS_NewFloat64(ctx
, (double)x
);
93 JSValue
liba_mf_trap(JSContext
*ctx
, JSValueConst this_val
, int argc
, JSValueConst
*argv
)
97 double arg
[] = {0, 0, 0, 0, 0};
98 for (i
= 0; i
< A_LEN(arg
); ++i
)
100 if (JS_ToFloat64(ctx
, &arg
[i
], argv
[i
])) { return JS_EXCEPTION
; }
104 x
= a_mf_trap((a_float
)arg
[0], (a_float
)arg
[1], (a_float
)arg
[2], (a_float
)arg
[3], (a_float
)arg
[4]);
105 return JS_NewFloat64(ctx
, (double)x
);
108 JSValue
liba_mf_tri(JSContext
*ctx
, JSValueConst this_val
, int argc
, JSValueConst
*argv
)
112 double arg
[] = {0, 0, 0, 0};
113 for (i
= 0; i
< A_LEN(arg
); ++i
)
115 if (JS_ToFloat64(ctx
, &arg
[i
], argv
[i
])) { return JS_EXCEPTION
; }
119 x
= a_mf_tri((a_float
)arg
[0], (a_float
)arg
[1], (a_float
)arg
[2], (a_float
)arg
[3]);
120 return JS_NewFloat64(ctx
, (double)x
);
123 JSValue
liba_mf_lins(JSContext
*ctx
, JSValueConst this_val
, int argc
, JSValueConst
*argv
)
127 double arg
[] = {0, 0, 0};
128 for (i
= 0; i
< A_LEN(arg
); ++i
)
130 if (JS_ToFloat64(ctx
, &arg
[i
], argv
[i
])) { return JS_EXCEPTION
; }
134 x
= a_mf_lins((a_float
)arg
[0], (a_float
)arg
[1], (a_float
)arg
[2]);
135 return JS_NewFloat64(ctx
, (double)x
);
138 JSValue
liba_mf_linz(JSContext
*ctx
, JSValueConst this_val
, int argc
, JSValueConst
*argv
)
142 double arg
[] = {0, 0, 0};
143 for (i
= 0; i
< A_LEN(arg
); ++i
)
145 if (JS_ToFloat64(ctx
, &arg
[i
], argv
[i
])) { return JS_EXCEPTION
; }
149 x
= a_mf_linz((a_float
)arg
[0], (a_float
)arg
[1], (a_float
)arg
[2]);
150 return JS_NewFloat64(ctx
, (double)x
);
153 JSValue
liba_mf_s(JSContext
*ctx
, JSValueConst this_val
, int argc
, JSValueConst
*argv
)
157 double arg
[] = {0, 0, 0};
158 for (i
= 0; i
< A_LEN(arg
); ++i
)
160 if (JS_ToFloat64(ctx
, &arg
[i
], argv
[i
])) { return JS_EXCEPTION
; }
164 x
= a_mf_s((a_float
)arg
[0], (a_float
)arg
[1], (a_float
)arg
[2]);
165 return JS_NewFloat64(ctx
, (double)x
);
168 JSValue
liba_mf_z(JSContext
*ctx
, JSValueConst this_val
, int argc
, JSValueConst
*argv
)
172 double arg
[] = {0, 0, 0};
173 for (i
= 0; i
< A_LEN(arg
); ++i
)
175 if (JS_ToFloat64(ctx
, &arg
[i
], argv
[i
])) { return JS_EXCEPTION
; }
179 x
= a_mf_z((a_float
)arg
[0], (a_float
)arg
[1], (a_float
)arg
[2]);
180 return JS_NewFloat64(ctx
, (double)x
);
183 JSValue
liba_mf_pi(JSContext
*ctx
, JSValueConst this_val
, int argc
, JSValueConst
*argv
)
187 double arg
[] = {0, 0, 0, 0, 0};
188 for (i
= 0; i
< A_LEN(arg
); ++i
)
190 if (JS_ToFloat64(ctx
, &arg
[i
], argv
[i
])) { return JS_EXCEPTION
; }
194 x
= a_mf_pi((a_float
)arg
[0], (a_float
)arg
[1], (a_float
)arg
[2], (a_float
)arg
[3], (a_float
)arg
[4]);
195 return JS_NewFloat64(ctx
, (double)x
);