* bug#13757: Problems with Guile's number printer
[not found] ` <87txp9nrmc.fsf_-_@tines.lan>
@ 2013-02-19 8:18 ` Andy Wingo
2013-03-17 23:47 ` bug#12216: " Mark H Weaver
2013-03-18 1:29 ` bug#13757: " Mark H Weaver
0 siblings, 2 replies; 7+ messages in thread
From: Andy Wingo @ 2013-02-19 8:18 UTC (permalink / raw)
To: 13757; +Cc: Daniel Llorens
Hi,
I'm redirecting the number printing conversation to bug-guile, so that
we can track it. Thanks for the debugging!
On Tue 19 Feb 2013 00:12, Mark H Weaver <mhw@netris.org> writes:
> Andy Wingo <wingo@pobox.com> writes:
>
>> On Wed 23 Jan 2013 13:20, Daniel Llorens <daniel.llorens@bluewin.ch> writes:
>>
>>> scheme@(guile-user)> (f64vector-ref #s64(1 2 3) 0)
>>> $1 = #.#
>>
>> Here you are interpreting an int64 as a double, which should work, but
>> this printed result is really bizarre and looks like a bug in our number
>> printer. Mark? :)
>
> Yes, our number printer is seriously flawed and needs a rewrite. It
> prints subnormal[1] floats as "#.#", and even in typical cases often
> fails to print enough digits to get the same number back when you read
> it back in.
>
> Note that this also affects compiled code involving numbers, because the
> compiler serializes numbers using 'number->string'. For example,
> (* 1e-155 1e-155) returns #f at the REPL, because peval turns this into
> a constant which happens to be a subnormal. During assembly it serializes
> this to "#.#", and then 'string->number' returns #f.
>
> Also, 3.14159265358979323846264338327950288419716939937510582097494, if
> compiled, fails to produce the float closest to pi. (acos -1) works
> properly, but only because this expression is not currently folded to a
> constant by the compiler.
>
> I've already started work on this (based on "Printing Floating-Point
> Numbers Quickly and Accurately" by Burger and Dybvig) but got
> distracted.
>
> Mark
>
> [1] http://en.wikipedia.org/wiki/Subnormal_number
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#12216: Problems with Guile's number printer
2013-02-19 8:18 ` bug#13757: Problems with Guile's number printer Andy Wingo
@ 2013-03-17 23:47 ` Mark H Weaver
2013-03-18 1:28 ` Mark H Weaver
2013-03-18 1:29 ` bug#13757: " Mark H Weaver
1 sibling, 1 reply; 7+ messages in thread
From: Mark H Weaver @ 2013-03-17 23:47 UTC (permalink / raw)
To: Andy Wingo; +Cc: 12216-done, Daniel Llorens
I've pushed 1ea37620c2c1794f7685b312d2530676a078ada7 to stable-2.0,
which fixes our number printer. Closing this bug.
Thanks,
Mark
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#12216: Problems with Guile's number printer
2013-03-17 23:47 ` bug#12216: " Mark H Weaver
@ 2013-03-18 1:28 ` Mark H Weaver
0 siblings, 0 replies; 7+ messages in thread
From: Mark H Weaver @ 2013-03-18 1:28 UTC (permalink / raw)
To: Andy Wingo; +Cc: Daniel Llorens, 12216
I wrote:
> I've pushed 1ea37620c2c1794f7685b312d2530676a078ada7 to stable-2.0,
> which fixes our number printer. Closing this bug.
Sorry, I sent this to the wrong bug. Oops :)
Mark
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#13757: Problems with Guile's number printer
2013-02-19 8:18 ` bug#13757: Problems with Guile's number printer Andy Wingo
2013-03-17 23:47 ` bug#12216: " Mark H Weaver
@ 2013-03-18 1:29 ` Mark H Weaver
1 sibling, 0 replies; 7+ messages in thread
From: Mark H Weaver @ 2013-03-18 1:29 UTC (permalink / raw)
To: Andy Wingo; +Cc: 13757-done, Daniel Llorens
I've pushed 1ea37620c2c1794f7685b312d2530676a078ada7 to stable-2.0,
which fixes our number printer. Closing this bug.
Thanks,
Mark
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#14047: more aggressive inlining
[not found] ` <87k3prlai3.fsf@pobox.com>
@ 2013-03-25 9:42 ` Daniel Llorens
2013-03-27 19:31 ` Andy Wingo
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Llorens @ 2013-03-25 9:42 UTC (permalink / raw)
To: 14047
On Mar 1, 2013, at 10:44, Andy Wingo wrote:
> On Fri 01 Mar 2013 10:01, Daniel Llorens <daniel.llorens@bluewin.ch> writes:
>
>> scheme@(guile-user)> ,optimize (vector-ref #(1 2 3) 0)
>> $1 = 1
>> scheme@(guile-user)> ,optimize (array-ref #(1 2 3) 0)
>> $2 = (array-ref '#(1 2 3) 0)
>
> File a bug for this case, this sort of thing is totally fixable :)
So I think this use of array-ref should be inlined.
Same for other simple functions such as e.g.
scheme@(guile-user)> ,optimize (real-part 1+1i)
$1 = (real-part 1.0+1.0i)
scheme@(guile-user)>
imag-part, magnitude, and so on.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#14047: more aggressive inlining
2013-03-25 9:42 ` bug#14047: more aggressive inlining Daniel Llorens
@ 2013-03-27 19:31 ` Andy Wingo
2013-03-27 20:40 ` Daniel Llorens
0 siblings, 1 reply; 7+ messages in thread
From: Andy Wingo @ 2013-03-27 19:31 UTC (permalink / raw)
To: Daniel Llorens; +Cc: 14047
On Mon 25 Mar 2013 10:42, Daniel Llorens <daniel.llorens@bluewin.ch> writes:
>> On Fri 01 Mar 2013 10:01, Daniel Llorens <daniel.llorens@bluewin.ch> writes:
>>
>>> scheme@(guile-user)> ,optimize (vector-ref #(1 2 3) 0)
>>> $1 = 1
>>> scheme@(guile-user)> ,optimize (array-ref #(1 2 3) 0)
>>> $2 = (array-ref '#(1 2 3) 0)
>>
>> File a bug for this case, this sort of thing is totally fixable :)
>
> So I think this use of array-ref should be inlined.
>
> Same for other simple functions such as e.g.
>
> scheme@(guile-user)> ,optimize (real-part 1+1i)
> $1 = (real-part 1.0+1.0i)
> scheme@(guile-user)>
>
> imag-part, magnitude, and so on.
If you would like to make a precise list, that would be helpful.
Cheers,
A
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#14047: more aggressive inlining
2013-03-27 19:31 ` Andy Wingo
@ 2013-03-27 20:40 ` Daniel Llorens
0 siblings, 0 replies; 7+ messages in thread
From: Daniel Llorens @ 2013-03-27 20:40 UTC (permalink / raw)
To: Andy Wingo; +Cc: 14047
On Mar 27, 2013, at 20:31, Andy Wingo wrote:
> If you would like to make a precise list, that would be helpful.
At least everything from §6.6.2.7 to §6.6.2.13 in http://www.gnu.org/software/guile/manual/html_node/
I've noticed that a few of these are already reduced, it seems quite random. For example everything in §6.6.2.8 is reduced, then logand is reduced but logior is not.
odd? *
even? *
quotient
modulo
remainder
gcd
lcm
modulo-expt
exact-integer-sqrt
make-rectangular
make-polar
real-part
imag-part
magnitude
angle
abs
min
max
truncate
round
floor
ceiling
euclidean/, -quotient, -remainder
floor/, -quotient, -remainder
ceiling/, -quotient, -remainder
truncate/, -quotient, -remainder
centered/, -quotient, -remainder
round/, -quotient, -remainder
sqrt
expt
sin
cos
tan
asin
acos
atan
exp
log
log10
sinh
cosh
tanh
asinh
acosh
atanh
logand *
logior
lognot *
logtest
ash *
logcount
integer-length
integer-expt
bit-extract
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-03-27 20:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.153.1351958430.10005.guile-devel@gnu.org>
[not found] ` <0F432FA1-CFF8-4A22-A477-5291A1B9925D@bluewin.ch>
[not found] ` <87ip9mgzp4.fsf@gnu.org>
[not found] ` <878v7m5xdh.fsf@pobox.com>
[not found] ` <2E5FFE0D-9001-409C-BCD4-9EE3BF9883F0@bluewin.ch>
[not found] ` <87mww0nu8l.fsf@pobox.com>
[not found] ` <2D31D517-08F8-4D07-84DB-098E335AE0AD@bluewin.ch>
[not found] ` <874nh9boqe.fsf@pobox.com>
[not found] ` <87txp9nrmc.fsf_-_@tines.lan>
2013-02-19 8:18 ` bug#13757: Problems with Guile's number printer Andy Wingo
2013-03-17 23:47 ` bug#12216: " Mark H Weaver
2013-03-18 1:28 ` Mark H Weaver
2013-03-18 1:29 ` bug#13757: " Mark H Weaver
[not found] ` <96617E9F-D83C-48EE-B84D-7CD45C4181C2@bluewin.ch>
[not found] ` <CA+U71=Pj1Ywr1Ay+w-u1jWd4ZZ8Xk1b27YEg-ME8JRVchYRuCA@mail.gmail.com>
[not found] ` <441E015F-F545-48DF-AF96-E1FEA64F64A3@bluewin.ch>
[not found] ` <CA+U71=MvGqHWqLgF5BOUiVCmimwPChmRwehJ0VQhACEPBDLzTg@mail.gmail.com>
[not found] ` <14C63C7B-DEA6-4C0C-AB18-17695BC5FAD3@bluewin.ch>
[not found] ` <87k3prlai3.fsf@pobox.com>
2013-03-25 9:42 ` bug#14047: more aggressive inlining Daniel Llorens
2013-03-27 19:31 ` Andy Wingo
2013-03-27 20:40 ` Daniel Llorens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).