
(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:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(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}
Initial program 97.4%
Final simplification97.4%
(FPCore (x tau) :precision binary32 (let* ((t_1 (* x (* PI tau)))) (* (/ (sin (* x PI)) (* x PI)) (/ (sin t_1) t_1))))
float code(float x, float tau) {
float t_1 = x * (((float) M_PI) * tau);
return (sinf((x * ((float) M_PI))) / (x * ((float) M_PI))) * (sinf(t_1) / t_1);
}
function code(x, tau) t_1 = Float32(x * Float32(Float32(pi) * tau)) return Float32(Float32(sin(Float32(x * Float32(pi))) / Float32(x * Float32(pi))) * Float32(sin(t_1) / t_1)) end
function tmp = code(x, tau) t_1 = x * (single(pi) * tau); tmp = (sin((x * single(pi))) / (x * single(pi))) * (sin(t_1) / t_1); end
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\pi \cdot tau\right)\\
\frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi} \cdot \frac{\sin t_1}{t_1}
\end{array}
\end{array}
Initial program 97.4%
associate-*l*96.7%
associate-*l*97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x tau) :precision binary32 (* (sin (* x PI)) (* (pow (* x PI) -2.0) (/ (sin (* PI (* x tau))) tau))))
float code(float x, float tau) {
return sinf((x * ((float) M_PI))) * (powf((x * ((float) M_PI)), -2.0f) * (sinf((((float) M_PI) * (x * tau))) / tau));
}
function code(x, tau) return Float32(sin(Float32(x * Float32(pi))) * Float32((Float32(x * Float32(pi)) ^ Float32(-2.0)) * Float32(sin(Float32(Float32(pi) * Float32(x * tau))) / tau))) end
function tmp = code(x, tau) tmp = sin((x * single(pi))) * (((x * single(pi)) ^ single(-2.0)) * (sin((single(pi) * (x * tau))) / tau)); end
\begin{array}{l}
\\
\sin \left(x \cdot \pi\right) \cdot \left({\left(x \cdot \pi\right)}^{-2} \cdot \frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{tau}\right)
\end{array}
Initial program 97.4%
*-commutative97.4%
times-frac97.4%
associate-*r/97.2%
associate-*r*96.9%
associate-/r*97.0%
associate-/l/96.9%
associate-*l*96.6%
swap-sqr96.4%
associate-*r*96.6%
Simplified96.6%
*-commutative96.6%
associate-*l/96.6%
associate-/l*96.6%
associate-*r*96.3%
*-commutative96.3%
associate-*l*96.3%
associate-/l*96.5%
*-commutative96.5%
associate-*r*96.5%
swap-sqr96.6%
pow296.6%
*-commutative96.6%
Applied egg-rr96.6%
associate-/r/96.5%
associate-/r*96.7%
un-div-inv96.4%
clear-num96.4%
associate-*r/96.6%
expm1-log1p-u96.3%
expm1-udef95.8%
Applied egg-rr96.0%
expm1-def96.5%
expm1-log1p96.7%
associate-*r/96.7%
*-commutative96.7%
associate-/r/96.6%
associate-*r/96.6%
*-commutative96.6%
associate-*r*97.0%
*-commutative97.0%
*-commutative97.0%
Simplified96.7%
Final simplification96.7%
(FPCore (x tau) :precision binary32 (* (sin (* PI (* x tau))) (/ (sin (* x PI)) (/ tau (pow (* x PI) -2.0)))))
float code(float x, float tau) {
return sinf((((float) M_PI) * (x * tau))) * (sinf((x * ((float) M_PI))) / (tau / powf((x * ((float) M_PI)), -2.0f)));
}
function code(x, tau) return Float32(sin(Float32(Float32(pi) * Float32(x * tau))) * Float32(sin(Float32(x * Float32(pi))) / Float32(tau / (Float32(x * Float32(pi)) ^ Float32(-2.0))))) end
function tmp = code(x, tau) tmp = sin((single(pi) * (x * tau))) * (sin((x * single(pi))) / (tau / ((x * single(pi)) ^ single(-2.0)))); end
\begin{array}{l}
\\
\sin \left(\pi \cdot \left(x \cdot tau\right)\right) \cdot \frac{\sin \left(x \cdot \pi\right)}{\frac{tau}{{\left(x \cdot \pi\right)}^{-2}}}
\end{array}
Initial program 97.4%
*-commutative97.4%
times-frac97.4%
associate-*r/97.2%
associate-*r*96.9%
associate-/r*97.0%
associate-/l/96.9%
associate-*l*96.6%
swap-sqr96.4%
associate-*r*96.6%
Simplified96.6%
*-commutative96.6%
associate-*l/96.6%
associate-/l*96.6%
associate-*r*96.3%
*-commutative96.3%
associate-*l*96.3%
associate-/l*96.5%
*-commutative96.5%
associate-*r*96.5%
swap-sqr96.6%
pow296.6%
*-commutative96.6%
Applied egg-rr96.6%
associate-/r/96.5%
associate-/r*96.7%
un-div-inv96.4%
clear-num96.4%
div-inv96.2%
Applied egg-rr96.7%
add-log-exp60.0%
*-commutative60.0%
*-commutative60.0%
associate-*r*60.1%
*-commutative60.1%
Applied egg-rr60.1%
expm1-log1p-u60.1%
expm1-udef59.5%
add-log-exp96.2%
associate-/r/96.2%
*-commutative96.2%
Applied egg-rr96.2%
expm1-def96.8%
expm1-log1p97.0%
associate-*l/97.0%
associate-*r/96.9%
associate-*l*96.9%
*-commutative96.9%
associate-*l*96.6%
associate-*l/96.6%
associate-/l*96.8%
Simplified96.8%
Final simplification96.8%
(FPCore (x tau) :precision binary32 (* (pow (* x PI) -2.0) (* (sin (* (* x PI) tau)) (/ (sin (* x PI)) tau))))
float code(float x, float tau) {
return powf((x * ((float) M_PI)), -2.0f) * (sinf(((x * ((float) M_PI)) * tau)) * (sinf((x * ((float) M_PI))) / tau));
}
function code(x, tau) return Float32((Float32(x * Float32(pi)) ^ Float32(-2.0)) * Float32(sin(Float32(Float32(x * Float32(pi)) * tau)) * Float32(sin(Float32(x * Float32(pi))) / tau))) end
function tmp = code(x, tau) tmp = ((x * single(pi)) ^ single(-2.0)) * (sin(((x * single(pi)) * tau)) * (sin((x * single(pi))) / tau)); end
\begin{array}{l}
\\
{\left(x \cdot \pi\right)}^{-2} \cdot \left(\sin \left(\left(x \cdot \pi\right) \cdot tau\right) \cdot \frac{\sin \left(x \cdot \pi\right)}{tau}\right)
\end{array}
Initial program 97.4%
*-commutative97.4%
times-frac97.4%
associate-*r/97.2%
associate-*r*96.9%
associate-/r*97.0%
associate-/l/96.9%
associate-*l*96.6%
swap-sqr96.4%
associate-*r*96.6%
Simplified96.6%
*-commutative96.6%
associate-*l/96.6%
associate-/l*96.6%
associate-*r*96.3%
*-commutative96.3%
associate-*l*96.3%
associate-/l*96.5%
*-commutative96.5%
associate-*r*96.5%
swap-sqr96.6%
pow296.6%
*-commutative96.6%
Applied egg-rr96.6%
associate-/r/96.5%
associate-/r*96.7%
un-div-inv96.4%
clear-num96.4%
div-inv96.2%
Applied egg-rr96.7%
add-log-exp60.0%
*-commutative60.0%
*-commutative60.0%
associate-*r*60.1%
*-commutative60.1%
Applied egg-rr60.1%
add-log-exp97.0%
div-inv96.8%
clear-num96.9%
Applied egg-rr96.9%
Final simplification96.9%
(FPCore (x tau) :precision binary32 (* (pow (* x PI) -2.0) (* (sin (* x PI)) (/ (sin (* (* x PI) tau)) tau))))
float code(float x, float tau) {
return powf((x * ((float) M_PI)), -2.0f) * (sinf((x * ((float) M_PI))) * (sinf(((x * ((float) M_PI)) * tau)) / tau));
}
function code(x, tau) return Float32((Float32(x * Float32(pi)) ^ Float32(-2.0)) * Float32(sin(Float32(x * Float32(pi))) * Float32(sin(Float32(Float32(x * Float32(pi)) * tau)) / tau))) end
function tmp = code(x, tau) tmp = ((x * single(pi)) ^ single(-2.0)) * (sin((x * single(pi))) * (sin(((x * single(pi)) * tau)) / tau)); end
\begin{array}{l}
\\
{\left(x \cdot \pi\right)}^{-2} \cdot \left(\sin \left(x \cdot \pi\right) \cdot \frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{tau}\right)
\end{array}
Initial program 97.4%
*-commutative97.4%
times-frac97.4%
associate-*r/97.2%
associate-*r*96.9%
associate-/r*97.0%
associate-/l/96.9%
associate-*l*96.6%
swap-sqr96.4%
associate-*r*96.6%
Simplified96.6%
*-commutative96.6%
associate-*l/96.6%
associate-/l*96.6%
associate-*r*96.3%
*-commutative96.3%
associate-*l*96.3%
associate-/l*96.5%
*-commutative96.5%
associate-*r*96.5%
swap-sqr96.6%
pow296.6%
*-commutative96.6%
Applied egg-rr96.6%
associate-/r/96.5%
associate-/r*96.7%
un-div-inv96.4%
clear-num96.4%
div-inv96.2%
Applied egg-rr96.7%
associate-/r/96.5%
*-commutative96.5%
*-commutative96.5%
associate-*r*97.0%
*-commutative97.0%
Applied egg-rr97.0%
Final simplification97.0%
(FPCore (x tau) :precision binary32 (* (/ (* (sin (* x PI)) (sin (* (* x PI) tau))) tau) (pow (* x PI) -2.0)))
float code(float x, float tau) {
return ((sinf((x * ((float) M_PI))) * sinf(((x * ((float) M_PI)) * tau))) / tau) * powf((x * ((float) M_PI)), -2.0f);
}
function code(x, tau) return Float32(Float32(Float32(sin(Float32(x * Float32(pi))) * sin(Float32(Float32(x * Float32(pi)) * tau))) / tau) * (Float32(x * Float32(pi)) ^ Float32(-2.0))) end
function tmp = code(x, tau) tmp = ((sin((x * single(pi))) * sin(((x * single(pi)) * tau))) / tau) * ((x * single(pi)) ^ single(-2.0)); end
\begin{array}{l}
\\
\frac{\sin \left(x \cdot \pi\right) \cdot \sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{tau} \cdot {\left(x \cdot \pi\right)}^{-2}
\end{array}
Initial program 97.4%
*-commutative97.4%
times-frac97.4%
associate-*r/97.2%
associate-*r*96.9%
associate-/r*97.0%
associate-/l/96.9%
associate-*l*96.6%
swap-sqr96.4%
associate-*r*96.6%
Simplified96.6%
*-commutative96.6%
associate-*l/96.6%
associate-/l*96.6%
associate-*r*96.3%
*-commutative96.3%
associate-*l*96.3%
associate-/l*96.5%
*-commutative96.5%
associate-*r*96.5%
swap-sqr96.6%
pow296.6%
*-commutative96.6%
Applied egg-rr96.6%
associate-/r/96.5%
associate-/r*96.7%
un-div-inv96.4%
clear-num96.4%
div-inv96.2%
Applied egg-rr96.7%
Taylor expanded in x around -inf 97.0%
Final simplification97.0%
(FPCore (x tau) :precision binary32 (/ (sin (* (* x PI) tau)) (/ tau (/ (sin (* x PI)) (pow (* x PI) 2.0)))))
float code(float x, float tau) {
return sinf(((x * ((float) M_PI)) * tau)) / (tau / (sinf((x * ((float) M_PI))) / powf((x * ((float) M_PI)), 2.0f)));
}
function code(x, tau) return Float32(sin(Float32(Float32(x * Float32(pi)) * tau)) / Float32(tau / Float32(sin(Float32(x * Float32(pi))) / (Float32(x * Float32(pi)) ^ Float32(2.0))))) end
function tmp = code(x, tau) tmp = sin(((x * single(pi)) * tau)) / (tau / (sin((x * single(pi))) / ((x * single(pi)) ^ single(2.0)))); end
\begin{array}{l}
\\
\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\frac{tau}{\frac{\sin \left(x \cdot \pi\right)}{{\left(x \cdot \pi\right)}^{2}}}}
\end{array}
Initial program 97.4%
*-commutative97.4%
times-frac97.4%
associate-*r/97.2%
associate-*r*96.9%
associate-/r*97.0%
associate-/l/96.9%
associate-*l*96.6%
swap-sqr96.4%
associate-*r*96.6%
Simplified96.6%
*-commutative96.6%
associate-*l/96.6%
associate-/l*96.6%
associate-*r*96.3%
*-commutative96.3%
associate-*l*96.3%
associate-/l*96.5%
*-commutative96.5%
associate-*r*96.5%
swap-sqr96.6%
pow296.6%
*-commutative96.6%
Applied egg-rr96.6%
Taylor expanded in x around -inf 97.0%
Final simplification97.0%
(FPCore (x tau) :precision binary32 (let* ((t_1 (* (* x PI) tau))) (* (/ (sin t_1) t_1) (+ 1.0 (* -0.16666666666666666 (pow (* x PI) 2.0))))))
float code(float x, float tau) {
float t_1 = (x * ((float) M_PI)) * tau;
return (sinf(t_1) / t_1) * (1.0f + (-0.16666666666666666f * powf((x * ((float) M_PI)), 2.0f)));
}
function code(x, tau) t_1 = Float32(Float32(x * Float32(pi)) * tau) return Float32(Float32(sin(t_1) / t_1) * Float32(Float32(1.0) + Float32(Float32(-0.16666666666666666) * (Float32(x * Float32(pi)) ^ Float32(2.0))))) end
function tmp = code(x, tau) t_1 = (x * single(pi)) * tau; tmp = (sin(t_1) / t_1) * (single(1.0) + (single(-0.16666666666666666) * ((x * single(pi)) ^ single(2.0)))); end
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \pi\right) \cdot tau\\
\frac{\sin t_1}{t_1} \cdot \left(1 + -0.16666666666666666 \cdot {\left(x \cdot \pi\right)}^{2}\right)
\end{array}
\end{array}
Initial program 97.4%
add-sqr-sqrt96.7%
sqrt-unprod97.4%
swap-sqr97.1%
associate-*r*97.2%
expm1-log1p-u97.1%
associate-*r*97.1%
swap-sqr97.4%
sqrt-unprod96.8%
add-sqr-sqrt97.4%
*-commutative97.4%
Applied egg-rr97.4%
Taylor expanded in x around 0 81.3%
unpow281.3%
unpow281.3%
swap-sqr81.3%
unpow281.3%
Simplified81.3%
Final simplification81.3%
(FPCore (x tau) :precision binary32 (/ (sin (* (* x PI) tau)) (/ tau (fma -0.16666666666666666 (* x PI) (/ 1.0 (* x PI))))))
float code(float x, float tau) {
return sinf(((x * ((float) M_PI)) * tau)) / (tau / fmaf(-0.16666666666666666f, (x * ((float) M_PI)), (1.0f / (x * ((float) M_PI)))));
}
function code(x, tau) return Float32(sin(Float32(Float32(x * Float32(pi)) * tau)) / Float32(tau / fma(Float32(-0.16666666666666666), Float32(x * Float32(pi)), Float32(Float32(1.0) / Float32(x * Float32(pi)))))) end
\begin{array}{l}
\\
\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\frac{tau}{\mathsf{fma}\left(-0.16666666666666666, x \cdot \pi, \frac{1}{x \cdot \pi}\right)}}
\end{array}
Initial program 97.4%
*-commutative97.4%
times-frac97.4%
associate-*r/97.2%
associate-*r*96.9%
associate-/r*97.0%
associate-/l/96.9%
associate-*l*96.6%
swap-sqr96.4%
associate-*r*96.6%
Simplified96.6%
*-commutative96.6%
associate-*l/96.6%
associate-/l*96.6%
associate-*r*96.3%
*-commutative96.3%
associate-*l*96.3%
associate-/l*96.5%
*-commutative96.5%
associate-*r*96.5%
swap-sqr96.6%
pow296.6%
*-commutative96.6%
Applied egg-rr96.6%
Taylor expanded in x around -inf 97.0%
Taylor expanded in x around 0 80.8%
+-commutative80.8%
*-commutative80.8%
fma-def80.8%
*-commutative80.8%
*-commutative80.8%
Simplified80.8%
Final simplification80.8%
(FPCore (x tau) :precision binary32 (/ (sin (* (* x PI) tau)) (/ tau (+ (/ 1.0 (* x PI)) (* (* x PI) -0.16666666666666666)))))
float code(float x, float tau) {
return sinf(((x * ((float) M_PI)) * tau)) / (tau / ((1.0f / (x * ((float) M_PI))) + ((x * ((float) M_PI)) * -0.16666666666666666f)));
}
function code(x, tau) return Float32(sin(Float32(Float32(x * Float32(pi)) * tau)) / Float32(tau / Float32(Float32(Float32(1.0) / Float32(x * Float32(pi))) + Float32(Float32(x * Float32(pi)) * Float32(-0.16666666666666666))))) end
function tmp = code(x, tau) tmp = sin(((x * single(pi)) * tau)) / (tau / ((single(1.0) / (x * single(pi))) + ((x * single(pi)) * single(-0.16666666666666666)))); end
\begin{array}{l}
\\
\frac{\sin \left(\left(x \cdot \pi\right) \cdot tau\right)}{\frac{tau}{\frac{1}{x \cdot \pi} + \left(x \cdot \pi\right) \cdot -0.16666666666666666}}
\end{array}
Initial program 97.4%
*-commutative97.4%
times-frac97.4%
associate-*r/97.2%
associate-*r*96.9%
associate-/r*97.0%
associate-/l/96.9%
associate-*l*96.6%
swap-sqr96.4%
associate-*r*96.6%
Simplified96.6%
*-commutative96.6%
associate-*l/96.6%
associate-/l*96.6%
associate-*r*96.3%
*-commutative96.3%
associate-*l*96.3%
associate-/l*96.5%
*-commutative96.5%
associate-*r*96.5%
swap-sqr96.6%
pow296.6%
*-commutative96.6%
Applied egg-rr96.6%
Taylor expanded in x around -inf 97.0%
Taylor expanded in x around 0 80.8%
Final simplification80.8%
(FPCore (x tau) :precision binary32 (+ 1.0 (* (* -0.16666666666666666 (+ (pow PI 2.0) (* (pow PI 2.0) (* tau tau)))) (* x x))))
float code(float x, float tau) {
return 1.0f + ((-0.16666666666666666f * (powf(((float) M_PI), 2.0f) + (powf(((float) M_PI), 2.0f) * (tau * tau)))) * (x * x));
}
function code(x, tau) return Float32(Float32(1.0) + Float32(Float32(Float32(-0.16666666666666666) * Float32((Float32(pi) ^ Float32(2.0)) + Float32((Float32(pi) ^ Float32(2.0)) * Float32(tau * tau)))) * Float32(x * x))) end
function tmp = code(x, tau) tmp = single(1.0) + ((single(-0.16666666666666666) * ((single(pi) ^ single(2.0)) + ((single(pi) ^ single(2.0)) * (tau * tau)))) * (x * x)); end
\begin{array}{l}
\\
1 + \left(-0.16666666666666666 \cdot \left({\pi}^{2} + {\pi}^{2} \cdot \left(tau \cdot tau\right)\right)\right) \cdot \left(x \cdot x\right)
\end{array}
Initial program 97.4%
*-commutative97.4%
times-frac97.4%
associate-*r/97.2%
associate-*r*96.9%
associate-/r*97.0%
associate-/l/96.9%
associate-*l*96.6%
swap-sqr96.4%
associate-*r*96.6%
Simplified96.6%
Taylor expanded in x around 0 75.1%
distribute-lft-out75.1%
*-commutative75.1%
unpow275.1%
unpow275.1%
Simplified75.1%
Final simplification75.1%
(FPCore (x tau) :precision binary32 (fma (* -0.16666666666666666 (* (pow PI 2.0) (+ 1.0 (* tau tau)))) (* x x) 1.0))
float code(float x, float tau) {
return fmaf((-0.16666666666666666f * (powf(((float) M_PI), 2.0f) * (1.0f + (tau * tau)))), (x * x), 1.0f);
}
function code(x, tau) return fma(Float32(Float32(-0.16666666666666666) * Float32((Float32(pi) ^ Float32(2.0)) * Float32(Float32(1.0) + Float32(tau * tau)))), Float32(x * x), Float32(1.0)) end
\begin{array}{l}
\\
\mathsf{fma}\left(-0.16666666666666666 \cdot \left({\pi}^{2} \cdot \left(1 + tau \cdot tau\right)\right), x \cdot x, 1\right)
\end{array}
Initial program 97.4%
*-commutative97.4%
times-frac97.4%
associate-*r/97.2%
associate-*r*96.9%
associate-/r*97.0%
associate-/l/96.9%
associate-*l*96.6%
swap-sqr96.4%
associate-*r*96.6%
Simplified96.6%
Taylor expanded in x around 0 75.1%
+-commutative75.1%
fma-def75.1%
distribute-lft-out75.1%
distribute-rgt1-in75.1%
unpow275.1%
unpow275.1%
Simplified75.1%
Final simplification75.1%
(FPCore (x tau) :precision binary32 (let* ((t_1 (* PI (* x tau)))) (/ (sin t_1) t_1)))
float code(float x, float tau) {
float t_1 = ((float) M_PI) * (x * tau);
return sinf(t_1) / t_1;
}
function code(x, tau) t_1 = Float32(Float32(pi) * Float32(x * tau)) return Float32(sin(t_1) / t_1) end
function tmp = code(x, tau) t_1 = single(pi) * (x * tau); tmp = sin(t_1) / t_1; end
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \pi \cdot \left(x \cdot tau\right)\\
\frac{\sin t_1}{t_1}
\end{array}
\end{array}
Initial program 97.4%
*-commutative97.4%
times-frac97.4%
associate-*r/97.2%
associate-*r*96.9%
associate-/r*97.0%
associate-/l/96.9%
associate-*l*96.6%
swap-sqr96.4%
associate-*r*96.6%
Simplified96.6%
*-commutative96.6%
associate-*l/96.6%
associate-/l*96.6%
associate-*r*96.3%
*-commutative96.3%
associate-*l*96.3%
associate-/l*96.5%
*-commutative96.5%
associate-*r*96.5%
swap-sqr96.6%
pow296.6%
*-commutative96.6%
Applied egg-rr96.6%
add-sqr-sqrt96.1%
pow296.1%
associate-*r*96.3%
*-commutative96.3%
associate-*l*96.1%
Applied egg-rr96.1%
Taylor expanded in x around 0 68.4%
associate-/r*68.5%
Simplified68.5%
expm1-log1p-u68.6%
expm1-udef68.5%
associate-/r/68.6%
unpow268.6%
add-sqr-sqrt68.7%
*-commutative68.7%
*-commutative68.7%
associate-*r*68.7%
associate-/l/68.8%
Applied egg-rr68.8%
expm1-def68.8%
expm1-log1p68.8%
associate-*l/68.7%
associate-/l*68.6%
associate-/l/68.5%
associate-/l*68.6%
associate-*l/68.5%
*-commutative68.5%
associate-*l*68.7%
*-commutative68.7%
associate-/r/68.8%
/-rgt-identity68.8%
*-commutative68.8%
Simplified68.8%
Final simplification68.8%
(FPCore (x tau) :precision binary32 (let* ((t_1 (* (* x PI) tau))) (/ (sin t_1) t_1)))
float code(float x, float tau) {
float t_1 = (x * ((float) M_PI)) * tau;
return sinf(t_1) / t_1;
}
function code(x, tau) t_1 = Float32(Float32(x * Float32(pi)) * tau) return Float32(sin(t_1) / t_1) end
function tmp = code(x, tau) t_1 = (x * single(pi)) * tau; tmp = sin(t_1) / t_1; end
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \pi\right) \cdot tau\\
\frac{\sin t_1}{t_1}
\end{array}
\end{array}
Initial program 97.4%
add-sqr-sqrt96.7%
sqrt-unprod97.4%
swap-sqr97.1%
associate-*r*97.2%
expm1-log1p-u97.1%
associate-*r*97.1%
swap-sqr97.4%
sqrt-unprod96.8%
add-sqr-sqrt97.4%
*-commutative97.4%
Applied egg-rr97.4%
Taylor expanded in x around 0 68.8%
Final simplification68.8%
(FPCore (x tau) :precision binary32 (fma (pow PI 2.0) (* -0.16666666666666666 (* x x)) 1.0))
float code(float x, float tau) {
return fmaf(powf(((float) M_PI), 2.0f), (-0.16666666666666666f * (x * x)), 1.0f);
}
function code(x, tau) return fma((Float32(pi) ^ Float32(2.0)), Float32(Float32(-0.16666666666666666) * Float32(x * x)), Float32(1.0)) end
\begin{array}{l}
\\
\mathsf{fma}\left({\pi}^{2}, -0.16666666666666666 \cdot \left(x \cdot x\right), 1\right)
\end{array}
Initial program 97.4%
*-commutative97.4%
times-frac97.4%
associate-*r/97.2%
associate-*r*96.9%
associate-/r*97.0%
associate-/l/96.9%
associate-*l*96.6%
swap-sqr96.4%
associate-*r*96.6%
Simplified96.6%
Taylor expanded in tau around 0 62.1%
expm1-log1p-u62.1%
expm1-udef53.0%
log1p-udef53.0%
add-exp-log53.0%
+-commutative53.0%
*-commutative53.0%
Applied egg-rr53.0%
Taylor expanded in x around 0 62.4%
associate-*r*62.4%
unpow262.4%
Simplified62.4%
+-commutative62.4%
*-commutative62.4%
fma-def62.4%
Applied egg-rr62.4%
Final simplification62.4%
(FPCore (x tau) :precision binary32 (fma -0.16666666666666666 (pow (* x PI) 2.0) 1.0))
float code(float x, float tau) {
return fmaf(-0.16666666666666666f, powf((x * ((float) M_PI)), 2.0f), 1.0f);
}
function code(x, tau) return fma(Float32(-0.16666666666666666), (Float32(x * Float32(pi)) ^ Float32(2.0)), Float32(1.0)) end
\begin{array}{l}
\\
\mathsf{fma}\left(-0.16666666666666666, {\left(x \cdot \pi\right)}^{2}, 1\right)
\end{array}
Initial program 97.4%
*-commutative97.4%
times-frac97.4%
associate-*r/97.2%
associate-*r*96.9%
associate-/r*97.0%
associate-/l/96.9%
associate-*l*96.6%
swap-sqr96.4%
associate-*r*96.6%
Simplified96.6%
Taylor expanded in tau around 0 62.1%
expm1-log1p-u62.1%
expm1-udef53.0%
log1p-udef53.0%
add-exp-log53.0%
+-commutative53.0%
*-commutative53.0%
Applied egg-rr53.0%
Taylor expanded in x around 0 62.4%
+-commutative62.4%
*-commutative62.4%
fma-def62.4%
unpow262.4%
unpow262.4%
swap-sqr62.4%
unpow262.4%
*-commutative62.4%
Simplified62.4%
Final simplification62.4%
(FPCore (x tau) :precision binary32 (+ 1.0 (* (pow PI 2.0) (* -0.16666666666666666 (* x x)))))
float code(float x, float tau) {
return 1.0f + (powf(((float) M_PI), 2.0f) * (-0.16666666666666666f * (x * x)));
}
function code(x, tau) return Float32(Float32(1.0) + Float32((Float32(pi) ^ Float32(2.0)) * Float32(Float32(-0.16666666666666666) * Float32(x * x)))) end
function tmp = code(x, tau) tmp = single(1.0) + ((single(pi) ^ single(2.0)) * (single(-0.16666666666666666) * (x * x))); end
\begin{array}{l}
\\
1 + {\pi}^{2} \cdot \left(-0.16666666666666666 \cdot \left(x \cdot x\right)\right)
\end{array}
Initial program 97.4%
*-commutative97.4%
times-frac97.4%
associate-*r/97.2%
associate-*r*96.9%
associate-/r*97.0%
associate-/l/96.9%
associate-*l*96.6%
swap-sqr96.4%
associate-*r*96.6%
Simplified96.6%
Taylor expanded in tau around 0 62.1%
expm1-log1p-u62.1%
expm1-udef53.0%
log1p-udef53.0%
add-exp-log53.0%
+-commutative53.0%
*-commutative53.0%
Applied egg-rr53.0%
Taylor expanded in x around 0 62.4%
associate-*r*62.4%
unpow262.4%
Simplified62.4%
Final simplification62.4%
(FPCore (x tau) :precision binary32 (+ 1.0 (* -0.16666666666666666 (pow (* x PI) 2.0))))
float code(float x, float tau) {
return 1.0f + (-0.16666666666666666f * powf((x * ((float) M_PI)), 2.0f));
}
function code(x, tau) return Float32(Float32(1.0) + Float32(Float32(-0.16666666666666666) * (Float32(x * Float32(pi)) ^ Float32(2.0)))) end
function tmp = code(x, tau) tmp = single(1.0) + (single(-0.16666666666666666) * ((x * single(pi)) ^ single(2.0))); end
\begin{array}{l}
\\
1 + -0.16666666666666666 \cdot {\left(x \cdot \pi\right)}^{2}
\end{array}
Initial program 97.4%
*-commutative97.4%
times-frac97.4%
associate-*r/97.2%
associate-*r*96.9%
associate-/r*97.0%
associate-/l/96.9%
associate-*l*96.6%
swap-sqr96.4%
associate-*r*96.6%
Simplified96.6%
Taylor expanded in tau around 0 62.1%
expm1-log1p-u62.1%
expm1-udef53.0%
log1p-udef53.0%
add-exp-log53.0%
+-commutative53.0%
*-commutative53.0%
Applied egg-rr53.0%
Taylor expanded in x around 0 62.4%
associate-*r*62.4%
unpow262.4%
Simplified62.4%
Taylor expanded in x around 0 62.4%
*-commutative62.4%
unpow262.4%
unpow262.4%
swap-sqr62.4%
unpow262.4%
Simplified62.4%
Final simplification62.4%
(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}
Initial program 97.4%
*-commutative97.4%
times-frac97.4%
associate-*r/97.2%
associate-*r*96.9%
associate-/r*97.0%
associate-/l/96.9%
associate-*l*96.6%
swap-sqr96.4%
associate-*r*96.6%
Simplified96.6%
Taylor expanded in x around 0 61.3%
Final simplification61.3%
herbie shell --seed 2023238
(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))))