
(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))))
\begin{array}{l}
\\
\frac{0.25 \cdot e^{\frac{-r}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \frac{0.75 \cdot e^{\frac{-r}{3 \cdot s}}}{\left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r}
\end{array}
Sampling outcomes in binary32 precision:
Herbie found 14 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))))
\begin{array}{l}
\\
\frac{0.25 \cdot e^{\frac{-r}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \frac{0.75 \cdot e^{\frac{-r}{3 \cdot s}}}{\left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r}
\end{array}
(FPCore (s r) :precision binary32 (+ (/ (* (exp (/ (- r) (* 3.0 s))) 0.75) (/ (* (* (* 6.0 s) r) (pow (PI) 3.0)) (* (PI) (PI)))) (/ (* (exp (/ (- r) s)) 0.25) (* (* (* (PI) 2.0) s) r))))
\begin{array}{l}
\\
\frac{e^{\frac{-r}{3 \cdot s}} \cdot 0.75}{\frac{\left(\left(6 \cdot s\right) \cdot r\right) \cdot {\mathsf{PI}\left(\right)}^{3}}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}} + \frac{e^{\frac{-r}{s}} \cdot 0.25}{\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot s\right) \cdot r}
\end{array}
Initial program 99.6%
lift-*.f32N/A
lift-*.f32N/A
associate-*l*N/A
lift-*.f32N/A
*-commutativeN/A
associate-*l*N/A
+-lft-identityN/A
flip3-+N/A
metadata-evalN/A
lift-PI.f32N/A
add-cbrt-cubeN/A
rem-cube-cbrtN/A
+-lft-identityN/A
metadata-evalN/A
+-lft-identityN/A
distribute-rgt-out--N/A
lift-PI.f32N/A
lift-PI.f32N/A
--rgt-identity-revN/A
Applied rewrites99.7%
Final simplification99.7%
(FPCore (s r)
:precision binary32
(let* ((t_0 (* (- 1.0 (/ r s)) 0.25))
(t_1 (* (exp (/ (- r) (* 3.0 s))) 0.75))
(t_2 (/ t_1 (* (* (* 6.0 (PI)) s) r)))
(t_3 (* (PI) (PI)))
(t_4 (* (* (* (PI) 2.0) s) r)))
(if (<= (+ t_2 (/ (* (exp (/ (- r) s)) 0.25) t_4)) 0.0020000000949949026)
(+ (/ t_0 (* (/ (* (* 2.0 s) t_3) (fma (PI) 1.0 0.0)) r)) t_2)
(+ (/ t_0 t_4) (/ t_1 (/ (* t_3 (* (* 6.0 s) r)) (PI)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 - \frac{r}{s}\right) \cdot 0.25\\
t_1 := e^{\frac{-r}{3 \cdot s}} \cdot 0.75\\
t_2 := \frac{t\_1}{\left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r}\\
t_3 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
t_4 := \left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot s\right) \cdot r\\
\mathbf{if}\;t\_2 + \frac{e^{\frac{-r}{s}} \cdot 0.25}{t\_4} \leq 0.0020000000949949026:\\
\;\;\;\;\frac{t\_0}{\frac{\left(2 \cdot s\right) \cdot t\_3}{\mathsf{fma}\left(\mathsf{PI}\left(\right), 1, 0\right)} \cdot r} + t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{t\_4} + \frac{t\_1}{\frac{t\_3 \cdot \left(\left(6 \cdot s\right) \cdot r\right)}{\mathsf{PI}\left(\right)}}\\
\end{array}
\end{array}
if (+.f32 (/.f32 (*.f32 #s(literal 1/4 binary32) (exp.f32 (/.f32 (neg.f32 r) s))) (*.f32 (*.f32 (*.f32 #s(literal 2 binary32) (PI.f32)) s) r)) (/.f32 (*.f32 #s(literal 3/4 binary32) (exp.f32 (/.f32 (neg.f32 r) (*.f32 #s(literal 3 binary32) s)))) (*.f32 (*.f32 (*.f32 #s(literal 6 binary32) (PI.f32)) s) r))) < 0.00200000009Initial program 99.7%
lift-*.f32N/A
lift-*.f32N/A
*-commutativeN/A
associate-*l*N/A
+-lft-identityN/A
flip-+N/A
metadata-evalN/A
lift-PI.f32N/A
lift-PI.f32N/A
sub0-negN/A
neg-sub0N/A
frac-2negN/A
associate-*l/N/A
lower-/.f32N/A
*-commutativeN/A
lower-*.f32N/A
lift-PI.f32N/A
lift-PI.f32N/A
lower-*.f32N/A
lower-*.f3299.7
Applied rewrites99.7%
Taylor expanded in s around inf
mul-1-negN/A
unsub-negN/A
lower--.f32N/A
lower-/.f324.4
Applied rewrites4.4%
+-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f3290.7
Applied rewrites90.7%
if 0.00200000009 < (+.f32 (/.f32 (*.f32 #s(literal 1/4 binary32) (exp.f32 (/.f32 (neg.f32 r) s))) (*.f32 (*.f32 (*.f32 #s(literal 2 binary32) (PI.f32)) s) r)) (/.f32 (*.f32 #s(literal 3/4 binary32) (exp.f32 (/.f32 (neg.f32 r) (*.f32 #s(literal 3 binary32) s)))) (*.f32 (*.f32 (*.f32 #s(literal 6 binary32) (PI.f32)) s) r))) Initial program 98.1%
lift-*.f32N/A
lift-*.f32N/A
associate-*l*N/A
lift-*.f32N/A
*-commutativeN/A
associate-*l*N/A
+-lft-identityN/A
flip-+N/A
metadata-evalN/A
lift-PI.f32N/A
lift-PI.f32N/A
sub0-negN/A
neg-sub0N/A
frac-2negN/A
associate-*l/N/A
lower-/.f32N/A
Applied rewrites98.8%
Taylor expanded in s around inf
mul-1-negN/A
unsub-negN/A
lower--.f32N/A
lower-/.f3266.8
Applied rewrites66.8%
Final simplification91.2%
(FPCore (s r)
:precision binary32
(let* ((t_0 (* (* (* (PI) 2.0) s) r))
(t_1 (* (PI) (PI)))
(t_2 (* (* (* 6.0 (PI)) s) r))
(t_3 (* (exp (/ (- r) (* 3.0 s))) 0.75))
(t_4 (* (- 1.0 (/ r s)) 0.25)))
(if (<=
(+ (/ t_3 t_2) (/ (* (exp (/ (- r) s)) 0.25) t_0))
0.0020000000949949026)
(+
(/ (* (exp (* (/ r s) -0.3333333333333333)) 0.75) t_2)
(/ t_4 (* (/ (* (* 2.0 s) t_1) (fma (PI) 1.0 0.0)) r)))
(+ (/ t_4 t_0) (/ t_3 (/ (* t_1 (* (* 6.0 s) r)) (PI)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot s\right) \cdot r\\
t_1 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
t_2 := \left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r\\
t_3 := e^{\frac{-r}{3 \cdot s}} \cdot 0.75\\
t_4 := \left(1 - \frac{r}{s}\right) \cdot 0.25\\
\mathbf{if}\;\frac{t\_3}{t\_2} + \frac{e^{\frac{-r}{s}} \cdot 0.25}{t\_0} \leq 0.0020000000949949026:\\
\;\;\;\;\frac{e^{\frac{r}{s} \cdot -0.3333333333333333} \cdot 0.75}{t\_2} + \frac{t\_4}{\frac{\left(2 \cdot s\right) \cdot t\_1}{\mathsf{fma}\left(\mathsf{PI}\left(\right), 1, 0\right)} \cdot r}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_4}{t\_0} + \frac{t\_3}{\frac{t\_1 \cdot \left(\left(6 \cdot s\right) \cdot r\right)}{\mathsf{PI}\left(\right)}}\\
\end{array}
\end{array}
if (+.f32 (/.f32 (*.f32 #s(literal 1/4 binary32) (exp.f32 (/.f32 (neg.f32 r) s))) (*.f32 (*.f32 (*.f32 #s(literal 2 binary32) (PI.f32)) s) r)) (/.f32 (*.f32 #s(literal 3/4 binary32) (exp.f32 (/.f32 (neg.f32 r) (*.f32 #s(literal 3 binary32) s)))) (*.f32 (*.f32 (*.f32 #s(literal 6 binary32) (PI.f32)) s) r))) < 0.00200000009Initial program 99.7%
lift-*.f32N/A
lift-*.f32N/A
*-commutativeN/A
associate-*l*N/A
+-lft-identityN/A
flip-+N/A
metadata-evalN/A
lift-PI.f32N/A
lift-PI.f32N/A
sub0-negN/A
neg-sub0N/A
frac-2negN/A
associate-*l/N/A
lower-/.f32N/A
*-commutativeN/A
lower-*.f32N/A
lift-PI.f32N/A
lift-PI.f32N/A
lower-*.f32N/A
lower-*.f3299.7
Applied rewrites99.7%
Taylor expanded in s around inf
mul-1-negN/A
unsub-negN/A
lower--.f32N/A
lower-/.f324.4
Applied rewrites4.4%
+-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f3291.1
Applied rewrites91.5%
lift-/.f32N/A
lift-neg.f32N/A
lift-*.f32N/A
neg-mul-1N/A
times-fracN/A
metadata-evalN/A
lift-/.f32N/A
*-commutativeN/A
lower-*.f3291.1
Applied rewrites90.6%
if 0.00200000009 < (+.f32 (/.f32 (*.f32 #s(literal 1/4 binary32) (exp.f32 (/.f32 (neg.f32 r) s))) (*.f32 (*.f32 (*.f32 #s(literal 2 binary32) (PI.f32)) s) r)) (/.f32 (*.f32 #s(literal 3/4 binary32) (exp.f32 (/.f32 (neg.f32 r) (*.f32 #s(literal 3 binary32) s)))) (*.f32 (*.f32 (*.f32 #s(literal 6 binary32) (PI.f32)) s) r))) Initial program 98.1%
lift-*.f32N/A
lift-*.f32N/A
associate-*l*N/A
lift-*.f32N/A
*-commutativeN/A
associate-*l*N/A
+-lft-identityN/A
flip-+N/A
metadata-evalN/A
lift-PI.f32N/A
lift-PI.f32N/A
sub0-negN/A
neg-sub0N/A
frac-2negN/A
associate-*l/N/A
lower-/.f32N/A
Applied rewrites98.8%
Taylor expanded in s around inf
mul-1-negN/A
unsub-negN/A
lower--.f32N/A
lower-/.f3266.8
Applied rewrites66.8%
Final simplification91.5%
(FPCore (s r) :precision binary32 (+ (/ (* (exp (/ (- r) (* 3.0 s))) 0.75) (/ (* (* (PI) (PI)) (* (* 6.0 s) r)) (PI))) (/ (* (exp (/ (- r) s)) 0.25) (* (* (* (PI) 2.0) s) r))))
\begin{array}{l}
\\
\frac{e^{\frac{-r}{3 \cdot s}} \cdot 0.75}{\frac{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(6 \cdot s\right) \cdot r\right)}{\mathsf{PI}\left(\right)}} + \frac{e^{\frac{-r}{s}} \cdot 0.25}{\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot s\right) \cdot r}
\end{array}
Initial program 99.6%
lift-*.f32N/A
lift-*.f32N/A
associate-*l*N/A
lift-*.f32N/A
*-commutativeN/A
associate-*l*N/A
+-lft-identityN/A
flip-+N/A
metadata-evalN/A
lift-PI.f32N/A
lift-PI.f32N/A
sub0-negN/A
neg-sub0N/A
frac-2negN/A
associate-*l/N/A
lower-/.f32N/A
Applied rewrites99.7%
Final simplification99.7%
(FPCore (s r) :precision binary32 (+ (/ (* (exp (/ (- r) (* 3.0 s))) 0.75) (* (* (* (PI) s) r) 6.0)) (/ (* (exp (/ (- r) s)) 0.25) (* (* (* (PI) 2.0) s) r))))
\begin{array}{l}
\\
\frac{e^{\frac{-r}{3 \cdot s}} \cdot 0.75}{\left(\left(\mathsf{PI}\left(\right) \cdot s\right) \cdot r\right) \cdot 6} + \frac{e^{\frac{-r}{s}} \cdot 0.25}{\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot s\right) \cdot r}
\end{array}
Initial program 99.6%
lift-*.f32N/A
lift-*.f32N/A
associate-*l*N/A
lift-*.f32N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f32N/A
associate-*r*N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f3299.6
Applied rewrites99.6%
Final simplification99.6%
(FPCore (s r) :precision binary32 (+ (/ (* (exp (/ (- r) (* 3.0 s))) 0.75) (* (* (PI) r) (* 6.0 s))) (/ (* (exp (/ (- r) s)) 0.25) (* (* (* (PI) 2.0) s) r))))
\begin{array}{l}
\\
\frac{e^{\frac{-r}{3 \cdot s}} \cdot 0.75}{\left(\mathsf{PI}\left(\right) \cdot r\right) \cdot \left(6 \cdot s\right)} + \frac{e^{\frac{-r}{s}} \cdot 0.25}{\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot s\right) \cdot r}
\end{array}
Initial program 99.6%
lift-*.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-*.f32N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f32N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f3299.6
Applied rewrites99.6%
Final simplification99.6%
(FPCore (s r) :precision binary32 (+ (/ (* (exp (/ r (* -3.0 s))) 0.75) (* (* (* 6.0 (PI)) s) r)) (/ (* (exp (/ (- r) s)) 0.25) (* (* (* (PI) 2.0) s) r))))
\begin{array}{l}
\\
\frac{e^{\frac{r}{-3 \cdot s}} \cdot 0.75}{\left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \frac{e^{\frac{-r}{s}} \cdot 0.25}{\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot s\right) \cdot r}
\end{array}
Initial program 99.6%
lift-/.f32N/A
frac-2neg-revN/A
lift-neg.f32N/A
remove-double-negN/A
lower-/.f32N/A
lift-*.f32N/A
distribute-lft-neg-inN/A
lower-*.f32N/A
metadata-eval99.6
Applied rewrites99.6%
Final simplification99.6%
(FPCore (s r) :precision binary32 (+ (/ (* (exp (* (/ -0.3333333333333333 s) r)) 0.75) (* (* (PI) r) (* 6.0 s))) (/ (* (exp (/ (- r) s)) 0.25) (* (* (* (PI) 2.0) s) r))))
\begin{array}{l}
\\
\frac{e^{\frac{-0.3333333333333333}{s} \cdot r} \cdot 0.75}{\left(\mathsf{PI}\left(\right) \cdot r\right) \cdot \left(6 \cdot s\right)} + \frac{e^{\frac{-r}{s}} \cdot 0.25}{\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot s\right) \cdot r}
\end{array}
Initial program 99.6%
lift-*.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-*.f32N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f32N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f3299.6
Applied rewrites99.6%
lift-/.f32N/A
clear-numN/A
frac-2negN/A
lift-neg.f32N/A
remove-double-negN/A
associate-/r/N/A
lower-*.f32N/A
lift-*.f32N/A
distribute-lft-neg-inN/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f32N/A
metadata-eval99.6
Applied rewrites99.6%
Final simplification99.6%
(FPCore (s r) :precision binary32 (+ (/ (* (- 1.0 (/ r s)) 0.25) (* (* (* (PI) 2.0) s) r)) (/ (* (exp (/ (- r) (* 3.0 s))) 0.75) (/ (* (* (PI) (PI)) (* (* 6.0 s) r)) (PI)))))
\begin{array}{l}
\\
\frac{\left(1 - \frac{r}{s}\right) \cdot 0.25}{\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot s\right) \cdot r} + \frac{e^{\frac{-r}{3 \cdot s}} \cdot 0.75}{\frac{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(6 \cdot s\right) \cdot r\right)}{\mathsf{PI}\left(\right)}}
\end{array}
Initial program 99.6%
lift-*.f32N/A
lift-*.f32N/A
associate-*l*N/A
lift-*.f32N/A
*-commutativeN/A
associate-*l*N/A
+-lft-identityN/A
flip-+N/A
metadata-evalN/A
lift-PI.f32N/A
lift-PI.f32N/A
sub0-negN/A
neg-sub0N/A
frac-2negN/A
associate-*l/N/A
lower-/.f32N/A
Applied rewrites99.7%
Taylor expanded in s around inf
mul-1-negN/A
unsub-negN/A
lower--.f32N/A
lower-/.f3210.0
Applied rewrites10.0%
Final simplification10.0%
(FPCore (s r) :precision binary32 (+ (/ (* (- 1.0 (/ r s)) 0.25) (* (* (* (PI) 2.0) s) r)) (/ (* (exp (/ r (* -3.0 s))) 0.75) (* (* (* 6.0 (PI)) s) r))))
\begin{array}{l}
\\
\frac{\left(1 - \frac{r}{s}\right) \cdot 0.25}{\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot s\right) \cdot r} + \frac{e^{\frac{r}{-3 \cdot s}} \cdot 0.75}{\left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r}
\end{array}
Initial program 99.6%
lift-/.f32N/A
frac-2neg-revN/A
lift-neg.f32N/A
remove-double-negN/A
lower-/.f32N/A
lift-*.f32N/A
distribute-lft-neg-inN/A
lower-*.f32N/A
metadata-eval99.6
Applied rewrites99.6%
Taylor expanded in s around inf
mul-1-negN/A
unsub-negN/A
lower--.f32N/A
lower-/.f3210.0
Applied rewrites10.0%
Final simplification10.0%
(FPCore (s r) :precision binary32 (+ (/ (* 1.0 0.25) (* (* (* (PI) 2.0) s) r)) (/ (* (exp (/ (- r) (* 3.0 s))) 0.75) (* (* (PI) r) (* 6.0 s)))))
\begin{array}{l}
\\
\frac{1 \cdot 0.25}{\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot s\right) \cdot r} + \frac{e^{\frac{-r}{3 \cdot s}} \cdot 0.75}{\left(\mathsf{PI}\left(\right) \cdot r\right) \cdot \left(6 \cdot s\right)}
\end{array}
Initial program 99.6%
lift-*.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-*.f32N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f32N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f3299.6
Applied rewrites99.6%
Taylor expanded in s around inf
Applied rewrites9.9%
Final simplification9.9%
(FPCore (s r) :precision binary32 (+ (/ (* 1.0 0.25) (* (* (* (PI) 2.0) s) r)) (/ (* (exp (/ r (* -3.0 s))) 0.75) (* (* (* 6.0 (PI)) s) r))))
\begin{array}{l}
\\
\frac{1 \cdot 0.25}{\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot s\right) \cdot r} + \frac{e^{\frac{r}{-3 \cdot s}} \cdot 0.75}{\left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r}
\end{array}
Initial program 99.6%
lift-/.f32N/A
frac-2neg-revN/A
lift-neg.f32N/A
remove-double-negN/A
lower-/.f32N/A
lift-*.f32N/A
distribute-lft-neg-inN/A
lower-*.f32N/A
metadata-eval99.6
Applied rewrites99.6%
Taylor expanded in s around inf
Applied rewrites9.9%
Final simplification9.9%
(FPCore (s r) :precision binary32 (+ (/ (* (fma -0.3333333333333333 (/ r s) 1.0) 0.75) (* (* (PI) r) (* 6.0 s))) (/ (* 1.0 0.25) (* (* (* (PI) 2.0) s) r))))
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(-0.3333333333333333, \frac{r}{s}, 1\right) \cdot 0.75}{\left(\mathsf{PI}\left(\right) \cdot r\right) \cdot \left(6 \cdot s\right)} + \frac{1 \cdot 0.25}{\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot s\right) \cdot r}
\end{array}
Initial program 99.6%
lift-*.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift-*.f32N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f32N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f3299.6
Applied rewrites99.6%
Taylor expanded in s around inf
+-commutativeN/A
lower-fma.f32N/A
lower-/.f325.5
Applied rewrites5.7%
Taylor expanded in s around inf
Applied rewrites9.7%
Final simplification9.7%
(FPCore (s r) :precision binary32 (- (/ (* (fma -0.3333333333333333 (/ r s) 1.0) 0.75) (* (* (* 6.0 (PI)) s) r)) (/ 0.25 (* (* 0.0 s) r))))
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(-0.3333333333333333, \frac{r}{s}, 1\right) \cdot 0.75}{\left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} - \frac{0.25}{\left(0 \cdot s\right) \cdot r}
\end{array}
Initial program 99.6%
lift-*.f32N/A
*-commutativeN/A
lift-*.f32N/A
count-2-revN/A
flip-+N/A
lift-PI.f32N/A
lift-PI.f32N/A
lift-PI.f32N/A
lift-PI.f32N/A
+-inversesN/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
flip-+N/A
metadata-evalN/A
lower-*.f320.8
Applied rewrites0.8%
Taylor expanded in s around inf
Applied rewrites3.6%
Taylor expanded in s around inf
+-commutativeN/A
lower-fma.f32N/A
lower-/.f323.6
Applied rewrites3.6%
Taylor expanded in s around inf
Applied rewrites3.6%
Final simplification2.8%
herbie shell --seed 2024312
(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))))