I am interested in utilizing the logarithmic function within the BinFHE framework. However, I am not well-versed with the process. Could you guide me on how to achieve a logarithmic function simulation that is both swift and accurate through BinFHE? Additionally, if such a simulation is feasible, what would be the expected execution time? And does this process involve the employment of Look-Up Tables (LUTs)?

I can image how to simulate the easy function (such as max and min) but I have no idea how can i simualte the logarithmic function through LUT.
Thank you so much!

This does not seem to be an easy feat to do in BinFHE. Firstly, you can only evaluate functions that deal with small numbers using programmable bootstrapping, or you would need to build the log circuit (as you would build it for an FPGA or ASIC) and implement that in BinFHE. Secondly, log is a real-valued function, so thatâ€™s something you need to address in your implementation either using fixed-point or floating-point approaches.

But, are you specifically interested in implementing the log function in BinFHE, or are you open to other schemes such as CKKS? CKKS handles naturally floating point data. With BinFHE, you would need to use fix-point representation besides implementing the LUT scaling your data.

If this article changes your mind to consider CKKS instead, then you might want to look at this example, which shows how to approximately evaluate a function over a certain range.

Approximating log in CKKS would be more efficient and much simpler to implement in OpenFHE as shwon in the example above.

Thank you so much. Hi, if I just want to maintain rough accuracy and simply use the properties of the log function to turn multiplication into addition, is it possible to achieve this in BinFHE if the results only need to maintain a simple integer linear relationship? The maximum value I want to handle with the log function is just 1000. Is it possible to implement this, or can BinFHE be easily modified to achieve this?

To the best of my knowledge, this is challenging to implement in BinFHE. Your input is 10-bit wide and I am not sure that would be efficient to implement in BinFHE whether you use programmable bootstrapping or you build the log function as a lookup circuit.