This site is supported by donations to The OEIS Foundation.

# Quasilogarithms

(Redirected from Quasilog)

Email from David W. Wilson, Sun, Oct 16, 2011 at 8:24 PM

I just wanted to make clear that I coined the term "quasilogarithm" to describe my proposed plotting scale. I had not checked to see if the term might already be defined. When I performed a quick Google search on "quasilogarithm", I found the terms "quasilog", "quasilogarithm", and "quasilogarithmic" used in several places, but a quick perusal showed that most of these references were nontechnical descriptions meaning "like a logarithm." Therefore, I think we are safe to appropriate the term and assign it the technical meaning you give in the wiki page.

(...)

The quasilogarithm (quasilog) function is a plotting scale used by the OEIS to plot values for sequences with large ranges. Prior to adoption of the quasilog scale, OEIS graphs employed variants of the log scale that plotted negative values above the X-axis. The quasilog scale is an approximation to the log scale that plots moderate to large positive values very close to their log scale coordinates, while plotting negative values below the X-axis.

## Definition

### Base b quasiexponential and quasilogarithm

The (base ${\displaystyle \scriptstyle b\,}$) quasilogarithm of ${\displaystyle \scriptstyle x\,}$ is the inverse of the (base ${\displaystyle \scriptstyle b\,}$) quasiexponential of ${\displaystyle \scriptstyle x\,}$

${\displaystyle {\rm {qexp}}_{b}(x)\equiv b^{x}-b^{-x}=2{\rm {~sinh~}}(x\log b),\,}$

and is given by

${\displaystyle {\rm {qlog}}_{b}(x)\equiv \log _{b}{\Bigg (}{\frac {x}{2}}+{\sqrt {{\bigg (}{\frac {x}{2}}{\bigg )}^{2}+1}}{\Bigg )}={\frac {{\rm {arsinh}}{\big (}{\frac {x}{2}}{\big )}}{\log b}}.\,}$

For negative values of ${\displaystyle \scriptstyle x\,}$, to avoid underflow in the argument of the logarithm, it is better to use the equivalent formula

${\displaystyle {\rm {qlog}}_{b}(x)\equiv \log _{b}\left({\frac {-1}{{\frac {x}{2}}-{\sqrt {{\big (}{\frac {x}{2}}{\big )}^{2}+1}}}}\right)=-\log _{b}{\Bigg (}-{\frac {x}{2}}+{\sqrt {{\bigg (}{\frac {x}{2}}{\bigg )}^{2}+1}}{\Bigg )}.\,}$

### Natural base quasiexponential and quasilogarithm

The (base ${\displaystyle \scriptstyle e\,}$) quasilogarithm of ${\displaystyle \scriptstyle x\,}$ is the inverse of the (base ${\displaystyle \scriptstyle e\,}$) quasiexponential of ${\displaystyle \scriptstyle x\,}$

${\displaystyle {\rm {qexp}}(x)\equiv e^{x}-e^{-x}=2{\rm {~sinh~}}x,\,}$

and is given by

${\displaystyle {\rm {qlog}}(x)\equiv \log {\Bigg (}{\frac {x}{2}}+{\sqrt {{\bigg (}{\frac {x}{2}}{\bigg )}^{2}+1}}{\Bigg )}={\rm {arsinh}}{\bigg (}{\frac {x}{2}}{\bigg )}.\,}$

For negative values of ${\displaystyle \scriptstyle x\,}$, to avoid underflow in the argument of the logarithm, it is better to use the equivalent formula

${\displaystyle {\rm {qlog}}(x)\equiv \log \left({\frac {-1}{{\frac {x}{2}}-{\sqrt {{\big (}{\frac {x}{2}}{\big )}^{2}+1}}}}\right)=-\log {\Bigg (}-{\frac {x}{2}}+{\sqrt {{\bigg (}{\frac {x}{2}}{\bigg )}^{2}+1}}{\Bigg )}.\,}$

## Asymptotic behavior of quasiexponential and quasilogarithm

${\displaystyle \lim _{x\to \infty }{\rm {qexp}}_{b}(x)=b^{x}\,}$
${\displaystyle \lim _{x\to -\infty }{\rm {qexp}}_{b}(x)=-b^{-x}\,}$
${\displaystyle \lim _{x\to \infty }{\rm {qlog}}_{b}(x)=\log _{b}(x)\,}$
${\displaystyle \lim _{x\to -\infty }{\rm {qlog}}_{b}(x)=-\log _{b}(-x)\,}$

## Improvement can be made to the log plots

### Improvement can be made to the log plots with qlog_10(n) = arsinh(a(n)/2) / ln 10

 7.8010329675812     ${\displaystyle \scriptstyle {\rm {qlog}}_{10}(F(n))\,}$
−7.8010329675812

David Wilson, [1], posting to SeqFan on Oct 13 2011:


---------- Forwarded message ----------
From: David Wilson <davidwwilson@comcast.net>
To: Sequence Fanatics Discussion list <seqfan@list.seqfan.eu>
Date: Wed, 12 Oct 2011 22:14:02 -0400
Subject: [seqfan] Chewing an old bone
Some time ago, I made a suggestion for improving the OEIS graphs. At the time, most of the seqfans
seemed  favorable to the idea, but it eventually dropped off the radar. I still think it's a good
idea, so I'm resurrecting it to see if it might fly.

(In the following, log means log_10).

In the current OEIS sequence scatter plots:

- For small valued sequences (e.g. A001511), a(n) is plotted.
- For large positive valued sequences (e.g. A000041), log(a(n)+1) is plotted.
- For large valued sequences with negtive values, (e.g, A103718), log(|a(n)|+1) is plotted.

I think an improvement can be made to the log plots. Specifically, log(|a(n)|+1) maps both a(n) = x
and a(n) = -x to the same value above the x-axis, which makes it impossible to distinguish positive
and negative sequence values in a log scatter plot. To see the effect, look at the graphs of A103718.
The sequence values alternate between positive and negative values, which is apparent from the pin plot,
but is not deducible from the scatter plot.

My suggestion to improve this situation is as follows: For large-valued sequences, instead of plotting
log(a(n)+1) or log(|a(n)|+1), plot

qlog(n) = arcsinh(a(n)/2)/(ln 10)

(qlog stands for quasilog). You can think of qlog as a sign-preserving log. From a graphing standpoint,
a qlog plot has many of the desirable features of a log plot, most notably, it shrinks very large values
into a reasonable plot range. qlog has the additional desirable features:

- qlog is defined and continuous on domain R:
- no tweaks needed to plot values <= 0 as with log.
- suitable for plotting integer sequences, since Z is a subset of R
- also suitable for plotting real functions if the need arises
- qlog is monotonically increasing:
- increases and decreases in sequence values are preserved in the graph.
- ditto for sequences that include negative values.
- qlog is an odd function:
- signs of values are preserved in the plot.
- positive values plot above, negative values below, zero values on the x-axis.
- values of equal maginitude plot at equal distance from x-axis.
- |qlog(n)| is asymptotic to |log(n)|.
- for large positive n, qlog(n) is very close to log(n).
- for large negative n, qlog(n) is very close to -log(-n).
- for |n| >= 5, the relative difference is < 2%, and shrinks quickly with increasing n.
- for positive valued sequences, qlog plots are visually equivalent to log plots.

Perhaps the OEIS might consider replacing its log plots with qlog plots.



### Improvement can be made to the log plots with sgn(a(n)) * log_10(|a(n)|+1)

Alois Heinz, [2], posting to SeqFan on Oct 13 2011:


---------- Forwarded message ----------
From: Alois Heinz <heinz@hs-heilbronn.de>
To: Sequence Fanatics Discussion list <seqfan@list.seqfan.eu>
Date: Thu, 13 Oct 2011 11:36:39 +0200
Subject: [seqfan] Re: Chewing an old bone

The idea is good.

But why not

signum(a(n)) * log(|a(n)|+1)

which is compatible with log(|a(n)|+1) for nonnegative sequences?

Alois



### Comparison of the two functions with sgn(a(n)) * log_10(|a(n)|)

 8
−8
 8.0000000043429
−8.0000000043429

Comparison with ${\displaystyle \scriptstyle {\rm {sgn}}(a(n))\cdot \log _{10}(|a(n)|),\,a(n)={\rm {sgn}}(n)\cdot 10^{|n|},\,-8\,\leq \,n\,\leq \,8.\,}$
-8 -8 -8 -8.0000000043429
-7 -7 -7 -7.0000000434294
-6 -6.0000000000004 -6 -6.0000004342943
-5 -5.0000000000434 -5 -5.0000043429231
-4 -4.0000000043429 -4 -4.0000434272769
-3 -3.0000004342938 -3 -3.0004340774793
-2 -2.0000434229352 -2 -2.0043213737826
-1 -1.0042792113563 -1 -1.0413926851582
0 0.20898764024998 undefined 0.30102999566398
1 1.0042792113563 1 1.0413926851582
2 2.0000434229352 2 2.0043213737826
3 3.0000004342938 3 3.0004340774793
4 4.0000000043429 4 4.0000434272769
5 5.0000000000434 5 5.0000043429231
6 6.0000000000004 6 6.0000004342943
7 7 7 7.0000000434294
8 8 8 8.0000000043429

David Wilson, [3], posting to SeqFan on Oct 13 2011:


---------- Forwarded message ----------
From: David Wilson <davidwwilson@comcast.net>
To: Sequence Fanatics Discussion list <seqfan@list.seqfan.eu>
Date: Thu, 13 Oct 2011 20:35:37 -0400
Subject: [seqfan] Re: Chewing an old bone
From a visual standpoint, your function would probably work just as well, although it turns
out that |qlog(x)| is closer to |log(x)| than is your proposed function for every nonzero x.

BTW, qlog is the inverse of f(x) = 10^x - 10^-x, which if you contemplate for a bit, explains
why it hugs log so closely for large values.