Disney BSSRDF, PDF of scattering profile

Percentage Accurate: 99.5% → 99.5%
Time: 14.8s
Alternatives: 19
Speedup: 1.0×

Specification

?
\[\left(0 \leq s \land s \leq 256\right) \land \left(10^{-6} < r \land r < 1000000\right)\]
\[\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.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}

Sampling outcomes in binary32 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 19 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.5% accurate, 1.0× speedup?

\[\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.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}

Alternative 1: 99.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{0.25 \cdot e^{\frac{r}{-s}}}{r \cdot \left(s \cdot \left(2 \cdot \pi\right)\right)} + \frac{0.75 \cdot e^{\frac{r}{3 \cdot \left(-s\right)}}}{r \cdot \left(s \cdot \left(\pi \cdot 6\right)\right)} \end{array} \]
(FPCore (s r)
 :precision binary32
 (+
  (/ (* 0.25 (exp (/ r (- s)))) (* r (* s (* 2.0 PI))))
  (/ (* 0.75 (exp (/ r (* 3.0 (- s))))) (* r (* s (* PI 6.0))))))
float code(float s, float r) {
	return ((0.25f * expf((r / -s))) / (r * (s * (2.0f * ((float) M_PI))))) + ((0.75f * expf((r / (3.0f * -s)))) / (r * (s * (((float) M_PI) * 6.0f))));
}
function code(s, r)
	return Float32(Float32(Float32(Float32(0.25) * exp(Float32(r / Float32(-s)))) / Float32(r * Float32(s * Float32(Float32(2.0) * Float32(pi))))) + Float32(Float32(Float32(0.75) * exp(Float32(r / Float32(Float32(3.0) * Float32(-s))))) / Float32(r * Float32(s * Float32(Float32(pi) * Float32(6.0))))))
end
function tmp = code(s, r)
	tmp = ((single(0.25) * exp((r / -s))) / (r * (s * (single(2.0) * single(pi))))) + ((single(0.75) * exp((r / (single(3.0) * -s)))) / (r * (s * (single(pi) * single(6.0)))));
end
\begin{array}{l}

\\
\frac{0.25 \cdot e^{\frac{r}{-s}}}{r \cdot \left(s \cdot \left(2 \cdot \pi\right)\right)} + \frac{0.75 \cdot e^{\frac{r}{3 \cdot \left(-s\right)}}}{r \cdot \left(s \cdot \left(\pi \cdot 6\right)\right)}
\end{array}
Derivation
  1. Initial program 99.5%

    \[\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} \]
  2. Add Preprocessing
  3. Final simplification99.5%

    \[\leadsto \frac{0.25 \cdot e^{\frac{r}{-s}}}{r \cdot \left(s \cdot \left(2 \cdot \pi\right)\right)} + \frac{0.75 \cdot e^{\frac{r}{3 \cdot \left(-s\right)}}}{r \cdot \left(s \cdot \left(\pi \cdot 6\right)\right)} \]
  4. Add Preprocessing

Alternative 2: 99.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \frac{0.125 \cdot \left(\frac{e^{\frac{r}{-s}}}{r \cdot \pi} + \frac{e^{\frac{r}{s} \cdot -0.3333333333333333}}{r \cdot \pi}\right)}{s} \end{array} \]
(FPCore (s r)
 :precision binary32
 (/
  (*
   0.125
   (+
    (/ (exp (/ r (- s))) (* r PI))
    (/ (exp (* (/ r s) -0.3333333333333333)) (* r PI))))
  s))
float code(float s, float r) {
	return (0.125f * ((expf((r / -s)) / (r * ((float) M_PI))) + (expf(((r / s) * -0.3333333333333333f)) / (r * ((float) M_PI))))) / s;
}
function code(s, r)
	return Float32(Float32(Float32(0.125) * Float32(Float32(exp(Float32(r / Float32(-s))) / Float32(r * Float32(pi))) + Float32(exp(Float32(Float32(r / s) * Float32(-0.3333333333333333))) / Float32(r * Float32(pi))))) / s)
end
function tmp = code(s, r)
	tmp = (single(0.125) * ((exp((r / -s)) / (r * single(pi))) + (exp(((r / s) * single(-0.3333333333333333))) / (r * single(pi))))) / s;
end
\begin{array}{l}

\\
\frac{0.125 \cdot \left(\frac{e^{\frac{r}{-s}}}{r \cdot \pi} + \frac{e^{\frac{r}{s} \cdot -0.3333333333333333}}{r \cdot \pi}\right)}{s}
\end{array}
Derivation
  1. Initial program 99.5%

    \[\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} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-/.f32N/A

      \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \color{blue}{\frac{\frac{3}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}}}{\left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r}} \]
    2. clear-numN/A

      \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \color{blue}{\frac{1}{\frac{\left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r}{\frac{3}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}}}}} \]
    3. lift-*.f32N/A

      \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \frac{1}{\frac{\color{blue}{\left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r}}{\frac{3}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}}}} \]
    4. lift-*.f32N/A

      \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \frac{1}{\frac{\left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r}{\color{blue}{\frac{3}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}}}}} \]
    5. *-commutativeN/A

      \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \frac{1}{\frac{\left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r}{\color{blue}{e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}} \cdot \frac{3}{4}}}} \]
    6. times-fracN/A

      \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \frac{1}{\color{blue}{\frac{\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s}{e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}}} \cdot \frac{r}{\frac{3}{4}}}} \]
    7. associate-/r*N/A

      \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \color{blue}{\frac{\frac{1}{\frac{\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s}{e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}}}}}{\frac{r}{\frac{3}{4}}}} \]
    8. clear-numN/A

      \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \frac{\color{blue}{\frac{e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}}}{\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s}}}{\frac{r}{\frac{3}{4}}} \]
    9. lower-/.f32N/A

      \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \color{blue}{\frac{\frac{e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}}}{\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s}}{\frac{r}{\frac{3}{4}}}} \]
  4. Applied rewrites99.5%

    \[\leadsto \frac{0.25 \cdot e^{\frac{-r}{s}}}{\left(\left(2 \cdot \pi\right) \cdot s\right) \cdot r} + \color{blue}{\frac{\frac{e^{\frac{r}{s \cdot -3}}}{s \cdot \left(\pi \cdot 6\right)}}{r \cdot 1.3333333333333333}} \]
  5. Taylor expanded in s around 0

    \[\leadsto \color{blue}{\frac{\frac{1}{8} \cdot \frac{e^{-1 \cdot \frac{r}{s}}}{r \cdot \mathsf{PI}\left(\right)} + \frac{1}{8} \cdot \frac{e^{\frac{-1}{3} \cdot \frac{r}{s}}}{r \cdot \mathsf{PI}\left(\right)}}{s}} \]
  6. Step-by-step derivation
    1. lower-/.f32N/A

      \[\leadsto \color{blue}{\frac{\frac{1}{8} \cdot \frac{e^{-1 \cdot \frac{r}{s}}}{r \cdot \mathsf{PI}\left(\right)} + \frac{1}{8} \cdot \frac{e^{\frac{-1}{3} \cdot \frac{r}{s}}}{r \cdot \mathsf{PI}\left(\right)}}{s}} \]
  7. Applied rewrites99.5%

    \[\leadsto \color{blue}{\frac{0.125 \cdot \left(\frac{e^{\frac{r}{-s}}}{r \cdot \pi} + \frac{e^{\frac{r}{s} \cdot -0.3333333333333333}}{r \cdot \pi}\right)}{s}} \]
  8. Add Preprocessing

Alternative 3: 99.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \frac{0.125}{s \cdot \pi} \cdot \left(\frac{e^{\frac{r}{s} \cdot -0.3333333333333333}}{r} + \frac{e^{\frac{r}{-s}}}{r}\right) \end{array} \]
(FPCore (s r)
 :precision binary32
 (*
  (/ 0.125 (* s PI))
  (+ (/ (exp (* (/ r s) -0.3333333333333333)) r) (/ (exp (/ r (- s))) r))))
float code(float s, float r) {
	return (0.125f / (s * ((float) M_PI))) * ((expf(((r / s) * -0.3333333333333333f)) / r) + (expf((r / -s)) / r));
}
function code(s, r)
	return Float32(Float32(Float32(0.125) / Float32(s * Float32(pi))) * Float32(Float32(exp(Float32(Float32(r / s) * Float32(-0.3333333333333333))) / r) + Float32(exp(Float32(r / Float32(-s))) / r)))
end
function tmp = code(s, r)
	tmp = (single(0.125) / (s * single(pi))) * ((exp(((r / s) * single(-0.3333333333333333))) / r) + (exp((r / -s)) / r));
end
\begin{array}{l}

\\
\frac{0.125}{s \cdot \pi} \cdot \left(\frac{e^{\frac{r}{s} \cdot -0.3333333333333333}}{r} + \frac{e^{\frac{r}{-s}}}{r}\right)
\end{array}
Derivation
  1. Initial program 99.5%

    \[\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} \]
  2. Add Preprocessing
  3. Applied rewrites99.5%

    \[\leadsto \color{blue}{\frac{0.125}{s \cdot \pi} \cdot \left(\frac{e^{\frac{r}{s \cdot -3}}}{r} + \frac{e^{\frac{r}{-s}}}{r}\right)} \]
  4. Step-by-step derivation
    1. lift-/.f32N/A

      \[\leadsto \frac{\frac{1}{8}}{s \cdot \mathsf{PI}\left(\right)} \cdot \left(\frac{e^{\color{blue}{\frac{r}{s \cdot -3}}}}{r} + \frac{e^{\frac{r}{\mathsf{neg}\left(s\right)}}}{r}\right) \]
    2. lift-*.f32N/A

      \[\leadsto \frac{\frac{1}{8}}{s \cdot \mathsf{PI}\left(\right)} \cdot \left(\frac{e^{\frac{r}{\color{blue}{s \cdot -3}}}}{r} + \frac{e^{\frac{r}{\mathsf{neg}\left(s\right)}}}{r}\right) \]
    3. associate-/r*N/A

      \[\leadsto \frac{\frac{1}{8}}{s \cdot \mathsf{PI}\left(\right)} \cdot \left(\frac{e^{\color{blue}{\frac{\frac{r}{s}}{-3}}}}{r} + \frac{e^{\frac{r}{\mathsf{neg}\left(s\right)}}}{r}\right) \]
    4. div-invN/A

      \[\leadsto \frac{\frac{1}{8}}{s \cdot \mathsf{PI}\left(\right)} \cdot \left(\frac{e^{\color{blue}{\frac{r}{s} \cdot \frac{1}{-3}}}}{r} + \frac{e^{\frac{r}{\mathsf{neg}\left(s\right)}}}{r}\right) \]
    5. metadata-evalN/A

      \[\leadsto \frac{\frac{1}{8}}{s \cdot \mathsf{PI}\left(\right)} \cdot \left(\frac{e^{\frac{r}{s} \cdot \color{blue}{\frac{-1}{3}}}}{r} + \frac{e^{\frac{r}{\mathsf{neg}\left(s\right)}}}{r}\right) \]
    6. lower-*.f32N/A

      \[\leadsto \frac{\frac{1}{8}}{s \cdot \mathsf{PI}\left(\right)} \cdot \left(\frac{e^{\color{blue}{\frac{r}{s} \cdot \frac{-1}{3}}}}{r} + \frac{e^{\frac{r}{\mathsf{neg}\left(s\right)}}}{r}\right) \]
    7. lower-/.f3299.5

      \[\leadsto \frac{0.125}{s \cdot \pi} \cdot \left(\frac{e^{\color{blue}{\frac{r}{s}} \cdot -0.3333333333333333}}{r} + \frac{e^{\frac{r}{-s}}}{r}\right) \]
  5. Applied rewrites99.5%

    \[\leadsto \frac{0.125}{s \cdot \pi} \cdot \left(\frac{e^{\color{blue}{\frac{r}{s} \cdot -0.3333333333333333}}}{r} + \frac{e^{\frac{r}{-s}}}{r}\right) \]
  6. Add Preprocessing

Alternative 4: 99.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \frac{0.125}{s \cdot \pi} \cdot \frac{e^{\frac{r}{-s}} + e^{\frac{r}{s \cdot -3}}}{r} \end{array} \]
(FPCore (s r)
 :precision binary32
 (* (/ 0.125 (* s PI)) (/ (+ (exp (/ r (- s))) (exp (/ r (* s -3.0)))) r)))
float code(float s, float r) {
	return (0.125f / (s * ((float) M_PI))) * ((expf((r / -s)) + expf((r / (s * -3.0f)))) / r);
}
function code(s, r)
	return Float32(Float32(Float32(0.125) / Float32(s * Float32(pi))) * Float32(Float32(exp(Float32(r / Float32(-s))) + exp(Float32(r / Float32(s * Float32(-3.0))))) / r))
end
function tmp = code(s, r)
	tmp = (single(0.125) / (s * single(pi))) * ((exp((r / -s)) + exp((r / (s * single(-3.0))))) / r);
end
\begin{array}{l}

\\
\frac{0.125}{s \cdot \pi} \cdot \frac{e^{\frac{r}{-s}} + e^{\frac{r}{s \cdot -3}}}{r}
\end{array}
Derivation
  1. Initial program 99.5%

    \[\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} \]
  2. Add Preprocessing
  3. Applied rewrites99.5%

    \[\leadsto \color{blue}{\frac{0.125}{s \cdot \pi} \cdot \left(\frac{e^{\frac{r}{s \cdot -3}}}{r} + \frac{e^{\frac{r}{-s}}}{r}\right)} \]
  4. Taylor expanded in r around inf

    \[\leadsto \color{blue}{\frac{1}{8} \cdot \frac{e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
  5. Step-by-step derivation
    1. associate-*r/N/A

      \[\leadsto \color{blue}{\frac{\frac{1}{8} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
    2. metadata-evalN/A

      \[\leadsto \frac{\color{blue}{\left(\frac{-1}{8} \cdot -1\right)} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
    3. associate-*r*N/A

      \[\leadsto \frac{\color{blue}{\frac{-1}{8} \cdot \left(-1 \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
    4. distribute-lft-outN/A

      \[\leadsto \frac{\frac{-1}{8} \cdot \color{blue}{\left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
    5. lower-/.f32N/A

      \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
  6. Applied rewrites99.4%

    \[\leadsto \color{blue}{\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s} \cdot -0.3333333333333333}\right)}{r \cdot \left(s \cdot \pi\right)}} \]
  7. Step-by-step derivation
    1. Applied rewrites99.5%

      \[\leadsto \frac{e^{\frac{r}{-s}} + e^{\frac{r}{s \cdot -3}}}{r} \cdot \color{blue}{\frac{0.125}{s \cdot \pi}} \]
    2. Final simplification99.5%

      \[\leadsto \frac{0.125}{s \cdot \pi} \cdot \frac{e^{\frac{r}{-s}} + e^{\frac{r}{s \cdot -3}}}{r} \]
    3. Add Preprocessing

    Alternative 5: 99.5% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s \cdot -3}}\right)}{r \cdot \left(s \cdot \pi\right)} \end{array} \]
    (FPCore (s r)
     :precision binary32
     (/ (* 0.125 (+ (exp (/ r (- s))) (exp (/ r (* s -3.0))))) (* r (* s PI))))
    float code(float s, float r) {
    	return (0.125f * (expf((r / -s)) + expf((r / (s * -3.0f))))) / (r * (s * ((float) M_PI)));
    }
    
    function code(s, r)
    	return Float32(Float32(Float32(0.125) * Float32(exp(Float32(r / Float32(-s))) + exp(Float32(r / Float32(s * Float32(-3.0)))))) / Float32(r * Float32(s * Float32(pi))))
    end
    
    function tmp = code(s, r)
    	tmp = (single(0.125) * (exp((r / -s)) + exp((r / (s * single(-3.0)))))) / (r * (s * single(pi)));
    end
    
    \begin{array}{l}
    
    \\
    \frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s \cdot -3}}\right)}{r \cdot \left(s \cdot \pi\right)}
    \end{array}
    
    Derivation
    1. Initial program 99.5%

      \[\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} \]
    2. Add Preprocessing
    3. Applied rewrites99.5%

      \[\leadsto \color{blue}{\frac{0.125}{s \cdot \pi} \cdot \left(\frac{e^{\frac{r}{s \cdot -3}}}{r} + \frac{e^{\frac{r}{-s}}}{r}\right)} \]
    4. Taylor expanded in r around inf

      \[\leadsto \color{blue}{\frac{1}{8} \cdot \frac{e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{8} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
      2. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{\left(\frac{-1}{8} \cdot -1\right)} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
      3. associate-*r*N/A

        \[\leadsto \frac{\color{blue}{\frac{-1}{8} \cdot \left(-1 \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
      4. distribute-lft-outN/A

        \[\leadsto \frac{\frac{-1}{8} \cdot \color{blue}{\left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
      5. lower-/.f32N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
    6. Applied rewrites99.4%

      \[\leadsto \color{blue}{\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s} \cdot -0.3333333333333333}\right)}{r \cdot \left(s \cdot \pi\right)}} \]
    7. Step-by-step derivation
      1. Applied rewrites99.5%

        \[\leadsto \frac{\left(e^{\frac{r}{-s}} + e^{\frac{r}{s \cdot -3}}\right) \cdot 0.125}{\color{blue}{r} \cdot \left(s \cdot \pi\right)} \]
      2. Final simplification99.5%

        \[\leadsto \frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s \cdot -3}}\right)}{r \cdot \left(s \cdot \pi\right)} \]
      3. Add Preprocessing

      Alternative 6: 99.5% accurate, 1.1× speedup?

      \[\begin{array}{l} \\ \frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s} \cdot -0.3333333333333333}\right)}{r \cdot \left(s \cdot \pi\right)} \end{array} \]
      (FPCore (s r)
       :precision binary32
       (/
        (* 0.125 (+ (exp (/ r (- s))) (exp (* (/ r s) -0.3333333333333333))))
        (* r (* s PI))))
      float code(float s, float r) {
      	return (0.125f * (expf((r / -s)) + expf(((r / s) * -0.3333333333333333f)))) / (r * (s * ((float) M_PI)));
      }
      
      function code(s, r)
      	return Float32(Float32(Float32(0.125) * Float32(exp(Float32(r / Float32(-s))) + exp(Float32(Float32(r / s) * Float32(-0.3333333333333333))))) / Float32(r * Float32(s * Float32(pi))))
      end
      
      function tmp = code(s, r)
      	tmp = (single(0.125) * (exp((r / -s)) + exp(((r / s) * single(-0.3333333333333333))))) / (r * (s * single(pi)));
      end
      
      \begin{array}{l}
      
      \\
      \frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s} \cdot -0.3333333333333333}\right)}{r \cdot \left(s \cdot \pi\right)}
      \end{array}
      
      Derivation
      1. Initial program 99.5%

        \[\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} \]
      2. Add Preprocessing
      3. Applied rewrites99.5%

        \[\leadsto \color{blue}{\frac{0.125}{s \cdot \pi} \cdot \left(\frac{e^{\frac{r}{s \cdot -3}}}{r} + \frac{e^{\frac{r}{-s}}}{r}\right)} \]
      4. Taylor expanded in r around inf

        \[\leadsto \color{blue}{\frac{1}{8} \cdot \frac{e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
      5. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{\frac{1}{8} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
        2. metadata-evalN/A

          \[\leadsto \frac{\color{blue}{\left(\frac{-1}{8} \cdot -1\right)} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
        3. associate-*r*N/A

          \[\leadsto \frac{\color{blue}{\frac{-1}{8} \cdot \left(-1 \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
        4. distribute-lft-outN/A

          \[\leadsto \frac{\frac{-1}{8} \cdot \color{blue}{\left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
        5. lower-/.f32N/A

          \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
      6. Applied rewrites99.4%

        \[\leadsto \color{blue}{\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s} \cdot -0.3333333333333333}\right)}{r \cdot \left(s \cdot \pi\right)}} \]
      7. Add Preprocessing

      Alternative 7: 99.4% accurate, 1.1× speedup?

      \[\begin{array}{l} \\ \frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{r \cdot \frac{-0.3333333333333333}{s}}\right)}{r \cdot \left(s \cdot \pi\right)} \end{array} \]
      (FPCore (s r)
       :precision binary32
       (/
        (* 0.125 (+ (exp (/ r (- s))) (exp (* r (/ -0.3333333333333333 s)))))
        (* r (* s PI))))
      float code(float s, float r) {
      	return (0.125f * (expf((r / -s)) + expf((r * (-0.3333333333333333f / s))))) / (r * (s * ((float) M_PI)));
      }
      
      function code(s, r)
      	return Float32(Float32(Float32(0.125) * Float32(exp(Float32(r / Float32(-s))) + exp(Float32(r * Float32(Float32(-0.3333333333333333) / s))))) / Float32(r * Float32(s * Float32(pi))))
      end
      
      function tmp = code(s, r)
      	tmp = (single(0.125) * (exp((r / -s)) + exp((r * (single(-0.3333333333333333) / s))))) / (r * (s * single(pi)));
      end
      
      \begin{array}{l}
      
      \\
      \frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{r \cdot \frac{-0.3333333333333333}{s}}\right)}{r \cdot \left(s \cdot \pi\right)}
      \end{array}
      
      Derivation
      1. Initial program 99.5%

        \[\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} \]
      2. Add Preprocessing
      3. Applied rewrites99.5%

        \[\leadsto \color{blue}{\frac{0.125}{s \cdot \pi} \cdot \left(\frac{e^{\frac{r}{s \cdot -3}}}{r} + \frac{e^{\frac{r}{-s}}}{r}\right)} \]
      4. Taylor expanded in r around inf

        \[\leadsto \color{blue}{\frac{1}{8} \cdot \frac{e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
      5. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{\frac{1}{8} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
        2. metadata-evalN/A

          \[\leadsto \frac{\color{blue}{\left(\frac{-1}{8} \cdot -1\right)} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
        3. associate-*r*N/A

          \[\leadsto \frac{\color{blue}{\frac{-1}{8} \cdot \left(-1 \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
        4. distribute-lft-outN/A

          \[\leadsto \frac{\frac{-1}{8} \cdot \color{blue}{\left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
        5. lower-/.f32N/A

          \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
      6. Applied rewrites99.4%

        \[\leadsto \color{blue}{\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s} \cdot -0.3333333333333333}\right)}{r \cdot \left(s \cdot \pi\right)}} \]
      7. Step-by-step derivation
        1. Applied rewrites99.4%

          \[\leadsto \frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{-0.3333333333333333}{s} \cdot r}\right)}{r \cdot \left(s \cdot \pi\right)} \]
        2. Final simplification99.4%

          \[\leadsto \frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{r \cdot \frac{-0.3333333333333333}{s}}\right)}{r \cdot \left(s \cdot \pi\right)} \]
        3. Add Preprocessing

        Alternative 8: 97.4% accurate, 1.1× speedup?

        \[\begin{array}{l} \\ \left(e^{\frac{r}{-s}} + e^{\frac{r}{s} \cdot -0.3333333333333333}\right) \cdot \frac{0.125}{s \cdot \left(r \cdot \pi\right)} \end{array} \]
        (FPCore (s r)
         :precision binary32
         (*
          (+ (exp (/ r (- s))) (exp (* (/ r s) -0.3333333333333333)))
          (/ 0.125 (* s (* r PI)))))
        float code(float s, float r) {
        	return (expf((r / -s)) + expf(((r / s) * -0.3333333333333333f))) * (0.125f / (s * (r * ((float) M_PI))));
        }
        
        function code(s, r)
        	return Float32(Float32(exp(Float32(r / Float32(-s))) + exp(Float32(Float32(r / s) * Float32(-0.3333333333333333)))) * Float32(Float32(0.125) / Float32(s * Float32(r * Float32(pi)))))
        end
        
        function tmp = code(s, r)
        	tmp = (exp((r / -s)) + exp(((r / s) * single(-0.3333333333333333)))) * (single(0.125) / (s * (r * single(pi))));
        end
        
        \begin{array}{l}
        
        \\
        \left(e^{\frac{r}{-s}} + e^{\frac{r}{s} \cdot -0.3333333333333333}\right) \cdot \frac{0.125}{s \cdot \left(r \cdot \pi\right)}
        \end{array}
        
        Derivation
        1. Initial program 99.5%

          \[\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} \]
        2. Add Preprocessing
        3. Applied rewrites99.5%

          \[\leadsto \color{blue}{\frac{0.125}{s \cdot \pi} \cdot \left(\frac{e^{\frac{r}{s \cdot -3}}}{r} + \frac{e^{\frac{r}{-s}}}{r}\right)} \]
        4. Taylor expanded in r around inf

          \[\leadsto \color{blue}{\frac{1}{8} \cdot \frac{e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
        5. Step-by-step derivation
          1. associate-*r/N/A

            \[\leadsto \color{blue}{\frac{\frac{1}{8} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
          2. metadata-evalN/A

            \[\leadsto \frac{\color{blue}{\left(\frac{-1}{8} \cdot -1\right)} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
          3. associate-*r*N/A

            \[\leadsto \frac{\color{blue}{\frac{-1}{8} \cdot \left(-1 \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
          4. distribute-lft-outN/A

            \[\leadsto \frac{\frac{-1}{8} \cdot \color{blue}{\left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
          5. lower-/.f32N/A

            \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
        6. Applied rewrites99.4%

          \[\leadsto \color{blue}{\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s} \cdot -0.3333333333333333}\right)}{r \cdot \left(s \cdot \pi\right)}} \]
        7. Taylor expanded in r around inf

          \[\leadsto \color{blue}{\frac{1}{8} \cdot \frac{e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
        8. Step-by-step derivation
          1. associate-*r/N/A

            \[\leadsto \color{blue}{\frac{\frac{1}{8} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
          2. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{\left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right) \cdot \frac{1}{8}}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
          3. associate-/l*N/A

            \[\leadsto \color{blue}{\left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right) \cdot \frac{\frac{1}{8}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
          4. lower-*.f32N/A

            \[\leadsto \color{blue}{\left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right) \cdot \frac{\frac{1}{8}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
          5. lower-+.f32N/A

            \[\leadsto \color{blue}{\left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)} \cdot \frac{\frac{1}{8}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
          6. lower-exp.f32N/A

            \[\leadsto \left(\color{blue}{e^{-1 \cdot \frac{r}{s}}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right) \cdot \frac{\frac{1}{8}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
          7. mul-1-negN/A

            \[\leadsto \left(e^{\color{blue}{\mathsf{neg}\left(\frac{r}{s}\right)}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right) \cdot \frac{\frac{1}{8}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
          8. lower-neg.f32N/A

            \[\leadsto \left(e^{\color{blue}{\mathsf{neg}\left(\frac{r}{s}\right)}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right) \cdot \frac{\frac{1}{8}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
          9. lower-/.f32N/A

            \[\leadsto \left(e^{\mathsf{neg}\left(\color{blue}{\frac{r}{s}}\right)} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right) \cdot \frac{\frac{1}{8}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
          10. lower-exp.f32N/A

            \[\leadsto \left(e^{\mathsf{neg}\left(\frac{r}{s}\right)} + \color{blue}{e^{\frac{-1}{3} \cdot \frac{r}{s}}}\right) \cdot \frac{\frac{1}{8}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
          11. *-commutativeN/A

            \[\leadsto \left(e^{\mathsf{neg}\left(\frac{r}{s}\right)} + e^{\color{blue}{\frac{r}{s} \cdot \frac{-1}{3}}}\right) \cdot \frac{\frac{1}{8}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
          12. lower-*.f32N/A

            \[\leadsto \left(e^{\mathsf{neg}\left(\frac{r}{s}\right)} + e^{\color{blue}{\frac{r}{s} \cdot \frac{-1}{3}}}\right) \cdot \frac{\frac{1}{8}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
          13. lower-/.f32N/A

            \[\leadsto \left(e^{\mathsf{neg}\left(\frac{r}{s}\right)} + e^{\color{blue}{\frac{r}{s}} \cdot \frac{-1}{3}}\right) \cdot \frac{\frac{1}{8}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
          14. lower-/.f32N/A

            \[\leadsto \left(e^{\mathsf{neg}\left(\frac{r}{s}\right)} + e^{\frac{r}{s} \cdot \frac{-1}{3}}\right) \cdot \color{blue}{\frac{\frac{1}{8}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
          15. *-commutativeN/A

            \[\leadsto \left(e^{\mathsf{neg}\left(\frac{r}{s}\right)} + e^{\frac{r}{s} \cdot \frac{-1}{3}}\right) \cdot \frac{\frac{1}{8}}{r \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot s\right)}} \]
          16. associate-*r*N/A

            \[\leadsto \left(e^{\mathsf{neg}\left(\frac{r}{s}\right)} + e^{\frac{r}{s} \cdot \frac{-1}{3}}\right) \cdot \frac{\frac{1}{8}}{\color{blue}{\left(r \cdot \mathsf{PI}\left(\right)\right) \cdot s}} \]
          17. lower-*.f32N/A

            \[\leadsto \left(e^{\mathsf{neg}\left(\frac{r}{s}\right)} + e^{\frac{r}{s} \cdot \frac{-1}{3}}\right) \cdot \frac{\frac{1}{8}}{\color{blue}{\left(r \cdot \mathsf{PI}\left(\right)\right) \cdot s}} \]
        9. Applied rewrites98.2%

          \[\leadsto \color{blue}{\left(e^{-\frac{r}{s}} + e^{\frac{r}{s} \cdot -0.3333333333333333}\right) \cdot \frac{0.125}{\left(r \cdot \pi\right) \cdot s}} \]
        10. Final simplification98.2%

          \[\leadsto \left(e^{\frac{r}{-s}} + e^{\frac{r}{s} \cdot -0.3333333333333333}\right) \cdot \frac{0.125}{s \cdot \left(r \cdot \pi\right)} \]
        11. Add Preprocessing

        Alternative 9: 10.8% accurate, 1.3× speedup?

        \[\begin{array}{l} \\ \frac{0.25 \cdot e^{\frac{r}{-s}}}{r \cdot \left(s \cdot \left(2 \cdot \pi\right)\right)} + \frac{\frac{0.125}{r \cdot \pi} + \mathsf{fma}\left(r, \frac{0.006944444444444444}{s \cdot \left(s \cdot \pi\right)}, \frac{-0.041666666666666664}{s \cdot \pi}\right)}{s} \end{array} \]
        (FPCore (s r)
         :precision binary32
         (+
          (/ (* 0.25 (exp (/ r (- s)))) (* r (* s (* 2.0 PI))))
          (/
           (+
            (/ 0.125 (* r PI))
            (fma
             r
             (/ 0.006944444444444444 (* s (* s PI)))
             (/ -0.041666666666666664 (* s PI))))
           s)))
        float code(float s, float r) {
        	return ((0.25f * expf((r / -s))) / (r * (s * (2.0f * ((float) M_PI))))) + (((0.125f / (r * ((float) M_PI))) + fmaf(r, (0.006944444444444444f / (s * (s * ((float) M_PI)))), (-0.041666666666666664f / (s * ((float) M_PI))))) / s);
        }
        
        function code(s, r)
        	return Float32(Float32(Float32(Float32(0.25) * exp(Float32(r / Float32(-s)))) / Float32(r * Float32(s * Float32(Float32(2.0) * Float32(pi))))) + Float32(Float32(Float32(Float32(0.125) / Float32(r * Float32(pi))) + fma(r, Float32(Float32(0.006944444444444444) / Float32(s * Float32(s * Float32(pi)))), Float32(Float32(-0.041666666666666664) / Float32(s * Float32(pi))))) / s))
        end
        
        \begin{array}{l}
        
        \\
        \frac{0.25 \cdot e^{\frac{r}{-s}}}{r \cdot \left(s \cdot \left(2 \cdot \pi\right)\right)} + \frac{\frac{0.125}{r \cdot \pi} + \mathsf{fma}\left(r, \frac{0.006944444444444444}{s \cdot \left(s \cdot \pi\right)}, \frac{-0.041666666666666664}{s \cdot \pi}\right)}{s}
        \end{array}
        
        Derivation
        1. Initial program 99.5%

          \[\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} \]
        2. Add Preprocessing
        3. Taylor expanded in s around inf

          \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \color{blue}{\frac{\left(\frac{1}{144} \cdot \frac{r}{{s}^{2} \cdot \mathsf{PI}\left(\right)} + \frac{1}{8} \cdot \frac{1}{r \cdot \mathsf{PI}\left(\right)}\right) - \frac{\frac{1}{24}}{s \cdot \mathsf{PI}\left(\right)}}{s}} \]
        4. Applied rewrites10.6%

          \[\leadsto \frac{0.25 \cdot e^{\frac{-r}{s}}}{\left(\left(2 \cdot \pi\right) \cdot s\right) \cdot r} + \color{blue}{\frac{\frac{0.125}{r \cdot \pi} + \mathsf{fma}\left(r, \frac{0.006944444444444444}{s \cdot \left(s \cdot \pi\right)}, \frac{-0.041666666666666664}{s \cdot \pi}\right)}{s}} \]
        5. Final simplification10.6%

          \[\leadsto \frac{0.25 \cdot e^{\frac{r}{-s}}}{r \cdot \left(s \cdot \left(2 \cdot \pi\right)\right)} + \frac{\frac{0.125}{r \cdot \pi} + \mathsf{fma}\left(r, \frac{0.006944444444444444}{s \cdot \left(s \cdot \pi\right)}, \frac{-0.041666666666666664}{s \cdot \pi}\right)}{s} \]
        6. Add Preprocessing

        Alternative 10: 10.2% accurate, 4.1× speedup?

        \[\begin{array}{l} \\ \frac{0.125}{s \cdot \pi} \cdot \frac{\mathsf{fma}\left(r, \mathsf{fma}\left(r, \frac{0.5555555555555556}{s \cdot s}, \frac{-1.3333333333333333}{s}\right), 2\right)}{r} \end{array} \]
        (FPCore (s r)
         :precision binary32
         (*
          (/ 0.125 (* s PI))
          (/
           (fma r (fma r (/ 0.5555555555555556 (* s s)) (/ -1.3333333333333333 s)) 2.0)
           r)))
        float code(float s, float r) {
        	return (0.125f / (s * ((float) M_PI))) * (fmaf(r, fmaf(r, (0.5555555555555556f / (s * s)), (-1.3333333333333333f / s)), 2.0f) / r);
        }
        
        function code(s, r)
        	return Float32(Float32(Float32(0.125) / Float32(s * Float32(pi))) * Float32(fma(r, fma(r, Float32(Float32(0.5555555555555556) / Float32(s * s)), Float32(Float32(-1.3333333333333333) / s)), Float32(2.0)) / r))
        end
        
        \begin{array}{l}
        
        \\
        \frac{0.125}{s \cdot \pi} \cdot \frac{\mathsf{fma}\left(r, \mathsf{fma}\left(r, \frac{0.5555555555555556}{s \cdot s}, \frac{-1.3333333333333333}{s}\right), 2\right)}{r}
        \end{array}
        
        Derivation
        1. Initial program 99.5%

          \[\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} \]
        2. Add Preprocessing
        3. Applied rewrites99.5%

          \[\leadsto \color{blue}{\frac{0.125}{s \cdot \pi} \cdot \left(\frac{e^{\frac{r}{s \cdot -3}}}{r} + \frac{e^{\frac{r}{-s}}}{r}\right)} \]
        4. Taylor expanded in r around inf

          \[\leadsto \color{blue}{\frac{1}{8} \cdot \frac{e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
        5. Step-by-step derivation
          1. associate-*r/N/A

            \[\leadsto \color{blue}{\frac{\frac{1}{8} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
          2. metadata-evalN/A

            \[\leadsto \frac{\color{blue}{\left(\frac{-1}{8} \cdot -1\right)} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
          3. associate-*r*N/A

            \[\leadsto \frac{\color{blue}{\frac{-1}{8} \cdot \left(-1 \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
          4. distribute-lft-outN/A

            \[\leadsto \frac{\frac{-1}{8} \cdot \color{blue}{\left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
          5. lower-/.f32N/A

            \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
        6. Applied rewrites99.4%

          \[\leadsto \color{blue}{\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s} \cdot -0.3333333333333333}\right)}{r \cdot \left(s \cdot \pi\right)}} \]
        7. Step-by-step derivation
          1. Applied rewrites99.5%

            \[\leadsto \frac{e^{\frac{r}{-s}} + e^{\frac{r}{s \cdot -3}}}{r} \cdot \color{blue}{\frac{0.125}{s \cdot \pi}} \]
          2. Taylor expanded in r around 0

            \[\leadsto \frac{2 + r \cdot \left(\frac{5}{9} \cdot \frac{r}{{s}^{2}} - \frac{4}{3} \cdot \frac{1}{s}\right)}{r} \cdot \frac{\frac{1}{8}}{s \cdot \mathsf{PI}\left(\right)} \]
          3. Step-by-step derivation
            1. Applied rewrites10.1%

              \[\leadsto \frac{\mathsf{fma}\left(r, \mathsf{fma}\left(r, \frac{0.5555555555555556}{s \cdot s}, \frac{-1.3333333333333333}{s}\right), 2\right)}{r} \cdot \frac{0.125}{s \cdot \pi} \]
            2. Final simplification10.1%

              \[\leadsto \frac{0.125}{s \cdot \pi} \cdot \frac{\mathsf{fma}\left(r, \mathsf{fma}\left(r, \frac{0.5555555555555556}{s \cdot s}, \frac{-1.3333333333333333}{s}\right), 2\right)}{r} \]
            3. Add Preprocessing

            Alternative 11: 10.2% accurate, 4.6× speedup?

            \[\begin{array}{l} \\ \frac{0.125}{s \cdot \pi} \cdot \left(\frac{2}{r} - \frac{\mathsf{fma}\left(\frac{r}{s}, -0.5555555555555556, 1.3333333333333333\right)}{s}\right) \end{array} \]
            (FPCore (s r)
             :precision binary32
             (*
              (/ 0.125 (* s PI))
              (- (/ 2.0 r) (/ (fma (/ r s) -0.5555555555555556 1.3333333333333333) s))))
            float code(float s, float r) {
            	return (0.125f / (s * ((float) M_PI))) * ((2.0f / r) - (fmaf((r / s), -0.5555555555555556f, 1.3333333333333333f) / s));
            }
            
            function code(s, r)
            	return Float32(Float32(Float32(0.125) / Float32(s * Float32(pi))) * Float32(Float32(Float32(2.0) / r) - Float32(fma(Float32(r / s), Float32(-0.5555555555555556), Float32(1.3333333333333333)) / s)))
            end
            
            \begin{array}{l}
            
            \\
            \frac{0.125}{s \cdot \pi} \cdot \left(\frac{2}{r} - \frac{\mathsf{fma}\left(\frac{r}{s}, -0.5555555555555556, 1.3333333333333333\right)}{s}\right)
            \end{array}
            
            Derivation
            1. Initial program 99.5%

              \[\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} \]
            2. Add Preprocessing
            3. Applied rewrites99.5%

              \[\leadsto \color{blue}{\frac{0.125}{s \cdot \pi} \cdot \left(\frac{e^{\frac{r}{s \cdot -3}}}{r} + \frac{e^{\frac{r}{-s}}}{r}\right)} \]
            4. Taylor expanded in r around inf

              \[\leadsto \color{blue}{\frac{1}{8} \cdot \frac{e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
            5. Step-by-step derivation
              1. associate-*r/N/A

                \[\leadsto \color{blue}{\frac{\frac{1}{8} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
              2. metadata-evalN/A

                \[\leadsto \frac{\color{blue}{\left(\frac{-1}{8} \cdot -1\right)} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
              3. associate-*r*N/A

                \[\leadsto \frac{\color{blue}{\frac{-1}{8} \cdot \left(-1 \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
              4. distribute-lft-outN/A

                \[\leadsto \frac{\frac{-1}{8} \cdot \color{blue}{\left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
              5. lower-/.f32N/A

                \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
            6. Applied rewrites99.4%

              \[\leadsto \color{blue}{\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s} \cdot -0.3333333333333333}\right)}{r \cdot \left(s \cdot \pi\right)}} \]
            7. Step-by-step derivation
              1. Applied rewrites99.5%

                \[\leadsto \frac{e^{\frac{r}{-s}} + e^{\frac{r}{s \cdot -3}}}{r} \cdot \color{blue}{\frac{0.125}{s \cdot \pi}} \]
              2. Taylor expanded in s around -inf

                \[\leadsto \left(-1 \cdot \frac{\frac{4}{3} + -1 \cdot \frac{\frac{1}{18} \cdot r + \frac{1}{2} \cdot r}{s}}{s} + 2 \cdot \frac{1}{r}\right) \cdot \frac{\color{blue}{\frac{1}{8}}}{s \cdot \mathsf{PI}\left(\right)} \]
              3. Step-by-step derivation
                1. Applied rewrites10.1%

                  \[\leadsto \left(\frac{2}{r} - \frac{\mathsf{fma}\left(\frac{r}{s}, -0.5555555555555556, 1.3333333333333333\right)}{s}\right) \cdot \frac{\color{blue}{0.125}}{s \cdot \pi} \]
                2. Final simplification10.1%

                  \[\leadsto \frac{0.125}{s \cdot \pi} \cdot \left(\frac{2}{r} - \frac{\mathsf{fma}\left(\frac{r}{s}, -0.5555555555555556, 1.3333333333333333\right)}{s}\right) \]
                3. Add Preprocessing

                Alternative 12: 10.2% accurate, 4.9× speedup?

                \[\begin{array}{l} \\ \frac{\mathsf{fma}\left(r, \mathsf{fma}\left(r, \frac{0.06944444444444445}{s \cdot s}, \frac{-0.16666666666666666}{s}\right), 0.25\right)}{r \cdot \left(s \cdot \pi\right)} \end{array} \]
                (FPCore (s r)
                 :precision binary32
                 (/
                  (fma
                   r
                   (fma r (/ 0.06944444444444445 (* s s)) (/ -0.16666666666666666 s))
                   0.25)
                  (* r (* s PI))))
                float code(float s, float r) {
                	return fmaf(r, fmaf(r, (0.06944444444444445f / (s * s)), (-0.16666666666666666f / s)), 0.25f) / (r * (s * ((float) M_PI)));
                }
                
                function code(s, r)
                	return Float32(fma(r, fma(r, Float32(Float32(0.06944444444444445) / Float32(s * s)), Float32(Float32(-0.16666666666666666) / s)), Float32(0.25)) / Float32(r * Float32(s * Float32(pi))))
                end
                
                \begin{array}{l}
                
                \\
                \frac{\mathsf{fma}\left(r, \mathsf{fma}\left(r, \frac{0.06944444444444445}{s \cdot s}, \frac{-0.16666666666666666}{s}\right), 0.25\right)}{r \cdot \left(s \cdot \pi\right)}
                \end{array}
                
                Derivation
                1. Initial program 99.5%

                  \[\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} \]
                2. Add Preprocessing
                3. Applied rewrites99.5%

                  \[\leadsto \color{blue}{\frac{0.125}{s \cdot \pi} \cdot \left(\frac{e^{\frac{r}{s \cdot -3}}}{r} + \frac{e^{\frac{r}{-s}}}{r}\right)} \]
                4. Taylor expanded in r around inf

                  \[\leadsto \color{blue}{\frac{1}{8} \cdot \frac{e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                5. Step-by-step derivation
                  1. associate-*r/N/A

                    \[\leadsto \color{blue}{\frac{\frac{1}{8} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                  2. metadata-evalN/A

                    \[\leadsto \frac{\color{blue}{\left(\frac{-1}{8} \cdot -1\right)} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
                  3. associate-*r*N/A

                    \[\leadsto \frac{\color{blue}{\frac{-1}{8} \cdot \left(-1 \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
                  4. distribute-lft-outN/A

                    \[\leadsto \frac{\frac{-1}{8} \cdot \color{blue}{\left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
                  5. lower-/.f32N/A

                    \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                6. Applied rewrites99.4%

                  \[\leadsto \color{blue}{\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s} \cdot -0.3333333333333333}\right)}{r \cdot \left(s \cdot \pi\right)}} \]
                7. Taylor expanded in r around 0

                  \[\leadsto \frac{\frac{1}{4} + r \cdot \left(\frac{5}{72} \cdot \frac{r}{{s}^{2}} - \frac{1}{6} \cdot \frac{1}{s}\right)}{\color{blue}{r} \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
                8. Step-by-step derivation
                  1. Applied rewrites10.1%

                    \[\leadsto \frac{\mathsf{fma}\left(r, \mathsf{fma}\left(r, \frac{0.06944444444444445}{s \cdot s}, \frac{-0.16666666666666666}{s}\right), 0.25\right)}{\color{blue}{r} \cdot \left(s \cdot \pi\right)} \]
                  2. Add Preprocessing

                  Alternative 13: 9.1% accurate, 5.0× speedup?

                  \[\begin{array}{l} \\ \frac{\frac{\mathsf{fma}\left(-0.16666666666666666, \pi, \left(s \cdot \pi\right) \cdot \frac{0.25}{r}\right)}{\pi \cdot \left(s \cdot \pi\right)}}{s} \end{array} \]
                  (FPCore (s r)
                   :precision binary32
                   (/
                    (/ (fma -0.16666666666666666 PI (* (* s PI) (/ 0.25 r))) (* PI (* s PI)))
                    s))
                  float code(float s, float r) {
                  	return (fmaf(-0.16666666666666666f, ((float) M_PI), ((s * ((float) M_PI)) * (0.25f / r))) / (((float) M_PI) * (s * ((float) M_PI)))) / s;
                  }
                  
                  function code(s, r)
                  	return Float32(Float32(fma(Float32(-0.16666666666666666), Float32(pi), Float32(Float32(s * Float32(pi)) * Float32(Float32(0.25) / r))) / Float32(Float32(pi) * Float32(s * Float32(pi)))) / s)
                  end
                  
                  \begin{array}{l}
                  
                  \\
                  \frac{\frac{\mathsf{fma}\left(-0.16666666666666666, \pi, \left(s \cdot \pi\right) \cdot \frac{0.25}{r}\right)}{\pi \cdot \left(s \cdot \pi\right)}}{s}
                  \end{array}
                  
                  Derivation
                  1. Initial program 99.5%

                    \[\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} \]
                  2. Add Preprocessing
                  3. Taylor expanded in s around inf

                    \[\leadsto \color{blue}{\frac{\left(\frac{-1}{48} \cdot \frac{{r}^{2}}{{s}^{3} \cdot \mathsf{PI}\left(\right)} + \left(\frac{-1}{1296} \cdot \frac{{r}^{2}}{{s}^{3} \cdot \mathsf{PI}\left(\right)} + \left(\frac{1}{144} \cdot \frac{r}{{s}^{2} \cdot \mathsf{PI}\left(\right)} + \left(\frac{1}{16} \cdot \frac{r}{{s}^{2} \cdot \mathsf{PI}\left(\right)} + \frac{1}{4} \cdot \frac{1}{r \cdot \mathsf{PI}\left(\right)}\right)\right)\right)\right) - \frac{\frac{1}{6}}{s \cdot \mathsf{PI}\left(\right)}}{s}} \]
                  4. Applied rewrites8.5%

                    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-0.021604938271604937, \frac{r \cdot r}{s \cdot \left(s \cdot \left(s \cdot \pi\right)\right)}, \frac{0.25}{r \cdot \pi} + \mathsf{fma}\left(\frac{r}{s \cdot \left(s \cdot \pi\right)}, 0.06944444444444445, \frac{-0.16666666666666666}{s \cdot \pi}\right)\right)}{s}} \]
                  5. Taylor expanded in s around inf

                    \[\leadsto \frac{\frac{1}{4} \cdot \frac{1}{r \cdot \mathsf{PI}\left(\right)} - \frac{1}{6} \cdot \frac{1}{s \cdot \mathsf{PI}\left(\right)}}{s} \]
                  6. Step-by-step derivation
                    1. Applied rewrites9.0%

                      \[\leadsto \frac{\frac{0.25}{r \cdot \pi} + \frac{-0.16666666666666666}{s \cdot \pi}}{s} \]
                    2. Step-by-step derivation
                      1. Applied rewrites9.0%

                        \[\leadsto \frac{\frac{\mathsf{fma}\left(-0.16666666666666666, \pi, \left(s \cdot \pi\right) \cdot \frac{0.25}{r}\right)}{\left(s \cdot \pi\right) \cdot \pi}}{s} \]
                      2. Final simplification9.0%

                        \[\leadsto \frac{\frac{\mathsf{fma}\left(-0.16666666666666666, \pi, \left(s \cdot \pi\right) \cdot \frac{0.25}{r}\right)}{\pi \cdot \left(s \cdot \pi\right)}}{s} \]
                      3. Add Preprocessing

                      Alternative 14: 9.1% accurate, 5.9× speedup?

                      \[\begin{array}{l} \\ \frac{0.125}{s \cdot \pi} \cdot \frac{\mathsf{fma}\left(\frac{r}{s}, -1.3333333333333333, 2\right)}{r} \end{array} \]
                      (FPCore (s r)
                       :precision binary32
                       (* (/ 0.125 (* s PI)) (/ (fma (/ r s) -1.3333333333333333 2.0) r)))
                      float code(float s, float r) {
                      	return (0.125f / (s * ((float) M_PI))) * (fmaf((r / s), -1.3333333333333333f, 2.0f) / r);
                      }
                      
                      function code(s, r)
                      	return Float32(Float32(Float32(0.125) / Float32(s * Float32(pi))) * Float32(fma(Float32(r / s), Float32(-1.3333333333333333), Float32(2.0)) / r))
                      end
                      
                      \begin{array}{l}
                      
                      \\
                      \frac{0.125}{s \cdot \pi} \cdot \frac{\mathsf{fma}\left(\frac{r}{s}, -1.3333333333333333, 2\right)}{r}
                      \end{array}
                      
                      Derivation
                      1. Initial program 99.5%

                        \[\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} \]
                      2. Add Preprocessing
                      3. Applied rewrites99.5%

                        \[\leadsto \color{blue}{\frac{0.125}{s \cdot \pi} \cdot \left(\frac{e^{\frac{r}{s \cdot -3}}}{r} + \frac{e^{\frac{r}{-s}}}{r}\right)} \]
                      4. Taylor expanded in r around inf

                        \[\leadsto \color{blue}{\frac{1}{8} \cdot \frac{e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                      5. Step-by-step derivation
                        1. associate-*r/N/A

                          \[\leadsto \color{blue}{\frac{\frac{1}{8} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                        2. metadata-evalN/A

                          \[\leadsto \frac{\color{blue}{\left(\frac{-1}{8} \cdot -1\right)} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
                        3. associate-*r*N/A

                          \[\leadsto \frac{\color{blue}{\frac{-1}{8} \cdot \left(-1 \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
                        4. distribute-lft-outN/A

                          \[\leadsto \frac{\frac{-1}{8} \cdot \color{blue}{\left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
                        5. lower-/.f32N/A

                          \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                      6. Applied rewrites99.4%

                        \[\leadsto \color{blue}{\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s} \cdot -0.3333333333333333}\right)}{r \cdot \left(s \cdot \pi\right)}} \]
                      7. Step-by-step derivation
                        1. Applied rewrites99.5%

                          \[\leadsto \frac{e^{\frac{r}{-s}} + e^{\frac{r}{s \cdot -3}}}{r} \cdot \color{blue}{\frac{0.125}{s \cdot \pi}} \]
                        2. Taylor expanded in r around 0

                          \[\leadsto \frac{2 + \frac{-4}{3} \cdot \frac{r}{s}}{r} \cdot \frac{\frac{1}{8}}{s \cdot \mathsf{PI}\left(\right)} \]
                        3. Step-by-step derivation
                          1. Applied rewrites9.0%

                            \[\leadsto \frac{\mathsf{fma}\left(\frac{r}{s}, -1.3333333333333333, 2\right)}{r} \cdot \frac{0.125}{s \cdot \pi} \]
                          2. Final simplification9.0%

                            \[\leadsto \frac{0.125}{s \cdot \pi} \cdot \frac{\mathsf{fma}\left(\frac{r}{s}, -1.3333333333333333, 2\right)}{r} \]
                          3. Add Preprocessing

                          Alternative 15: 9.1% accurate, 7.2× speedup?

                          \[\begin{array}{l} \\ \frac{0.25 - \frac{r \cdot 0.16666666666666666}{s}}{r \cdot \left(s \cdot \pi\right)} \end{array} \]
                          (FPCore (s r)
                           :precision binary32
                           (/ (- 0.25 (/ (* r 0.16666666666666666) s)) (* r (* s PI))))
                          float code(float s, float r) {
                          	return (0.25f - ((r * 0.16666666666666666f) / s)) / (r * (s * ((float) M_PI)));
                          }
                          
                          function code(s, r)
                          	return Float32(Float32(Float32(0.25) - Float32(Float32(r * Float32(0.16666666666666666)) / s)) / Float32(r * Float32(s * Float32(pi))))
                          end
                          
                          function tmp = code(s, r)
                          	tmp = (single(0.25) - ((r * single(0.16666666666666666)) / s)) / (r * (s * single(pi)));
                          end
                          
                          \begin{array}{l}
                          
                          \\
                          \frac{0.25 - \frac{r \cdot 0.16666666666666666}{s}}{r \cdot \left(s \cdot \pi\right)}
                          \end{array}
                          
                          Derivation
                          1. Initial program 99.5%

                            \[\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} \]
                          2. Add Preprocessing
                          3. Applied rewrites99.5%

                            \[\leadsto \color{blue}{\frac{0.125}{s \cdot \pi} \cdot \left(\frac{e^{\frac{r}{s \cdot -3}}}{r} + \frac{e^{\frac{r}{-s}}}{r}\right)} \]
                          4. Taylor expanded in r around inf

                            \[\leadsto \color{blue}{\frac{1}{8} \cdot \frac{e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                          5. Step-by-step derivation
                            1. associate-*r/N/A

                              \[\leadsto \color{blue}{\frac{\frac{1}{8} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                            2. metadata-evalN/A

                              \[\leadsto \frac{\color{blue}{\left(\frac{-1}{8} \cdot -1\right)} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
                            3. associate-*r*N/A

                              \[\leadsto \frac{\color{blue}{\frac{-1}{8} \cdot \left(-1 \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
                            4. distribute-lft-outN/A

                              \[\leadsto \frac{\frac{-1}{8} \cdot \color{blue}{\left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
                            5. lower-/.f32N/A

                              \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                          6. Applied rewrites99.4%

                            \[\leadsto \color{blue}{\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s} \cdot -0.3333333333333333}\right)}{r \cdot \left(s \cdot \pi\right)}} \]
                          7. Taylor expanded in s around inf

                            \[\leadsto \frac{\frac{1}{4} + \frac{1}{8} \cdot \frac{-1 \cdot r + \frac{-1}{3} \cdot r}{s}}{\color{blue}{r} \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
                          8. Step-by-step derivation
                            1. Applied rewrites9.0%

                              \[\leadsto \frac{0.25 + \frac{-0.16666666666666666 \cdot r}{s}}{\color{blue}{r} \cdot \left(s \cdot \pi\right)} \]
                            2. Final simplification9.0%

                              \[\leadsto \frac{0.25 - \frac{r \cdot 0.16666666666666666}{s}}{r \cdot \left(s \cdot \pi\right)} \]
                            3. Add Preprocessing

                            Alternative 16: 9.1% accurate, 7.6× speedup?

                            \[\begin{array}{l} \\ \frac{\mathsf{fma}\left(-0.16666666666666666, \frac{r}{s}, 0.25\right)}{r \cdot \left(s \cdot \pi\right)} \end{array} \]
                            (FPCore (s r)
                             :precision binary32
                             (/ (fma -0.16666666666666666 (/ r s) 0.25) (* r (* s PI))))
                            float code(float s, float r) {
                            	return fmaf(-0.16666666666666666f, (r / s), 0.25f) / (r * (s * ((float) M_PI)));
                            }
                            
                            function code(s, r)
                            	return Float32(fma(Float32(-0.16666666666666666), Float32(r / s), Float32(0.25)) / Float32(r * Float32(s * Float32(pi))))
                            end
                            
                            \begin{array}{l}
                            
                            \\
                            \frac{\mathsf{fma}\left(-0.16666666666666666, \frac{r}{s}, 0.25\right)}{r \cdot \left(s \cdot \pi\right)}
                            \end{array}
                            
                            Derivation
                            1. Initial program 99.5%

                              \[\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} \]
                            2. Add Preprocessing
                            3. Applied rewrites99.5%

                              \[\leadsto \color{blue}{\frac{0.125}{s \cdot \pi} \cdot \left(\frac{e^{\frac{r}{s \cdot -3}}}{r} + \frac{e^{\frac{r}{-s}}}{r}\right)} \]
                            4. Taylor expanded in r around inf

                              \[\leadsto \color{blue}{\frac{1}{8} \cdot \frac{e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                            5. Step-by-step derivation
                              1. associate-*r/N/A

                                \[\leadsto \color{blue}{\frac{\frac{1}{8} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                              2. metadata-evalN/A

                                \[\leadsto \frac{\color{blue}{\left(\frac{-1}{8} \cdot -1\right)} \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
                              3. associate-*r*N/A

                                \[\leadsto \frac{\color{blue}{\frac{-1}{8} \cdot \left(-1 \cdot \left(e^{-1 \cdot \frac{r}{s}} + e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
                              4. distribute-lft-outN/A

                                \[\leadsto \frac{\frac{-1}{8} \cdot \color{blue}{\left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
                              5. lower-/.f32N/A

                                \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(-1 \cdot e^{-1 \cdot \frac{r}{s}} + -1 \cdot e^{\frac{-1}{3} \cdot \frac{r}{s}}\right)}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                            6. Applied rewrites99.4%

                              \[\leadsto \color{blue}{\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s} \cdot -0.3333333333333333}\right)}{r \cdot \left(s \cdot \pi\right)}} \]
                            7. Taylor expanded in r around 0

                              \[\leadsto \frac{\frac{1}{4} + \frac{-1}{6} \cdot \frac{r}{s}}{\color{blue}{r} \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)} \]
                            8. Step-by-step derivation
                              1. Applied rewrites9.0%

                                \[\leadsto \frac{\mathsf{fma}\left(-0.16666666666666666, \frac{r}{s}, 0.25\right)}{\color{blue}{r} \cdot \left(s \cdot \pi\right)} \]
                              2. Add Preprocessing

                              Alternative 17: 9.0% accurate, 9.0× speedup?

                              \[\begin{array}{l} \\ \frac{0.25}{r \cdot \pi} \cdot \frac{1}{s} \end{array} \]
                              (FPCore (s r) :precision binary32 (* (/ 0.25 (* r PI)) (/ 1.0 s)))
                              float code(float s, float r) {
                              	return (0.25f / (r * ((float) M_PI))) * (1.0f / s);
                              }
                              
                              function code(s, r)
                              	return Float32(Float32(Float32(0.25) / Float32(r * Float32(pi))) * Float32(Float32(1.0) / s))
                              end
                              
                              function tmp = code(s, r)
                              	tmp = (single(0.25) / (r * single(pi))) * (single(1.0) / s);
                              end
                              
                              \begin{array}{l}
                              
                              \\
                              \frac{0.25}{r \cdot \pi} \cdot \frac{1}{s}
                              \end{array}
                              
                              Derivation
                              1. Initial program 99.5%

                                \[\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} \]
                              2. Add Preprocessing
                              3. Step-by-step derivation
                                1. lift-/.f32N/A

                                  \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \color{blue}{\frac{\frac{3}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}}}{\left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r}} \]
                                2. clear-numN/A

                                  \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \color{blue}{\frac{1}{\frac{\left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r}{\frac{3}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}}}}} \]
                                3. lift-*.f32N/A

                                  \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \frac{1}{\frac{\color{blue}{\left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r}}{\frac{3}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}}}} \]
                                4. lift-*.f32N/A

                                  \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \frac{1}{\frac{\left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r}{\color{blue}{\frac{3}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}}}}} \]
                                5. *-commutativeN/A

                                  \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \frac{1}{\frac{\left(\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r}{\color{blue}{e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}} \cdot \frac{3}{4}}}} \]
                                6. times-fracN/A

                                  \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \frac{1}{\color{blue}{\frac{\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s}{e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}}} \cdot \frac{r}{\frac{3}{4}}}} \]
                                7. associate-/r*N/A

                                  \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \color{blue}{\frac{\frac{1}{\frac{\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s}{e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}}}}}{\frac{r}{\frac{3}{4}}}} \]
                                8. clear-numN/A

                                  \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \frac{\color{blue}{\frac{e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}}}{\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s}}}{\frac{r}{\frac{3}{4}}} \]
                                9. lower-/.f32N/A

                                  \[\leadsto \frac{\frac{1}{4} \cdot e^{\frac{\mathsf{neg}\left(r\right)}{s}}}{\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot s\right) \cdot r} + \color{blue}{\frac{\frac{e^{\frac{\mathsf{neg}\left(r\right)}{3 \cdot s}}}{\left(6 \cdot \mathsf{PI}\left(\right)\right) \cdot s}}{\frac{r}{\frac{3}{4}}}} \]
                              4. Applied rewrites99.5%

                                \[\leadsto \frac{0.25 \cdot e^{\frac{-r}{s}}}{\left(\left(2 \cdot \pi\right) \cdot s\right) \cdot r} + \color{blue}{\frac{\frac{e^{\frac{r}{s \cdot -3}}}{s \cdot \left(\pi \cdot 6\right)}}{r \cdot 1.3333333333333333}} \]
                              5. Taylor expanded in s around 0

                                \[\leadsto \color{blue}{\frac{\frac{1}{8} \cdot \frac{e^{-1 \cdot \frac{r}{s}}}{r \cdot \mathsf{PI}\left(\right)} + \frac{1}{8} \cdot \frac{e^{\frac{-1}{3} \cdot \frac{r}{s}}}{r \cdot \mathsf{PI}\left(\right)}}{s}} \]
                              6. Step-by-step derivation
                                1. lower-/.f32N/A

                                  \[\leadsto \color{blue}{\frac{\frac{1}{8} \cdot \frac{e^{-1 \cdot \frac{r}{s}}}{r \cdot \mathsf{PI}\left(\right)} + \frac{1}{8} \cdot \frac{e^{\frac{-1}{3} \cdot \frac{r}{s}}}{r \cdot \mathsf{PI}\left(\right)}}{s}} \]
                              7. Applied rewrites99.5%

                                \[\leadsto \color{blue}{\frac{0.125 \cdot \left(\frac{e^{\frac{r}{-s}}}{r \cdot \pi} + \frac{e^{\frac{r}{s} \cdot -0.3333333333333333}}{r \cdot \pi}\right)}{s}} \]
                              8. Taylor expanded in r around 0

                                \[\leadsto \color{blue}{\frac{\frac{1}{4}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                              9. Step-by-step derivation
                                1. lower-/.f32N/A

                                  \[\leadsto \color{blue}{\frac{\frac{1}{4}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                                2. *-commutativeN/A

                                  \[\leadsto \frac{\frac{1}{4}}{r \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot s\right)}} \]
                                3. associate-*r*N/A

                                  \[\leadsto \frac{\frac{1}{4}}{\color{blue}{\left(r \cdot \mathsf{PI}\left(\right)\right) \cdot s}} \]
                                4. lower-*.f32N/A

                                  \[\leadsto \frac{\frac{1}{4}}{\color{blue}{\left(r \cdot \mathsf{PI}\left(\right)\right) \cdot s}} \]
                                5. lower-*.f32N/A

                                  \[\leadsto \frac{\frac{1}{4}}{\color{blue}{\left(r \cdot \mathsf{PI}\left(\right)\right)} \cdot s} \]
                                6. lower-PI.f328.7

                                  \[\leadsto \frac{0.25}{\left(r \cdot \color{blue}{\pi}\right) \cdot s} \]
                              10. Applied rewrites8.7%

                                \[\leadsto \color{blue}{\frac{0.25}{\left(r \cdot \pi\right) \cdot s}} \]
                              11. Step-by-step derivation
                                1. Applied rewrites8.7%

                                  \[\leadsto \frac{0.25}{r \cdot \pi} \cdot \color{blue}{\frac{1}{s}} \]
                                2. Add Preprocessing

                                Alternative 18: 9.0% accurate, 10.6× speedup?

                                \[\begin{array}{l} \\ \frac{\frac{0.25}{r \cdot \pi}}{s} \end{array} \]
                                (FPCore (s r) :precision binary32 (/ (/ 0.25 (* r PI)) s))
                                float code(float s, float r) {
                                	return (0.25f / (r * ((float) M_PI))) / s;
                                }
                                
                                function code(s, r)
                                	return Float32(Float32(Float32(0.25) / Float32(r * Float32(pi))) / s)
                                end
                                
                                function tmp = code(s, r)
                                	tmp = (single(0.25) / (r * single(pi))) / s;
                                end
                                
                                \begin{array}{l}
                                
                                \\
                                \frac{\frac{0.25}{r \cdot \pi}}{s}
                                \end{array}
                                
                                Derivation
                                1. Initial program 99.5%

                                  \[\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} \]
                                2. Add Preprocessing
                                3. Taylor expanded in r around 0

                                  \[\leadsto \color{blue}{\frac{\frac{1}{4}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                                4. Step-by-step derivation
                                  1. lower-/.f32N/A

                                    \[\leadsto \color{blue}{\frac{\frac{1}{4}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                                  2. lower-*.f32N/A

                                    \[\leadsto \frac{\frac{1}{4}}{\color{blue}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                                  3. lower-*.f32N/A

                                    \[\leadsto \frac{\frac{1}{4}}{r \cdot \color{blue}{\left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                                  4. lower-PI.f328.7

                                    \[\leadsto \frac{0.25}{r \cdot \left(s \cdot \color{blue}{\pi}\right)} \]
                                5. Applied rewrites8.7%

                                  \[\leadsto \color{blue}{\frac{0.25}{r \cdot \left(s \cdot \pi\right)}} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites8.7%

                                    \[\leadsto \frac{\frac{0.25}{r \cdot \pi}}{\color{blue}{s}} \]
                                  2. Add Preprocessing

                                  Alternative 19: 9.0% accurate, 13.5× speedup?

                                  \[\begin{array}{l} \\ \frac{0.25}{r \cdot \left(s \cdot \pi\right)} \end{array} \]
                                  (FPCore (s r) :precision binary32 (/ 0.25 (* r (* s PI))))
                                  float code(float s, float r) {
                                  	return 0.25f / (r * (s * ((float) M_PI)));
                                  }
                                  
                                  function code(s, r)
                                  	return Float32(Float32(0.25) / Float32(r * Float32(s * Float32(pi))))
                                  end
                                  
                                  function tmp = code(s, r)
                                  	tmp = single(0.25) / (r * (s * single(pi)));
                                  end
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \frac{0.25}{r \cdot \left(s \cdot \pi\right)}
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 99.5%

                                    \[\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} \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in r around 0

                                    \[\leadsto \color{blue}{\frac{\frac{1}{4}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                                  4. Step-by-step derivation
                                    1. lower-/.f32N/A

                                      \[\leadsto \color{blue}{\frac{\frac{1}{4}}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                                    2. lower-*.f32N/A

                                      \[\leadsto \frac{\frac{1}{4}}{\color{blue}{r \cdot \left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                                    3. lower-*.f32N/A

                                      \[\leadsto \frac{\frac{1}{4}}{r \cdot \color{blue}{\left(s \cdot \mathsf{PI}\left(\right)\right)}} \]
                                    4. lower-PI.f328.7

                                      \[\leadsto \frac{0.25}{r \cdot \left(s \cdot \color{blue}{\pi}\right)} \]
                                  5. Applied rewrites8.7%

                                    \[\leadsto \color{blue}{\frac{0.25}{r \cdot \left(s \cdot \pi\right)}} \]
                                  6. Add Preprocessing

                                  Reproduce

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