Lanczos kernel

Percentage Accurate: 97.9% → 97.8%
Time: 8.4s
Alternatives: 7
Speedup: 1.0×

Specification

?
\[\left(10^{-5} \leq x \land x \leq 1\right) \land \left(1 \leq tau \land tau \leq 5\right)\]
\[\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}

Sampling outcomes in binary32 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 7 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 97.9% accurate, 1.0× speedup?

\[\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}

Alternative 1: 97.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{PI}\left(\right) \cdot x\\ t_2 := tau \cdot t\_1\\ \frac{\frac{\sin t\_1}{t\_1} \cdot \sin t\_2}{t\_2} \end{array} \end{array} \]
(FPCore (x tau)
 :precision binary32
 (let* ((t_1 (* (PI) x)) (t_2 (* tau t_1)))
   (/ (* (/ (sin t_1) t_1) (sin t_2)) t_2)))
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{PI}\left(\right) \cdot x\\
t_2 := tau \cdot t\_1\\
\frac{\frac{\sin t\_1}{t\_1} \cdot \sin t\_2}{t\_2}
\end{array}
\end{array}
Derivation
  1. Initial program 98.0%

    \[\frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{x \cdot \mathsf{PI}\left(\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-/.f32N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{x \cdot \mathsf{PI}\left(\right)}} \]
    2. clear-numN/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\frac{1}{\frac{x \cdot \mathsf{PI}\left(\right)}{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}}} \]
    3. associate-/r/N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\left(\frac{1}{x \cdot \mathsf{PI}\left(\right)} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \]
    4. lower-*.f32N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\left(\frac{1}{x \cdot \mathsf{PI}\left(\right)} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \]
    5. lower-/.f3298.0

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\color{blue}{\frac{1}{x \cdot \mathsf{PI}\left(\right)}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
    6. lift-*.f32N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\color{blue}{x \cdot \mathsf{PI}\left(\right)}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
    7. *-commutativeN/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\color{blue}{\mathsf{PI}\left(\right) \cdot x}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
    8. lower-*.f3298.0

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\color{blue}{\mathsf{PI}\left(\right) \cdot x}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
    9. lift-*.f32N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \color{blue}{\left(x \cdot \mathsf{PI}\left(\right)\right)}\right) \]
    10. *-commutativeN/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot x\right)}\right) \]
    11. lower-*.f3298.0

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot x\right)}\right) \]
  4. Applied rewrites98.0%

    \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot x\right)\right)} \]
  5. Step-by-step derivation
    1. lift-*.f32N/A

      \[\leadsto \color{blue}{\frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot x\right)\right)} \]
    2. lift-/.f32N/A

      \[\leadsto \color{blue}{\frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot x\right)\right) \]
    3. clear-numN/A

      \[\leadsto \color{blue}{\frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}}} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot x\right)\right) \]
    4. lift-*.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \color{blue}{\left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot x\right)\right)} \]
    5. *-commutativeN/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \color{blue}{\left(\sin \left(\mathsf{PI}\left(\right) \cdot x\right) \cdot \frac{1}{\mathsf{PI}\left(\right) \cdot x}\right)} \]
    6. lift-*.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot x\right)} \cdot \frac{1}{\mathsf{PI}\left(\right) \cdot x}\right) \]
    7. *-commutativeN/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \color{blue}{\left(x \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{\mathsf{PI}\left(\right) \cdot x}\right) \]
    8. lift-*.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \color{blue}{\left(x \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{\mathsf{PI}\left(\right) \cdot x}\right) \]
    9. lift-/.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \left(x \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{PI}\left(\right) \cdot x}}\right) \]
    10. lift-*.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \left(x \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{\color{blue}{\mathsf{PI}\left(\right) \cdot x}}\right) \]
    11. *-commutativeN/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \left(x \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{\color{blue}{x \cdot \mathsf{PI}\left(\right)}}\right) \]
    12. lift-*.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \left(x \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{\color{blue}{x \cdot \mathsf{PI}\left(\right)}}\right) \]
    13. div-invN/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \color{blue}{\frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{x \cdot \mathsf{PI}\left(\right)}} \]
    14. frac-timesN/A

      \[\leadsto \color{blue}{\frac{1 \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)} \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}} \]
  6. Applied rewrites98.0%

    \[\leadsto \color{blue}{\frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{\frac{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}} \]
  7. Applied rewrites98.1%

    \[\leadsto \color{blue}{\frac{\frac{\sin \left(\mathsf{PI}\left(\right) \cdot x\right)}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(tau \cdot \left(\mathsf{PI}\left(\right) \cdot x\right)\right)}{tau \cdot \left(\mathsf{PI}\left(\right) \cdot x\right)}} \]
  8. Add Preprocessing

Alternative 2: 97.9% accurate, 1.0× speedup?

\[\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}
Derivation
  1. Initial program 98.0%

    \[\frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{x \cdot \mathsf{PI}\left(\right)} \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 3: 97.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \mathsf{PI}\left(\right)\\ t_2 := tau \cdot t\_1\\ \frac{\sin t\_1 \cdot \sin t\_2}{t\_1 \cdot t\_2} \end{array} \end{array} \]
(FPCore (x tau)
 :precision binary32
 (let* ((t_1 (* x (PI))) (t_2 (* tau t_1)))
   (/ (* (sin t_1) (sin t_2)) (* t_1 t_2))))
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \mathsf{PI}\left(\right)\\
t_2 := tau \cdot t\_1\\
\frac{\sin t\_1 \cdot \sin t\_2}{t\_1 \cdot t\_2}
\end{array}
\end{array}
Derivation
  1. Initial program 98.0%

    \[\frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{x \cdot \mathsf{PI}\left(\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-/.f32N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{x \cdot \mathsf{PI}\left(\right)}} \]
    2. clear-numN/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\frac{1}{\frac{x \cdot \mathsf{PI}\left(\right)}{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}}} \]
    3. associate-/r/N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\left(\frac{1}{x \cdot \mathsf{PI}\left(\right)} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \]
    4. lower-*.f32N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\left(\frac{1}{x \cdot \mathsf{PI}\left(\right)} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \]
    5. lower-/.f3298.0

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\color{blue}{\frac{1}{x \cdot \mathsf{PI}\left(\right)}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
    6. lift-*.f32N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\color{blue}{x \cdot \mathsf{PI}\left(\right)}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
    7. *-commutativeN/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\color{blue}{\mathsf{PI}\left(\right) \cdot x}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
    8. lower-*.f3298.0

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\color{blue}{\mathsf{PI}\left(\right) \cdot x}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
    9. lift-*.f32N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \color{blue}{\left(x \cdot \mathsf{PI}\left(\right)\right)}\right) \]
    10. *-commutativeN/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot x\right)}\right) \]
    11. lower-*.f3298.0

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot x\right)}\right) \]
  4. Applied rewrites98.0%

    \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot x\right)\right)} \]
  5. Step-by-step derivation
    1. lift-*.f32N/A

      \[\leadsto \color{blue}{\frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot x\right)\right)} \]
    2. lift-/.f32N/A

      \[\leadsto \color{blue}{\frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot x\right)\right) \]
    3. clear-numN/A

      \[\leadsto \color{blue}{\frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}}} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot x\right)\right) \]
    4. lift-*.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \color{blue}{\left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot x\right)\right)} \]
    5. *-commutativeN/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \color{blue}{\left(\sin \left(\mathsf{PI}\left(\right) \cdot x\right) \cdot \frac{1}{\mathsf{PI}\left(\right) \cdot x}\right)} \]
    6. lift-*.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot x\right)} \cdot \frac{1}{\mathsf{PI}\left(\right) \cdot x}\right) \]
    7. *-commutativeN/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \color{blue}{\left(x \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{\mathsf{PI}\left(\right) \cdot x}\right) \]
    8. lift-*.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \color{blue}{\left(x \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{\mathsf{PI}\left(\right) \cdot x}\right) \]
    9. lift-/.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \left(x \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{PI}\left(\right) \cdot x}}\right) \]
    10. lift-*.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \left(x \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{\color{blue}{\mathsf{PI}\left(\right) \cdot x}}\right) \]
    11. *-commutativeN/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \left(x \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{\color{blue}{x \cdot \mathsf{PI}\left(\right)}}\right) \]
    12. lift-*.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \left(x \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{\color{blue}{x \cdot \mathsf{PI}\left(\right)}}\right) \]
    13. div-invN/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \color{blue}{\frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{x \cdot \mathsf{PI}\left(\right)}} \]
    14. frac-timesN/A

      \[\leadsto \color{blue}{\frac{1 \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)} \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}} \]
  6. Applied rewrites98.0%

    \[\leadsto \color{blue}{\frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{\frac{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}} \]
  7. Applied rewrites98.1%

    \[\leadsto \color{blue}{\frac{\frac{\sin \left(\mathsf{PI}\left(\right) \cdot x\right)}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(tau \cdot \left(\mathsf{PI}\left(\right) \cdot x\right)\right)}{tau \cdot \left(\mathsf{PI}\left(\right) \cdot x\right)}} \]
  8. Step-by-step derivation
    1. lift-/.f32N/A

      \[\leadsto \color{blue}{\frac{\frac{\sin \left(\mathsf{PI}\left(\right) \cdot x\right)}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(tau \cdot \left(\mathsf{PI}\left(\right) \cdot x\right)\right)}{tau \cdot \left(\mathsf{PI}\left(\right) \cdot x\right)}} \]
    2. frac-2negN/A

      \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{\sin \left(\mathsf{PI}\left(\right) \cdot x\right)}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(tau \cdot \left(\mathsf{PI}\left(\right) \cdot x\right)\right)\right)}{\mathsf{neg}\left(tau \cdot \left(\mathsf{PI}\left(\right) \cdot x\right)\right)}} \]
    3. lift-*.f32N/A

      \[\leadsto \frac{\mathsf{neg}\left(\frac{\sin \left(\mathsf{PI}\left(\right) \cdot x\right)}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(tau \cdot \left(\mathsf{PI}\left(\right) \cdot x\right)\right)\right)}{\mathsf{neg}\left(tau \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot x\right)}\right)} \]
    4. *-commutativeN/A

      \[\leadsto \frac{\mathsf{neg}\left(\frac{\sin \left(\mathsf{PI}\left(\right) \cdot x\right)}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(tau \cdot \left(\mathsf{PI}\left(\right) \cdot x\right)\right)\right)}{\mathsf{neg}\left(tau \cdot \color{blue}{\left(x \cdot \mathsf{PI}\left(\right)\right)}\right)} \]
    5. lift-*.f32N/A

      \[\leadsto \frac{\mathsf{neg}\left(\frac{\sin \left(\mathsf{PI}\left(\right) \cdot x\right)}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(tau \cdot \left(\mathsf{PI}\left(\right) \cdot x\right)\right)\right)}{\mathsf{neg}\left(tau \cdot \color{blue}{\left(x \cdot \mathsf{PI}\left(\right)\right)}\right)} \]
  9. Applied rewrites97.8%

    \[\leadsto \color{blue}{\frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right) \cdot \left(-\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(-tau\right) \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)}} \]
  10. Final simplification97.8%

    \[\leadsto \frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right) \cdot \sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \]
  11. Add Preprocessing

Alternative 4: 71.1% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \mathsf{PI}\left(\right)\\ t_2 := tau \cdot t\_1\\ \frac{t\_1 \cdot \frac{\sin t\_2}{t\_2}}{t\_1} \end{array} \end{array} \]
(FPCore (x tau)
 :precision binary32
 (let* ((t_1 (* x (PI))) (t_2 (* tau t_1))) (/ (* t_1 (/ (sin t_2) t_2)) t_1)))
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \mathsf{PI}\left(\right)\\
t_2 := tau \cdot t\_1\\
\frac{t\_1 \cdot \frac{\sin t\_2}{t\_2}}{t\_1}
\end{array}
\end{array}
Derivation
  1. Initial program 98.0%

    \[\frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{x \cdot \mathsf{PI}\left(\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-/.f32N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{x \cdot \mathsf{PI}\left(\right)}} \]
    2. clear-numN/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\frac{1}{\frac{x \cdot \mathsf{PI}\left(\right)}{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}}} \]
    3. associate-/r/N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\left(\frac{1}{x \cdot \mathsf{PI}\left(\right)} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \]
    4. lower-*.f32N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\left(\frac{1}{x \cdot \mathsf{PI}\left(\right)} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \]
    5. lower-/.f3298.0

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\color{blue}{\frac{1}{x \cdot \mathsf{PI}\left(\right)}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
    6. lift-*.f32N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\color{blue}{x \cdot \mathsf{PI}\left(\right)}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
    7. *-commutativeN/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\color{blue}{\mathsf{PI}\left(\right) \cdot x}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
    8. lower-*.f3298.0

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\color{blue}{\mathsf{PI}\left(\right) \cdot x}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
    9. lift-*.f32N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \color{blue}{\left(x \cdot \mathsf{PI}\left(\right)\right)}\right) \]
    10. *-commutativeN/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot x\right)}\right) \]
    11. lower-*.f3298.0

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot x\right)}\right) \]
  4. Applied rewrites98.0%

    \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot x\right)\right)} \]
  5. Step-by-step derivation
    1. lift-*.f32N/A

      \[\leadsto \color{blue}{\frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot x\right)\right)} \]
    2. lift-/.f32N/A

      \[\leadsto \color{blue}{\frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot x\right)\right) \]
    3. clear-numN/A

      \[\leadsto \color{blue}{\frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}}} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot x\right)\right) \]
    4. lift-*.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \color{blue}{\left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot x\right)\right)} \]
    5. *-commutativeN/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \color{blue}{\left(\sin \left(\mathsf{PI}\left(\right) \cdot x\right) \cdot \frac{1}{\mathsf{PI}\left(\right) \cdot x}\right)} \]
    6. lift-*.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot x\right)} \cdot \frac{1}{\mathsf{PI}\left(\right) \cdot x}\right) \]
    7. *-commutativeN/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \color{blue}{\left(x \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{\mathsf{PI}\left(\right) \cdot x}\right) \]
    8. lift-*.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \color{blue}{\left(x \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{\mathsf{PI}\left(\right) \cdot x}\right) \]
    9. lift-/.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \left(x \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{PI}\left(\right) \cdot x}}\right) \]
    10. lift-*.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \left(x \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{\color{blue}{\mathsf{PI}\left(\right) \cdot x}}\right) \]
    11. *-commutativeN/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \left(x \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{\color{blue}{x \cdot \mathsf{PI}\left(\right)}}\right) \]
    12. lift-*.f32N/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \left(\sin \left(x \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{\color{blue}{x \cdot \mathsf{PI}\left(\right)}}\right) \]
    13. div-invN/A

      \[\leadsto \frac{1}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}} \cdot \color{blue}{\frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{x \cdot \mathsf{PI}\left(\right)}} \]
    14. frac-timesN/A

      \[\leadsto \color{blue}{\frac{1 \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau}{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)} \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}} \]
  6. Applied rewrites97.6%

    \[\leadsto \color{blue}{\frac{1}{\frac{\frac{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}}} \]
  7. Taylor expanded in x around 0

    \[\leadsto \frac{1}{\frac{\frac{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\color{blue}{x \cdot \mathsf{PI}\left(\right)}}} \]
  8. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \frac{1}{\frac{\frac{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\color{blue}{\mathsf{PI}\left(\right) \cdot x}}} \]
    2. lower-*.f32N/A

      \[\leadsto \frac{1}{\frac{\frac{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\color{blue}{\mathsf{PI}\left(\right) \cdot x}}} \]
    3. lower-PI.f3270.9

      \[\leadsto \frac{1}{\frac{\frac{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\color{blue}{\mathsf{PI}\left(\right)} \cdot x}} \]
  9. Applied rewrites70.9%

    \[\leadsto \frac{1}{\frac{\frac{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\color{blue}{\mathsf{PI}\left(\right) \cdot x}}} \]
  10. Step-by-step derivation
    1. lift-/.f32N/A

      \[\leadsto \color{blue}{\frac{1}{\frac{\frac{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\mathsf{PI}\left(\right) \cdot x}}} \]
    2. lift-/.f32N/A

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\mathsf{PI}\left(\right) \cdot x}}} \]
    3. clear-numN/A

      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot x}{\frac{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}} \]
    4. lift-*.f32N/A

      \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot x}{\color{blue}{\frac{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}} \]
    5. lift-*.f32N/A

      \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot x}{\frac{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \color{blue}{\left(x \cdot \mathsf{PI}\left(\right)\right)}} \]
    6. *-commutativeN/A

      \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot x}{\frac{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot x\right)}} \]
    7. lift-*.f32N/A

      \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot x}{\frac{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot x\right)}} \]
    8. associate-/r*N/A

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{PI}\left(\right) \cdot x}{\frac{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)}}}{\mathsf{PI}\left(\right) \cdot x}} \]
    9. lower-/.f32N/A

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{PI}\left(\right) \cdot x}{\frac{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)}}}{\mathsf{PI}\left(\right) \cdot x}} \]
  11. Applied rewrites71.0%

    \[\leadsto \color{blue}{\frac{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{\sin \left(tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)\right)}{tau \cdot \left(x \cdot \mathsf{PI}\left(\right)\right)}}{x \cdot \mathsf{PI}\left(\right)}} \]
  12. Add Preprocessing

Alternative 5: 71.1% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\\ \frac{\sin t\_1}{t\_1} \cdot 1 \end{array} \end{array} \]
(FPCore (x tau)
 :precision binary32
 (let* ((t_1 (* (* x (PI)) tau))) (* (/ (sin t_1) t_1) 1.0)))
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\\
\frac{\sin t\_1}{t\_1} \cdot 1
\end{array}
\end{array}
Derivation
  1. Initial program 98.0%

    \[\frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{x \cdot \mathsf{PI}\left(\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-/.f32N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{x \cdot \mathsf{PI}\left(\right)}} \]
    2. clear-numN/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\frac{1}{\frac{x \cdot \mathsf{PI}\left(\right)}{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}}} \]
    3. associate-/r/N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\left(\frac{1}{x \cdot \mathsf{PI}\left(\right)} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \]
    4. lower-*.f32N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\left(\frac{1}{x \cdot \mathsf{PI}\left(\right)} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \]
    5. lower-/.f3298.0

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\color{blue}{\frac{1}{x \cdot \mathsf{PI}\left(\right)}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
    6. lift-*.f32N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\color{blue}{x \cdot \mathsf{PI}\left(\right)}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
    7. *-commutativeN/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\color{blue}{\mathsf{PI}\left(\right) \cdot x}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
    8. lower-*.f3298.0

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\color{blue}{\mathsf{PI}\left(\right) \cdot x}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
    9. lift-*.f32N/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \color{blue}{\left(x \cdot \mathsf{PI}\left(\right)\right)}\right) \]
    10. *-commutativeN/A

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot x\right)}\right) \]
    11. lower-*.f3298.0

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot x\right)}\right) \]
  4. Applied rewrites98.0%

    \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot x\right)\right)} \]
  5. Taylor expanded in x around 0

    \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{1} \]
  6. Step-by-step derivation
    1. Applied rewrites70.9%

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{1} \]
    2. Add Preprocessing

    Alternative 6: 64.7% accurate, 10.8× speedup?

    \[\begin{array}{l} \\ \left(x \cdot x\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -0.16666666666666666\right) + 1 \end{array} \]
    (FPCore (x tau)
     :precision binary32
     (+ (* (* x x) (* (* (PI) (PI)) -0.16666666666666666)) 1.0))
    \begin{array}{l}
    
    \\
    \left(x \cdot x\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -0.16666666666666666\right) + 1
    \end{array}
    
    Derivation
    1. Initial program 98.0%

      \[\frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{x \cdot \mathsf{PI}\left(\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f32N/A

        \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{x \cdot \mathsf{PI}\left(\right)}} \]
      2. clear-numN/A

        \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\frac{1}{\frac{x \cdot \mathsf{PI}\left(\right)}{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}}} \]
      3. associate-/r/N/A

        \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\left(\frac{1}{x \cdot \mathsf{PI}\left(\right)} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \]
      4. lower-*.f32N/A

        \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\left(\frac{1}{x \cdot \mathsf{PI}\left(\right)} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right)} \]
      5. lower-/.f3298.0

        \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\color{blue}{\frac{1}{x \cdot \mathsf{PI}\left(\right)}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
      6. lift-*.f32N/A

        \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\color{blue}{x \cdot \mathsf{PI}\left(\right)}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\color{blue}{\mathsf{PI}\left(\right) \cdot x}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
      8. lower-*.f3298.0

        \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\color{blue}{\mathsf{PI}\left(\right) \cdot x}} \cdot \sin \left(x \cdot \mathsf{PI}\left(\right)\right)\right) \]
      9. lift-*.f32N/A

        \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \color{blue}{\left(x \cdot \mathsf{PI}\left(\right)\right)}\right) \]
      10. *-commutativeN/A

        \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot x\right)}\right) \]
      11. lower-*.f3298.0

        \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot x\right)}\right) \]
    4. Applied rewrites98.0%

      \[\leadsto \frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \color{blue}{\left(\frac{1}{\mathsf{PI}\left(\right) \cdot x} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot x\right)\right)} \]
    5. Taylor expanded in x around 0

      \[\leadsto \color{blue}{1 + {x}^{2} \cdot \left(\frac{-1}{6} \cdot \left({tau}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-1}{6} \cdot {\mathsf{PI}\left(\right)}^{2}\right)} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{{x}^{2} \cdot \left(\frac{-1}{6} \cdot \left({tau}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-1}{6} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + 1} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{-1}{6} \cdot \left({tau}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-1}{6} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot {x}^{2}} + 1 \]
      3. lower-fma.f32N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{6} \cdot \left({tau}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-1}{6} \cdot {\mathsf{PI}\left(\right)}^{2}, {x}^{2}, 1\right)} \]
    7. Applied rewrites63.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(tau, tau, 1\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -0.16666666666666666\right), x \cdot x, 1\right)} \]
    8. Taylor expanded in tau around 0

      \[\leadsto \mathsf{fma}\left(\frac{-1}{6} \cdot {\mathsf{PI}\left(\right)}^{2}, \color{blue}{x} \cdot x, 1\right) \]
    9. Step-by-step derivation
      1. Applied rewrites63.2%

        \[\leadsto \mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -0.16666666666666666, \color{blue}{x} \cdot x, 1\right) \]
      2. Step-by-step derivation
        1. Applied rewrites64.2%

          \[\leadsto \left(x \cdot x\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -0.16666666666666666\right) + \color{blue}{1} \]
        2. Add Preprocessing

        Alternative 7: 63.7% accurate, 258.0× speedup?

        \[\begin{array}{l} \\ 1 \end{array} \]
        (FPCore (x tau) :precision binary32 1.0)
        float code(float x, float tau) {
        	return 1.0f;
        }
        
        real(4) function code(x, tau)
            real(4), intent (in) :: x
            real(4), intent (in) :: tau
            code = 1.0e0
        end function
        
        function code(x, tau)
        	return Float32(1.0)
        end
        
        function tmp = code(x, tau)
        	tmp = single(1.0);
        end
        
        \begin{array}{l}
        
        \\
        1
        \end{array}
        
        Derivation
        1. Initial program 98.0%

          \[\frac{\sin \left(\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau\right)}{\left(x \cdot \mathsf{PI}\left(\right)\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \mathsf{PI}\left(\right)\right)}{x \cdot \mathsf{PI}\left(\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in x around 0

          \[\leadsto \color{blue}{1} \]
        4. Step-by-step derivation
          1. Applied rewrites63.2%

            \[\leadsto \color{blue}{1} \]
          2. Final simplification63.2%

            \[\leadsto 1 \]
          3. Add Preprocessing

          Reproduce

          ?
          herbie shell --seed 2024313 
          (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)))))