← Back to context

Comment by pveierland

7 hours ago

Got curious to see whether SymPy could be used to evaluate the expressions, so I used Claude Code to build a quick evaluator. Numeric and symbolic results appear to agree:

    nix run github:pveierland/eml-eval
    EML Evaluator — eml(x, y) = exp(x) - ln(y)
    Based on arXiv:2603.21852v2 by A. Odrzywołek
    
    Constants
    ------------------------------------------------------------------------------
      1        K=1    d=0    got 1                    expected 1                    sym=ok   num=ok   [simplify]
      e        K=3    d=1    got 2.718281828          expected 2.718281828          sym=ok   num=ok   [simplify]
      0        K=7    d=3    got 0                    expected 0                    sym=ok   num=ok   [simplify]
      -1       K=17   d=7    got -1                   expected -1                   sym=ok   num=ok   [simplify]
      2        K=27   d=9    got 2                    expected 2                    sym=ok   num=ok   [simplify]
      -2       K=43   d=11   got -2                   expected -2                   sym=ok   num=ok   [simplify]
      1/2      K=51   d=15   got 0.5                  expected 0.5                  sym=ok   num=ok   [simplify]
      -1/2     K=67   d=17   got -0.5                 expected -0.5                 sym=ok   num=ok   [simplify]
      2/3      K=103  d=19   got 0.6666666667         expected 0.6666666667         sym=ok   num=ok   [simplify]
      -2/3     K=119  d=21   got -0.6666666667        expected -0.6666666667        sym=ok   num=ok   [simplify]
      sqrt2    K=85   d=21   got 1.414213562          expected 1.414213562          sym=ok   num=ok   [simplify]
      i        K=75   d=19   got i                    expected i                    sym=ok   num=ok   [i²=-1, simplify]
      pi       K=153  d=29   got 3.141592654          expected 3.141592654          sym=ok   num=ok   [simplify]
    
    Unary functions  (x = 7/3)
    ------------------------------------------------------------------------------
      exp(x)   K=3    d=1    got 10.3122585           expected 10.3122585           sym=ok   num=ok   [simplify]
      ln(x)    K=7    d=3    got 0.8472978604         expected 0.8472978604         sym=ok   num=ok   [simplify]
      -x       K=17   d=7    got -2.333333333         expected -2.333333333         sym=ok   num=ok   [simplify]
      1/x      K=25   d=8    got 0.4285714286         expected 0.4285714286         sym=ok   num=ok   [simplify]
      x - 1    K=11   d=4    got 1.333333333          expected 1.333333333          sym=ok   num=ok   [simplify]
      x + 1    K=27   d=9    got 3.333333333          expected 3.333333333          sym=ok   num=ok   [simplify]
      2x       K=67   d=17   got 4.666666667          expected 4.666666667          sym=ok   num=ok   [simplify]
      x/2      K=51   d=15   got 1.166666667          expected 1.166666667          sym=ok   num=ok   [simplify]
      x^2      K=41   d=10   got 5.444444444          expected 5.444444444          sym=ok   num=ok   [simplify]
      sqrt(x)  K=59   d=16   got 1.527525232          expected 1.527525232          sym=ok   num=ok   [simplify]
    
    Binary operations  (x = 7/3, y = 5/2)
    ------------------------------------------------------------------------------
      x + y    K=27   d=9    got 4.833333333          expected 4.833333333          sym=ok   num=ok   [simplify]
      x - y    K=11   d=4    got -0.1666666667        expected -0.1666666667        sym=ok   num=ok   [simplify]
      x * y    K=41   d=10   got 5.833333333          expected 5.833333333          sym=ok   num=ok   [simplify]
      x / y    K=25   d=8    got 0.9333333333         expected 0.9333333333         sym=ok   num=ok   [simplify]
      x ^ y    K=49   d=12   got 8.316526261          expected 8.316526261          sym=ok   num=ok   [simplify]