Package org.jruby
Class RubyMath
java.lang.Object
org.jruby.RubyMath
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInner class to help with Γ functions -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double[]static final double[]static final double[]static final double[]static final double[]private static final double[]private static final double[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RubyFloatacos(ThreadContext context, IRubyObject recv, IRubyObject x) static RubyFloatacos19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated.static RubyFloatacosh(ThreadContext context, IRubyObject recv, IRubyObject x) static RubyFloatacosh19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated.static RubyFloatasin(ThreadContext context, IRubyObject recv, IRubyObject x) static RubyFloatasin19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated.static RubyFloatasinh(ThreadContext context, IRubyObject recv, IRubyObject x) static RubyFloatasinh19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated.static RubyFloatatan(ThreadContext context, IRubyObject recv, IRubyObject x) static RubyFloatatan19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated.static RubyFloatatan2(ThreadContext context, IRubyObject recv, IRubyObject x, IRubyObject y) static RubyFloatatan219(ThreadContext context, IRubyObject recv, IRubyObject x, IRubyObject y) Deprecated.static RubyFloatatanh(ThreadContext context, IRubyObject recv, IRubyObject x) static RubyFloatatanh_19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated.static RubyFloatcbrt(ThreadContext context, IRubyObject recv, IRubyObject x) static doublechebylevSerie(double x, double[] coef) static RubyFloatcos(ThreadContext context, IRubyObject recv, IRubyObject x) static RubyFloatcos19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated.static RubyFloatcosh(ThreadContext context, IRubyObject recv, IRubyObject x) static RubyFloatcosh19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated.static RubyModulecreateMathModule(Ruby runtime) Create the Math module and add it to the Ruby runtime.private static voiddomainCheck(IRubyObject recv, double value, String msg) private static voiddomainCheck19(IRubyObject recv, double value, String msg) static RubyFloaterf(ThreadContext context, IRubyObject recv, IRubyObject x) static RubyFloaterf19(ThreadContext context, IRubyObject recv, IRubyObject x) static RubyFloaterfc(ThreadContext context, IRubyObject recv, IRubyObject x) static RubyFloaterfc19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated.static RubyFloatexp(ThreadContext context, IRubyObject exponent) static RubyFloatexp(ThreadContext context, IRubyObject recv, IRubyObject exponent) static RubyFloatexp19(ThreadContext context, IRubyObject recv, IRubyObject exponent) Deprecated.static RubyArrayfrexp(ThreadContext context, IRubyObject recv, IRubyObject other) static RubyArrayfrexp19(ThreadContext context, IRubyObject recv, IRubyObject other) Deprecated.static RubyFloatgamma(ThreadContext context, IRubyObject recv, IRubyObject x) Based on Gergő Nemes's Gamma Function approximation formula, we compute approximate value of Gamma function of x.static RubyFloathypot(ThreadContext context, IRubyObject recv, IRubyObject x, IRubyObject y) static RubyFloathypot19(ThreadContext context, IRubyObject recv, IRubyObject x, IRubyObject y) static RubyFloatldexp(ThreadContext context, IRubyObject recv, IRubyObject mantissa, IRubyObject exponent) static RubyFloatldexp19(ThreadContext context, IRubyObject recv, IRubyObject mantissa, IRubyObject exponent) static RubyArraylgamma(ThreadContext context, IRubyObject recv, IRubyObject x) Based on Gergő Nemes's Gamma Function approximation formula, we compute Log Gamma function for real number x.static RubyFloatlog(ThreadContext context, IRubyObject val) static RubyFloatlog(ThreadContext context, IRubyObject recv, IRubyObject val) Returns the natural logarithm of x.static RubyFloatlog(ThreadContext context, IRubyObject recv, IRubyObject... args) static RubyFloatlog(ThreadContext context, IRubyObject recv, IRubyObject val, IRubyObject base) static RubyFloatlog_19(ThreadContext context, IRubyObject recv, IRubyObject[] args) Deprecated.static RubyFloatlog10(ThreadContext context, IRubyObject recv, IRubyObject x) Returns the base 10 logarithm of x.static RubyFloatlog10_19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated.static RubyFloatlog2(ThreadContext context, IRubyObject recv, IRubyObject x) Returns the base 2 logarithm of x.static RubyFloatlog2_19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated.private static RubyFloatlogCommon(ThreadContext context, double value, double base, String msg) static doublenemes_gamma(double x) static doublesign(double x, double y) static RubyFloatsin(ThreadContext context, IRubyObject recv, IRubyObject x) static RubyFloatsin19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated.static RubyFloatsinh(ThreadContext context, IRubyObject recv, IRubyObject x) static RubyFloatsinh19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated.static RubyFloatsqrt(ThreadContext context, IRubyObject recv, IRubyObject x) static RubyFloatsqrt19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated.static RubyFloattan(ThreadContext context, IRubyObject recv, IRubyObject x) static RubyFloattan19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated.static RubyFloattanh(ThreadContext context, IRubyObject recv, IRubyObject x) static RubyFloattanh19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated.
-
Field Details
-
ASINH_COEF
public static final double[] ASINH_COEF -
ATANH_COEF
public static final double[] ATANH_COEF -
ERFC_COEF
public static final double[] ERFC_COEF -
ERFC2_COEF
public static final double[] ERFC2_COEF -
ERFCC_COEF
public static final double[] ERFCC_COEF -
FACTORIAL
private static final double[] FACTORIAL -
NEMES_GAMMA_COEFF
private static final double[] NEMES_GAMMA_COEFF
-
-
Constructor Details
-
RubyMath
public RubyMath()
-
-
Method Details
-
createMathModule
Create the Math module and add it to the Ruby runtime. -
domainCheck
-
domainCheck19
-
chebylevSerie
public static double chebylevSerie(double x, double[] coef) -
sign
public static double sign(double x, double y) -
atan2
public static RubyFloat atan2(ThreadContext context, IRubyObject recv, IRubyObject x, IRubyObject y) -
atan219
@Deprecated public static RubyFloat atan219(ThreadContext context, IRubyObject recv, IRubyObject x, IRubyObject y) Deprecated. -
cos
-
cos19
Deprecated. -
sin
-
sin19
Deprecated. -
tan
-
tan19
Deprecated. -
asin
-
asin19
Deprecated. -
acos
-
acos19
Deprecated. -
atan
-
atan19
Deprecated. -
cosh
-
cosh19
Deprecated. -
sinh
-
sinh19
Deprecated. -
tanh
-
tanh19
Deprecated. -
acosh
-
acosh19
Deprecated. -
asinh
-
asinh19
Deprecated. -
atanh
-
atanh_19
@Deprecated public static RubyFloat atanh_19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated. -
exp
-
exp
-
exp19
@Deprecated public static RubyFloat exp19(ThreadContext context, IRubyObject recv, IRubyObject exponent) Deprecated. -
logCommon
-
log
Returns the natural logarithm of x. -
log
-
log
public static RubyFloat log(ThreadContext context, IRubyObject recv, IRubyObject val, IRubyObject base) -
log
-
log_19
@Deprecated public static RubyFloat log_19(ThreadContext context, IRubyObject recv, IRubyObject[] args) Deprecated. -
log10
Returns the base 10 logarithm of x. -
log10_19
@Deprecated public static RubyFloat log10_19(ThreadContext context, IRubyObject recv, IRubyObject x) Deprecated. -
log2
Returns the base 2 logarithm of x. -
log2_19
Deprecated. -
sqrt
-
sqrt19
Deprecated. -
cbrt
-
hypot
public static RubyFloat hypot(ThreadContext context, IRubyObject recv, IRubyObject x, IRubyObject y) -
hypot19
public static RubyFloat hypot19(ThreadContext context, IRubyObject recv, IRubyObject x, IRubyObject y) -
frexp
-
frexp19
@Deprecated public static RubyArray frexp19(ThreadContext context, IRubyObject recv, IRubyObject other) Deprecated. -
ldexp
public static RubyFloat ldexp(ThreadContext context, IRubyObject recv, IRubyObject mantissa, IRubyObject exponent) -
ldexp19
public static RubyFloat ldexp19(ThreadContext context, IRubyObject recv, IRubyObject mantissa, IRubyObject exponent) -
erf
-
erf19
-
erfc
-
erfc19
Deprecated. -
gamma
Based on Gergő Nemes's Gamma Function approximation formula, we compute approximate value of Gamma function of x.- Parameters:
recv- Math modulex- a real number- Returns:
- Γ(x) for real number x
- See Also:
-
lgamma
Based on Gergő Nemes's Gamma Function approximation formula, we compute Log Gamma function for real number x.- Parameters:
recv- Math modulex- a real number- Returns:
- 2-element array [ln(Γ(x)), sgn] for real number x, where sgn is the sign of Γ(x) when exponentiated
- See Also:
-
nemes_gamma
public static double nemes_gamma(double x)
-