Lanczos kernel

Percentage Accurate: 98.0% → 97.9%
Time: 12.2s
Alternatives: 13
Speedup: N/A×

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 := \left(x \cdot \pi\right) \cdot tau\\ \frac{\sin t_1}{t_1} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \end{array} \end{array} \]
(FPCore (x tau)
 :precision binary32
 (let* ((t_1 (* (* x PI) tau)))
   (* (/ (sin t_1) t_1) (/ (sin (* x PI)) (* x PI)))))
float code(float x, float tau) {
	float t_1 = (x * ((float) M_PI)) * tau;
	return (sinf(t_1) / t_1) * (sinf((x * ((float) M_PI))) / (x * ((float) M_PI)));
}
function code(x, tau)
	t_1 = Float32(Float32(x * Float32(pi)) * tau)
	return Float32(Float32(sin(t_1) / t_1) * Float32(sin(Float32(x * Float32(pi))) / Float32(x * Float32(pi))))
end
function tmp = code(x, tau)
	t_1 = (x * single(pi)) * tau;
	tmp = (sin(t_1) / t_1) * (sin((x * single(pi))) / (x * single(pi)));
end
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x \cdot \pi\right) \cdot tau\\
\frac{\sin t_1}{t_1} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi}
\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 13 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: 98.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot \pi\right) \cdot tau\\ \frac{\sin t_1}{t_1} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \end{array} \end{array} \]
(FPCore (x tau)
 :precision binary32
 (let* ((t_1 (* (* x PI) tau)))
   (* (/ (sin t_1) t_1) (/ (sin (* x PI)) (* x PI)))))
float code(float x, float tau) {
	float t_1 = (x * ((float) M_PI)) * tau;
	return (sinf(t_1) / t_1) * (sinf((x * ((float) M_PI))) / (x * ((float) M_PI)));
}
function code(x, tau)
	t_1 = Float32(Float32(x * Float32(pi)) * tau)
	return Float32(Float32(sin(t_1) / t_1) * Float32(sin(Float32(x * Float32(pi))) / Float32(x * Float32(pi))))
end
function tmp = code(x, tau)
	t_1 = (x * single(pi)) * tau;
	tmp = (sin(t_1) / t_1) * (sin((x * single(pi))) / (x * single(pi)));
end
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x \cdot \pi\right) \cdot tau\\
\frac{\sin t_1}{t_1} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi}
\end{array}
\end{array}

Alternative 1: 97.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \pi \cdot \left(x \cdot tau\right)\\ \frac{\sin t_1}{t_1} \cdot \frac{\sin \left(\pi \cdot x\right)}{\pi \cdot x} \end{array} \end{array} \]
(FPCore (x tau)
 :precision binary32
 (let* ((t_1 (* PI (* x tau))))
   (* (/ (sin t_1) t_1) (/ (sin (* PI x)) (* PI x)))))
float code(float x, float tau) {
	float t_1 = ((float) M_PI) * (x * tau);
	return (sinf(t_1) / t_1) * (sinf((((float) M_PI) * x)) / (((float) M_PI) * x));
}
function code(x, tau)
	t_1 = Float32(Float32(pi) * Float32(x * tau))
	return Float32(Float32(sin(t_1) / t_1) * Float32(sin(Float32(Float32(pi) * x)) / Float32(Float32(pi) * x)))
end
function tmp = code(x, tau)
	t_1 = single(pi) * (x * tau);
	tmp = (sin(t_1) / t_1) * (sin((single(pi) * x)) / (single(pi) * x));
end
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \pi \cdot \left(x \cdot tau\right)\\
\frac{\sin t_1}{t_1} \cdot \frac{\sin \left(\pi \cdot x\right)}{\pi \cdot x}
\end{array}
\end{array}
Derivation
  1. Initial program 97.9%

    \[\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  2. Step-by-step derivation
    1. *-commutative97.9%

      \[\leadsto \frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\color{blue}{\left(\pi \cdot x\right)} \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    2. associate-*l*97.4%

      \[\leadsto \frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\color{blue}{\pi \cdot \left(x \cdot tau\right)}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    3. *-commutative97.4%

      \[\leadsto \frac{\sin \left(\color{blue}{\left(\pi \cdot x\right)} \cdot tau\right)}{\pi \cdot \left(x \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    4. associate-*l*98.0%

      \[\leadsto \frac{\sin \color{blue}{\left(\pi \cdot \left(x \cdot tau\right)\right)}}{\pi \cdot \left(x \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  3. Simplified98.0%

    \[\leadsto \color{blue}{\frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{\pi \cdot \left(x \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi}} \]
  4. Final simplification98.0%

    \[\leadsto \frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{\pi \cdot \left(x \cdot tau\right)} \cdot \frac{\sin \left(\pi \cdot x\right)}{\pi \cdot x} \]

Alternative 2: 97.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\sin \left(\pi \cdot x\right)}{\pi \cdot x} \cdot \frac{\sin \left(tau \cdot \left(\pi \cdot x\right)\right)}{x \cdot \left(\pi \cdot tau\right)} \end{array} \]
(FPCore (x tau)
 :precision binary32
 (* (/ (sin (* PI x)) (* PI x)) (/ (sin (* tau (* PI x))) (* x (* PI tau)))))
float code(float x, float tau) {
	return (sinf((((float) M_PI) * x)) / (((float) M_PI) * x)) * (sinf((tau * (((float) M_PI) * x))) / (x * (((float) M_PI) * tau)));
}
function code(x, tau)
	return Float32(Float32(sin(Float32(Float32(pi) * x)) / Float32(Float32(pi) * x)) * Float32(sin(Float32(tau * Float32(Float32(pi) * x))) / Float32(x * Float32(Float32(pi) * tau))))
end
function tmp = code(x, tau)
	tmp = (sin((single(pi) * x)) / (single(pi) * x)) * (sin((tau * (single(pi) * x))) / (x * (single(pi) * tau)));
end
\begin{array}{l}

\\
\frac{\sin \left(\pi \cdot x\right)}{\pi \cdot x} \cdot \frac{\sin \left(tau \cdot \left(\pi \cdot x\right)\right)}{x \cdot \left(\pi \cdot tau\right)}
\end{array}
Derivation
  1. Initial program 97.9%

    \[\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  2. Step-by-step derivation
    1. associate-*l*97.4%

      \[\leadsto \frac{\sin \color{blue}{\left(x \cdot \left(\pi \cdot tau\right)\right)}}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    2. associate-*l*97.9%

      \[\leadsto \frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{\color{blue}{x \cdot \left(\pi \cdot tau\right)}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  3. Simplified97.9%

    \[\leadsto \color{blue}{\frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{x \cdot \left(\pi \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi}} \]
  4. Taylor expanded in x around inf 97.4%

    \[\leadsto \frac{\color{blue}{\sin \left(tau \cdot \left(x \cdot \pi\right)\right)}}{x \cdot \left(\pi \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  5. Final simplification97.4%

    \[\leadsto \frac{\sin \left(\pi \cdot x\right)}{\pi \cdot x} \cdot \frac{\sin \left(tau \cdot \left(\pi \cdot x\right)\right)}{x \cdot \left(\pi \cdot tau\right)} \]

Alternative 3: 97.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\pi \cdot tau\right)\\ \frac{\sin \left(\pi \cdot x\right)}{\pi \cdot x} \cdot \frac{\sin t_1}{t_1} \end{array} \end{array} \]
(FPCore (x tau)
 :precision binary32
 (let* ((t_1 (* x (* PI tau))))
   (* (/ (sin (* PI x)) (* PI x)) (/ (sin t_1) t_1))))
float code(float x, float tau) {
	float t_1 = x * (((float) M_PI) * tau);
	return (sinf((((float) M_PI) * x)) / (((float) M_PI) * x)) * (sinf(t_1) / t_1);
}
function code(x, tau)
	t_1 = Float32(x * Float32(Float32(pi) * tau))
	return Float32(Float32(sin(Float32(Float32(pi) * x)) / Float32(Float32(pi) * x)) * Float32(sin(t_1) / t_1))
end
function tmp = code(x, tau)
	t_1 = x * (single(pi) * tau);
	tmp = (sin((single(pi) * x)) / (single(pi) * x)) * (sin(t_1) / t_1);
end
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(\pi \cdot tau\right)\\
\frac{\sin \left(\pi \cdot x\right)}{\pi \cdot x} \cdot \frac{\sin t_1}{t_1}
\end{array}
\end{array}
Derivation
  1. Initial program 97.9%

    \[\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  2. Step-by-step derivation
    1. associate-*l*97.4%

      \[\leadsto \frac{\sin \color{blue}{\left(x \cdot \left(\pi \cdot tau\right)\right)}}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    2. associate-*l*97.9%

      \[\leadsto \frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{\color{blue}{x \cdot \left(\pi \cdot tau\right)}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  3. Simplified97.9%

    \[\leadsto \color{blue}{\frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{x \cdot \left(\pi \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi}} \]
  4. Final simplification97.9%

    \[\leadsto \frac{\sin \left(\pi \cdot x\right)}{\pi \cdot x} \cdot \frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{x \cdot \left(\pi \cdot tau\right)} \]

Alternative 4: 79.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\sin \left(\pi \cdot x\right)}{\pi \cdot x} \cdot \mathsf{fma}\left(-0.16666666666666666, {\left(tau \cdot \left(\pi \cdot x\right)\right)}^{2}, 1\right) \end{array} \]
(FPCore (x tau)
 :precision binary32
 (*
  (/ (sin (* PI x)) (* PI x))
  (fma -0.16666666666666666 (pow (* tau (* PI x)) 2.0) 1.0)))
float code(float x, float tau) {
	return (sinf((((float) M_PI) * x)) / (((float) M_PI) * x)) * fmaf(-0.16666666666666666f, powf((tau * (((float) M_PI) * x)), 2.0f), 1.0f);
}
function code(x, tau)
	return Float32(Float32(sin(Float32(Float32(pi) * x)) / Float32(Float32(pi) * x)) * fma(Float32(-0.16666666666666666), (Float32(tau * Float32(Float32(pi) * x)) ^ Float32(2.0)), Float32(1.0)))
end
\begin{array}{l}

\\
\frac{\sin \left(\pi \cdot x\right)}{\pi \cdot x} \cdot \mathsf{fma}\left(-0.16666666666666666, {\left(tau \cdot \left(\pi \cdot x\right)\right)}^{2}, 1\right)
\end{array}
Derivation
  1. Initial program 97.9%

    \[\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  2. Step-by-step derivation
    1. associate-*l*97.4%

      \[\leadsto \frac{\sin \color{blue}{\left(x \cdot \left(\pi \cdot tau\right)\right)}}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    2. associate-*l*97.9%

      \[\leadsto \frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{\color{blue}{x \cdot \left(\pi \cdot tau\right)}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  3. Simplified97.9%

    \[\leadsto \color{blue}{\frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{x \cdot \left(\pi \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi}} \]
  4. Taylor expanded in x around 0 78.7%

    \[\leadsto \color{blue}{\left(1 + -0.16666666666666666 \cdot \left({tau}^{2} \cdot \left({x}^{2} \cdot {\pi}^{2}\right)\right)\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  5. Step-by-step derivation
    1. +-commutative78.7%

      \[\leadsto \color{blue}{\left(-0.16666666666666666 \cdot \left({tau}^{2} \cdot \left({x}^{2} \cdot {\pi}^{2}\right)\right) + 1\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    2. fma-def78.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.16666666666666666, {tau}^{2} \cdot \left({x}^{2} \cdot {\pi}^{2}\right), 1\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    3. *-commutative78.7%

      \[\leadsto \mathsf{fma}\left(-0.16666666666666666, \color{blue}{\left({x}^{2} \cdot {\pi}^{2}\right) \cdot {tau}^{2}}, 1\right) \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    4. *-commutative78.7%

      \[\leadsto \mathsf{fma}\left(-0.16666666666666666, \color{blue}{\left({\pi}^{2} \cdot {x}^{2}\right)} \cdot {tau}^{2}, 1\right) \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    5. associate-*l*78.7%

      \[\leadsto \mathsf{fma}\left(-0.16666666666666666, \color{blue}{{\pi}^{2} \cdot \left({x}^{2} \cdot {tau}^{2}\right)}, 1\right) \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    6. unpow278.7%

      \[\leadsto \mathsf{fma}\left(-0.16666666666666666, \color{blue}{\left(\pi \cdot \pi\right)} \cdot \left({x}^{2} \cdot {tau}^{2}\right), 1\right) \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    7. unpow278.7%

      \[\leadsto \mathsf{fma}\left(-0.16666666666666666, \left(\pi \cdot \pi\right) \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot {tau}^{2}\right), 1\right) \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    8. unpow278.7%

      \[\leadsto \mathsf{fma}\left(-0.16666666666666666, \left(\pi \cdot \pi\right) \cdot \left(\left(x \cdot x\right) \cdot \color{blue}{\left(tau \cdot tau\right)}\right), 1\right) \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    9. swap-sqr78.7%

      \[\leadsto \mathsf{fma}\left(-0.16666666666666666, \left(\pi \cdot \pi\right) \cdot \color{blue}{\left(\left(x \cdot tau\right) \cdot \left(x \cdot tau\right)\right)}, 1\right) \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    10. swap-sqr78.7%

      \[\leadsto \mathsf{fma}\left(-0.16666666666666666, \color{blue}{\left(\pi \cdot \left(x \cdot tau\right)\right) \cdot \left(\pi \cdot \left(x \cdot tau\right)\right)}, 1\right) \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    11. unpow278.7%

      \[\leadsto \mathsf{fma}\left(-0.16666666666666666, \color{blue}{{\left(\pi \cdot \left(x \cdot tau\right)\right)}^{2}}, 1\right) \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    12. *-commutative78.7%

      \[\leadsto \mathsf{fma}\left(-0.16666666666666666, {\color{blue}{\left(\left(x \cdot tau\right) \cdot \pi\right)}}^{2}, 1\right) \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    13. *-commutative78.7%

      \[\leadsto \mathsf{fma}\left(-0.16666666666666666, {\left(\color{blue}{\left(tau \cdot x\right)} \cdot \pi\right)}^{2}, 1\right) \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    14. associate-*r*78.7%

      \[\leadsto \mathsf{fma}\left(-0.16666666666666666, {\color{blue}{\left(tau \cdot \left(x \cdot \pi\right)\right)}}^{2}, 1\right) \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  6. Simplified78.7%

    \[\leadsto \color{blue}{\mathsf{fma}\left(-0.16666666666666666, {\left(tau \cdot \left(x \cdot \pi\right)\right)}^{2}, 1\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  7. Final simplification78.7%

    \[\leadsto \frac{\sin \left(\pi \cdot x\right)}{\pi \cdot x} \cdot \mathsf{fma}\left(-0.16666666666666666, {\left(tau \cdot \left(\pi \cdot x\right)\right)}^{2}, 1\right) \]

Alternative 5: 70.6% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \frac{\frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{x \cdot tau}}{\pi} \cdot \frac{\pi \cdot x}{\pi \cdot x} \end{array} \]
(FPCore (x tau)
 :precision binary32
 (* (/ (/ (sin (* PI (* x tau))) (* x tau)) PI) (/ (* PI x) (* PI x))))
float code(float x, float tau) {
	return ((sinf((((float) M_PI) * (x * tau))) / (x * tau)) / ((float) M_PI)) * ((((float) M_PI) * x) / (((float) M_PI) * x));
}
function code(x, tau)
	return Float32(Float32(Float32(sin(Float32(Float32(pi) * Float32(x * tau))) / Float32(x * tau)) / Float32(pi)) * Float32(Float32(Float32(pi) * x) / Float32(Float32(pi) * x)))
end
function tmp = code(x, tau)
	tmp = ((sin((single(pi) * (x * tau))) / (x * tau)) / single(pi)) * ((single(pi) * x) / (single(pi) * x));
end
\begin{array}{l}

\\
\frac{\frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{x \cdot tau}}{\pi} \cdot \frac{\pi \cdot x}{\pi \cdot x}
\end{array}
Derivation
  1. Initial program 97.9%

    \[\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  2. Step-by-step derivation
    1. associate-*l*97.4%

      \[\leadsto \frac{\sin \color{blue}{\left(x \cdot \left(\pi \cdot tau\right)\right)}}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    2. associate-*l*97.9%

      \[\leadsto \frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{\color{blue}{x \cdot \left(\pi \cdot tau\right)}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  3. Simplified97.9%

    \[\leadsto \color{blue}{\frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{x \cdot \left(\pi \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi}} \]
  4. Step-by-step derivation
    1. associate-*r*97.4%

      \[\leadsto \frac{\sin \color{blue}{\left(\left(x \cdot \pi\right) \cdot tau\right)}}{x \cdot \left(\pi \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    2. associate-*r*97.9%

      \[\leadsto \frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\color{blue}{\left(x \cdot \pi\right) \cdot tau}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    3. associate-/r*97.8%

      \[\leadsto \color{blue}{\frac{\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{x \cdot \pi}}{tau}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    4. div-inv97.6%

      \[\leadsto \color{blue}{\left(\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{x \cdot \pi} \cdot \frac{1}{tau}\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    5. *-commutative97.6%

      \[\leadsto \left(\frac{\sin \left(\color{blue}{\left(\pi \cdot x\right)} \cdot tau\right)}{x \cdot \pi} \cdot \frac{1}{tau}\right) \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    6. associate-*r*97.3%

      \[\leadsto \left(\frac{\sin \color{blue}{\left(\pi \cdot \left(x \cdot tau\right)\right)}}{x \cdot \pi} \cdot \frac{1}{tau}\right) \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  5. Applied egg-rr97.3%

    \[\leadsto \color{blue}{\left(\frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{x \cdot \pi} \cdot \frac{1}{tau}\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  6. Step-by-step derivation
    1. un-div-inv97.3%

      \[\leadsto \color{blue}{\frac{\frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{x \cdot \pi}}{tau}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    2. associate-/r*97.3%

      \[\leadsto \color{blue}{\frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{\left(x \cdot \pi\right) \cdot tau}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    3. *-commutative97.3%

      \[\leadsto \frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{\color{blue}{\left(\pi \cdot x\right)} \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    4. associate-*r*98.0%

      \[\leadsto \frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{\color{blue}{\pi \cdot \left(x \cdot tau\right)}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    5. *-commutative98.0%

      \[\leadsto \frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{\color{blue}{\left(x \cdot tau\right) \cdot \pi}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    6. associate-/r*97.8%

      \[\leadsto \color{blue}{\frac{\frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{x \cdot tau}}{\pi}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  7. Applied egg-rr97.8%

    \[\leadsto \color{blue}{\frac{\frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{x \cdot tau}}{\pi}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  8. Taylor expanded in x around 0 71.4%

    \[\leadsto \frac{\frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{x \cdot tau}}{\pi} \cdot \frac{\color{blue}{x \cdot \pi}}{x \cdot \pi} \]
  9. Final simplification71.4%

    \[\leadsto \frac{\frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{x \cdot tau}}{\pi} \cdot \frac{\pi \cdot x}{\pi \cdot x} \]

Alternative 6: 70.6% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \pi \cdot \left(x \cdot tau\right)\\ \frac{\sin t_1}{t_1} \cdot {\left(\frac{x}{x}\right)}^{-1} \end{array} \end{array} \]
(FPCore (x tau)
 :precision binary32
 (let* ((t_1 (* PI (* x tau)))) (* (/ (sin t_1) t_1) (pow (/ x x) -1.0))))
float code(float x, float tau) {
	float t_1 = ((float) M_PI) * (x * tau);
	return (sinf(t_1) / t_1) * powf((x / x), -1.0f);
}
function code(x, tau)
	t_1 = Float32(Float32(pi) * Float32(x * tau))
	return Float32(Float32(sin(t_1) / t_1) * (Float32(x / x) ^ Float32(-1.0)))
end
function tmp = code(x, tau)
	t_1 = single(pi) * (x * tau);
	tmp = (sin(t_1) / t_1) * ((x / x) ^ single(-1.0));
end
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \pi \cdot \left(x \cdot tau\right)\\
\frac{\sin t_1}{t_1} \cdot {\left(\frac{x}{x}\right)}^{-1}
\end{array}
\end{array}
Derivation
  1. Initial program 97.9%

    \[\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  2. Step-by-step derivation
    1. *-commutative97.9%

      \[\leadsto \frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\color{blue}{\left(\pi \cdot x\right)} \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    2. associate-*l*97.4%

      \[\leadsto \frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\color{blue}{\pi \cdot \left(x \cdot tau\right)}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    3. *-commutative97.4%

      \[\leadsto \frac{\sin \left(\color{blue}{\left(\pi \cdot x\right)} \cdot tau\right)}{\pi \cdot \left(x \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    4. associate-*l*98.0%

      \[\leadsto \frac{\sin \color{blue}{\left(\pi \cdot \left(x \cdot tau\right)\right)}}{\pi \cdot \left(x \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  3. Simplified98.0%

    \[\leadsto \color{blue}{\frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{\pi \cdot \left(x \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi}} \]
  4. Step-by-step derivation
    1. clear-num97.8%

      \[\leadsto \frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{\pi \cdot \left(x \cdot tau\right)} \cdot \color{blue}{\frac{1}{\frac{x \cdot \pi}{\sin \left(x \cdot \pi\right)}}} \]
    2. inv-pow97.8%

      \[\leadsto \frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{\pi \cdot \left(x \cdot tau\right)} \cdot \color{blue}{{\left(\frac{x \cdot \pi}{\sin \left(x \cdot \pi\right)}\right)}^{-1}} \]
    3. associate-/l*97.6%

      \[\leadsto \frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{\pi \cdot \left(x \cdot tau\right)} \cdot {\color{blue}{\left(\frac{x}{\frac{\sin \left(x \cdot \pi\right)}{\pi}}\right)}}^{-1} \]
  5. Applied egg-rr97.6%

    \[\leadsto \frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{\pi \cdot \left(x \cdot tau\right)} \cdot \color{blue}{{\left(\frac{x}{\frac{\sin \left(x \cdot \pi\right)}{\pi}}\right)}^{-1}} \]
  6. Taylor expanded in x around 0 71.4%

    \[\leadsto \frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{\pi \cdot \left(x \cdot tau\right)} \cdot {\left(\frac{x}{\color{blue}{x}}\right)}^{-1} \]
  7. Final simplification71.4%

    \[\leadsto \frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{\pi \cdot \left(x \cdot tau\right)} \cdot {\left(\frac{x}{x}\right)}^{-1} \]

Alternative 7: 70.6% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := tau \cdot \left(\pi \cdot x\right)\\ \frac{\sin t_1}{t_1} \end{array} \end{array} \]
(FPCore (x tau)
 :precision binary32
 (let* ((t_1 (* tau (* PI x)))) (/ (sin t_1) t_1)))
float code(float x, float tau) {
	float t_1 = tau * (((float) M_PI) * x);
	return sinf(t_1) / t_1;
}
function code(x, tau)
	t_1 = Float32(tau * Float32(Float32(pi) * x))
	return Float32(sin(t_1) / t_1)
end
function tmp = code(x, tau)
	t_1 = tau * (single(pi) * x);
	tmp = sin(t_1) / t_1;
end
\begin{array}{l}

\\
\begin{array}{l}
t_1 := tau \cdot \left(\pi \cdot x\right)\\
\frac{\sin t_1}{t_1}
\end{array}
\end{array}
Derivation
  1. Initial program 97.9%

    \[\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  2. Step-by-step derivation
    1. add-cube-cbrt96.2%

      \[\leadsto \frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \color{blue}{\left(\left(\sqrt[3]{x \cdot \pi} \cdot \sqrt[3]{x \cdot \pi}\right) \cdot \sqrt[3]{x \cdot \pi}\right)}}{x \cdot \pi} \]
    2. pow396.3%

      \[\leadsto \frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \color{blue}{\left({\left(\sqrt[3]{x \cdot \pi}\right)}^{3}\right)}}{x \cdot \pi} \]
  3. Applied egg-rr96.3%

    \[\leadsto \frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \color{blue}{\left({\left(\sqrt[3]{x \cdot \pi}\right)}^{3}\right)}}{x \cdot \pi} \]
  4. Step-by-step derivation
    1. clear-num96.2%

      \[\leadsto \frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \color{blue}{\frac{1}{\frac{x \cdot \pi}{\sin \left({\left(\sqrt[3]{x \cdot \pi}\right)}^{3}\right)}}} \]
    2. rem-cube-cbrt97.8%

      \[\leadsto \frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{1}{\frac{x \cdot \pi}{\sin \color{blue}{\left(x \cdot \pi\right)}}} \]
    3. associate-/r/97.9%

      \[\leadsto \frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \color{blue}{\left(\frac{1}{x \cdot \pi} \cdot \sin \left(x \cdot \pi\right)\right)} \]
  5. Applied egg-rr97.9%

    \[\leadsto \frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \color{blue}{\left(\frac{1}{x \cdot \pi} \cdot \sin \left(x \cdot \pi\right)\right)} \]
  6. Taylor expanded in x around 0 71.4%

    \[\leadsto \frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \color{blue}{1} \]
  7. Final simplification71.4%

    \[\leadsto \frac{\sin \left(tau \cdot \left(\pi \cdot x\right)\right)}{tau \cdot \left(\pi \cdot x\right)} \]

Alternative 8: 64.1% accurate, 2.0× speedup?

\[\begin{array}{l} \\ 1 + -0.16666666666666666 \cdot \left({x}^{2} \cdot {\pi}^{2}\right) \end{array} \]
(FPCore (x tau)
 :precision binary32
 (+ 1.0 (* -0.16666666666666666 (* (pow x 2.0) (pow PI 2.0)))))
float code(float x, float tau) {
	return 1.0f + (-0.16666666666666666f * (powf(x, 2.0f) * powf(((float) M_PI), 2.0f)));
}
function code(x, tau)
	return Float32(Float32(1.0) + Float32(Float32(-0.16666666666666666) * Float32((x ^ Float32(2.0)) * (Float32(pi) ^ Float32(2.0)))))
end
function tmp = code(x, tau)
	tmp = single(1.0) + (single(-0.16666666666666666) * ((x ^ single(2.0)) * (single(pi) ^ single(2.0))));
end
\begin{array}{l}

\\
1 + -0.16666666666666666 \cdot \left({x}^{2} \cdot {\pi}^{2}\right)
\end{array}
Derivation
  1. Initial program 97.9%

    \[\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  2. Step-by-step derivation
    1. associate-*l*97.4%

      \[\leadsto \frac{\sin \color{blue}{\left(x \cdot \left(\pi \cdot tau\right)\right)}}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    2. associate-*l*97.9%

      \[\leadsto \frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{\color{blue}{x \cdot \left(\pi \cdot tau\right)}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  3. Simplified97.9%

    \[\leadsto \color{blue}{\frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{x \cdot \left(\pi \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi}} \]
  4. Taylor expanded in x around 0 64.5%

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

    \[\leadsto 1 \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot \left({x}^{2} \cdot {\pi}^{2}\right)\right)} \]
  6. Final simplification64.7%

    \[\leadsto 1 + -0.16666666666666666 \cdot \left({x}^{2} \cdot {\pi}^{2}\right) \]

Alternative 9: 64.1% accurate, 2.0× speedup?

\[\begin{array}{l} \\ 1 + \left(-0.16666666666666666 \cdot {x}^{2}\right) \cdot {\pi}^{2} \end{array} \]
(FPCore (x tau)
 :precision binary32
 (+ 1.0 (* (* -0.16666666666666666 (pow x 2.0)) (pow PI 2.0))))
float code(float x, float tau) {
	return 1.0f + ((-0.16666666666666666f * powf(x, 2.0f)) * powf(((float) M_PI), 2.0f));
}
function code(x, tau)
	return Float32(Float32(1.0) + Float32(Float32(Float32(-0.16666666666666666) * (x ^ Float32(2.0))) * (Float32(pi) ^ Float32(2.0))))
end
function tmp = code(x, tau)
	tmp = single(1.0) + ((single(-0.16666666666666666) * (x ^ single(2.0))) * (single(pi) ^ single(2.0)));
end
\begin{array}{l}

\\
1 + \left(-0.16666666666666666 \cdot {x}^{2}\right) \cdot {\pi}^{2}
\end{array}
Derivation
  1. Initial program 97.9%

    \[\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  2. Step-by-step derivation
    1. associate-*l*97.4%

      \[\leadsto \frac{\sin \color{blue}{\left(x \cdot \left(\pi \cdot tau\right)\right)}}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    2. associate-*l*97.9%

      \[\leadsto \frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{\color{blue}{x \cdot \left(\pi \cdot tau\right)}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  3. Simplified97.9%

    \[\leadsto \color{blue}{\frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{x \cdot \left(\pi \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi}} \]
  4. Taylor expanded in x around 0 64.5%

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

    \[\leadsto 1 \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot \left({x}^{2} \cdot {\pi}^{2}\right)\right)} \]
  6. Step-by-step derivation
    1. associate-*r*64.7%

      \[\leadsto 1 \cdot \left(1 + \color{blue}{\left(-0.16666666666666666 \cdot {x}^{2}\right) \cdot {\pi}^{2}}\right) \]
  7. Simplified64.7%

    \[\leadsto 1 \cdot \color{blue}{\left(1 + \left(-0.16666666666666666 \cdot {x}^{2}\right) \cdot {\pi}^{2}\right)} \]
  8. Final simplification64.7%

    \[\leadsto 1 + \left(-0.16666666666666666 \cdot {x}^{2}\right) \cdot {\pi}^{2} \]

Alternative 10: 64.1% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(-0.16666666666666666, x \cdot \left(\pi \cdot \left(\pi \cdot x\right)\right), 1\right) \end{array} \]
(FPCore (x tau)
 :precision binary32
 (fma -0.16666666666666666 (* x (* PI (* PI x))) 1.0))
float code(float x, float tau) {
	return fmaf(-0.16666666666666666f, (x * (((float) M_PI) * (((float) M_PI) * x))), 1.0f);
}
function code(x, tau)
	return fma(Float32(-0.16666666666666666), Float32(x * Float32(Float32(pi) * Float32(Float32(pi) * x))), Float32(1.0))
end
\begin{array}{l}

\\
\mathsf{fma}\left(-0.16666666666666666, x \cdot \left(\pi \cdot \left(\pi \cdot x\right)\right), 1\right)
\end{array}
Derivation
  1. Initial program 97.9%

    \[\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  2. Step-by-step derivation
    1. associate-*l*97.4%

      \[\leadsto \frac{\sin \color{blue}{\left(x \cdot \left(\pi \cdot tau\right)\right)}}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    2. associate-*l*97.9%

      \[\leadsto \frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{\color{blue}{x \cdot \left(\pi \cdot tau\right)}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  3. Simplified97.9%

    \[\leadsto \color{blue}{\frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{x \cdot \left(\pi \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi}} \]
  4. Taylor expanded in x around 0 64.5%

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

    \[\leadsto 1 \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot \left({x}^{2} \cdot {\pi}^{2}\right)\right)} \]
  6. Step-by-step derivation
    1. +-commutative64.7%

      \[\leadsto 1 \cdot \color{blue}{\left(-0.16666666666666666 \cdot \left({x}^{2} \cdot {\pi}^{2}\right) + 1\right)} \]
    2. fma-def64.7%

      \[\leadsto 1 \cdot \color{blue}{\mathsf{fma}\left(-0.16666666666666666, {x}^{2} \cdot {\pi}^{2}, 1\right)} \]
    3. unpow264.7%

      \[\leadsto 1 \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{\left(x \cdot x\right)} \cdot {\pi}^{2}, 1\right) \]
    4. unpow264.7%

      \[\leadsto 1 \cdot \mathsf{fma}\left(-0.16666666666666666, \left(x \cdot x\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)}, 1\right) \]
    5. swap-sqr64.7%

      \[\leadsto 1 \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{\left(x \cdot \pi\right) \cdot \left(x \cdot \pi\right)}, 1\right) \]
    6. unpow264.7%

      \[\leadsto 1 \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{{\left(x \cdot \pi\right)}^{2}}, 1\right) \]
  7. Simplified64.7%

    \[\leadsto 1 \cdot \color{blue}{\mathsf{fma}\left(-0.16666666666666666, {\left(x \cdot \pi\right)}^{2}, 1\right)} \]
  8. Step-by-step derivation
    1. unpow264.7%

      \[\leadsto 1 \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{\left(x \cdot \pi\right) \cdot \left(x \cdot \pi\right)}, 1\right) \]
    2. *-commutative64.7%

      \[\leadsto 1 \cdot \mathsf{fma}\left(-0.16666666666666666, \left(x \cdot \pi\right) \cdot \color{blue}{\left(\pi \cdot x\right)}, 1\right) \]
    3. associate-*r*64.7%

      \[\leadsto 1 \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{\left(\left(x \cdot \pi\right) \cdot \pi\right) \cdot x}, 1\right) \]
    4. *-commutative64.7%

      \[\leadsto 1 \cdot \mathsf{fma}\left(-0.16666666666666666, \left(\color{blue}{\left(\pi \cdot x\right)} \cdot \pi\right) \cdot x, 1\right) \]
  9. Applied egg-rr64.7%

    \[\leadsto 1 \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{\left(\left(\pi \cdot x\right) \cdot \pi\right) \cdot x}, 1\right) \]
  10. Final simplification64.7%

    \[\leadsto \mathsf{fma}\left(-0.16666666666666666, x \cdot \left(\pi \cdot \left(\pi \cdot x\right)\right), 1\right) \]

Alternative 11: 64.1% accurate, 3.0× speedup?

\[\begin{array}{l} \\ 1 + -0.16666666666666666 \cdot {\left(\pi \cdot x\right)}^{2} \end{array} \]
(FPCore (x tau)
 :precision binary32
 (+ 1.0 (* -0.16666666666666666 (pow (* PI x) 2.0))))
float code(float x, float tau) {
	return 1.0f + (-0.16666666666666666f * powf((((float) M_PI) * x), 2.0f));
}
function code(x, tau)
	return Float32(Float32(1.0) + Float32(Float32(-0.16666666666666666) * (Float32(Float32(pi) * x) ^ Float32(2.0))))
end
function tmp = code(x, tau)
	tmp = single(1.0) + (single(-0.16666666666666666) * ((single(pi) * x) ^ single(2.0)));
end
\begin{array}{l}

\\
1 + -0.16666666666666666 \cdot {\left(\pi \cdot x\right)}^{2}
\end{array}
Derivation
  1. Initial program 97.9%

    \[\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  2. Step-by-step derivation
    1. associate-*l*97.4%

      \[\leadsto \frac{\sin \color{blue}{\left(x \cdot \left(\pi \cdot tau\right)\right)}}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    2. associate-*l*97.9%

      \[\leadsto \frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{\color{blue}{x \cdot \left(\pi \cdot tau\right)}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  3. Simplified97.9%

    \[\leadsto \color{blue}{\frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{x \cdot \left(\pi \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi}} \]
  4. Taylor expanded in x around 0 64.5%

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

    \[\leadsto 1 \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot \left({x}^{2} \cdot {\pi}^{2}\right)\right)} \]
  6. Step-by-step derivation
    1. +-commutative64.7%

      \[\leadsto 1 \cdot \color{blue}{\left(-0.16666666666666666 \cdot \left({x}^{2} \cdot {\pi}^{2}\right) + 1\right)} \]
    2. fma-def64.7%

      \[\leadsto 1 \cdot \color{blue}{\mathsf{fma}\left(-0.16666666666666666, {x}^{2} \cdot {\pi}^{2}, 1\right)} \]
    3. unpow264.7%

      \[\leadsto 1 \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{\left(x \cdot x\right)} \cdot {\pi}^{2}, 1\right) \]
    4. unpow264.7%

      \[\leadsto 1 \cdot \mathsf{fma}\left(-0.16666666666666666, \left(x \cdot x\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)}, 1\right) \]
    5. swap-sqr64.7%

      \[\leadsto 1 \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{\left(x \cdot \pi\right) \cdot \left(x \cdot \pi\right)}, 1\right) \]
    6. unpow264.7%

      \[\leadsto 1 \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{{\left(x \cdot \pi\right)}^{2}}, 1\right) \]
  7. Simplified64.7%

    \[\leadsto 1 \cdot \color{blue}{\mathsf{fma}\left(-0.16666666666666666, {\left(x \cdot \pi\right)}^{2}, 1\right)} \]
  8. Step-by-step derivation
    1. fma-udef64.7%

      \[\leadsto 1 \cdot \color{blue}{\left(-0.16666666666666666 \cdot {\left(x \cdot \pi\right)}^{2} + 1\right)} \]
    2. *-commutative64.7%

      \[\leadsto 1 \cdot \left(\color{blue}{{\left(x \cdot \pi\right)}^{2} \cdot -0.16666666666666666} + 1\right) \]
    3. *-commutative64.7%

      \[\leadsto 1 \cdot \left({\color{blue}{\left(\pi \cdot x\right)}}^{2} \cdot -0.16666666666666666 + 1\right) \]
  9. Applied egg-rr64.7%

    \[\leadsto 1 \cdot \color{blue}{\left({\left(\pi \cdot x\right)}^{2} \cdot -0.16666666666666666 + 1\right)} \]
  10. Final simplification64.7%

    \[\leadsto 1 + -0.16666666666666666 \cdot {\left(\pi \cdot x\right)}^{2} \]

Alternative 12: 4.6% accurate, 3.0× speedup?

\[\begin{array}{l} \\ -0.16666666666666666 \cdot {\left(\pi \cdot x\right)}^{2} \end{array} \]
(FPCore (x tau)
 :precision binary32
 (* -0.16666666666666666 (pow (* PI x) 2.0)))
float code(float x, float tau) {
	return -0.16666666666666666f * powf((((float) M_PI) * x), 2.0f);
}
function code(x, tau)
	return Float32(Float32(-0.16666666666666666) * (Float32(Float32(pi) * x) ^ Float32(2.0)))
end
function tmp = code(x, tau)
	tmp = single(-0.16666666666666666) * ((single(pi) * x) ^ single(2.0));
end
\begin{array}{l}

\\
-0.16666666666666666 \cdot {\left(\pi \cdot x\right)}^{2}
\end{array}
Derivation
  1. Initial program 97.9%

    \[\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  2. Step-by-step derivation
    1. associate-*l*97.4%

      \[\leadsto \frac{\sin \color{blue}{\left(x \cdot \left(\pi \cdot tau\right)\right)}}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    2. associate-*l*97.9%

      \[\leadsto \frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{\color{blue}{x \cdot \left(\pi \cdot tau\right)}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  3. Simplified97.9%

    \[\leadsto \color{blue}{\frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{x \cdot \left(\pi \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi}} \]
  4. Taylor expanded in x around 0 64.5%

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

    \[\leadsto 1 \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot \left({x}^{2} \cdot {\pi}^{2}\right)\right)} \]
  6. Step-by-step derivation
    1. +-commutative64.7%

      \[\leadsto 1 \cdot \color{blue}{\left(-0.16666666666666666 \cdot \left({x}^{2} \cdot {\pi}^{2}\right) + 1\right)} \]
    2. fma-def64.7%

      \[\leadsto 1 \cdot \color{blue}{\mathsf{fma}\left(-0.16666666666666666, {x}^{2} \cdot {\pi}^{2}, 1\right)} \]
    3. unpow264.7%

      \[\leadsto 1 \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{\left(x \cdot x\right)} \cdot {\pi}^{2}, 1\right) \]
    4. unpow264.7%

      \[\leadsto 1 \cdot \mathsf{fma}\left(-0.16666666666666666, \left(x \cdot x\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)}, 1\right) \]
    5. swap-sqr64.7%

      \[\leadsto 1 \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{\left(x \cdot \pi\right) \cdot \left(x \cdot \pi\right)}, 1\right) \]
    6. unpow264.7%

      \[\leadsto 1 \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{{\left(x \cdot \pi\right)}^{2}}, 1\right) \]
  7. Simplified64.7%

    \[\leadsto 1 \cdot \color{blue}{\mathsf{fma}\left(-0.16666666666666666, {\left(x \cdot \pi\right)}^{2}, 1\right)} \]
  8. Taylor expanded in x around inf 5.0%

    \[\leadsto 1 \cdot \color{blue}{\left(-0.16666666666666666 \cdot \left({x}^{2} \cdot {\pi}^{2}\right)\right)} \]
  9. Step-by-step derivation
    1. *-commutative5.0%

      \[\leadsto 1 \cdot \left(-0.16666666666666666 \cdot \color{blue}{\left({\pi}^{2} \cdot {x}^{2}\right)}\right) \]
    2. unpow25.0%

      \[\leadsto 1 \cdot \left(-0.16666666666666666 \cdot \left(\color{blue}{\left(\pi \cdot \pi\right)} \cdot {x}^{2}\right)\right) \]
    3. unpow25.0%

      \[\leadsto 1 \cdot \left(-0.16666666666666666 \cdot \left(\left(\pi \cdot \pi\right) \cdot \color{blue}{\left(x \cdot x\right)}\right)\right) \]
    4. swap-sqr5.0%

      \[\leadsto 1 \cdot \left(-0.16666666666666666 \cdot \color{blue}{\left(\left(\pi \cdot x\right) \cdot \left(\pi \cdot x\right)\right)}\right) \]
    5. unpow25.0%

      \[\leadsto 1 \cdot \left(-0.16666666666666666 \cdot \color{blue}{{\left(\pi \cdot x\right)}^{2}}\right) \]
    6. *-commutative5.0%

      \[\leadsto 1 \cdot \left(-0.16666666666666666 \cdot {\color{blue}{\left(x \cdot \pi\right)}}^{2}\right) \]
  10. Simplified5.0%

    \[\leadsto 1 \cdot \color{blue}{\left(-0.16666666666666666 \cdot {\left(x \cdot \pi\right)}^{2}\right)} \]
  11. Final simplification5.0%

    \[\leadsto -0.16666666666666666 \cdot {\left(\pi \cdot x\right)}^{2} \]

Alternative 13: 63.2% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \frac{\pi \cdot x}{\pi \cdot x} \end{array} \]
(FPCore (x tau) :precision binary32 (/ (* PI x) (* PI x)))
float code(float x, float tau) {
	return (((float) M_PI) * x) / (((float) M_PI) * x);
}
function code(x, tau)
	return Float32(Float32(Float32(pi) * x) / Float32(Float32(pi) * x))
end
function tmp = code(x, tau)
	tmp = (single(pi) * x) / (single(pi) * x);
end
\begin{array}{l}

\\
\frac{\pi \cdot x}{\pi \cdot x}
\end{array}
Derivation
  1. Initial program 97.9%

    \[\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  2. Step-by-step derivation
    1. associate-*l*97.4%

      \[\leadsto \frac{\sin \color{blue}{\left(x \cdot \left(\pi \cdot tau\right)\right)}}{\left(x \cdot \pi\right) \cdot tau} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
    2. associate-*l*97.9%

      \[\leadsto \frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{\color{blue}{x \cdot \left(\pi \cdot tau\right)}} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \]
  3. Simplified97.9%

    \[\leadsto \color{blue}{\frac{\sin \left(x \cdot \left(\pi \cdot tau\right)\right)}{x \cdot \left(\pi \cdot tau\right)} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi}} \]
  4. Taylor expanded in x around 0 64.5%

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

    \[\leadsto 1 \cdot \frac{\color{blue}{x \cdot \pi}}{x \cdot \pi} \]
  6. Final simplification63.8%

    \[\leadsto \frac{\pi \cdot x}{\pi \cdot x} \]

Reproduce

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