(FPCore (x) :precision binary64 (tan (* (PI) x)))
\begin{array}{l} \\ \tan \left(\mathsf{PI}\left(\right) \cdot x\right) \end{array}
Sampling outcomes in binary64 precision:
Herbie found 5 alternatives:
Alternative | Accuracy | Speedup |
---|
(FPCore (x) :precision binary64 (tan (* (PI) x)))
\begin{array}{l} \\ \tan \left(\mathsf{PI}\left(\right) \cdot x\right) \end{array}
(FPCore (x) :precision binary64 (/ (sin (* (PI) x)) (fma (pow x 4.0) (fma (* -0.001388888888888889 (pow (PI) 6.0)) (* x x) (* (pow (PI) 4.0) 0.041666666666666664)) (fma (* -0.5 (* x x)) (* (PI) (PI)) 1.0))))
\begin{array}{l} \\ \frac{\sin \left(\mathsf{PI}\left(\right) \cdot x\right)}{\mathsf{fma}\left({x}^{4}, \mathsf{fma}\left(-0.001388888888888889 \cdot {\mathsf{PI}\left(\right)}^{6}, x \cdot x, {\mathsf{PI}\left(\right)}^{4} \cdot 0.041666666666666664\right), \mathsf{fma}\left(-0.5 \cdot \left(x \cdot x\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), 1\right)\right)} \end{array}
Initial program 51.2%
Taylor expanded in x around inf
lower-/.f64
N/A
lower-sin.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
lower-PI.f64
N/A
lower-cos.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
lower-PI.f64
51.2
Applied rewrites51.2%
Taylor expanded in x around 0
Applied rewrites90.4%
(FPCore (x) :precision binary64 (/ (sin (* (PI) x)) (fma (fma (* (* (pow (PI) 4.0) 0.041666666666666664) x) x (* (* (PI) (PI)) -0.5)) (* x x) 1.0)))
\begin{array}{l} \\ \frac{\sin \left(\mathsf{PI}\left(\right) \cdot x\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\left({\mathsf{PI}\left(\right)}^{4} \cdot 0.041666666666666664\right) \cdot x, x, \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -0.5\right), x \cdot x, 1\right)} \end{array}
Initial program 51.2%
Taylor expanded in x around inf
lower-/.f64
N/A
lower-sin.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
lower-PI.f64
N/A
lower-cos.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
lower-PI.f64
51.2
Applied rewrites51.2%
Taylor expanded in x around 0
Applied rewrites86.3%
(FPCore (x) :precision binary64 (/ (sin (* (PI) x)) (fma (* -0.5 (* x x)) (* (PI) (PI)) 1.0)))
\begin{array}{l} \\ \frac{\sin \left(\mathsf{PI}\left(\right) \cdot x\right)}{\mathsf{fma}\left(-0.5 \cdot \left(x \cdot x\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), 1\right)} \end{array}
Initial program 51.2%
Taylor expanded in x around inf
lower-/.f64
N/A
lower-sin.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
lower-PI.f64
N/A
lower-cos.f64
N/A
*-commutative
N/A
lower-*.f64
N/A
lower-PI.f64
51.2
Applied rewrites51.2%
Taylor expanded in x around 0
Applied rewrites71.9%
(FPCore (x) :precision binary64 (tan (* (PI) x)))
\begin{array}{l} \\ \tan \left(\mathsf{PI}\left(\right) \cdot x\right) \end{array}
Initial program 51.2%
(FPCore (x) :precision binary64 (* (PI) x))
\begin{array}{l} \\ \mathsf{PI}\left(\right) \cdot x \end{array}
Initial program 51.2%
Taylor expanded in x around 0
*-commutative
N/A
lower-*.f64
N/A
lower-PI.f64
49.6
Applied rewrites49.6%
herbie shell --seed 1
(FPCore (x)
:name "(tan (* (PI) x))"
:precision binary64
(tan (* (PI) x)))