[racket] Error propagation in `flexpt` [was: [racket-bug] all/14862: extflonum returns a different solution to flonum and mixed-integer calculations]

From: Mark Lee (mark at markelee.com)
Date: Mon Dec 1 19:37:36 EST 2014

On 12/01/2014 06:17 PM, Neil Toronto wrote:
> #lang racket
> (require racket/extflonum
>          math/bigfloat)
> (define phi.t 1.6180339887498948482t0)
> (real->extfl (bigfloat->real (bfexpt (bf (extfl->exact phi.t))
>                                      (bf 1474))))
> (extflexpt phi.t 1474.0t0)

To Neil,

The evaluation of your code indicates they are the same. Interestingly,
when my extfloat fibonacci code outputs a different solution from the
wolfram alpha solution. Since I see differences in the mixed-integer and
double flonum implementation, I think this is probably due to precision
in calculating the golden ratio since I'm not using the built in phi.
Thanks a lot!


---(extfl->exact-integer (fibonacci-binet-extfloat (->extfl 1474)))----

Posted on the users mailing list.