
(FPCore (s r) :precision binary32 (+ (/ (* 0.25 (exp (/ (- r) s))) (* (* (* 2.0 PI) s) r)) (/ (* 0.75 (exp (/ (- r) (* 3.0 s)))) (* (* (* 6.0 PI) s) r))))
float code(float s, float r) {
return ((0.25f * expf((-r / s))) / (((2.0f * ((float) M_PI)) * s) * r)) + ((0.75f * expf((-r / (3.0f * s)))) / (((6.0f * ((float) M_PI)) * s) * r));
}
function code(s, r) return Float32(Float32(Float32(Float32(0.25) * exp(Float32(Float32(-r) / s))) / Float32(Float32(Float32(Float32(2.0) * Float32(pi)) * s) * r)) + Float32(Float32(Float32(0.75) * exp(Float32(Float32(-r) / Float32(Float32(3.0) * s)))) / Float32(Float32(Float32(Float32(6.0) * Float32(pi)) * s) * r))) end
function tmp = code(s, r) tmp = ((single(0.25) * exp((-r / s))) / (((single(2.0) * single(pi)) * s) * r)) + ((single(0.75) * exp((-r / (single(3.0) * s)))) / (((single(6.0) * single(pi)) * s) * r)); end
\begin{array}{l}
\\
\frac{0.25 \cdot e^{\frac{-r}{s}}}{\left(\left(2 \cdot \pi\right) \cdot s\right) \cdot r} + \frac{0.75 \cdot e^{\frac{-r}{3 \cdot s}}}{\left(\left(6 \cdot \pi\right) \cdot s\right) \cdot r}
\end{array}
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (s r) :precision binary32 (+ (/ (* 0.25 (exp (/ (- r) s))) (* (* (* 2.0 PI) s) r)) (/ (* 0.75 (exp (/ (- r) (* 3.0 s)))) (* (* (* 6.0 PI) s) r))))
float code(float s, float r) {
return ((0.25f * expf((-r / s))) / (((2.0f * ((float) M_PI)) * s) * r)) + ((0.75f * expf((-r / (3.0f * s)))) / (((6.0f * ((float) M_PI)) * s) * r));
}
function code(s, r) return Float32(Float32(Float32(Float32(0.25) * exp(Float32(Float32(-r) / s))) / Float32(Float32(Float32(Float32(2.0) * Float32(pi)) * s) * r)) + Float32(Float32(Float32(0.75) * exp(Float32(Float32(-r) / Float32(Float32(3.0) * s)))) / Float32(Float32(Float32(Float32(6.0) * Float32(pi)) * s) * r))) end
function tmp = code(s, r) tmp = ((single(0.25) * exp((-r / s))) / (((single(2.0) * single(pi)) * s) * r)) + ((single(0.75) * exp((-r / (single(3.0) * s)))) / (((single(6.0) * single(pi)) * s) * r)); end
\begin{array}{l}
\\
\frac{0.25 \cdot e^{\frac{-r}{s}}}{\left(\left(2 \cdot \pi\right) \cdot s\right) \cdot r} + \frac{0.75 \cdot e^{\frac{-r}{3 \cdot s}}}{\left(\left(6 \cdot \pi\right) \cdot s\right) \cdot r}
\end{array}
(FPCore (s r) :precision binary32 (+ (* 0.75 (/ (exp (/ (- r) (* 3.0 s))) (* (* (* 6.0 PI) s) r))) (* (/ (exp (/ (- r) s)) (* (* PI s) r)) 0.125)))
float code(float s, float r) {
return (0.75f * (expf((-r / (3.0f * s))) / (((6.0f * ((float) M_PI)) * s) * r))) + ((expf((-r / s)) / ((((float) M_PI) * s) * r)) * 0.125f);
}
function code(s, r) return Float32(Float32(Float32(0.75) * Float32(exp(Float32(Float32(-r) / Float32(Float32(3.0) * s))) / Float32(Float32(Float32(Float32(6.0) * Float32(pi)) * s) * r))) + Float32(Float32(exp(Float32(Float32(-r) / s)) / Float32(Float32(Float32(pi) * s) * r)) * Float32(0.125))) end
function tmp = code(s, r) tmp = (single(0.75) * (exp((-r / (single(3.0) * s))) / (((single(6.0) * single(pi)) * s) * r))) + ((exp((-r / s)) / ((single(pi) * s) * r)) * single(0.125)); end
\begin{array}{l}
\\
0.75 \cdot \frac{e^{\frac{-r}{3 \cdot s}}}{\left(\left(6 \cdot \pi\right) \cdot s\right) \cdot r} + \frac{e^{\frac{-r}{s}}}{\left(\pi \cdot s\right) \cdot r} \cdot 0.125
\end{array}
Initial program 99.6%
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
lower-*.f32N/A
lift-PI.f3299.5
Applied rewrites99.5%
Taylor expanded in s around 0
*-commutativeN/A
lower-*.f32N/A
mul-1-negN/A
distribute-frac-negN/A
lower-/.f32N/A
lift-neg.f32N/A
lift-/.f32N/A
lift-exp.f32N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f3299.5
Applied rewrites99.5%
lift-*.f32N/A
lift-/.f32N/A
associate-/r*N/A
lower-/.f32N/A
lower-/.f3299.5
Applied rewrites99.5%
lift-+.f32N/A
lift-/.f32N/A
lift-*.f32N/A
lift-exp.f32N/A
lift-/.f32N/A
lift-/.f32N/A
lift-neg.f32N/A
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
lift-*.f32N/A
Applied rewrites99.6%
(FPCore (s r) :precision binary32 (+ (* (/ (exp (/ (- r) s)) (* (* PI s) r)) 0.125) (/ (* 0.75 (exp (/ (- r) (* 3.0 s)))) (* (* (* 6.0 s) PI) r))))
float code(float s, float r) {
return ((expf((-r / s)) / ((((float) M_PI) * s) * r)) * 0.125f) + ((0.75f * expf((-r / (3.0f * s)))) / (((6.0f * s) * ((float) M_PI)) * r));
}
function code(s, r) return Float32(Float32(Float32(exp(Float32(Float32(-r) / s)) / Float32(Float32(Float32(pi) * s) * r)) * Float32(0.125)) + Float32(Float32(Float32(0.75) * exp(Float32(Float32(-r) / Float32(Float32(3.0) * s)))) / Float32(Float32(Float32(Float32(6.0) * s) * Float32(pi)) * r))) end
function tmp = code(s, r) tmp = ((exp((-r / s)) / ((single(pi) * s) * r)) * single(0.125)) + ((single(0.75) * exp((-r / (single(3.0) * s)))) / (((single(6.0) * s) * single(pi)) * r)); end
\begin{array}{l}
\\
\frac{e^{\frac{-r}{s}}}{\left(\pi \cdot s\right) \cdot r} \cdot 0.125 + \frac{0.75 \cdot e^{\frac{-r}{3 \cdot s}}}{\left(\left(6 \cdot s\right) \cdot \pi\right) \cdot r}
\end{array}
Initial program 99.6%
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
lower-*.f32N/A
lift-PI.f3299.5
Applied rewrites99.5%
Taylor expanded in s around 0
*-commutativeN/A
lower-*.f32N/A
mul-1-negN/A
distribute-frac-negN/A
lower-/.f32N/A
lift-neg.f32N/A
lift-/.f32N/A
lift-exp.f32N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f3299.5
Applied rewrites99.5%
(FPCore (s r) :precision binary32 (+ (* (/ (exp (/ (- r) s)) (* (* PI s) r)) 0.125) (/ (* 0.75 (exp (/ (* -0.3333333333333333 r) s))) (* (* (* 6.0 s) PI) r))))
float code(float s, float r) {
return ((expf((-r / s)) / ((((float) M_PI) * s) * r)) * 0.125f) + ((0.75f * expf(((-0.3333333333333333f * r) / s))) / (((6.0f * s) * ((float) M_PI)) * r));
}
function code(s, r) return Float32(Float32(Float32(exp(Float32(Float32(-r) / s)) / Float32(Float32(Float32(pi) * s) * r)) * Float32(0.125)) + Float32(Float32(Float32(0.75) * exp(Float32(Float32(Float32(-0.3333333333333333) * r) / s))) / Float32(Float32(Float32(Float32(6.0) * s) * Float32(pi)) * r))) end
function tmp = code(s, r) tmp = ((exp((-r / s)) / ((single(pi) * s) * r)) * single(0.125)) + ((single(0.75) * exp(((single(-0.3333333333333333) * r) / s))) / (((single(6.0) * s) * single(pi)) * r)); end
\begin{array}{l}
\\
\frac{e^{\frac{-r}{s}}}{\left(\pi \cdot s\right) \cdot r} \cdot 0.125 + \frac{0.75 \cdot e^{\frac{-0.3333333333333333 \cdot r}{s}}}{\left(\left(6 \cdot s\right) \cdot \pi\right) \cdot r}
\end{array}
Initial program 99.6%
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
lower-*.f32N/A
lift-PI.f3299.5
Applied rewrites99.5%
Taylor expanded in s around 0
*-commutativeN/A
lower-*.f32N/A
mul-1-negN/A
distribute-frac-negN/A
lower-/.f32N/A
lift-neg.f32N/A
lift-/.f32N/A
lift-exp.f32N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f3299.5
Applied rewrites99.5%
lift-*.f32N/A
lift-/.f32N/A
associate-/r*N/A
lower-/.f32N/A
lower-/.f3299.5
Applied rewrites99.5%
Taylor expanded in r around 0
lower-*.f3299.5
Applied rewrites99.5%
(FPCore (s r) :precision binary32 (+ (/ (* 0.25 (exp (/ (- r) s))) (* (* (* 2.0 PI) s) r)) (/ (* 0.125 (exp (/ (* -0.3333333333333333 r) s))) (* (* PI s) r))))
float code(float s, float r) {
return ((0.25f * expf((-r / s))) / (((2.0f * ((float) M_PI)) * s) * r)) + ((0.125f * expf(((-0.3333333333333333f * r) / s))) / ((((float) M_PI) * s) * r));
}
function code(s, r) return Float32(Float32(Float32(Float32(0.25) * exp(Float32(Float32(-r) / s))) / Float32(Float32(Float32(Float32(2.0) * Float32(pi)) * s) * r)) + Float32(Float32(Float32(0.125) * exp(Float32(Float32(Float32(-0.3333333333333333) * r) / s))) / Float32(Float32(Float32(pi) * s) * r))) end
function tmp = code(s, r) tmp = ((single(0.25) * exp((-r / s))) / (((single(2.0) * single(pi)) * s) * r)) + ((single(0.125) * exp(((single(-0.3333333333333333) * r) / s))) / ((single(pi) * s) * r)); end
\begin{array}{l}
\\
\frac{0.25 \cdot e^{\frac{-r}{s}}}{\left(\left(2 \cdot \pi\right) \cdot s\right) \cdot r} + \frac{0.125 \cdot e^{\frac{-0.3333333333333333 \cdot r}{s}}}{\left(\pi \cdot s\right) \cdot r}
\end{array}
Initial program 99.6%
Taylor expanded in s around 0
associate-*r/N/A
lower-/.f32N/A
lower-*.f32N/A
lower-exp.f32N/A
lower-*.f32N/A
lower-/.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lift-PI.f3299.5
Applied rewrites99.5%
lift-*.f32N/A
lift-/.f32N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f32N/A
metadata-evalN/A
lower-*.f3299.5
Applied rewrites99.5%
(FPCore (s r) :precision binary32 (+ (/ (* 0.25 (exp (/ (- r) s))) (* (+ PI PI) (* s r))) (/ (* 0.125 (exp (* -0.3333333333333333 (/ r s)))) (* (* PI s) r))))
float code(float s, float r) {
return ((0.25f * expf((-r / s))) / ((((float) M_PI) + ((float) M_PI)) * (s * r))) + ((0.125f * expf((-0.3333333333333333f * (r / s)))) / ((((float) M_PI) * s) * r));
}
function code(s, r) return Float32(Float32(Float32(Float32(0.25) * exp(Float32(Float32(-r) / s))) / Float32(Float32(Float32(pi) + Float32(pi)) * Float32(s * r))) + Float32(Float32(Float32(0.125) * exp(Float32(Float32(-0.3333333333333333) * Float32(r / s)))) / Float32(Float32(Float32(pi) * s) * r))) end
function tmp = code(s, r) tmp = ((single(0.25) * exp((-r / s))) / ((single(pi) + single(pi)) * (s * r))) + ((single(0.125) * exp((single(-0.3333333333333333) * (r / s)))) / ((single(pi) * s) * r)); end
\begin{array}{l}
\\
\frac{0.25 \cdot e^{\frac{-r}{s}}}{\left(\pi + \pi\right) \cdot \left(s \cdot r\right)} + \frac{0.125 \cdot e^{-0.3333333333333333 \cdot \frac{r}{s}}}{\left(\pi \cdot s\right) \cdot r}
\end{array}
Initial program 99.6%
Taylor expanded in s around 0
associate-*r/N/A
lower-/.f32N/A
lower-*.f32N/A
lower-exp.f32N/A
lower-*.f32N/A
lower-/.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lift-PI.f3299.5
Applied rewrites99.5%
lift-*.f32N/A
lift-*.f32N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
count-2-revN/A
lower-+.f32N/A
lift-PI.f32N/A
lift-PI.f32N/A
*-commutativeN/A
lower-*.f3299.5
Applied rewrites99.5%
(FPCore (s r)
:precision binary32
(/
(*
0.125
(+
(/ (exp (/ (- r) s)) (* PI r))
(/ (exp (* -0.3333333333333333 (/ r s))) (* PI r))))
s))
float code(float s, float r) {
return (0.125f * ((expf((-r / s)) / (((float) M_PI) * r)) + (expf((-0.3333333333333333f * (r / s))) / (((float) M_PI) * r)))) / s;
}
function code(s, r) return Float32(Float32(Float32(0.125) * Float32(Float32(exp(Float32(Float32(-r) / s)) / Float32(Float32(pi) * r)) + Float32(exp(Float32(Float32(-0.3333333333333333) * Float32(r / s))) / Float32(Float32(pi) * r)))) / s) end
function tmp = code(s, r) tmp = (single(0.125) * ((exp((-r / s)) / (single(pi) * r)) + (exp((single(-0.3333333333333333) * (r / s))) / (single(pi) * r)))) / s; end
\begin{array}{l}
\\
\frac{0.125 \cdot \left(\frac{e^{\frac{-r}{s}}}{\pi \cdot r} + \frac{e^{-0.3333333333333333 \cdot \frac{r}{s}}}{\pi \cdot r}\right)}{s}
\end{array}
Initial program 99.6%
Taylor expanded in s around 0
lower-/.f32N/A
Applied rewrites99.5%
(FPCore (s r)
:precision binary32
(if (<= r 3.200000047683716)
(-
(/
(-
(-
(/
(-
(-
(/
(*
(-
(* (/ r (* PI s)) 0.021604938271604937)
(/ 0.06944444444444445 PI))
r)
s))
(/ 0.16666666666666666 PI))
s))
(/ (/ 0.25 r) PI))
s))
(/ 0.25 (log (pow (exp r) (* PI s))))))
float code(float s, float r) {
float tmp;
if (r <= 3.200000047683716f) {
tmp = -((-((-(((((r / (((float) M_PI) * s)) * 0.021604938271604937f) - (0.06944444444444445f / ((float) M_PI))) * r) / s) - (0.16666666666666666f / ((float) M_PI))) / s) - ((0.25f / r) / ((float) M_PI))) / s);
} else {
tmp = 0.25f / logf(powf(expf(r), (((float) M_PI) * s)));
}
return tmp;
}
function code(s, r) tmp = Float32(0.0) if (r <= Float32(3.200000047683716)) tmp = Float32(-Float32(Float32(Float32(-Float32(Float32(Float32(-Float32(Float32(Float32(Float32(Float32(r / Float32(Float32(pi) * s)) * Float32(0.021604938271604937)) - Float32(Float32(0.06944444444444445) / Float32(pi))) * r) / s)) - Float32(Float32(0.16666666666666666) / Float32(pi))) / s)) - Float32(Float32(Float32(0.25) / r) / Float32(pi))) / s)); else tmp = Float32(Float32(0.25) / log((exp(r) ^ Float32(Float32(pi) * s)))); end return tmp end
function tmp_2 = code(s, r) tmp = single(0.0); if (r <= single(3.200000047683716)) tmp = -((-((-(((((r / (single(pi) * s)) * single(0.021604938271604937)) - (single(0.06944444444444445) / single(pi))) * r) / s) - (single(0.16666666666666666) / single(pi))) / s) - ((single(0.25) / r) / single(pi))) / s); else tmp = single(0.25) / log((exp(r) ^ (single(pi) * s))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 3.200000047683716:\\
\;\;\;\;-\frac{\left(-\frac{\left(-\frac{\left(\frac{r}{\pi \cdot s} \cdot 0.021604938271604937 - \frac{0.06944444444444445}{\pi}\right) \cdot r}{s}\right) - \frac{0.16666666666666666}{\pi}}{s}\right) - \frac{\frac{0.25}{r}}{\pi}}{s}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{\log \left({\left(e^{r}\right)}^{\left(\pi \cdot s\right)}\right)}\\
\end{array}
\end{array}
if r < 3.20000005Initial program 99.6%
Taylor expanded in s around -inf
Applied rewrites9.8%
lift-/.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f32N/A
lower-/.f32N/A
lift-PI.f329.8
Applied rewrites9.8%
Taylor expanded in r around 0
*-commutativeN/A
lower-*.f32N/A
lower--.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-/.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f32N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f32N/A
lift-PI.f329.8
Applied rewrites9.8%
if 3.20000005 < r Initial program 99.6%
Taylor expanded in s around inf
lower-/.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lift-PI.f329.1
Applied rewrites9.1%
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
add-log-expN/A
log-pow-revN/A
lower-log.f32N/A
lower-pow.f32N/A
lower-exp.f32N/A
lift-PI.f32N/A
*-commutativeN/A
lower-*.f3210.2
Applied rewrites10.2%
lift-*.f32N/A
lift-pow.f32N/A
lift-PI.f32N/A
lift-exp.f32N/A
pow-expN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f32N/A
lower-exp.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f3238.2
Applied rewrites38.2%
(FPCore (s r)
:precision binary32
(if (<= r 3.200000047683716)
(-
(/
(-
(-
(/
(-
(-
(/
(*
(-
(* (/ r (* PI s)) 0.021604938271604937)
(/ 0.06944444444444445 PI))
r)
s))
(/ 0.16666666666666666 PI))
s))
(/ 0.25 (* PI r)))
s))
(/ 0.25 (log (pow (exp r) (* PI s))))))
float code(float s, float r) {
float tmp;
if (r <= 3.200000047683716f) {
tmp = -((-((-(((((r / (((float) M_PI) * s)) * 0.021604938271604937f) - (0.06944444444444445f / ((float) M_PI))) * r) / s) - (0.16666666666666666f / ((float) M_PI))) / s) - (0.25f / (((float) M_PI) * r))) / s);
} else {
tmp = 0.25f / logf(powf(expf(r), (((float) M_PI) * s)));
}
return tmp;
}
function code(s, r) tmp = Float32(0.0) if (r <= Float32(3.200000047683716)) tmp = Float32(-Float32(Float32(Float32(-Float32(Float32(Float32(-Float32(Float32(Float32(Float32(Float32(r / Float32(Float32(pi) * s)) * Float32(0.021604938271604937)) - Float32(Float32(0.06944444444444445) / Float32(pi))) * r) / s)) - Float32(Float32(0.16666666666666666) / Float32(pi))) / s)) - Float32(Float32(0.25) / Float32(Float32(pi) * r))) / s)); else tmp = Float32(Float32(0.25) / log((exp(r) ^ Float32(Float32(pi) * s)))); end return tmp end
function tmp_2 = code(s, r) tmp = single(0.0); if (r <= single(3.200000047683716)) tmp = -((-((-(((((r / (single(pi) * s)) * single(0.021604938271604937)) - (single(0.06944444444444445) / single(pi))) * r) / s) - (single(0.16666666666666666) / single(pi))) / s) - (single(0.25) / (single(pi) * r))) / s); else tmp = single(0.25) / log((exp(r) ^ (single(pi) * s))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 3.200000047683716:\\
\;\;\;\;-\frac{\left(-\frac{\left(-\frac{\left(\frac{r}{\pi \cdot s} \cdot 0.021604938271604937 - \frac{0.06944444444444445}{\pi}\right) \cdot r}{s}\right) - \frac{0.16666666666666666}{\pi}}{s}\right) - \frac{0.25}{\pi \cdot r}}{s}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{\log \left({\left(e^{r}\right)}^{\left(\pi \cdot s\right)}\right)}\\
\end{array}
\end{array}
if r < 3.20000005Initial program 99.6%
Taylor expanded in s around -inf
Applied rewrites9.8%
Taylor expanded in r around 0
*-commutativeN/A
lower-*.f32N/A
lower--.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-/.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f32N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f32N/A
lift-PI.f329.8
Applied rewrites9.8%
if 3.20000005 < r Initial program 99.6%
Taylor expanded in s around inf
lower-/.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lift-PI.f329.1
Applied rewrites9.1%
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
add-log-expN/A
log-pow-revN/A
lower-log.f32N/A
lower-pow.f32N/A
lower-exp.f32N/A
lift-PI.f32N/A
*-commutativeN/A
lower-*.f3210.2
Applied rewrites10.2%
lift-*.f32N/A
lift-pow.f32N/A
lift-PI.f32N/A
lift-exp.f32N/A
pow-expN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f32N/A
lower-exp.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f3238.2
Applied rewrites38.2%
(FPCore (s r)
:precision binary32
(if (<= r 82.0)
(-
(/
(/
(-
(*
(fma
(/ r (* (* s s) PI))
-0.06944444444444445
(/ 0.16666666666666666 (* PI s)))
r)
(/ 0.25 PI))
r)
s))
(/ 0.25 (log (pow (exp r) (* PI s))))))
float code(float s, float r) {
float tmp;
if (r <= 82.0f) {
tmp = -((((fmaf((r / ((s * s) * ((float) M_PI))), -0.06944444444444445f, (0.16666666666666666f / (((float) M_PI) * s))) * r) - (0.25f / ((float) M_PI))) / r) / s);
} else {
tmp = 0.25f / logf(powf(expf(r), (((float) M_PI) * s)));
}
return tmp;
}
function code(s, r) tmp = Float32(0.0) if (r <= Float32(82.0)) tmp = Float32(-Float32(Float32(Float32(Float32(fma(Float32(r / Float32(Float32(s * s) * Float32(pi))), Float32(-0.06944444444444445), Float32(Float32(0.16666666666666666) / Float32(Float32(pi) * s))) * r) - Float32(Float32(0.25) / Float32(pi))) / r) / s)); else tmp = Float32(Float32(0.25) / log((exp(r) ^ Float32(Float32(pi) * s)))); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 82:\\
\;\;\;\;-\frac{\frac{\mathsf{fma}\left(\frac{r}{\left(s \cdot s\right) \cdot \pi}, -0.06944444444444445, \frac{0.16666666666666666}{\pi \cdot s}\right) \cdot r - \frac{0.25}{\pi}}{r}}{s}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{\log \left({\left(e^{r}\right)}^{\left(\pi \cdot s\right)}\right)}\\
\end{array}
\end{array}
if r < 82Initial program 99.6%
Taylor expanded in s around -inf
Applied rewrites9.8%
Taylor expanded in r around 0
lower-/.f32N/A
Applied rewrites10.0%
if 82 < r Initial program 99.6%
Taylor expanded in s around inf
lower-/.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lift-PI.f329.1
Applied rewrites9.1%
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
add-log-expN/A
log-pow-revN/A
lower-log.f32N/A
lower-pow.f32N/A
lower-exp.f32N/A
lift-PI.f32N/A
*-commutativeN/A
lower-*.f3210.2
Applied rewrites10.2%
lift-*.f32N/A
lift-pow.f32N/A
lift-PI.f32N/A
lift-exp.f32N/A
pow-expN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f32N/A
lower-exp.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f3238.2
Applied rewrites38.2%
(FPCore (s r)
:precision binary32
(if (<= r 125.0)
(-
(/
(/
(-
(*
(fma
(/ r (* (* s s) PI))
-0.06944444444444445
(/ 0.16666666666666666 (* PI s)))
r)
(/ 0.25 PI))
r)
s))
(/ 0.25 (log (exp (* (* PI s) r))))))
float code(float s, float r) {
float tmp;
if (r <= 125.0f) {
tmp = -((((fmaf((r / ((s * s) * ((float) M_PI))), -0.06944444444444445f, (0.16666666666666666f / (((float) M_PI) * s))) * r) - (0.25f / ((float) M_PI))) / r) / s);
} else {
tmp = 0.25f / logf(expf(((((float) M_PI) * s) * r)));
}
return tmp;
}
function code(s, r) tmp = Float32(0.0) if (r <= Float32(125.0)) tmp = Float32(-Float32(Float32(Float32(Float32(fma(Float32(r / Float32(Float32(s * s) * Float32(pi))), Float32(-0.06944444444444445), Float32(Float32(0.16666666666666666) / Float32(Float32(pi) * s))) * r) - Float32(Float32(0.25) / Float32(pi))) / r) / s)); else tmp = Float32(Float32(0.25) / log(exp(Float32(Float32(Float32(pi) * s) * r)))); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 125:\\
\;\;\;\;-\frac{\frac{\mathsf{fma}\left(\frac{r}{\left(s \cdot s\right) \cdot \pi}, -0.06944444444444445, \frac{0.16666666666666666}{\pi \cdot s}\right) \cdot r - \frac{0.25}{\pi}}{r}}{s}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{\log \left(e^{\left(\pi \cdot s\right) \cdot r}\right)}\\
\end{array}
\end{array}
if r < 125Initial program 99.6%
Taylor expanded in s around -inf
Applied rewrites9.8%
Taylor expanded in r around 0
lower-/.f32N/A
Applied rewrites10.0%
if 125 < r Initial program 99.6%
Taylor expanded in s around inf
lower-/.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lift-PI.f329.1
Applied rewrites9.1%
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
add-log-expN/A
log-pow-revN/A
lower-log.f32N/A
lower-pow.f32N/A
lower-exp.f32N/A
lift-PI.f32N/A
*-commutativeN/A
lower-*.f3210.2
Applied rewrites10.2%
lift-*.f32N/A
lift-pow.f32N/A
lift-PI.f32N/A
lift-exp.f32N/A
pow-expN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lower-exp.f32N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f3210.2
Applied rewrites10.2%
(FPCore (s r)
:precision binary32
(if (<= r 125.0)
(-
(/
(-
(/
(fma (/ r (* PI s)) -0.06944444444444445 (/ 0.16666666666666666 PI))
s)
(/ (/ 0.25 PI) r))
s))
(/ 0.25 (log (exp (* (* PI s) r))))))
float code(float s, float r) {
float tmp;
if (r <= 125.0f) {
tmp = -(((fmaf((r / (((float) M_PI) * s)), -0.06944444444444445f, (0.16666666666666666f / ((float) M_PI))) / s) - ((0.25f / ((float) M_PI)) / r)) / s);
} else {
tmp = 0.25f / logf(expf(((((float) M_PI) * s) * r)));
}
return tmp;
}
function code(s, r) tmp = Float32(0.0) if (r <= Float32(125.0)) tmp = Float32(-Float32(Float32(Float32(fma(Float32(r / Float32(Float32(pi) * s)), Float32(-0.06944444444444445), Float32(Float32(0.16666666666666666) / Float32(pi))) / s) - Float32(Float32(Float32(0.25) / Float32(pi)) / r)) / s)); else tmp = Float32(Float32(0.25) / log(exp(Float32(Float32(Float32(pi) * s) * r)))); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 125:\\
\;\;\;\;-\frac{\frac{\mathsf{fma}\left(\frac{r}{\pi \cdot s}, -0.06944444444444445, \frac{0.16666666666666666}{\pi}\right)}{s} - \frac{\frac{0.25}{\pi}}{r}}{s}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{\log \left(e^{\left(\pi \cdot s\right) \cdot r}\right)}\\
\end{array}
\end{array}
if r < 125Initial program 99.6%
Taylor expanded in s around -inf
Applied rewrites9.8%
Taylor expanded in s around inf
lower-/.f32N/A
*-commutativeN/A
lower-fma.f32N/A
lower-/.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f32N/A
associate-*r/N/A
metadata-evalN/A
lift-/.f32N/A
lift-PI.f3210.0
Applied rewrites10.0%
lift-/.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
associate-/r*N/A
metadata-evalN/A
associate-*r/N/A
lower-/.f32N/A
associate-*r/N/A
metadata-evalN/A
lift-/.f32N/A
lift-PI.f3210.0
Applied rewrites10.0%
if 125 < r Initial program 99.6%
Taylor expanded in s around inf
lower-/.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lift-PI.f329.1
Applied rewrites9.1%
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
add-log-expN/A
log-pow-revN/A
lower-log.f32N/A
lower-pow.f32N/A
lower-exp.f32N/A
lift-PI.f32N/A
*-commutativeN/A
lower-*.f3210.2
Applied rewrites10.2%
lift-*.f32N/A
lift-pow.f32N/A
lift-PI.f32N/A
lift-exp.f32N/A
pow-expN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lower-exp.f32N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f3210.2
Applied rewrites10.2%
(FPCore (s r)
:precision binary32
(if (<= r 125.0)
(-
(/
(-
(/
(+ (/ 0.16666666666666666 PI) (* (/ r (* PI s)) -0.06944444444444445))
s)
(/ 0.25 (* PI r)))
s))
(/ 0.25 (log (exp (* (* PI s) r))))))
float code(float s, float r) {
float tmp;
if (r <= 125.0f) {
tmp = -(((((0.16666666666666666f / ((float) M_PI)) + ((r / (((float) M_PI) * s)) * -0.06944444444444445f)) / s) - (0.25f / (((float) M_PI) * r))) / s);
} else {
tmp = 0.25f / logf(expf(((((float) M_PI) * s) * r)));
}
return tmp;
}
function code(s, r) tmp = Float32(0.0) if (r <= Float32(125.0)) tmp = Float32(-Float32(Float32(Float32(Float32(Float32(Float32(0.16666666666666666) / Float32(pi)) + Float32(Float32(r / Float32(Float32(pi) * s)) * Float32(-0.06944444444444445))) / s) - Float32(Float32(0.25) / Float32(Float32(pi) * r))) / s)); else tmp = Float32(Float32(0.25) / log(exp(Float32(Float32(Float32(pi) * s) * r)))); end return tmp end
function tmp_2 = code(s, r) tmp = single(0.0); if (r <= single(125.0)) tmp = -(((((single(0.16666666666666666) / single(pi)) + ((r / (single(pi) * s)) * single(-0.06944444444444445))) / s) - (single(0.25) / (single(pi) * r))) / s); else tmp = single(0.25) / log(exp(((single(pi) * s) * r))); end tmp_2 = tmp; end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 125:\\
\;\;\;\;-\frac{\frac{\frac{0.16666666666666666}{\pi} + \frac{r}{\pi \cdot s} \cdot -0.06944444444444445}{s} - \frac{0.25}{\pi \cdot r}}{s}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{\log \left(e^{\left(\pi \cdot s\right) \cdot r}\right)}\\
\end{array}
\end{array}
if r < 125Initial program 99.6%
Taylor expanded in s around -inf
Applied rewrites9.8%
Taylor expanded in s around inf
lower-/.f32N/A
*-commutativeN/A
lower-fma.f32N/A
lower-/.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f32N/A
associate-*r/N/A
metadata-evalN/A
lift-/.f32N/A
lift-PI.f3210.0
Applied rewrites10.0%
lift-fma.f32N/A
*-commutativeN/A
lift-/.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
*-commutativeN/A
lift-PI.f32N/A
lift-/.f32N/A
metadata-evalN/A
associate-*r/N/A
+-commutativeN/A
lower-+.f32N/A
associate-*r/N/A
metadata-evalN/A
lift-/.f32N/A
lift-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-/.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f3210.0
Applied rewrites10.0%
if 125 < r Initial program 99.6%
Taylor expanded in s around inf
lower-/.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lift-PI.f329.1
Applied rewrites9.1%
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
add-log-expN/A
log-pow-revN/A
lower-log.f32N/A
lower-pow.f32N/A
lower-exp.f32N/A
lift-PI.f32N/A
*-commutativeN/A
lower-*.f3210.2
Applied rewrites10.2%
lift-*.f32N/A
lift-pow.f32N/A
lift-PI.f32N/A
lift-exp.f32N/A
pow-expN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lower-exp.f32N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f3210.2
Applied rewrites10.2%
(FPCore (s r)
:precision binary32
(if (<= r 125.0)
(-
(/
(-
(/
(fma (/ r (* PI s)) -0.06944444444444445 (/ 0.16666666666666666 PI))
s)
(/ 0.25 (* PI r)))
s))
(/ 0.25 (log (exp (* (* PI s) r))))))
float code(float s, float r) {
float tmp;
if (r <= 125.0f) {
tmp = -(((fmaf((r / (((float) M_PI) * s)), -0.06944444444444445f, (0.16666666666666666f / ((float) M_PI))) / s) - (0.25f / (((float) M_PI) * r))) / s);
} else {
tmp = 0.25f / logf(expf(((((float) M_PI) * s) * r)));
}
return tmp;
}
function code(s, r) tmp = Float32(0.0) if (r <= Float32(125.0)) tmp = Float32(-Float32(Float32(Float32(fma(Float32(r / Float32(Float32(pi) * s)), Float32(-0.06944444444444445), Float32(Float32(0.16666666666666666) / Float32(pi))) / s) - Float32(Float32(0.25) / Float32(Float32(pi) * r))) / s)); else tmp = Float32(Float32(0.25) / log(exp(Float32(Float32(Float32(pi) * s) * r)))); end return tmp end
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;r \leq 125:\\
\;\;\;\;-\frac{\frac{\mathsf{fma}\left(\frac{r}{\pi \cdot s}, -0.06944444444444445, \frac{0.16666666666666666}{\pi}\right)}{s} - \frac{0.25}{\pi \cdot r}}{s}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{\log \left(e^{\left(\pi \cdot s\right) \cdot r}\right)}\\
\end{array}
\end{array}
if r < 125Initial program 99.6%
Taylor expanded in s around -inf
Applied rewrites9.8%
Taylor expanded in s around inf
lower-/.f32N/A
*-commutativeN/A
lower-fma.f32N/A
lower-/.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f32N/A
associate-*r/N/A
metadata-evalN/A
lift-/.f32N/A
lift-PI.f3210.0
Applied rewrites10.0%
if 125 < r Initial program 99.6%
Taylor expanded in s around inf
lower-/.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lift-PI.f329.1
Applied rewrites9.1%
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
add-log-expN/A
log-pow-revN/A
lower-log.f32N/A
lower-pow.f32N/A
lower-exp.f32N/A
lift-PI.f32N/A
*-commutativeN/A
lower-*.f3210.2
Applied rewrites10.2%
lift-*.f32N/A
lift-pow.f32N/A
lift-PI.f32N/A
lift-exp.f32N/A
pow-expN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lower-exp.f32N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f3210.2
Applied rewrites10.2%
(FPCore (s r) :precision binary32 (/ 0.25 (log (exp (* (* PI s) r)))))
float code(float s, float r) {
return 0.25f / logf(expf(((((float) M_PI) * s) * r)));
}
function code(s, r) return Float32(Float32(0.25) / log(exp(Float32(Float32(Float32(pi) * s) * r)))) end
function tmp = code(s, r) tmp = single(0.25) / log(exp(((single(pi) * s) * r))); end
\begin{array}{l}
\\
\frac{0.25}{\log \left(e^{\left(\pi \cdot s\right) \cdot r}\right)}
\end{array}
Initial program 99.6%
Taylor expanded in s around inf
lower-/.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lift-PI.f329.1
Applied rewrites9.1%
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
add-log-expN/A
log-pow-revN/A
lower-log.f32N/A
lower-pow.f32N/A
lower-exp.f32N/A
lift-PI.f32N/A
*-commutativeN/A
lower-*.f3210.2
Applied rewrites10.2%
lift-*.f32N/A
lift-pow.f32N/A
lift-PI.f32N/A
lift-exp.f32N/A
pow-expN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lower-exp.f32N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f3210.2
Applied rewrites10.2%
(FPCore (s r) :precision binary32 (- (/ (/ (- (* (/ r (* PI s)) 0.16666666666666666) (/ 0.25 PI)) r) s)))
float code(float s, float r) {
return -(((((r / (((float) M_PI) * s)) * 0.16666666666666666f) - (0.25f / ((float) M_PI))) / r) / s);
}
function code(s, r) return Float32(-Float32(Float32(Float32(Float32(Float32(r / Float32(Float32(pi) * s)) * Float32(0.16666666666666666)) - Float32(Float32(0.25) / Float32(pi))) / r) / s)) end
function tmp = code(s, r) tmp = -(((((r / (single(pi) * s)) * single(0.16666666666666666)) - (single(0.25) / single(pi))) / r) / s); end
\begin{array}{l}
\\
-\frac{\frac{\frac{r}{\pi \cdot s} \cdot 0.16666666666666666 - \frac{0.25}{\pi}}{r}}{s}
\end{array}
Initial program 99.6%
Taylor expanded in s around -inf
Applied rewrites9.8%
Taylor expanded in r around 0
lower-/.f32N/A
lower--.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-/.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f32N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f32N/A
lift-PI.f329.0
Applied rewrites9.0%
(FPCore (s r) :precision binary32 (/ (/ (fma (/ r (* PI s)) -0.16666666666666666 (/ 0.25 PI)) s) r))
float code(float s, float r) {
return (fmaf((r / (((float) M_PI) * s)), -0.16666666666666666f, (0.25f / ((float) M_PI))) / s) / r;
}
function code(s, r) return Float32(Float32(fma(Float32(r / Float32(Float32(pi) * s)), Float32(-0.16666666666666666), Float32(Float32(0.25) / Float32(pi))) / s) / r) end
\begin{array}{l}
\\
\frac{\frac{\mathsf{fma}\left(\frac{r}{\pi \cdot s}, -0.16666666666666666, \frac{0.25}{\pi}\right)}{s}}{r}
\end{array}
Initial program 99.6%
Taylor expanded in r around 0
lower-/.f32N/A
Applied rewrites8.6%
Taylor expanded in s around inf
lower-/.f32N/A
*-commutativeN/A
lower-fma.f32N/A
lower-/.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f32N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f32N/A
lift-PI.f329.0
Applied rewrites9.0%
(FPCore (s r) :precision binary32 (- (/ (- (/ 0.16666666666666666 (* PI s)) (/ (/ 0.25 r) PI)) s)))
float code(float s, float r) {
return -(((0.16666666666666666f / (((float) M_PI) * s)) - ((0.25f / r) / ((float) M_PI))) / s);
}
function code(s, r) return Float32(-Float32(Float32(Float32(Float32(0.16666666666666666) / Float32(Float32(pi) * s)) - Float32(Float32(Float32(0.25) / r) / Float32(pi))) / s)) end
function tmp = code(s, r) tmp = -(((single(0.16666666666666666) / (single(pi) * s)) - ((single(0.25) / r) / single(pi))) / s); end
\begin{array}{l}
\\
-\frac{\frac{0.16666666666666666}{\pi \cdot s} - \frac{\frac{0.25}{r}}{\pi}}{s}
\end{array}
Initial program 99.6%
Taylor expanded in s around -inf
Applied rewrites9.8%
lift-/.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f32N/A
lower-/.f32N/A
lift-PI.f329.8
Applied rewrites9.8%
Taylor expanded in s around inf
lower-/.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f329.0
Applied rewrites9.0%
(FPCore (s r) :precision binary32 (/ (- (/ 0.25 (* PI r)) (/ 0.16666666666666666 (* PI s))) s))
float code(float s, float r) {
return ((0.25f / (((float) M_PI) * r)) - (0.16666666666666666f / (((float) M_PI) * s))) / s;
}
function code(s, r) return Float32(Float32(Float32(Float32(0.25) / Float32(Float32(pi) * r)) - Float32(Float32(0.16666666666666666) / Float32(Float32(pi) * s))) / s) end
function tmp = code(s, r) tmp = ((single(0.25) / (single(pi) * r)) - (single(0.16666666666666666) / (single(pi) * s))) / s; end
\begin{array}{l}
\\
\frac{\frac{0.25}{\pi \cdot r} - \frac{0.16666666666666666}{\pi \cdot s}}{s}
\end{array}
Initial program 99.6%
Taylor expanded in s around inf
lower-/.f32N/A
Applied rewrites9.0%
(FPCore (s r) :precision binary32 (/ (/ 0.25 (* PI s)) r))
float code(float s, float r) {
return (0.25f / (((float) M_PI) * s)) / r;
}
function code(s, r) return Float32(Float32(Float32(0.25) / Float32(Float32(pi) * s)) / r) end
function tmp = code(s, r) tmp = (single(0.25) / (single(pi) * s)) / r; end
\begin{array}{l}
\\
\frac{\frac{0.25}{\pi \cdot s}}{r}
\end{array}
Initial program 99.6%
Taylor expanded in s around inf
lower-/.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lift-PI.f329.1
Applied rewrites9.1%
lift-/.f32N/A
lift-*.f32N/A
associate-/r*N/A
lift-PI.f32N/A
lift-*.f32N/A
metadata-evalN/A
*-commutativeN/A
associate-*r/N/A
lower-/.f32N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-PI.f329.1
Applied rewrites9.1%
(FPCore (s r) :precision binary32 (/ 0.25 (* (* s r) PI)))
float code(float s, float r) {
return 0.25f / ((s * r) * ((float) M_PI));
}
function code(s, r) return Float32(Float32(0.25) / Float32(Float32(s * r) * Float32(pi))) end
function tmp = code(s, r) tmp = single(0.25) / ((s * r) * single(pi)); end
\begin{array}{l}
\\
\frac{0.25}{\left(s \cdot r\right) \cdot \pi}
\end{array}
Initial program 99.6%
Taylor expanded in s around inf
lower-/.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lift-PI.f329.1
Applied rewrites9.1%
lift-*.f32N/A
lift-PI.f32N/A
lift-*.f32N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lift-PI.f329.1
Applied rewrites9.1%
herbie shell --seed 2025142
(FPCore (s r)
:name "Disney BSSRDF, PDF of scattering profile"
:precision binary32
:pre (and (and (<= 0.0 s) (<= s 256.0)) (and (< 1e-6 r) (< r 1000000.0)))
(+ (/ (* 0.25 (exp (/ (- r) s))) (* (* (* 2.0 PI) s) r)) (/ (* 0.75 (exp (/ (- r) (* 3.0 s)))) (* (* (* 6.0 PI) s) r))))