
(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 18 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(x * Float32(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 := x \cdot \left(\pi \cdot tau\right)\\
\frac{\sin t_1}{t_1} \cdot \frac{\sin \left(x \cdot \pi\right)}{x \cdot \pi}
\end{array}
\end{array}
Initial program 98.0%
associate-*l*97.4%
associate-*l*98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (x tau) :precision binary32 (* (sin (* x PI)) (/ (sin (* tau (* x PI))) (* tau (pow (* x PI) 2.0)))))
float code(float x, float tau) {
return sinf((x * ((float) M_PI))) * (sinf((tau * (x * ((float) M_PI)))) / (tau * powf((x * ((float) M_PI)), 2.0f)));
}
function code(x, tau) return Float32(sin(Float32(x * Float32(pi))) * Float32(sin(Float32(tau * Float32(x * Float32(pi)))) / Float32(tau * (Float32(x * Float32(pi)) ^ Float32(2.0))))) end
function tmp = code(x, tau) tmp = sin((x * single(pi))) * (sin((tau * (x * single(pi)))) / (tau * ((x * single(pi)) ^ single(2.0)))); end
\begin{array}{l}
\\
\sin \left(x \cdot \pi\right) \cdot \frac{\sin \left(tau \cdot \left(x \cdot \pi\right)\right)}{tau \cdot {\left(x \cdot \pi\right)}^{2}}
\end{array}
Initial program 98.0%
*-commutative98.0%
times-frac97.9%
associate-*r/97.8%
associate-*r*97.4%
associate-/r*97.5%
associate-/l/97.4%
associate-*l*97.1%
swap-sqr97.0%
associate-*r*97.2%
Simplified97.2%
pow297.2%
pow-to-exp95.5%
Applied egg-rr95.5%
Taylor expanded in x around inf 96.8%
*-commutative96.8%
unpow296.8%
unpow296.8%
swap-sqr97.4%
unpow297.4%
Simplified97.4%
Final simplification97.4%
(FPCore (x tau) :precision binary32 (* (sin (* x PI)) (* (pow (* x PI) -2.0) (/ (sin (* tau (* x PI))) tau))))
float code(float x, float tau) {
return sinf((x * ((float) M_PI))) * (powf((x * ((float) M_PI)), -2.0f) * (sinf((tau * (x * ((float) M_PI)))) / tau));
}
function code(x, tau) return Float32(sin(Float32(x * Float32(pi))) * Float32((Float32(x * Float32(pi)) ^ Float32(-2.0)) * Float32(sin(Float32(tau * Float32(x * Float32(pi)))) / tau))) end
function tmp = code(x, tau) tmp = sin((x * single(pi))) * (((x * single(pi)) ^ single(-2.0)) * (sin((tau * (x * single(pi)))) / tau)); end
\begin{array}{l}
\\
\sin \left(x \cdot \pi\right) \cdot \left({\left(x \cdot \pi\right)}^{-2} \cdot \frac{\sin \left(tau \cdot \left(x \cdot \pi\right)\right)}{tau}\right)
\end{array}
Initial program 98.0%
*-commutative98.0%
times-frac97.9%
associate-*r/97.8%
associate-*r*97.4%
associate-/r*97.5%
associate-/l/97.4%
associate-*l*97.1%
swap-sqr97.0%
associate-*r*97.2%
Simplified97.2%
*-commutative97.2%
associate-/r*97.2%
associate-*l/97.2%
associate-*r*97.0%
*-commutative97.0%
associate-*l*97.2%
*-commutative97.2%
associate-*r*97.3%
swap-sqr97.1%
pow297.1%
*-commutative97.1%
Applied egg-rr97.1%
expm1-log1p-u97.0%
expm1-udef96.7%
div-inv96.5%
*-commutative96.5%
pow-flip96.5%
metadata-eval96.5%
Applied egg-rr96.5%
expm1-def96.9%
expm1-log1p97.1%
associate-*l*97.2%
associate-*r*97.6%
*-commutative97.6%
*-commutative97.6%
*-commutative97.6%
Simplified97.6%
Final simplification97.6%
(FPCore (x tau)
:precision binary32
(let* ((t_1 (* x (* PI tau))))
(*
(/ (sin t_1) t_1)
(+ 1.0 (* -0.16666666666666666 (* (pow PI 2.0) (* x x)))))))
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(((float) M_PI), 2.0f) * (x * x))));
}
function code(x, tau) t_1 = Float32(x * Float32(Float32(pi) * tau)) return Float32(Float32(sin(t_1) / t_1) * Float32(Float32(1.0) + Float32(Float32(-0.16666666666666666) * Float32((Float32(pi) ^ Float32(2.0)) * Float32(x * x))))) end
function tmp = code(x, tau) t_1 = x * (single(pi) * tau); tmp = (sin(t_1) / t_1) * (single(1.0) + (single(-0.16666666666666666) * ((single(pi) ^ single(2.0)) * (x * x)))); end
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\pi \cdot tau\right)\\
\frac{\sin t_1}{t_1} \cdot \left(1 + -0.16666666666666666 \cdot \left({\pi}^{2} \cdot \left(x \cdot x\right)\right)\right)
\end{array}
\end{array}
Initial program 98.0%
associate-*l*97.4%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in x around 0 87.3%
*-commutative87.3%
unpow287.3%
Simplified87.3%
Final simplification87.3%
(FPCore (x tau)
:precision binary32
(let* ((t_1 (* tau (* x PI))))
(*
(/ (sin t_1) t_1)
(+ 1.0 (* -0.16666666666666666 (* (pow PI 2.0) (* x x)))))))
float code(float x, float tau) {
float t_1 = tau * (x * ((float) M_PI));
return (sinf(t_1) / t_1) * (1.0f + (-0.16666666666666666f * (powf(((float) M_PI), 2.0f) * (x * x))));
}
function code(x, tau) t_1 = Float32(tau * Float32(x * Float32(pi))) return Float32(Float32(sin(t_1) / t_1) * Float32(Float32(1.0) + Float32(Float32(-0.16666666666666666) * Float32((Float32(pi) ^ Float32(2.0)) * Float32(x * x))))) end
function tmp = code(x, tau) t_1 = tau * (x * single(pi)); tmp = (sin(t_1) / t_1) * (single(1.0) + (single(-0.16666666666666666) * ((single(pi) ^ single(2.0)) * (x * x)))); end
\begin{array}{l}
\\
\begin{array}{l}
t_1 := tau \cdot \left(x \cdot \pi\right)\\
\frac{\sin t_1}{t_1} \cdot \left(1 + -0.16666666666666666 \cdot \left({\pi}^{2} \cdot \left(x \cdot x\right)\right)\right)
\end{array}
\end{array}
Initial program 98.0%
Taylor expanded in x around 0 87.3%
*-commutative87.3%
unpow287.3%
Simplified87.3%
Final simplification87.3%
(FPCore (x tau) :precision binary32 (let* ((t_1 (* tau (* x PI)))) (* (sin t_1) (fma -0.16666666666666666 (* x (/ PI tau)) (/ 1.0 t_1)))))
float code(float x, float tau) {
float t_1 = tau * (x * ((float) M_PI));
return sinf(t_1) * fmaf(-0.16666666666666666f, (x * (((float) M_PI) / tau)), (1.0f / t_1));
}
function code(x, tau) t_1 = Float32(tau * Float32(x * Float32(pi))) return Float32(sin(t_1) * fma(Float32(-0.16666666666666666), Float32(x * Float32(Float32(pi) / tau)), Float32(Float32(1.0) / t_1))) end
\begin{array}{l}
\\
\begin{array}{l}
t_1 := tau \cdot \left(x \cdot \pi\right)\\
\sin t_1 \cdot \mathsf{fma}\left(-0.16666666666666666, x \cdot \frac{\pi}{tau}, \frac{1}{t_1}\right)
\end{array}
\end{array}
Initial program 98.0%
associate-*r/97.9%
associate-*l/97.9%
associate-/l/97.9%
associate-*r/97.9%
associate-*l*97.5%
associate-*r*97.2%
associate-/r*97.2%
associate-/l/97.2%
swap-sqr97.0%
associate-*r*97.3%
Simplified97.3%
Taylor expanded in x around 0 86.6%
fma-def86.6%
associate-/l*86.6%
associate-*r*86.7%
*-commutative86.7%
*-commutative86.7%
*-commutative86.7%
Simplified86.7%
expm1-log1p-u86.4%
expm1-udef86.3%
Applied egg-rr86.6%
expm1-def86.7%
expm1-log1p87.1%
associate-*r*86.5%
*-commutative86.5%
*-commutative86.5%
associate-*r*87.1%
*-commutative87.1%
Simplified87.1%
Final simplification87.1%
(FPCore (x tau) :precision binary32 (/ (sin (* PI (* x tau))) (/ tau (+ (/ (/ 1.0 x) PI) (* PI (* x -0.16666666666666666))))))
float code(float x, float tau) {
return sinf((((float) M_PI) * (x * tau))) / (tau / (((1.0f / x) / ((float) M_PI)) + (((float) M_PI) * (x * -0.16666666666666666f))));
}
function code(x, tau) return Float32(sin(Float32(Float32(pi) * Float32(x * tau))) / Float32(tau / Float32(Float32(Float32(Float32(1.0) / x) / Float32(pi)) + Float32(Float32(pi) * Float32(x * Float32(-0.16666666666666666)))))) end
function tmp = code(x, tau) tmp = sin((single(pi) * (x * tau))) / (tau / (((single(1.0) / x) / single(pi)) + (single(pi) * (x * single(-0.16666666666666666))))); end
\begin{array}{l}
\\
\frac{\sin \left(\pi \cdot \left(x \cdot tau\right)\right)}{\frac{tau}{\frac{\frac{1}{x}}{\pi} + \pi \cdot \left(x \cdot -0.16666666666666666\right)}}
\end{array}
Initial program 98.0%
associate-*r/97.9%
associate-*l/97.9%
associate-/l/97.9%
associate-*r/97.9%
associate-*l*97.5%
associate-*r*97.2%
associate-/r*97.2%
associate-/l/97.2%
swap-sqr97.0%
associate-*r*97.3%
Simplified97.3%
Taylor expanded in x around 0 86.6%
fma-def86.6%
associate-/l*86.6%
associate-*r*86.7%
*-commutative86.7%
*-commutative86.7%
*-commutative86.7%
Simplified86.7%
expm1-log1p-u86.4%
expm1-udef86.3%
Applied egg-rr86.6%
expm1-def86.7%
expm1-log1p87.1%
*-commutative87.1%
associate-*l/87.1%
*-commutative87.1%
associate-/l*87.1%
associate-/r/87.1%
*-commutative87.1%
associate-/r*86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in tau around inf 86.7%
associate-/l*86.8%
associate-*r*86.5%
*-commutative86.5%
*-commutative86.5%
associate-/l/86.6%
associate-*r*86.6%
Simplified86.6%
Final simplification86.6%
(FPCore (x tau) :precision binary32 (/ (* (sin (* tau (* x PI))) (+ (/ 1.0 (* x PI)) (* (* x PI) -0.16666666666666666))) tau))
float code(float x, float tau) {
return (sinf((tau * (x * ((float) M_PI)))) * ((1.0f / (x * ((float) M_PI))) + ((x * ((float) M_PI)) * -0.16666666666666666f))) / tau;
}
function code(x, tau) return Float32(Float32(sin(Float32(tau * Float32(x * Float32(pi)))) * Float32(Float32(Float32(1.0) / Float32(x * Float32(pi))) + Float32(Float32(x * Float32(pi)) * Float32(-0.16666666666666666)))) / tau) end
function tmp = code(x, tau) tmp = (sin((tau * (x * single(pi)))) * ((single(1.0) / (x * single(pi))) + ((x * single(pi)) * single(-0.16666666666666666)))) / tau; end
\begin{array}{l}
\\
\frac{\sin \left(tau \cdot \left(x \cdot \pi\right)\right) \cdot \left(\frac{1}{x \cdot \pi} + \left(x \cdot \pi\right) \cdot -0.16666666666666666\right)}{tau}
\end{array}
Initial program 98.0%
associate-*r/97.9%
associate-*l/97.9%
associate-/l/97.9%
associate-*r/97.9%
associate-*l*97.5%
associate-*r*97.2%
associate-/r*97.2%
associate-/l/97.2%
swap-sqr97.0%
associate-*r*97.3%
Simplified97.3%
Taylor expanded in x around 0 86.6%
fma-def86.6%
associate-/l*86.6%
associate-*r*86.7%
*-commutative86.7%
*-commutative86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in tau around inf 86.7%
*-commutative86.7%
Simplified86.7%
Final simplification86.7%
(FPCore (x tau) :precision binary32 (* (/ (sin (* tau (* x PI))) tau) (- (/ 1.0 (* x PI)) (* PI (* x 0.16666666666666666)))))
float code(float x, float tau) {
return (sinf((tau * (x * ((float) M_PI)))) / tau) * ((1.0f / (x * ((float) M_PI))) - (((float) M_PI) * (x * 0.16666666666666666f)));
}
function code(x, tau) return Float32(Float32(sin(Float32(tau * Float32(x * Float32(pi)))) / tau) * Float32(Float32(Float32(1.0) / Float32(x * Float32(pi))) - Float32(Float32(pi) * Float32(x * Float32(0.16666666666666666))))) end
function tmp = code(x, tau) tmp = (sin((tau * (x * single(pi)))) / tau) * ((single(1.0) / (x * single(pi))) - (single(pi) * (x * single(0.16666666666666666)))); end
\begin{array}{l}
\\
\frac{\sin \left(tau \cdot \left(x \cdot \pi\right)\right)}{tau} \cdot \left(\frac{1}{x \cdot \pi} - \pi \cdot \left(x \cdot 0.16666666666666666\right)\right)
\end{array}
Initial program 98.0%
associate-*r/97.9%
associate-*l/97.9%
associate-/l/97.9%
associate-*r/97.9%
associate-*l*97.5%
associate-*r*97.2%
associate-/r*97.2%
associate-/l/97.2%
swap-sqr97.0%
associate-*r*97.3%
Simplified97.3%
Taylor expanded in x around 0 86.6%
fma-def86.6%
associate-/l*86.6%
associate-*r*86.7%
*-commutative86.7%
*-commutative86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in tau around -inf 86.7%
mul-1-neg86.7%
associate-/l*86.8%
*-commutative86.8%
*-commutative86.8%
*-commutative86.8%
Simplified86.8%
associate-/r/86.9%
*-commutative86.9%
associate-*l*86.9%
Applied egg-rr86.9%
Final simplification86.9%
(FPCore (x tau) :precision binary32 (* (sin (* x (* PI tau))) (/ 1.0 (* tau (* x PI)))))
float code(float x, float tau) {
return sinf((x * (((float) M_PI) * tau))) * (1.0f / (tau * (x * ((float) M_PI))));
}
function code(x, tau) return Float32(sin(Float32(x * Float32(Float32(pi) * tau))) * Float32(Float32(1.0) / Float32(tau * Float32(x * Float32(pi))))) end
function tmp = code(x, tau) tmp = sin((x * (single(pi) * tau))) * (single(1.0) / (tau * (x * single(pi)))); end
\begin{array}{l}
\\
\sin \left(x \cdot \left(\pi \cdot tau\right)\right) \cdot \frac{1}{tau \cdot \left(x \cdot \pi\right)}
\end{array}
Initial program 98.0%
associate-*r/97.9%
associate-*l/97.9%
associate-/l/97.9%
associate-*r/97.9%
associate-*l*97.5%
associate-*r*97.2%
associate-/r*97.2%
associate-/l/97.2%
swap-sqr97.0%
associate-*r*97.3%
Simplified97.3%
Taylor expanded in x around 0 73.9%
Final simplification73.9%
(FPCore (x tau) :precision binary32 (* (sin (* x (* PI tau))) (/ 1.0 (* PI (* x tau)))))
float code(float x, float tau) {
return sinf((x * (((float) M_PI) * tau))) * (1.0f / (((float) M_PI) * (x * tau)));
}
function code(x, tau) return Float32(sin(Float32(x * Float32(Float32(pi) * tau))) * Float32(Float32(1.0) / Float32(Float32(pi) * Float32(x * tau)))) end
function tmp = code(x, tau) tmp = sin((x * (single(pi) * tau))) * (single(1.0) / (single(pi) * (x * tau))); end
\begin{array}{l}
\\
\sin \left(x \cdot \left(\pi \cdot tau\right)\right) \cdot \frac{1}{\pi \cdot \left(x \cdot tau\right)}
\end{array}
Initial program 98.0%
associate-*r/97.9%
associate-*l/97.9%
associate-/l/97.9%
associate-*r/97.9%
associate-*l*97.5%
associate-*r*97.2%
associate-/r*97.2%
associate-/l/97.2%
swap-sqr97.0%
associate-*r*97.3%
Simplified97.3%
Taylor expanded in x around 0 73.9%
*-commutative73.9%
associate-*r*74.0%
*-commutative74.0%
Simplified74.0%
Final simplification74.0%
(FPCore (x tau) :precision binary32 (+ 1.0 (* -0.16666666666666666 (* (pow (* x PI) 2.0) (fma tau tau 1.0)))))
float code(float x, float tau) {
return 1.0f + (-0.16666666666666666f * (powf((x * ((float) M_PI)), 2.0f) * fmaf(tau, tau, 1.0f)));
}
function code(x, tau) return Float32(Float32(1.0) + Float32(Float32(-0.16666666666666666) * Float32((Float32(x * Float32(pi)) ^ Float32(2.0)) * fma(tau, tau, Float32(1.0))))) end
\begin{array}{l}
\\
1 + -0.16666666666666666 \cdot \left({\left(x \cdot \pi\right)}^{2} \cdot \mathsf{fma}\left(tau, tau, 1\right)\right)
\end{array}
Initial program 98.0%
associate-*r/97.9%
associate-*l/97.9%
associate-/l/97.9%
associate-*r/97.9%
associate-*l*97.5%
associate-*r*97.2%
associate-/r*97.2%
associate-/l/97.2%
swap-sqr97.0%
associate-*r*97.3%
Simplified97.3%
Taylor expanded in x around 0 86.6%
fma-def86.6%
associate-/l*86.6%
associate-*r*86.7%
*-commutative86.7%
*-commutative86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in x around 0 82.4%
*-commutative82.4%
unpow282.4%
distribute-lft-out82.4%
unpow282.4%
Simplified82.4%
Taylor expanded in x around 0 82.4%
*-commutative82.4%
distribute-lft1-in82.4%
unpow282.4%
fma-udef82.4%
*-commutative82.4%
associate-*r*82.4%
*-commutative82.4%
unpow282.4%
unpow282.4%
swap-sqr82.4%
unpow282.4%
*-commutative82.4%
Simplified82.4%
Final simplification82.4%
(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(x * Float32(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 := x \cdot \left(\pi \cdot tau\right)\\
\frac{\sin t_1}{t_1}
\end{array}
\end{array}
Initial program 98.0%
associate-*l*97.4%
associate-*l*98.1%
Simplified98.1%
expm1-log1p-u97.8%
expm1-udef97.8%
*-commutative97.8%
*-commutative97.8%
Applied egg-rr97.8%
Taylor expanded in x around 0 74.1%
Final simplification74.1%
(FPCore (x tau) :precision binary32 (+ 1.0 (* (* x x) (* -0.16666666666666666 (* (pow PI 2.0) (* tau tau))))))
float code(float x, float tau) {
return 1.0f + ((x * x) * (-0.16666666666666666f * (powf(((float) M_PI), 2.0f) * (tau * tau))));
}
function code(x, tau) return Float32(Float32(1.0) + Float32(Float32(x * x) * Float32(Float32(-0.16666666666666666) * Float32((Float32(pi) ^ Float32(2.0)) * Float32(tau * tau))))) end
function tmp = code(x, tau) tmp = single(1.0) + ((x * x) * (single(-0.16666666666666666) * ((single(pi) ^ single(2.0)) * (tau * tau)))); end
\begin{array}{l}
\\
1 + \left(x \cdot x\right) \cdot \left(-0.16666666666666666 \cdot \left({\pi}^{2} \cdot \left(tau \cdot tau\right)\right)\right)
\end{array}
Initial program 98.0%
associate-*r/97.9%
associate-*l/97.9%
associate-/l/97.9%
associate-*r/97.9%
associate-*l*97.5%
associate-*r*97.2%
associate-/r*97.2%
associate-/l/97.2%
swap-sqr97.0%
associate-*r*97.3%
Simplified97.3%
Taylor expanded in x around 0 86.6%
fma-def86.6%
associate-/l*86.6%
associate-*r*86.7%
*-commutative86.7%
*-commutative86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in x around 0 82.4%
*-commutative82.4%
unpow282.4%
distribute-lft-out82.4%
unpow282.4%
Simplified82.4%
Taylor expanded in tau around inf 73.3%
*-commutative73.3%
unpow273.3%
Simplified73.3%
Final simplification73.3%
(FPCore (x tau) :precision binary32 (+ 1.0 (* (pow (* x PI) 2.0) (* -0.16666666666666666 (* tau tau)))))
float code(float x, float tau) {
return 1.0f + (powf((x * ((float) M_PI)), 2.0f) * (-0.16666666666666666f * (tau * tau)));
}
function code(x, tau) return Float32(Float32(1.0) + Float32((Float32(x * Float32(pi)) ^ Float32(2.0)) * Float32(Float32(-0.16666666666666666) * Float32(tau * tau)))) end
function tmp = code(x, tau) tmp = single(1.0) + (((x * single(pi)) ^ single(2.0)) * (single(-0.16666666666666666) * (tau * tau))); end
\begin{array}{l}
\\
1 + {\left(x \cdot \pi\right)}^{2} \cdot \left(-0.16666666666666666 \cdot \left(tau \cdot tau\right)\right)
\end{array}
Initial program 98.0%
associate-*r/97.9%
associate-*l/97.9%
associate-/l/97.9%
associate-*r/97.9%
associate-*l*97.5%
associate-*r*97.2%
associate-/r*97.2%
associate-/l/97.2%
swap-sqr97.0%
associate-*r*97.3%
Simplified97.3%
Taylor expanded in x around 0 86.6%
fma-def86.6%
associate-/l*86.6%
associate-*r*86.7%
*-commutative86.7%
*-commutative86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in x around 0 82.4%
*-commutative82.4%
unpow282.4%
distribute-lft-out82.4%
unpow282.4%
Simplified82.4%
Taylor expanded in tau around inf 73.3%
associate-*r*73.3%
*-commutative73.3%
*-commutative73.3%
unpow273.3%
unpow273.3%
swap-sqr73.3%
unpow273.3%
*-commutative73.3%
unpow273.3%
Simplified73.3%
Final simplification73.3%
(FPCore (x tau) :precision binary32 (+ 1.0 (* (* x x) (* -0.16666666666666666 (pow PI 2.0)))))
float code(float x, float tau) {
return 1.0f + ((x * x) * (-0.16666666666666666f * powf(((float) M_PI), 2.0f)));
}
function code(x, tau) return Float32(Float32(1.0) + Float32(Float32(x * x) * Float32(Float32(-0.16666666666666666) * (Float32(pi) ^ Float32(2.0))))) end
function tmp = code(x, tau) tmp = single(1.0) + ((x * x) * (single(-0.16666666666666666) * (single(pi) ^ single(2.0)))); end
\begin{array}{l}
\\
1 + \left(x \cdot x\right) \cdot \left(-0.16666666666666666 \cdot {\pi}^{2}\right)
\end{array}
Initial program 98.0%
associate-*r/97.9%
associate-*l/97.9%
associate-/l/97.9%
associate-*r/97.9%
associate-*l*97.5%
associate-*r*97.2%
associate-/r*97.2%
associate-/l/97.2%
swap-sqr97.0%
associate-*r*97.3%
Simplified97.3%
Taylor expanded in x around 0 86.6%
fma-def86.6%
associate-/l*86.6%
associate-*r*86.7%
*-commutative86.7%
*-commutative86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in x around 0 82.4%
*-commutative82.4%
unpow282.4%
distribute-lft-out82.4%
unpow282.4%
Simplified82.4%
Taylor expanded in tau around 0 67.4%
Final simplification67.4%
(FPCore (x tau) :precision binary32 (+ 1.0 (* (pow (* x PI) 2.0) -0.16666666666666666)))
float code(float x, float tau) {
return 1.0f + (powf((x * ((float) M_PI)), 2.0f) * -0.16666666666666666f);
}
function code(x, tau) return Float32(Float32(1.0) + Float32((Float32(x * Float32(pi)) ^ Float32(2.0)) * Float32(-0.16666666666666666))) end
function tmp = code(x, tau) tmp = single(1.0) + (((x * single(pi)) ^ single(2.0)) * single(-0.16666666666666666)); end
\begin{array}{l}
\\
1 + {\left(x \cdot \pi\right)}^{2} \cdot -0.16666666666666666
\end{array}
Initial program 98.0%
*-commutative98.0%
times-frac97.9%
associate-*r/97.8%
associate-*r*97.4%
associate-/r*97.5%
associate-/l/97.4%
associate-*l*97.1%
swap-sqr97.0%
associate-*r*97.2%
Simplified97.2%
Taylor expanded in tau around 0 67.7%
*-commutative67.7%
Simplified67.7%
Taylor expanded in x around 0 67.4%
*-commutative67.4%
unpow267.4%
unpow267.4%
swap-sqr67.4%
unpow267.4%
Simplified67.4%
Final simplification67.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 98.0%
*-commutative98.0%
times-frac97.9%
associate-*r/97.8%
associate-*r*97.4%
associate-/r*97.5%
associate-/l/97.4%
associate-*l*97.1%
swap-sqr97.0%
associate-*r*97.2%
Simplified97.2%
Taylor expanded in x around 0 66.9%
Final simplification66.9%
herbie shell --seed 2023258
(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))))