{"action":"closed","issue":{"url":"https://api.github.com/repos/codeplea/tinyexpr/issues/10","repository_url":"https://api.github.com/repos/codeplea/tinyexpr","labels_url":"https://api.github.com/repos/codeplea/tinyexpr/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/codeplea/tinyexpr/issues/10/comments","events_url":"https://api.github.com/repos/codeplea/tinyexpr/issues/10/events","html_url":"https://github.com/codeplea/tinyexpr/issues/10","id":172375304,"number":10,"title":"Addition to benchmark suite","user":{"login":"ArashPartow","id":513642,"avatar_url":"https://avatars.githubusercontent.com/u/513642?v=3","gravatar_id":"","url":"https://api.github.com/users/ArashPartow","html_url":"https://github.com/ArashPartow","followers_url":"https://api.github.com/users/ArashPartow/followers","following_url":"https://api.github.com/users/ArashPartow/following{/other_user}","gists_url":"https://api.github.com/users/ArashPartow/gists{/gist_id}","starred_url":"https://api.github.com/users/ArashPartow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArashPartow/subscriptions","organizations_url":"https://api.github.com/users/ArashPartow/orgs","repos_url":"https://api.github.com/users/ArashPartow/repos","events_url":"https://api.github.com/users/ArashPartow/events{/privacy}","received_events_url":"https://api.github.com/users/ArashPartow/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2016-08-22T06:03:41Z","updated_at":"2016-08-24T01:23:34Z","closed_at":"2016-08-24T01:23:34Z","body":"I've added added TinyExpr to the following mathematical expression benchmark suite:\r\nhttps://github.com/ArashPartow/math-parser-benchmark-project\r\n\r\nThe specific code can be found here:\r\nhttps://github.com/ArashPartow/math-parser-benchmark-project/blob/master/src/BenchTinyExpr.cpp\r\n\r\nIf possible could you review the above and make sure, the library is being used correctly and that there's no unintended _latencies_ being added.\r\n\r\nHere is an example run:\r\n\r\n```\r\nExpression 92 of 205: \"abs(sin(sqrt(a^2+b^2)))\"; Progress: ############\r\n[01] ExprTk               ( 64.072 ns, 0.630283156548410717,  630283.156537625589407980)\r\n[02] muparserSSE          ( 68.056 ns, 0.630283117294311523,  630283.117294311523437500)\r\n[03] ExprTkFloat          ( 68.758 ns, 0.630283117294311523,  630283.117294311523437500)\r\n[04] atmsp 1.0.4          ( 74.571 ns, 0.630283156548410717,  630283.156537625589407980)\r\n[05] FParser 4.5          ( 74.707 ns, 0.630283156548410717,  630283.156537625589407980)\r\n[06] muparser 2.2.4       ( 81.762 ns, 0.630283156548410717,  630283.156537625589407980)\r\n[07] muparser 2.2.4 (omp) ( 83.188 ns, 0.630283156548410717,  630283.156537625589407980)\r\n[08] MTParser             (123.360 ns, 0.630283156548410717,  630283.156537625589407980)\r\n[09] MathExpr             (251.873 ns, 0.630283156548410717,  630283.156537625589407980)\r\n[10] TinyExpr             (295.522 ns, 0.630283156548410717,  630283.156537625589407980)\r\n[11] Lepton               (408.594 ns, 0.630283156548410717,  630283.156537625589407980)\r\n[12] muparserx            (533.038 ns, 0.630283156548410717,  630283.156537625589407980)\r\n```\r\n___\r\n\r\nDuring integration of TinyExpr issues relating to compiler diagnostics during compilation of library  and bugs relating to expression parsing were found, here are some of the changes:\r\n\r\n1. https://github.com/ArashPartow/math-parser-benchmark-project/blob/master/tinyexpr/tinyexpr.c#L232\r\n2. https://github.com/ArashPartow/math-parser-benchmark-project/blob/master/tinyexpr/tinyexpr.h#L38\r\n3. https://github.com/ArashPartow/math-parser-benchmark-project/blob/master/tinyexpr/tinyexpr.h#L56\r\n\r\nWhen you get a chance, can you review the above changes and make sure they're correct, and don't add any unintended latencies or evaluation errors.\r\n\r\n___\r\n\r\nThere also seems to be general **precedence** and **associativity** issues with regards to the generated AST/evaluation. The following is one example of such problems:\r\n\r\n```\r\nExpression 61 of 96: \"-a^-b\"; Progress: ############\r\n[01] muparserSSE          ( 68.395 ns, -0.810841679573059082, -6154.623031616210937500)\r\n[02] ExprTk               ( 71.411 ns, -0.810841732005176952, -6154.623390711222782556)\r\n[03] atmsp 1.0.4          ( 72.180 ns, -0.810841732005176952, -6154.623390711222782556)\r\n[04] ExprTkFloat          ( 79.174 ns, -0.810841679573059082, -6154.623031616210937500)\r\n[05] MathExpr             ( 90.595 ns, -0.810841732005176952, -6154.623390711222782556)\r\n[06] FParser 4.5          ( 96.818 ns, -0.810841732005177063, -6154.623390711222782556)\r\n[07] muparser 2.2.4       (108.624 ns, -0.810841732005176952, -6154.623390711222782556)\r\n[08] muparser 2.2.4 (omp) (109.714 ns, -0.810841732005176952, -6154.623390711222782556)\r\n[09] Lepton               (362.571 ns, -0.810841732005176952, -6154.623390711222782556)\r\n[10] muparserx            (397.474 ns, -0.810841732005176952, -6154.623390711222782556)\r\nDNQ List\r\n[01] TinyExpr             ( 85.975 ns, 0.000000000000000000, 0.000000000000000000)\r\n```\r\n\r\nIn the following the call to **log** seems to have a different meaning to the one commonly used in programming languages (log is generally known as the natural logarithm base e (aka ln), where as TinyExpr seems to implement it as log base 10):\r\n```\r\nExpression 170 of 205: \"10^log(3+b)\"; Progress: ############\r\n[01] ExprTk         ( 86.773 ns,44.530608078220737411, 35146523.457089543342590332)\r\n[02] muparserSSE    ( 97.832 ns,44.530609130859375000, 35146521.568298339843750000)\r\n[03] ExprTkFloat    ( 99.054 ns,44.530609130859375000, 35146521.568298339843750000)\r\n[04] MTParser       (102.149 ns,44.530608078220737411, 35146523.457089543342590332)\r\n[05] muparser 2.2.4 (104.093 ns,44.530608078220737411, 35146523.457089543342590332)\r\n[06] atmsp 1.0.4    (104.925 ns,44.530608078220737411, 35146523.457089543342590332)\r\n[07] muparser 2.2.4 (105.696 ns,44.530608078220737411, 35146523.457089543342590332)\r\n[08] FParser 4.5    (118.495 ns,44.530608078220751622, 35146523.457089543342590332)\r\n[09] MathExpr       (127.893 ns,44.530608078220737411, 35146523.457089543342590332)\r\n[10] Lepton         (296.503 ns,44.530608078220737411, 35146523.457089543342590332)\r\n[11] muparserx      (418.354 ns,44.530608078220737411, 35146523.457089543342590332)\r\nDNQ List\r\n[01] TinyExpr       (117.324 ns, 5.200000000000001066, 4650000.000055111944675446)\r\n```\r\n\r\nHere's a list of only some of the problematic expressions, though running all the benchmarks results in a _great_ deal more:\r\n```\r\n(0.1*a+1)*a+1.1-sin(a)-log(a)/a*3/4 - incorrect result\r\n-(-b^2^3)+b^6    - incorrect result\r\n-a^(-b)          - incorrect result\r\n-a^+b            - incorrect result\r\n-a^-b            - incorrect result\r\n-a^-b+1.1        - incorrect result\r\n-a^-b/1.1        - incorrect result\r\n-a^2^3-a^8       - incorrect result\r\n-b^2^3-b^6       - incorrect result\r\n+a^+2^+3-a^+8    - incorrect result\r\n10^log(3+b)      - incorrect result\r\na-(e^(log(7+b))) - incorrect result\r\na^-2^-3-1/a^1/8  - incorrect result\r\na^-2^3-1/a^8     - incorrect result\r\na^2.2^3.3        - incorrect result\r\na^2.2^3.3-a^13.48946876053338489126547 - incorrect result\r\na^2.2^3.3^1.1    - incorrect result\r\na^2^3            - incorrect result\r\na^2^3-a^8        - incorrect result\r\ne^log(7*a)       - incorrect result\r\n```\r\n\r\n\r\n"}}
{"actor":{"display_login":"ArashPartow"}}