There is colt.

The Colt library provides fundamental general-purpose data structures optimized for numerical data, such as resizable arrays, dense and sparse matrices (multi-dimensional arrays), linear algebra, associative containers and buffer management.

The Jet library contains mathematical and statistical tools for data analysis, powerful histogramming functionality, Random Number Generators and Distributions useful for (event) simulations, and more.

The CoreJava library contains C-like print formatting. The Concurrent library contains standardized, efficient utility classes commonly encountered in parallel & concurrent programming.

Answer from miku on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-math-class
Java Math Class - GeeksforGeeks
July 23, 2025 - System.out.println("The floor of " + x + " is " + Math.floor(x)); System.out.println("The floor of " + y + " is " + Math.floor(y)); // Comparison operators // min() returns the smaller of the two arguments // you pass it System.out.println("min(" ...
🌐
W3Schools
w3schools.com › java › java_math.asp
Java Math
Java Examples Java Videos Java Compiler Java Exercises Java Quiz Java Code Challenges Java Server Java Syllabus Java Study Plan Java Interview Q&A Java Certificate ... The Java Math class has many methods that allows you to perform mathematical tasks on numbers.
🌐
Programiz
programiz.com › java-programming › library › math
Java Math Methods | Programiz
Java has a lot of Math methods that allow us to perform mathematical computations. In this reference page, you will find all the math methods available in Java. For example, if you need to get the square root of a number, use the sqrt() method.
🌐
W3Schools
w3schools.com › java › java_ref_math.asp
Java Math Reference
Java Examples Java Videos Java Compiler Java Exercises Java Quiz Java Code Challenges Java Server Java Syllabus Java Study Plan Java Interview Q&A Java Certificate ... The Java Math class has many methods that allows you to perform mathematical tasks on numbers.
🌐
Tutorial Gateway
tutorialgateway.org › java-math-library
Java Math Library
March 28, 2025 - The following functions are the list of Trigonometric functions available in the Math Library. The Hyperbolic Functions are trigonometric functions that allow performing the following Hyperbolic library functions instead of Circles. The following functions are the list of Hyperbolic functions available in the Java Math Library.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › lang › Math.html
Math (Java Platform SE 8 )
October 20, 2025 - Java™ Platform Standard Ed. 8 ... The class Math contains methods for performing basic numeric operations such as the elementary exponential, logarithm, square root, and trigonometric functions.
🌐
Javatpoint
javatpoint.com › java-math
Java Math Class
Java Math class with methods with Examples on abs(), min(), max(), avg(), round(), ceil(), floor(), pow(), sqrt(), sin(), cos(), tan(), exp() etc.
Find elsewhere
🌐
Tutorialspoint
tutorialspoint.com › java › java_lang_math.htm
Java - Math Class
package com.tutorialspoint; public class MathDemo { public static void main(String[] args) { // get two double numbers double x = 60984.1; double y = -497.99; // get the natural logarithm for x System.out.println("Math.log(" + x + ")=" + Math.log(x)); // get the natural logarithm for y System.out.println("Math.log(" + y + ")=" + Math.log(y)); // get the max value System.out.println("Math.max(" + x + ", y" + ")=" + Math.max(x,y)); // get the min value System.out.println("Math.min(" + x + ", y" + ")=" + Math.min(x,y)); } }
🌐
Google Sites
sites.google.com › view › manobal-sir › java-topics › java-mathematical-library-function
Manobal sir - Java mathematical library Function
JAVA math Function Java Math class provides several methods to work on math calculations like min(), max(), avg(), sin(), cos(), tan(), round(), ceil(), floor(), abs() etc. Basic Method with Description Math.abs() It will return the Absolute ...
🌐
Maven Repository
mvnrepository.com › open-source › math-libraries
Maven Repository: Math Libraries
Alternate implementations of JDK's "Math" functions. ... A fast and easy to use dense and sparse matrix linear algebra library written in Java.
🌐
O'Reilly
oreilly.com › library › view › learning-java › 1565927184 › ch09s02.html
Math Utilities - Learning Java [Book]
May 1, 2000 - The following example generates an infinite result: double zero = 0.0; double d = 1.0/zero; if ( d == Double.POSITIVE_INFINITY ) System.out.println( "Division by zero" ); The special value NaN indicates the result is “not a number.” The value NaN has the special distinction of not being equal to itself (NaN != NaN evaluates to true). Use Float.isNaN( ) or Double.isNaN( ) to test for NaN. The java.lang.Math class provides Java’s math library.
Authors   Jonathan KnudsenPatrick Niemeyer
Published   2000
Pages   726
🌐
Tpoint Tech
tpointtech.com › java-math
Java Math Class (Methods with Examples) - Tpoint Tech
March 17, 2025 - ... Maximum number of x and y is: 28.0 Square root of y is: 2.0 Power of x and y is: 614656.0 Logarithm of x is: 3.332204510175204 Logarithm of y is: 1.3862943611198906 log10 of x is: 1.4471580313422192 log10 of y is: 0.6020599913279624 log1p of x is: 3.367295829986474 exp of a is: ...
🌐
Delft Stack
delftstack.com › home › howto › java › java mathematical library
Best Math Libraries Every Java Developer Should Know | Delft Stack
December 11, 2023 - It is a highly rated, trusted, and frequently used open-source math library from the famous Apache organization. ... Right-click your project from your favorite IDE, got to build path > configure build path > libraries > add external jar file. ... Create a folder Demo, paste your library jar file in the folder. Now, create a simple program like the following (a demo for you, it can be anything that uses any library). Code `Demo.java`: ```java import org.apache.commons.math3.fraction.Fraction; public class Demo { public static void main(String[] args) { /* * double[] n = { 1.1, 1.2, 1.3, 1.4, 2
🌐
Medium
medium.com › @AlexanderObregon › beginners-guide-to-java-math-21edc9cc1ee0
Java Math Guide for Beginners | Medium
March 9, 2024 - Explore our beginner's guide to Java Math, including basic operations, the Math class, and real-world examples, to boost your Java programming skills.
🌐
GitHub
github.com › TilmanNeumann › java-math-library
GitHub - TilmanNeumann/java-math-library: A Java math library focused on number theory and integer factorization in particular.
TinyEcm64MHInlined: Java version of YaFu's fast tinyEcm.c for numbers <= 62 bit. CFrac63, CFrac: CFrac implementations working on longs rsp. BigIntegers internally. SIQS: Single-threaded self-initializing quadratic sieve (SIQS). PSIQS: Multi-threaded SIQS. PSIQS_U: Faster multi-threaded SIQS, using native memory access via sun.misc.Unsafe. The factoring methods are used to implement a fast sumOfDivisors() function. Another prominent subject in this library is prime generation and testing.
Starred by 33 users
Forked by 8 users
Languages   Java 100.0% | Java 100.0%
Top answer
1 of 3
1

You can use the Symja - Java computer algebra and symbolic math library.

import org.matheclipse.core.eval.ExprEvaluator;
import org.matheclipse.core.expression.F;
import org.matheclipse.core.interfaces.IAST;
import org.matheclipse.core.interfaces.IExpr;
import org.matheclipse.core.interfaces.ISymbol;
import org.matheclipse.parser.client.SyntaxError;

public class Example {
  public static void main(String[] args) {
    try {
      ExprEvaluator util = new ExprEvaluator(false, (short) 100);

      // Convert an expression to the internal Java form:
      // Note: single character identifiers are case sensitive
      // (the "D()" function identifier must be written as upper case character)
      String javaForm = util.toJavaForm("4*x + x - 20 + 10");
      // prints: Plus(ZZ(-20L),x,Times(C4,x),C10)
      System.out.println("Out[1]: " + javaForm.toString());

      // Use the Java form to create an expression with F.* static methods:
      ISymbol x = F.Dummy("x");
      IAST function = F.Plus(F.ZZ(-20L), x, F.Times(F.C4, x), F.C10);
      IExpr result = util.eval(function);
      // print: -10+5*x
      System.out.println("Out[2]: " + result.toString());
    } catch (SyntaxError e) {
      // catch Symja parser errors here
      System.out.println(e.getMessage());
    } catch (RuntimeException rex) { 
      System.out.println(rex.getMessage());
    }
  }
}
2 of 3
0

DataMelt (http://jwork.org/dmelt) does this. Here is an example (I use Jython, but you can use Java too)

from jhplot.math import *  
from jhplot import *
j=Symbolic("jscl") # using jscl engine
print j.simplify("(x + 1)^(1/x)") == "(1+x)^(1/x)" 
print j.simplify("(x^2-1)/(x-1)") == "1+x"

This code returns "true" for all such simplifications

🌐
Java Almanac
javaalmanac.io › jdk › 1.2 › api › java › lang › Math.html
Java Platform 1.2 API Specification: Class Math
Computes the remainder operation on two arguments as prescribed by the IEEE 754 standard. The remainder value is mathematically equal to f1 - f2 × n, where n is the mathematical integer closest to the exact mathematical value of the quotient f1/f2, and if two mathematical integers are equally close to f1/f2, then n is the integer that is even.
🌐
Oracle
docs.oracle.com › javase › › 7 › docs › api › java › lang › Math.html
Math (Java Platform SE 7 )
Java™ Platform Standard Ed. 7 ... The class Math contains methods for performing basic numeric operations such as the elementary exponential, logarithm, square root, and trigonometric functions.