data/full_repos/permissive/214858095/FPGA_Exploration/spartan6/B205mini/ISE_Project/sim/general/sim_math.vh
 line:23: before: "function"
1: b"%Error: data/full_repos/permissive/214858095/FPGA_Exploration/spartan6/B205mini/ISE_Project/sim/general/sim_math.vh:122: Can't find definition of task/function: 'fabs'\n    x1 = fabs(x)*1.44269504;\n         ^~~~\n%Error: Exiting due to 1 error(s)\n"
function real log;
  input x;
  real x;
  real re,log2;
  integer i;
  begin
    if (x <= 0.0)
      begin
        $display("log illegal argument:",x);
        $stop;
        log = 0;
      end
    else
      begin
        if (x<1.0)
          re = 1.0/x;
        else
          re = x;
        log2 = 0.0;
        for (i=7; i>=-23; i=i-1)
          begin
            if (re > rootof2(i))
              begin
                re = re/rootof2(i);
                log2 = 2.0*log2 + 1.0;
              end
            else
              log2 = log2*2;
          end
        if (x < 1.0)
          log = -log2/12102203.16;
        else
          log = log2/12102203.16;
      end
    end
endfunction
function real log;

  input x;
  real x;
  real re,log2;
  integer i;
  begin
    if (x <= 0.0)
      begin
        $display("log illegal argument:",x);
        $stop;
        log = 0;
      end
    else
      begin
        if (x<1.0)
          re = 1.0/x;
        else
          re = x;
        log2 = 0.0;
        for (i=7; i>=-23; i=i-1)
          begin
            if (re > rootof2(i))
              begin
                re = re/rootof2(i);
                log2 = 2.0*log2 + 1.0;
              end
            else
              log2 = log2*2;
          end
        if (x < 1.0)
          log = -log2/12102203.16;
        else
          log = log2/12102203.16;
      end
    end
endfunction