<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">The default if it’s a Floating type is Double. Leaving the type polymorphic breaks sharing, though, and that’s a common cause of perf issues with Num/Integral/Floating a => a computations.<div class=""><br class=""></div><div class="">Best to post code when asking questions like this.</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 4, 2016, at 6:08 PM, Tim Perry <<a href="mailto:tim.v2.0@gmail.com" class="">tim.v2.0@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I imagine that in this program when Double isn't specified the compiler doesn't assign a "hardware optimized" number type. Consequently it isn't using the specialized functions that are used for 64-bit floating point numbers. When the program specifies it is receiving the "Double" values, then it does use the "hardware optimized" data types.</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, May 4, 2016 at 3:12 PM, Ben Rogalski <span dir="ltr" class=""><<a href="mailto:bwrogalski@gmail.com" target="_blank" class="">bwrogalski@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class=""><div class="">I have found that using the type Double in a type signature causes my program to run much faster than if I use a type variable with a Num constraint.<br class=""><br class=""></div>Is this common, and if so, why is explicitly using Double faster?<br class=""></div></div>
<br class="">_______________________________________________<br class="">
Beginners mailing list<br class="">
<a href="mailto:Beginners@haskell.org" class="">Beginners@haskell.org</a><br class="">
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank" class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br class="">
<br class=""></blockquote></div><br class=""></div>
_______________________________________________<br class="">Beginners mailing list<br class=""><a href="mailto:Beginners@haskell.org" class="">Beginners@haskell.org</a><br class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners<br class=""></div></blockquote></div><br class=""></div></body></html>