Timeline for answer to Calculate values of standard normal distribution table as macro by jps
Current License: CC BY-SA 4.0
Post Revisions
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| 10 hours ago | comment | added | user691586 | @jps thanks for these interesting timings... maybe xint is a bit more nimble with powers, which Horner's method avoids. It is possible that for algebra l3fp is only a bit faster than xint, for the math functions it is more convincingly faster which however is not completely surprising as xint is multi-precision, not only 16 decimal digits. | |
| 12 hours ago | history | edited | jps | CC BY-SA 4.0 |
added 105 characters in body
|
| 12 hours ago | comment | added | jps |
@user691586 well, l3fp isn't know to be the fastest, it's known to be one of the most precise :) If you aim for speed consider rewriting the polynomial using Horner's method. If I do that for your xintexpr based document compiling it takes 2.9s, while after sticking my l3fp-function into your \SN the entire document took 1.7s. So in this case l3fp was faster for this. Without Horner's l3fp took 4.0s and xintexpr only 3.8s.
|
|
| 17 hours ago | comment | added | user691586 |
+1. I injected your l3fp code in my answer and used \NewDocumentCommand\SN{O{5} m}{\np{\fpeval{round(Phi(#2), #1)}}} (so \np from numprint is used in both cases for fair comparison) A bit to my surprise, it seems pdflatex takes about 5% more time with the l3fp code than with the xint one. Apart from that it seems \fpeval trims trailing zero and I don't know how to reinject them.
|
|
| yesterday | history | edited | jps | CC BY-SA 4.0 |
added 926 characters in body
|
| yesterday | comment | added | cis | Yes, that solves it in the sense of task setter. :() | |
| yesterday | history | answered | jps | CC BY-SA 4.0 |