Permalink
3 comments
on commit
sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add "use fpu reciprocal" to avoid loss of precision
This code has been contributed by Schrödinger's cat See https://tex.stackexchange.com/a/529159/38080 Use it as a key in paths or in "circuitikz" environments when needed
- Loading branch information
Showing
with
16 additions
and 0 deletions.
- +1 −0 tex/circuitikz.sty
- +14 −0 tex/pgfcircutils.tex
- +1 −0 tex/t-circuitikz.tex
This comment has been minimized.
Please correct this code to use this:
As I've already noted on the PGF bugtracker the original version of
use fpu reciprocalis extremely inefficient, because on every invocation it loads the entire FPU and reparses an expression that is already know to be a number. By using the internal FPU functions we can sidestep all of this and achieve a speedup of about 3x.In the example below I spin every function for identical input 10000 times. The “lengths” are in seconds, i.e. 2.4336pt = 2.4336 seconds.
This comment has been minimized.
Thanks! I will add this as soon as the end of my vacations... (too early, I fear ;-))
This comment has been minimized.
Anyway, with any recent Tikz, circuitikz will use the internal function:
circuitikz/tex/pgfcircutils.tex
Lines 79 to 90 in c23fd5d
...so probably it's already using your code most of the time (I think!).