#! /usr/bin/dc
#
# Calculates ln(x) using Taylor Series. x is read from stdin.
#

67k
52 sr	# Repetitions

? sx

# Terms x, repetition
[
Sr 1 - lr ^ lr / _1 Lr 1 - ^ *
] sT

[
lx lr lT x +
lr 1 - d sr 0 !=M
] sM

0
lM x p
