
(FPCore (x tau) :precision binary32 (let* ((t_1 (* x (PI))) (t_2 (* t_1 tau))) (* (/ (sin t_2) t_2) (/ (sin t_1) t_1))))
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{PI}\left(\right)\\
t_2 := t\_1 \cdot tau\\
\frac{\sin t\_2}{t\_2} \cdot \frac{\sin t\_1}{t\_1}
\end{array}
\end{array}
Sampling outcomes in binary32 precision:
Herbie found 5 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x tau) :precision binary32 (let* ((t_1 (* x (PI))) (t_2 (* t_1 tau))) (* (/ (sin t_2) t_2) (/ (sin t_1) t_1))))
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{PI}\left(\right)\\
t_2 := t\_1 \cdot tau\\
\frac{\sin t\_2}{t\_2} \cdot \frac{\sin t\_1}{t\_1}
\end{array}
\end{array}
(FPCore (x tau) :precision binary32 (let* ((t_1 (* x (PI))) (t_2 (* t_1 tau))) (* (/ (sin t_2) t_2) (/ (sin t_1) t_1))))
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{PI}\left(\right)\\
t_2 := t\_1 \cdot tau\\
\frac{\sin t\_2}{t\_2} \cdot \frac{\sin t\_1}{t\_1}
\end{array}
\end{array}
Initial program 97.6%
(FPCore (x tau) :precision binary32 (let* ((t_1 (* (* x (PI)) tau))) (/ (sin t_1) t_1)))
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\\
\frac{\sin t\_1}{t\_1}
\end{array}
\end{array}
Initial program 97.6%
Taylor expanded in x around 0
Applied rewrites68.1%
(FPCore (x tau) :precision binary32 (let* ((t_1 (* x (PI)))) (/ (sin t_1) t_1)))
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{PI}\left(\right)\\
\frac{\sin t\_1}{t\_1}
\end{array}
\end{array}
Initial program 97.6%
Taylor expanded in x around 0
Applied rewrites22.2%
Taylor expanded in x around 0
Applied rewrites18.7%
Taylor expanded in x around 0
Applied rewrites60.1%
(FPCore (x tau) :precision binary32 (let* ((t_1 (* x (PI)))) (/ t_1 t_1)))
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{PI}\left(\right)\\
\frac{t\_1}{t\_1}
\end{array}
\end{array}
Initial program 97.6%
Taylor expanded in x around 0
Applied rewrites22.2%
Taylor expanded in x around 0
Applied rewrites18.7%
Taylor expanded in x around 0
Applied rewrites60.1%
Taylor expanded in x around inf
Applied rewrites59.4%
(FPCore (x tau) :precision binary32 (PI))
\begin{array}{l}
\\
\mathsf{PI}\left(\right)
\end{array}
Initial program 97.6%
Taylor expanded in x around 0
Applied rewrites68.1%
Taylor expanded in x around 0
Applied rewrites23.1%
herbie shell --seed 2024321
(FPCore (x tau)
:name "Lanczos kernel"
:precision binary32
:pre (and (and (<= 1e-5 x) (<= x 1.0)) (and (<= 1.0 tau) (<= tau 5.0)))
(* (/ (sin (* (* x (PI)) tau)) (* (* x (PI)) tau)) (/ (sin (* x (PI))) (* x (PI)))))