Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 13:58

    axkr on master

    fix spotbugs issue (compare)

  • Sep 24 15:33

    axkr on master

    Introduce some basic Sympy func… Improve/refactor Cacel() and Si… (compare)

  • Sep 21 23:11

    axkr on master

    io.pebbletemplates 3.1.6 (compare)

  • Sep 21 15:29
    axkr edited #582
  • Sep 21 11:16

    axkr on master

    Move DefaultDict to package o.m… (compare)

  • Sep 21 09:26

    dependabot[bot] on maven

    (compare)

  • Sep 21 09:26

    axkr on master

    Bump junit-jupiter-engine from … (compare)

  • Sep 21 09:26
    axkr closed #591
  • Sep 21 09:26

    dependabot[bot] on maven

    (compare)

  • Sep 21 09:26

    axkr on master

    Bump junit-vintage-engine from … (compare)

  • Sep 21 09:26
    axkr closed #590
  • Sep 21 04:17
    gitpod-io[bot] commented #591
  • Sep 21 04:17
    dependabot[bot] labeled #591
  • Sep 21 04:17
    dependabot[bot] labeled #591
  • Sep 21 04:17

    dependabot[bot] on maven

    Bump junit-jupiter-engine from … (compare)

  • Sep 21 04:17
    dependabot[bot] opened #591
  • Sep 21 04:17
    gitpod-io[bot] commented #590
  • Sep 21 04:16
    dependabot[bot] labeled #590
  • Sep 21 04:16
    dependabot[bot] labeled #590
  • Sep 21 04:16

    dependabot[bot] on maven

    Bump junit-vintage-engine from … (compare)

Axel Kramer
@axkr
you can check the numbers with method IExpr#isInexactNumber() if they are floating-point real or complex numbers
With EvalEngine#isDoubleMode() method you can check if the user runs a numeric evaluation:
OleksandrMariupol
@OleksandrMariupol
@axkr we can use this formula Gamma(x+n)/Gamma(x-n+1) instead (x)n = x(x-1)(x-2)......(x-n+1) but in case if we have a step " for example h = 0.5, etc", we should think, if we can replace f(x) f(x-h) f(x-2h) .... f(x-(k-1)h) with Gamma(x+n)/Gamma(x-n+1) or another formula which depends on Gamma". Work (x)n = Gamma(x+n)/Gamma(x-n+1) or another formula which depends on Gamma in case when we have custom step.
OleksandrMariupol
@OleksandrMariupol
Hi @axkr I did changes that I think you wanted to see. Please, let me know if I actually understood the requirements correct. In case if so, I do not understand the benefit
of those changes because of next:
  1. It does not seem to be shorter.
  2. For me it makes logic more confusing and less generalized if to look the entire function logic (I mean where we use similar while loops in both cases, for second case we can't use gamma)
factorialgamma.png
OleksandrMariupol
@OleksandrMariupol
Maybe I am missing something, can you please help me to understand?
Also, based on the information I found (I posted the screenshort above) n can't be anything else but 0 or positive integer. Maybe I should add a verification for this case and throw an exception if it fails? Please let me what do you think.
Thanks in advance for your time. Stay safe.
Axel Kramer
@axkr
Yes the screenshot shows the formulas for Java double values.
you can also use ApfloatMath.gamma(arg1)
for apfloat floating point numbers which can have higher precision than Java double values.
to evaluate for a higher precision you can use the N()function.
Axel Kramer
@axkr
Example N(FactorialPower(1/3, 7 ), 30)
but the arguments of the function should be symbolic.
breandan
@breandan
Hi Axel, I've been reading about SymJa. It's an amazing piece of work! I'm particularly impressed by the effort you've put into usability. Been reading through the source code and I'm not sure how it all fits together yet, but I was curious if you currently support or plan to implement Knuth–Bendix completion for general purpose term rewriting? Is there some documentation on how the different CAS's (e.g. JAS, Rubi) fit together? Can you describe your long-term goals for the project, i.e. do you plan to focus on the user-facing application and notebook support, or do you see Symja as becoming more of a library like Sympy? Thanks for your hard work on this project!
Axel Kramer
@axkr
@breandan Yes general purpose term rewriting is the goal. JAS is supported by converting from Symja IExpr to JAS and backward:
https://github.com/axkr/symja_android_library/blob/master/symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/convert/JASConvert.java.
The conversion of Rubi (Mathematica pattern matching rules) is described in this wiki page:
https://github.com/axkr/symja_android_library/wiki/Porting-Rubi-Integration-rules-to-Symja.
Symja is used currently in the Android and Apple Store NCalc programs by github user @tranleduy2000.
(Very) long term goal is to use Symja as a programming language (similar to Mathematica packages) and providing a JSON API interface (with NLP functions in the future?):
https://github.com/axkr/symja_android_library/wiki/API
Евгений Буйволов
@ereborDeveloper
Hello! Did you reduce Config.EXPLICIT_TIMES_OPERATOR? I can't use it anymore. How to enable times operator?
Axel Kramer
@axkr
@ereborDeveloper please use FEConfig.EXPLICIT_TIMES_OPERATOR
The project is now splitted in more maven submodules:
<module>matheclipse-external</module> <module>matheclipse-frontend</module> <module>matheclipse-core</module> <module>matheclipse-api</module> <module>matheclipse-io</module>
Евгений Буйволов
@ereborDeveloper
Thanks! Found it in unit tests. How should I properly listen for change log? Instead of reading commits I mean
Axel Kramer
@axkr
A short summary of changes can be found in the release notes:
Евгений Буйволов
@ereborDeveloper
Ahh! Thanks! Very helpful
TiMauzi
@TiMauzi
@axkr Hello, I just found the Symja project while looking for a Java CAS. Did you happen to publish any papers concerning your work on this library? Would be very helpful, since I am working on a thesis at the moment! Thank you in advance! :)
Axel Kramer
@axkr
@TiMauzi No there is no paper.
There is the tutorial with the available functions in markdown: https://github.com/axkr/symja_android_library/tree/master/symja_android_library/doc
A feature "highlight" is the port of the RUBI integration engine: https://github.com/axkr/symja_android_library/wiki/Porting-Rubi-Integration-rules-to-Symja
Axel Kramer
@axkr
Another is the "partial" Wolfram language package support: https://github.com/axkr/symja_android_library/wiki/Context
The Compile function https://github.com/axkr/symja_android_library/blob/master/symja_android_library/doc/functions/Compile.md will be independent from the JDK in next version and will be realized with the Janino compiler: http://janino-compiler.github.io/janino/
TiMauzi
@TiMauzi
@axkr Too bad there is no paper... Thank you nevetheless for the information! :)
TiMauzi
@TiMauzi
@axkr Different question... does Symja have a method to get all literals within an IExpr object? E.g. if I have "a || b && c || c", is there a function that returns "[a, b, c, c]"?
TiMauzi
@TiMauzi
@axkr Awesome, thank you!
TiMauzi
@TiMauzi
@axkr And is there a method to invert a logical expression with De Morgan's Laws? Something like "a || b" => "!(!a && !b)"?
TiMauzi
@TiMauzi
Something like "use only '&&' and '!' but no '||'"
TiMauzi
@TiMauzi

Nice, I think I managed already:

deMorgan1 = {x_ || y_ :> !(!x && !y)}
deMorgan2 = {x_ && y_ :> !(!x || !y)}
ReplaceRepeated(fox || rabbit || chicken, deMorgan1)

... leads to: ¬(¬fox∧¬rabbit∧¬chicken), perfect :)

Axel Kramer
@axkr
@TiMauzi I'm not sure what you want to get exactly, but BooleanConvert may also be an option?
TiMauzi
@TiMauzi
No, this is not what I want, since "a || b || c" would always stay the same with BooleanConvert, while I want it to become "!(!a && !b && !c)".
I want to write a formula with only "&&"s or only "||"s, and I think that's what my deMorgan1/deMorgan2 replacements are doing
TiMauzi
@TiMauzi

The BooleanVariables() function use this internally https://github.com/axkr/symja_android_library/blob/master/symja_android_library/doc/functions/BooleanVariables.md

@axkr Is there a way of outputting the list/set created by BooleanVariables() or Variables() to a Java list or Java array?

Without doing some usual pattern matching, of course :)
Axel Kramer
@axkr
@TiMauzi something like this?
private static List<IExpr> booleanVariables(final IExpr expr) {
      VariablesSet eVar = new VariablesSet();
      eVar.addBooleanVarList(expr);
      return eVar.getArrayList(); 
}
TiMauzi
@TiMauzi
I did it the following way now:
private static String[] getVariablesArray(IExpr variables) throws MathException, StackOverflowError, OutOfMemoryError {
    return variables.toString()
            .replaceAll("\\{", "")
            .replaceAll("}", "")
            .replaceAll(" ", "")
            .split(",");
}
With IExpr calcExpr = evaluator.eval("Variables(" + calc + ")"); and calc being my formula
And then getVariablesArray(calcExpr);
Since I need the string representation anyway, I think the effort is similar, no?
Axel Kramer
@axkr
If you use regex it might be slower: