Disney BSSRDF, PDF of scattering profile

Percentage Accurate: 99.6% → 99.6%
Time: 16.5s
Alternatives: 17
Speedup: N/A×

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 17 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.6% 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.6% accurate, 1.1× speedup?

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

\\
\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{\frac{r}{s}}{-3}}\right)}{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. Simplified97.6%

    \[\leadsto \color{blue}{\frac{\frac{0.125}{r \cdot s} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)}{\pi}} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. associate-/l*N/A

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

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

      \[\leadsto \mathsf{/.f32}\left(\left(\frac{1}{8} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)\right), \color{blue}{\left(\left(r \cdot s\right) \cdot \mathsf{PI}\left(\right)\right)}\right) \]
  5. Applied egg-rr99.6%

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

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\left(\frac{\frac{r}{s}}{-3}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    2. /-lowering-/.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\left(\frac{r}{s}\right), -3\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    3. /-lowering-/.f3299.6%

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{/.f32}\left(r, s\right), -3\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
  7. Applied egg-rr99.6%

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

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

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

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{/.f32}\left(r, s\right), -3\right)\right)\right)\right), \left(\left(r \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{s}\right)\right) \]
    4. *-lowering-*.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{/.f32}\left(r, s\right), -3\right)\right)\right)\right), \mathsf{*.f32}\left(\left(r \cdot \mathsf{PI}\left(\right)\right), \color{blue}{s}\right)\right) \]
    5. *-lowering-*.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{/.f32}\left(r, s\right), -3\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, \mathsf{PI}\left(\right)\right), s\right)\right) \]
    6. PI-lowering-PI.f3299.6%

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{/.f32}\left(r, s\right), -3\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, \mathsf{PI.f32}\left(\right)\right), s\right)\right) \]
  9. Applied egg-rr99.6%

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

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

Alternative 2: 99.6% accurate, 1.1× speedup?

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

\\
\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{\frac{r}{s}}{-3}}\right)}{\pi \cdot \left(r \cdot 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. Simplified97.6%

    \[\leadsto \color{blue}{\frac{\frac{0.125}{r \cdot s} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)}{\pi}} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. associate-/l*N/A

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

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

      \[\leadsto \mathsf{/.f32}\left(\left(\frac{1}{8} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)\right), \color{blue}{\left(\left(r \cdot s\right) \cdot \mathsf{PI}\left(\right)\right)}\right) \]
  5. Applied egg-rr99.6%

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

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\left(\frac{\frac{r}{s}}{-3}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    2. /-lowering-/.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\left(\frac{r}{s}\right), -3\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    3. /-lowering-/.f3299.6%

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{/.f32}\left(r, s\right), -3\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
  7. Applied egg-rr99.6%

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

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

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

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{/.f32}\left(r, s\right), -3\right)\right)\right)\right), \left(\left(r \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{s}\right)\right) \]
    4. *-lowering-*.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{/.f32}\left(r, s\right), -3\right)\right)\right)\right), \mathsf{*.f32}\left(\left(r \cdot \mathsf{PI}\left(\right)\right), \color{blue}{s}\right)\right) \]
    5. *-lowering-*.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{/.f32}\left(r, s\right), -3\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, \mathsf{PI}\left(\right)\right), s\right)\right) \]
    6. PI-lowering-PI.f3299.6%

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{/.f32}\left(r, s\right), -3\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, \mathsf{PI.f32}\left(\right)\right), s\right)\right) \]
  9. Applied egg-rr99.6%

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

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{/.f32}\left(r, s\right), -3\right)\right)\right)\right), \left(\left(\mathsf{PI}\left(\right) \cdot r\right) \cdot s\right)\right) \]
    2. associate-*r*N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{/.f32}\left(r, s\right), -3\right)\right)\right)\right), \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(r \cdot s\right)}\right)\right) \]
    3. *-lowering-*.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{/.f32}\left(r, s\right), -3\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{PI}\left(\right), \color{blue}{\left(r \cdot s\right)}\right)\right) \]
    4. PI-lowering-PI.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{/.f32}\left(r, s\right), -3\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \left(\color{blue}{r} \cdot s\right)\right)\right) \]
    5. *-lowering-*.f3299.6%

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{/.f32}\left(r, s\right), -3\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(r, \color{blue}{s}\right)\right)\right) \]
  11. Applied egg-rr99.6%

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

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

Alternative 3: 99.6% accurate, 1.1× speedup?

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

\\
\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s \cdot -3}}\right)}{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. Simplified97.6%

    \[\leadsto \color{blue}{\frac{\frac{0.125}{r \cdot s} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)}{\pi}} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. associate-/l*N/A

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

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

      \[\leadsto \mathsf{/.f32}\left(\left(\frac{1}{8} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)\right), \color{blue}{\left(\left(r \cdot s\right) \cdot \mathsf{PI}\left(\right)\right)}\right) \]
  5. Applied egg-rr99.6%

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

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

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

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(r, \mathsf{*.f32}\left(s, -3\right)\right)\right)\right)\right), \left(\left(r \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{s}\right)\right) \]
    4. *-lowering-*.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(r, \mathsf{*.f32}\left(s, -3\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\left(r \cdot \mathsf{PI}\left(\right)\right), \color{blue}{s}\right)\right) \]
    5. *-lowering-*.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(r, \mathsf{*.f32}\left(s, -3\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, \mathsf{PI}\left(\right)\right), s\right)\right) \]
    6. PI-lowering-PI.f3299.6%

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(r, \mathsf{*.f32}\left(s, -3\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, \mathsf{PI.f32}\left(\right)\right), s\right)\right) \]
  7. Applied egg-rr99.6%

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

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

Alternative 4: 99.6% accurate, 1.1× speedup?

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

\\
\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{\frac{r}{s \cdot -3}}\right)}{\pi \cdot \left(r \cdot 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. Simplified97.6%

    \[\leadsto \color{blue}{\frac{\frac{0.125}{r \cdot s} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)}{\pi}} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. associate-/l*N/A

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

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

      \[\leadsto \mathsf{/.f32}\left(\left(\frac{1}{8} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)\right), \color{blue}{\left(\left(r \cdot s\right) \cdot \mathsf{PI}\left(\right)\right)}\right) \]
  5. Applied egg-rr99.6%

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

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

Alternative 5: 99.5% accurate, 1.1× speedup?

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

\\
\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + e^{r \cdot \frac{-0.3333333333333333}{s}}\right)}{\pi \cdot \left(r \cdot 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. Simplified97.6%

    \[\leadsto \color{blue}{\frac{\frac{0.125}{r \cdot s} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)}{\pi}} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. associate-/l*N/A

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

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

      \[\leadsto \mathsf{/.f32}\left(\left(\frac{1}{8} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)\right), \color{blue}{\left(\left(r \cdot s\right) \cdot \mathsf{PI}\left(\right)\right)}\right) \]
  5. Applied egg-rr99.6%

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

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\left(\frac{\frac{r}{s}}{-3}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    2. /-lowering-/.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\left(\frac{r}{s}\right), -3\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    3. /-lowering-/.f3299.6%

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{/.f32}\left(r, s\right), -3\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
  7. Applied egg-rr99.6%

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

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\left(\frac{r}{s} \cdot \frac{1}{-3}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\left(\frac{r}{s} \cdot \frac{-1}{3}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    3. associate-*l/N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\left(\frac{r \cdot \frac{-1}{3}}{s}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    4. associate-/l*N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\left(r \cdot \frac{\frac{-1}{3}}{s}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    5. *-lowering-*.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{*.f32}\left(r, \left(\frac{\frac{-1}{3}}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    6. /-lowering-/.f3299.6%

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{exp.f32}\left(\mathsf{*.f32}\left(r, \mathsf{/.f32}\left(\frac{-1}{3}, s\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
  9. Applied egg-rr99.6%

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

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

Alternative 6: 10.8% accurate, 1.8× speedup?

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

\\
\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + \left(1 - \frac{r \cdot 0.3333333333333333 + \frac{r \cdot r}{s} \cdot -0.05555555555555555}{s}\right)\right)}{\pi \cdot \left(r \cdot 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. Simplified97.6%

    \[\leadsto \color{blue}{\frac{\frac{0.125}{r \cdot s} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)}{\pi}} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. associate-/l*N/A

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

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

      \[\leadsto \mathsf{/.f32}\left(\left(\frac{1}{8} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)\right), \color{blue}{\left(\left(r \cdot s\right) \cdot \mathsf{PI}\left(\right)\right)}\right) \]
  5. Applied egg-rr99.6%

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

    \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \color{blue}{\left(1 + -1 \cdot \frac{\frac{-1}{18} \cdot \frac{{r}^{2}}{s} + \frac{1}{3} \cdot r}{s}\right)}\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
  7. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \left(1 + \left(\mathsf{neg}\left(\frac{\frac{-1}{18} \cdot \frac{{r}^{2}}{s} + \frac{1}{3} \cdot r}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    2. unsub-negN/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \left(1 - \frac{\frac{-1}{18} \cdot \frac{{r}^{2}}{s} + \frac{1}{3} \cdot r}{s}\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    3. --lowering--.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{\_.f32}\left(1, \left(\frac{\frac{-1}{18} \cdot \frac{{r}^{2}}{s} + \frac{1}{3} \cdot r}{s}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    4. /-lowering-/.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{\_.f32}\left(1, \mathsf{/.f32}\left(\left(\frac{-1}{18} \cdot \frac{{r}^{2}}{s} + \frac{1}{3} \cdot r\right), s\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    5. +-commutativeN/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{\_.f32}\left(1, \mathsf{/.f32}\left(\left(\frac{1}{3} \cdot r + \frac{-1}{18} \cdot \frac{{r}^{2}}{s}\right), s\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    6. +-lowering-+.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{\_.f32}\left(1, \mathsf{/.f32}\left(\mathsf{+.f32}\left(\left(\frac{1}{3} \cdot r\right), \left(\frac{-1}{18} \cdot \frac{{r}^{2}}{s}\right)\right), s\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    7. *-commutativeN/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{\_.f32}\left(1, \mathsf{/.f32}\left(\mathsf{+.f32}\left(\left(r \cdot \frac{1}{3}\right), \left(\frac{-1}{18} \cdot \frac{{r}^{2}}{s}\right)\right), s\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    8. *-lowering-*.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{\_.f32}\left(1, \mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(r, \frac{1}{3}\right), \left(\frac{-1}{18} \cdot \frac{{r}^{2}}{s}\right)\right), s\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    9. *-commutativeN/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{\_.f32}\left(1, \mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(r, \frac{1}{3}\right), \left(\frac{{r}^{2}}{s} \cdot \frac{-1}{18}\right)\right), s\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    10. *-lowering-*.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{\_.f32}\left(1, \mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(r, \frac{1}{3}\right), \mathsf{*.f32}\left(\left(\frac{{r}^{2}}{s}\right), \frac{-1}{18}\right)\right), s\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    11. /-lowering-/.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{\_.f32}\left(1, \mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(r, \frac{1}{3}\right), \mathsf{*.f32}\left(\mathsf{/.f32}\left(\left({r}^{2}\right), s\right), \frac{-1}{18}\right)\right), s\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    12. unpow2N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{\_.f32}\left(1, \mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(r, \frac{1}{3}\right), \mathsf{*.f32}\left(\mathsf{/.f32}\left(\left(r \cdot r\right), s\right), \frac{-1}{18}\right)\right), s\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    13. *-lowering-*.f329.8%

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{\_.f32}\left(1, \mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(r, \frac{1}{3}\right), \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, r\right), s\right), \frac{-1}{18}\right)\right), s\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
  8. Simplified9.8%

    \[\leadsto \frac{0.125 \cdot \left(e^{\frac{-r}{s}} + \color{blue}{\left(1 - \frac{r \cdot 0.3333333333333333 + \frac{r \cdot r}{s} \cdot -0.05555555555555555}{s}\right)}\right)}{\left(r \cdot s\right) \cdot \pi} \]
  9. Final simplification9.8%

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

Alternative 7: 10.8% accurate, 1.8× speedup?

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

\\
\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + \left(1 + r \cdot \left(\frac{-0.3333333333333333}{s} + \frac{r \cdot 0.05555555555555555}{s \cdot s}\right)\right)\right)}{\pi \cdot \left(r \cdot 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. Simplified97.6%

    \[\leadsto \color{blue}{\frac{\frac{0.125}{r \cdot s} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)}{\pi}} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. associate-/l*N/A

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

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

      \[\leadsto \mathsf{/.f32}\left(\left(\frac{1}{8} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)\right), \color{blue}{\left(\left(r \cdot s\right) \cdot \mathsf{PI}\left(\right)\right)}\right) \]
  5. Applied egg-rr99.6%

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

    \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \color{blue}{\left(1 + r \cdot \left(\frac{1}{18} \cdot \frac{r}{{s}^{2}} - \frac{1}{3} \cdot \frac{1}{s}\right)\right)}\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
  7. Step-by-step derivation
    1. +-lowering-+.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \left(r \cdot \left(\frac{1}{18} \cdot \frac{r}{{s}^{2}} - \frac{1}{3} \cdot \frac{1}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    2. *-lowering-*.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \left(\frac{1}{18} \cdot \frac{r}{{s}^{2}} - \frac{1}{3} \cdot \frac{1}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    3. sub-negN/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \left(\frac{1}{18} \cdot \frac{r}{{s}^{2}} + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{s}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    4. associate-*r/N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \left(\frac{\frac{1}{18} \cdot r}{{s}^{2}} + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{s}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    5. *-commutativeN/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \left(\frac{r \cdot \frac{1}{18}}{{s}^{2}} + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{s}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    6. associate-*r/N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \left(r \cdot \frac{\frac{1}{18}}{{s}^{2}} + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{s}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    7. metadata-evalN/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \left(r \cdot \frac{\frac{1}{18} \cdot 1}{{s}^{2}} + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{s}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    8. associate-*r/N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \left(r \cdot \left(\frac{1}{18} \cdot \frac{1}{{s}^{2}}\right) + \left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{s}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    9. +-commutativeN/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \left(\left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{s}\right)\right) + r \cdot \left(\frac{1}{18} \cdot \frac{1}{{s}^{2}}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    10. +-lowering-+.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\left(\mathsf{neg}\left(\frac{1}{3} \cdot \frac{1}{s}\right)\right), \left(r \cdot \left(\frac{1}{18} \cdot \frac{1}{{s}^{2}}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    11. associate-*r/N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\left(\mathsf{neg}\left(\frac{\frac{1}{3} \cdot 1}{s}\right)\right), \left(r \cdot \left(\frac{1}{18} \cdot \frac{1}{{s}^{2}}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    12. metadata-evalN/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\left(\mathsf{neg}\left(\frac{\frac{1}{3}}{s}\right)\right), \left(r \cdot \left(\frac{1}{18} \cdot \frac{1}{{s}^{2}}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    13. distribute-neg-fracN/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\left(\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{s}\right), \left(r \cdot \left(\frac{1}{18} \cdot \frac{1}{{s}^{2}}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\left(\frac{\frac{-1}{3}}{s}\right), \left(r \cdot \left(\frac{1}{18} \cdot \frac{1}{{s}^{2}}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    15. /-lowering-/.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\mathsf{/.f32}\left(\frac{-1}{3}, s\right), \left(r \cdot \left(\frac{1}{18} \cdot \frac{1}{{s}^{2}}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    16. associate-*r/N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\mathsf{/.f32}\left(\frac{-1}{3}, s\right), \left(r \cdot \frac{\frac{1}{18} \cdot 1}{{s}^{2}}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    17. metadata-evalN/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\mathsf{/.f32}\left(\frac{-1}{3}, s\right), \left(r \cdot \frac{\frac{1}{18}}{{s}^{2}}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    18. associate-*r/N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\mathsf{/.f32}\left(\frac{-1}{3}, s\right), \left(\frac{r \cdot \frac{1}{18}}{{s}^{2}}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    19. *-commutativeN/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\mathsf{/.f32}\left(\frac{-1}{3}, s\right), \left(\frac{\frac{1}{18} \cdot r}{{s}^{2}}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    20. /-lowering-/.f32N/A

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\mathsf{/.f32}\left(\frac{-1}{3}, s\right), \mathsf{/.f32}\left(\left(\frac{1}{18} \cdot r\right), \left({s}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
  8. Simplified9.8%

    \[\leadsto \frac{0.125 \cdot \left(e^{\frac{-r}{s}} + \color{blue}{\left(1 + r \cdot \left(\frac{-0.3333333333333333}{s} + \frac{r \cdot 0.05555555555555555}{s \cdot s}\right)\right)}\right)}{\left(r \cdot s\right) \cdot \pi} \]
  9. Final simplification9.8%

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

Alternative 8: 9.6% accurate, 2.0× speedup?

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

\\
\frac{0.125 \cdot \left(e^{\frac{r}{-s}} + 1\right)}{\pi \cdot \left(r \cdot 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. Simplified97.6%

    \[\leadsto \color{blue}{\frac{\frac{0.125}{r \cdot s} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)}{\pi}} \]
  3. Add Preprocessing
  4. Step-by-step derivation
    1. associate-/l*N/A

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

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

      \[\leadsto \mathsf{/.f32}\left(\left(\frac{1}{8} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)\right), \color{blue}{\left(\left(r \cdot s\right) \cdot \mathsf{PI}\left(\right)\right)}\right) \]
  5. Applied egg-rr99.6%

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

    \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \color{blue}{1}\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
  7. Step-by-step derivation
    1. Simplified9.1%

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

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

    Alternative 9: 10.2% accurate, 11.0× speedup?

    \[\begin{array}{l} \\ \frac{0.25 + r \cdot \left(r \cdot \frac{0.06944444444444445}{s \cdot s} + \frac{-0.16666666666666666}{s}\right)}{\pi \cdot \left(r \cdot s\right)} \end{array} \]
    (FPCore (s r)
     :precision binary32
     (/
      (+
       0.25
       (* r (+ (* r (/ 0.06944444444444445 (* s s))) (/ -0.16666666666666666 s))))
      (* PI (* r s))))
    float code(float s, float r) {
    	return (0.25f + (r * ((r * (0.06944444444444445f / (s * s))) + (-0.16666666666666666f / s)))) / (((float) M_PI) * (r * s));
    }
    
    function code(s, r)
    	return Float32(Float32(Float32(0.25) + Float32(r * Float32(Float32(r * Float32(Float32(0.06944444444444445) / Float32(s * s))) + Float32(Float32(-0.16666666666666666) / s)))) / Float32(Float32(pi) * Float32(r * s)))
    end
    
    function tmp = code(s, r)
    	tmp = (single(0.25) + (r * ((r * (single(0.06944444444444445) / (s * s))) + (single(-0.16666666666666666) / s)))) / (single(pi) * (r * s));
    end
    
    \begin{array}{l}
    
    \\
    \frac{0.25 + r \cdot \left(r \cdot \frac{0.06944444444444445}{s \cdot s} + \frac{-0.16666666666666666}{s}\right)}{\pi \cdot \left(r \cdot 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. Simplified97.6%

      \[\leadsto \color{blue}{\frac{\frac{0.125}{r \cdot s} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)}{\pi}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-/l*N/A

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

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

        \[\leadsto \mathsf{/.f32}\left(\left(\frac{1}{8} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)\right), \color{blue}{\left(\left(r \cdot s\right) \cdot \mathsf{PI}\left(\right)\right)}\right) \]
    5. Applied egg-rr99.6%

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

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \color{blue}{\left(1 + \left(\frac{-1}{3} \cdot \frac{r}{s} + \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}} + \frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}}\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    7. Step-by-step derivation
      1. associate-+r+N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \left(\left(1 + \frac{-1}{3} \cdot \frac{r}{s}\right) + \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}} + \frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      2. +-lowering-+.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\left(1 + \frac{-1}{3} \cdot \frac{r}{s}\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}} + \frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      3. +-lowering-+.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \left(\frac{-1}{3} \cdot \frac{r}{s}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}} + \frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \left(\frac{r}{s} \cdot \frac{-1}{3}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}} + \frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\left(\frac{r}{s}\right), \frac{-1}{3}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}} + \frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      6. /-lowering-/.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}} + \frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \left(\frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}} + \frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      8. +-lowering-+.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\left(\frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}}\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\left(\frac{\frac{1}{18} \cdot {r}^{2}}{{s}^{2}}\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      10. /-lowering-/.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{18} \cdot {r}^{2}\right), \left({s}^{2}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\left({r}^{2} \cdot \frac{1}{18}\right), \left({s}^{2}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\left(\left(r \cdot r\right) \cdot \frac{1}{18}\right), \left({s}^{2}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      13. associate-*l*N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\left(r \cdot \left(r \cdot \frac{1}{18}\right)\right), \left({s}^{2}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\left(r \cdot \left(\frac{1}{18} \cdot r\right)\right), \left({s}^{2}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      15. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, \left(\frac{1}{18} \cdot r\right)\right), \left({s}^{2}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, \left(r \cdot \frac{1}{18}\right)\right), \left({s}^{2}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      17. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, \mathsf{*.f32}\left(r, \frac{1}{18}\right)\right), \left({s}^{2}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      18. unpow2N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, \mathsf{*.f32}\left(r, \frac{1}{18}\right)\right), \left(s \cdot s\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      19. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, \mathsf{*.f32}\left(r, \frac{1}{18}\right)\right), \mathsf{*.f32}\left(s, s\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      20. associate-*r/N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, \mathsf{*.f32}\left(r, \frac{1}{18}\right)\right), \mathsf{*.f32}\left(s, s\right)\right), \left(\frac{\frac{-1}{162} \cdot {r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      21. /-lowering-/.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, \mathsf{*.f32}\left(r, \frac{1}{18}\right)\right), \mathsf{*.f32}\left(s, s\right)\right), \mathsf{/.f32}\left(\left(\frac{-1}{162} \cdot {r}^{3}\right), \left({s}^{3}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    8. Simplified7.8%

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

      \[\leadsto \mathsf{/.f32}\left(\color{blue}{\left(\frac{1}{4} + r \cdot \left(\frac{5}{72} \cdot \frac{r}{{s}^{2}} - \frac{1}{6} \cdot \frac{1}{s}\right)\right)}, \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    10. Step-by-step derivation
      1. +-lowering-+.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \left(r \cdot \left(\frac{5}{72} \cdot \frac{r}{{s}^{2}} - \frac{1}{6} \cdot \frac{1}{s}\right)\right)\right), \mathsf{*.f32}\left(\color{blue}{\mathsf{*.f32}\left(r, s\right)}, \mathsf{PI.f32}\left(\right)\right)\right) \]
      2. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \left(\frac{5}{72} \cdot \frac{r}{{s}^{2}} - \frac{1}{6} \cdot \frac{1}{s}\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, \color{blue}{s}\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      3. sub-negN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \left(\frac{5}{72} \cdot \frac{r}{{s}^{2}} + \left(\mathsf{neg}\left(\frac{1}{6} \cdot \frac{1}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      4. +-lowering-+.f32N/A

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

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\left(\frac{r}{{s}^{2}} \cdot \frac{5}{72}\right), \left(\mathsf{neg}\left(\frac{1}{6} \cdot \frac{1}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\left(\frac{r \cdot \frac{5}{72}}{{s}^{2}}\right), \left(\mathsf{neg}\left(\frac{1}{6} \cdot \frac{1}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      7. associate-*r/N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\left(r \cdot \frac{\frac{5}{72}}{{s}^{2}}\right), \left(\mathsf{neg}\left(\frac{1}{6} \cdot \frac{1}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\left(r \cdot \frac{\frac{5}{72} \cdot 1}{{s}^{2}}\right), \left(\mathsf{neg}\left(\frac{1}{6} \cdot \frac{1}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\left(r \cdot \left(\frac{5}{72} \cdot \frac{1}{{s}^{2}}\right)\right), \left(\mathsf{neg}\left(\frac{1}{6} \cdot \frac{1}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      10. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\mathsf{*.f32}\left(r, \left(\frac{5}{72} \cdot \frac{1}{{s}^{2}}\right)\right), \left(\mathsf{neg}\left(\frac{1}{6} \cdot \frac{1}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      11. associate-*r/N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\mathsf{*.f32}\left(r, \left(\frac{\frac{5}{72} \cdot 1}{{s}^{2}}\right)\right), \left(\mathsf{neg}\left(\frac{1}{6} \cdot \frac{1}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\mathsf{*.f32}\left(r, \left(\frac{\frac{5}{72}}{{s}^{2}}\right)\right), \left(\mathsf{neg}\left(\frac{1}{6} \cdot \frac{1}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      13. /-lowering-/.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\mathsf{*.f32}\left(r, \mathsf{/.f32}\left(\frac{5}{72}, \left({s}^{2}\right)\right)\right), \left(\mathsf{neg}\left(\frac{1}{6} \cdot \frac{1}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\mathsf{*.f32}\left(r, \mathsf{/.f32}\left(\frac{5}{72}, \left(s \cdot s\right)\right)\right), \left(\mathsf{neg}\left(\frac{1}{6} \cdot \frac{1}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      15. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\mathsf{*.f32}\left(r, \mathsf{/.f32}\left(\frac{5}{72}, \mathsf{*.f32}\left(s, s\right)\right)\right), \left(\mathsf{neg}\left(\frac{1}{6} \cdot \frac{1}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      16. associate-*r/N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\mathsf{*.f32}\left(r, \mathsf{/.f32}\left(\frac{5}{72}, \mathsf{*.f32}\left(s, s\right)\right)\right), \left(\mathsf{neg}\left(\frac{\frac{1}{6} \cdot 1}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\mathsf{*.f32}\left(r, \mathsf{/.f32}\left(\frac{5}{72}, \mathsf{*.f32}\left(s, s\right)\right)\right), \left(\mathsf{neg}\left(\frac{\frac{1}{6}}{s}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      18. distribute-neg-fracN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\mathsf{*.f32}\left(r, \mathsf{/.f32}\left(\frac{5}{72}, \mathsf{*.f32}\left(s, s\right)\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{6}\right)}{s}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      19. metadata-evalN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\mathsf{*.f32}\left(r, \mathsf{/.f32}\left(\frac{5}{72}, \mathsf{*.f32}\left(s, s\right)\right)\right), \left(\frac{\frac{-1}{6}}{s}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      20. /-lowering-/.f329.1%

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{+.f32}\left(\mathsf{*.f32}\left(r, \mathsf{/.f32}\left(\frac{5}{72}, \mathsf{*.f32}\left(s, s\right)\right)\right), \mathsf{/.f32}\left(\frac{-1}{6}, s\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    11. Simplified9.1%

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

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

    Alternative 10: 10.2% accurate, 12.2× speedup?

    \[\begin{array}{l} \\ \frac{0.25 + r \cdot \frac{-0.16666666666666666 + r \cdot \frac{0.06944444444444445}{s}}{s}}{\pi \cdot \left(r \cdot s\right)} \end{array} \]
    (FPCore (s r)
     :precision binary32
     (/
      (+ 0.25 (* r (/ (+ -0.16666666666666666 (* r (/ 0.06944444444444445 s))) s)))
      (* PI (* r s))))
    float code(float s, float r) {
    	return (0.25f + (r * ((-0.16666666666666666f + (r * (0.06944444444444445f / s))) / s))) / (((float) M_PI) * (r * s));
    }
    
    function code(s, r)
    	return Float32(Float32(Float32(0.25) + Float32(r * Float32(Float32(Float32(-0.16666666666666666) + Float32(r * Float32(Float32(0.06944444444444445) / s))) / s))) / Float32(Float32(pi) * Float32(r * s)))
    end
    
    function tmp = code(s, r)
    	tmp = (single(0.25) + (r * ((single(-0.16666666666666666) + (r * (single(0.06944444444444445) / s))) / s))) / (single(pi) * (r * s));
    end
    
    \begin{array}{l}
    
    \\
    \frac{0.25 + r \cdot \frac{-0.16666666666666666 + r \cdot \frac{0.06944444444444445}{s}}{s}}{\pi \cdot \left(r \cdot 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. Simplified97.6%

      \[\leadsto \color{blue}{\frac{\frac{0.125}{r \cdot s} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)}{\pi}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-/l*N/A

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

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

        \[\leadsto \mathsf{/.f32}\left(\left(\frac{1}{8} \cdot \left(e^{0 - \frac{r}{s}} + e^{\frac{\frac{r}{s}}{-3}}\right)\right), \color{blue}{\left(\left(r \cdot s\right) \cdot \mathsf{PI}\left(\right)\right)}\right) \]
    5. Applied egg-rr99.6%

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

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \color{blue}{\left(1 + \left(\frac{-1}{3} \cdot \frac{r}{s} + \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}} + \frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}}\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    7. Step-by-step derivation
      1. associate-+r+N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \left(\left(1 + \frac{-1}{3} \cdot \frac{r}{s}\right) + \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}} + \frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      2. +-lowering-+.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\left(1 + \frac{-1}{3} \cdot \frac{r}{s}\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}} + \frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      3. +-lowering-+.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \left(\frac{-1}{3} \cdot \frac{r}{s}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}} + \frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \left(\frac{r}{s} \cdot \frac{-1}{3}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}} + \frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\left(\frac{r}{s}\right), \frac{-1}{3}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}} + \frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      6. /-lowering-/.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}} + \frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \left(\frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}} + \frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      8. +-lowering-+.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\left(\frac{1}{18} \cdot \frac{{r}^{2}}{{s}^{2}}\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\left(\frac{\frac{1}{18} \cdot {r}^{2}}{{s}^{2}}\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      10. /-lowering-/.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\left(\frac{1}{18} \cdot {r}^{2}\right), \left({s}^{2}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\left({r}^{2} \cdot \frac{1}{18}\right), \left({s}^{2}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\left(\left(r \cdot r\right) \cdot \frac{1}{18}\right), \left({s}^{2}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      13. associate-*l*N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\left(r \cdot \left(r \cdot \frac{1}{18}\right)\right), \left({s}^{2}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\left(r \cdot \left(\frac{1}{18} \cdot r\right)\right), \left({s}^{2}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      15. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, \left(\frac{1}{18} \cdot r\right)\right), \left({s}^{2}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, \left(r \cdot \frac{1}{18}\right)\right), \left({s}^{2}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      17. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, \mathsf{*.f32}\left(r, \frac{1}{18}\right)\right), \left({s}^{2}\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      18. unpow2N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, \mathsf{*.f32}\left(r, \frac{1}{18}\right)\right), \left(s \cdot s\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      19. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, \mathsf{*.f32}\left(r, \frac{1}{18}\right)\right), \mathsf{*.f32}\left(s, s\right)\right), \left(\frac{-1}{162} \cdot \frac{{r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      20. associate-*r/N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, \mathsf{*.f32}\left(r, \frac{1}{18}\right)\right), \mathsf{*.f32}\left(s, s\right)\right), \left(\frac{\frac{-1}{162} \cdot {r}^{3}}{{s}^{3}}\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      21. /-lowering-/.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{+.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{/.f32}\left(r, s\right), \frac{-1}{3}\right)\right), \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, \mathsf{*.f32}\left(r, \frac{1}{18}\right)\right), \mathsf{*.f32}\left(s, s\right)\right), \mathsf{/.f32}\left(\left(\frac{-1}{162} \cdot {r}^{3}\right), \left({s}^{3}\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    8. Simplified7.8%

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

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \color{blue}{\left(\frac{\frac{-1}{162} \cdot {r}^{3} + s \cdot \left(\frac{1}{18} \cdot {r}^{2} + s \cdot \left(s + \frac{-1}{3} \cdot r\right)\right)}{{s}^{3}}\right)}\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    10. Step-by-step derivation
      1. /-lowering-/.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{1}{8}, \mathsf{+.f32}\left(\mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(r\right), s\right)\right), \mathsf{/.f32}\left(\left(\frac{-1}{162} \cdot {r}^{3} + s \cdot \left(\frac{1}{18} \cdot {r}^{2} + s \cdot \left(s + \frac{-1}{3} \cdot r\right)\right)\right), \left({s}^{3}\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    11. Simplified9.3%

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

      \[\leadsto \mathsf{/.f32}\left(\color{blue}{\left(\frac{1}{4} + r \cdot \left(\frac{5}{72} \cdot \frac{r}{{s}^{2}} - \frac{1}{6} \cdot \frac{1}{s}\right)\right)}, \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    13. Step-by-step derivation
      1. +-lowering-+.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \left(r \cdot \left(\frac{5}{72} \cdot \frac{r}{{s}^{2}} - \frac{1}{6} \cdot \frac{1}{s}\right)\right)\right), \mathsf{*.f32}\left(\color{blue}{\mathsf{*.f32}\left(r, s\right)}, \mathsf{PI.f32}\left(\right)\right)\right) \]
      2. associate-*r/N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \left(r \cdot \left(\frac{\frac{5}{72} \cdot r}{{s}^{2}} - \frac{1}{6} \cdot \frac{1}{s}\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \left(r \cdot \left(\frac{\frac{5}{72} \cdot r}{s \cdot s} - \frac{1}{6} \cdot \frac{1}{s}\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      4. associate-/r*N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \left(r \cdot \left(\frac{\frac{\frac{5}{72} \cdot r}{s}}{s} - \frac{1}{6} \cdot \frac{1}{s}\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \left(r \cdot \left(\frac{\frac{5}{72} \cdot \frac{r}{s}}{s} - \frac{1}{6} \cdot \frac{1}{s}\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \left(r \cdot \left(\frac{\frac{5}{72} \cdot \frac{r}{s}}{s} - \frac{\frac{1}{6} \cdot 1}{s}\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \left(r \cdot \left(\frac{\frac{5}{72} \cdot \frac{r}{s}}{s} - \frac{\frac{1}{6}}{s}\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      8. div-subN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \left(r \cdot \frac{\frac{5}{72} \cdot \frac{r}{s} - \frac{1}{6}}{s}\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      9. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \left(\frac{\frac{5}{72} \cdot \frac{r}{s} - \frac{1}{6}}{s}\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, \color{blue}{s}\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
      10. /-lowering-/.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{+.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{/.f32}\left(\left(\frac{5}{72} \cdot \frac{r}{s} - \frac{1}{6}\right), s\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, s\right), \mathsf{PI.f32}\left(\right)\right)\right) \]
    14. Simplified9.1%

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

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

    Alternative 11: 9.1% accurate, 13.6× speedup?

    \[\begin{array}{l} \\ \frac{\left(r \cdot r\right) \cdot \left(\frac{0.25}{\pi} \cdot \frac{\frac{1}{r}}{r \cdot r}\right)}{s} \end{array} \]
    (FPCore (s r)
     :precision binary32
     (/ (* (* r r) (* (/ 0.25 PI) (/ (/ 1.0 r) (* r r)))) s))
    float code(float s, float r) {
    	return ((r * r) * ((0.25f / ((float) M_PI)) * ((1.0f / r) / (r * r)))) / s;
    }
    
    function code(s, r)
    	return Float32(Float32(Float32(r * r) * Float32(Float32(Float32(0.25) / Float32(pi)) * Float32(Float32(Float32(1.0) / r) / Float32(r * r)))) / s)
    end
    
    function tmp = code(s, r)
    	tmp = ((r * r) * ((single(0.25) / single(pi)) * ((single(1.0) / r) / (r * r)))) / s;
    end
    
    \begin{array}{l}
    
    \\
    \frac{\left(r \cdot r\right) \cdot \left(\frac{0.25}{\pi} \cdot \frac{\frac{1}{r}}{r \cdot r}\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}{-1 \cdot \frac{-1 \cdot \frac{-1 \cdot \frac{-1 \cdot \frac{\frac{-1}{48} \cdot \frac{{r}^{2}}{\mathsf{PI}\left(\right)} + \frac{-1}{1296} \cdot \frac{{r}^{2}}{\mathsf{PI}\left(\right)}}{s} + \left(\frac{-1}{16} \cdot \frac{r}{\mathsf{PI}\left(\right)} + \frac{-1}{144} \cdot \frac{r}{\mathsf{PI}\left(\right)}\right)}{s} - \frac{1}{6} \cdot \frac{1}{\mathsf{PI}\left(\right)}}{s} - \frac{1}{4} \cdot \frac{1}{r \cdot \mathsf{PI}\left(\right)}}{s}} \]
    4. Simplified8.4%

      \[\leadsto \color{blue}{\frac{\frac{\frac{-0.16666666666666666}{\pi} - \frac{\frac{r}{\pi} \cdot -0.06944444444444445 + \frac{\frac{r \cdot r}{\pi} \cdot 0.021604938271604937}{s}}{s}}{s} + \frac{0.25}{r \cdot \pi}}{s}} \]
    5. Taylor expanded in r around -inf

      \[\leadsto \mathsf{/.f32}\left(\color{blue}{\left({r}^{2} \cdot \left(-1 \cdot \frac{-1 \cdot \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)}}{r} - \frac{5}{72} \cdot \frac{1}{{s}^{2} \cdot \mathsf{PI}\left(\right)}}{r} - \frac{7}{324} \cdot \frac{1}{{s}^{3} \cdot \mathsf{PI}\left(\right)}\right)\right)}, s\right) \]
    6. Simplified6.9%

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

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \color{blue}{\left(\frac{\frac{1}{4}}{{r}^{3} \cdot \mathsf{PI}\left(\right)}\right)}\right), s\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \left({r}^{3} \cdot \mathsf{PI}\left(\right)\right)\right)\right), s\right) \]
      2. cube-multN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \left(\left(r \cdot \left(r \cdot r\right)\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), s\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \left(\left(r \cdot {r}^{2}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), s\right) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \left(r \cdot \left({r}^{2} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), s\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \left({r}^{2} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), s\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{*.f32}\left(\left({r}^{2}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right), s\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{*.f32}\left(\left(r \cdot r\right), \mathsf{PI}\left(\right)\right)\right)\right)\right), s\right) \]
      8. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{PI}\left(\right)\right)\right)\right)\right), s\right) \]
      9. PI-lowering-PI.f328.6%

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), s\right) \]
    9. Simplified8.6%

      \[\leadsto \frac{\left(r \cdot r\right) \cdot \color{blue}{\frac{0.25}{r \cdot \left(\left(r \cdot r\right) \cdot \pi\right)}}}{s} \]
    10. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \left(\frac{\frac{\frac{1}{4}}{r}}{\left(r \cdot r\right) \cdot \mathsf{PI}\left(\right)}\right)\right), s\right) \]
      2. div-invN/A

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

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \left(\frac{\frac{1}{4} \cdot \frac{1}{r}}{\mathsf{PI}\left(\right) \cdot \left(r \cdot r\right)}\right)\right), s\right) \]
      4. times-fracN/A

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

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{*.f32}\left(\left(\frac{\frac{1}{4}}{\mathsf{PI}\left(\right)}\right), \left(\frac{\frac{1}{r}}{r \cdot r}\right)\right)\right), s\right) \]
      6. /-lowering-/.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{*.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, \mathsf{PI}\left(\right)\right), \left(\frac{\frac{1}{r}}{r \cdot r}\right)\right)\right), s\right) \]
      7. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{*.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, \mathsf{PI.f32}\left(\right)\right), \left(\frac{\frac{1}{r}}{r \cdot r}\right)\right)\right), s\right) \]
      8. /-lowering-/.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{*.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, \mathsf{PI.f32}\left(\right)\right), \mathsf{/.f32}\left(\left(\frac{1}{r}\right), \left(r \cdot r\right)\right)\right)\right), s\right) \]
      9. /-lowering-/.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{*.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, \mathsf{PI.f32}\left(\right)\right), \mathsf{/.f32}\left(\mathsf{/.f32}\left(1, r\right), \left(r \cdot r\right)\right)\right)\right), s\right) \]
      10. *-lowering-*.f328.6%

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{*.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, \mathsf{PI.f32}\left(\right)\right), \mathsf{/.f32}\left(\mathsf{/.f32}\left(1, r\right), \mathsf{*.f32}\left(r, r\right)\right)\right)\right), s\right) \]
    11. Applied egg-rr8.6%

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

    Alternative 12: 9.1% accurate, 15.4× speedup?

    \[\begin{array}{l} \\ \frac{\frac{0.25}{\pi} \cdot \frac{r \cdot r}{r \cdot \left(r \cdot r\right)}}{s} \end{array} \]
    (FPCore (s r)
     :precision binary32
     (/ (* (/ 0.25 PI) (/ (* r r) (* r (* r r)))) s))
    float code(float s, float r) {
    	return ((0.25f / ((float) M_PI)) * ((r * r) / (r * (r * r)))) / s;
    }
    
    function code(s, r)
    	return Float32(Float32(Float32(Float32(0.25) / Float32(pi)) * Float32(Float32(r * r) / Float32(r * Float32(r * r)))) / s)
    end
    
    function tmp = code(s, r)
    	tmp = ((single(0.25) / single(pi)) * ((r * r) / (r * (r * r)))) / s;
    end
    
    \begin{array}{l}
    
    \\
    \frac{\frac{0.25}{\pi} \cdot \frac{r \cdot r}{r \cdot \left(r \cdot r\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}{-1 \cdot \frac{-1 \cdot \frac{-1 \cdot \frac{-1 \cdot \frac{\frac{-1}{48} \cdot \frac{{r}^{2}}{\mathsf{PI}\left(\right)} + \frac{-1}{1296} \cdot \frac{{r}^{2}}{\mathsf{PI}\left(\right)}}{s} + \left(\frac{-1}{16} \cdot \frac{r}{\mathsf{PI}\left(\right)} + \frac{-1}{144} \cdot \frac{r}{\mathsf{PI}\left(\right)}\right)}{s} - \frac{1}{6} \cdot \frac{1}{\mathsf{PI}\left(\right)}}{s} - \frac{1}{4} \cdot \frac{1}{r \cdot \mathsf{PI}\left(\right)}}{s}} \]
    4. Simplified8.4%

      \[\leadsto \color{blue}{\frac{\frac{\frac{-0.16666666666666666}{\pi} - \frac{\frac{r}{\pi} \cdot -0.06944444444444445 + \frac{\frac{r \cdot r}{\pi} \cdot 0.021604938271604937}{s}}{s}}{s} + \frac{0.25}{r \cdot \pi}}{s}} \]
    5. Taylor expanded in r around -inf

      \[\leadsto \mathsf{/.f32}\left(\color{blue}{\left({r}^{2} \cdot \left(-1 \cdot \frac{-1 \cdot \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)}}{r} - \frac{5}{72} \cdot \frac{1}{{s}^{2} \cdot \mathsf{PI}\left(\right)}}{r} - \frac{7}{324} \cdot \frac{1}{{s}^{3} \cdot \mathsf{PI}\left(\right)}\right)\right)}, s\right) \]
    6. Simplified6.9%

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

      \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \color{blue}{\left(\frac{\frac{1}{4}}{{r}^{3} \cdot \mathsf{PI}\left(\right)}\right)}\right), s\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \left({r}^{3} \cdot \mathsf{PI}\left(\right)\right)\right)\right), s\right) \]
      2. cube-multN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \left(\left(r \cdot \left(r \cdot r\right)\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), s\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \left(\left(r \cdot {r}^{2}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), s\right) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \left(r \cdot \left({r}^{2} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), s\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \left({r}^{2} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), s\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{*.f32}\left(\left({r}^{2}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right), s\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{*.f32}\left(\left(r \cdot r\right), \mathsf{PI}\left(\right)\right)\right)\right)\right), s\right) \]
      8. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{PI}\left(\right)\right)\right)\right)\right), s\right) \]
      9. PI-lowering-PI.f328.6%

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{*.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), s\right) \]
    9. Simplified8.6%

      \[\leadsto \frac{\left(r \cdot r\right) \cdot \color{blue}{\frac{0.25}{r \cdot \left(\left(r \cdot r\right) \cdot \pi\right)}}}{s} \]
    10. Step-by-step derivation
      1. associate-*r/N/A

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

        \[\leadsto \mathsf{/.f32}\left(\left(\frac{\left(r \cdot r\right) \cdot \frac{1}{4}}{\left(r \cdot \left(r \cdot r\right)\right) \cdot \mathsf{PI}\left(\right)}\right), s\right) \]
      3. cube-unmultN/A

        \[\leadsto \mathsf{/.f32}\left(\left(\frac{\left(r \cdot r\right) \cdot \frac{1}{4}}{{r}^{3} \cdot \mathsf{PI}\left(\right)}\right), s\right) \]
      4. times-fracN/A

        \[\leadsto \mathsf{/.f32}\left(\left(\frac{r \cdot r}{{r}^{3}} \cdot \frac{\frac{1}{4}}{\mathsf{PI}\left(\right)}\right), s\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\left(\frac{r \cdot r}{{r}^{3}}\right), \left(\frac{\frac{1}{4}}{\mathsf{PI}\left(\right)}\right)\right), s\right) \]
      6. /-lowering-/.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(\left(r \cdot r\right), \left({r}^{3}\right)\right), \left(\frac{\frac{1}{4}}{\mathsf{PI}\left(\right)}\right)\right), s\right) \]
      7. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, r\right), \left({r}^{3}\right)\right), \left(\frac{\frac{1}{4}}{\mathsf{PI}\left(\right)}\right)\right), s\right) \]
      8. cube-unmultN/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, r\right), \left(r \cdot \left(r \cdot r\right)\right)\right), \left(\frac{\frac{1}{4}}{\mathsf{PI}\left(\right)}\right)\right), s\right) \]
      9. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{*.f32}\left(r, \left(r \cdot r\right)\right)\right), \left(\frac{\frac{1}{4}}{\mathsf{PI}\left(\right)}\right)\right), s\right) \]
      10. *-lowering-*.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{*.f32}\left(r, \mathsf{*.f32}\left(r, r\right)\right)\right), \left(\frac{\frac{1}{4}}{\mathsf{PI}\left(\right)}\right)\right), s\right) \]
      11. /-lowering-/.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{*.f32}\left(r, \mathsf{*.f32}\left(r, r\right)\right)\right), \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{PI}\left(\right)\right)\right), s\right) \]
      12. PI-lowering-PI.f328.6%

        \[\leadsto \mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(r, r\right), \mathsf{*.f32}\left(r, \mathsf{*.f32}\left(r, r\right)\right)\right), \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{PI.f32}\left(\right)\right)\right), s\right) \]
    11. Applied egg-rr8.6%

      \[\leadsto \frac{\color{blue}{\frac{r \cdot r}{r \cdot \left(r \cdot r\right)} \cdot \frac{0.25}{\pi}}}{s} \]
    12. Final simplification8.6%

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

    Alternative 13: 9.1% accurate, 25.7× speedup?

    \[\begin{array}{l} \\ \frac{1}{\frac{s \cdot \pi}{\frac{0.25}{r}}} \end{array} \]
    (FPCore (s r) :precision binary32 (/ 1.0 (/ (* s PI) (/ 0.25 r))))
    float code(float s, float r) {
    	return 1.0f / ((s * ((float) M_PI)) / (0.25f / r));
    }
    
    function code(s, r)
    	return Float32(Float32(1.0) / Float32(Float32(s * Float32(pi)) / Float32(Float32(0.25) / r)))
    end
    
    function tmp = code(s, r)
    	tmp = single(1.0) / ((s * single(pi)) / (single(0.25) / r));
    end
    
    \begin{array}{l}
    
    \\
    \frac{1}{\frac{s \cdot \pi}{\frac{0.25}{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. Simplified97.6%

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

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

        \[\leadsto \mathsf{/.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, \left(r \cdot s\right)\right), \mathsf{PI.f32}\left(\right)\right) \]
      2. *-lowering-*.f328.6%

        \[\leadsto \mathsf{/.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, s\right)\right), \mathsf{PI.f32}\left(\right)\right) \]
    6. Simplified8.6%

      \[\leadsto \frac{\color{blue}{\frac{0.25}{r \cdot s}}}{\pi} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

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

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

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

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

        \[\leadsto \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{*.f32}\left(s, \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right) \]
      6. PI-lowering-PI.f328.6%

        \[\leadsto \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{*.f32}\left(s, \mathsf{PI.f32}\left(\right)\right)\right)\right) \]
    8. Applied egg-rr8.6%

      \[\leadsto \color{blue}{\frac{0.25}{r \cdot \left(s \cdot \pi\right)}} \]
    9. Step-by-step derivation
      1. associate-/r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{/.f32}\left(1, \mathsf{/.f32}\left(\mathsf{*.f32}\left(s, \mathsf{PI.f32}\left(\right)\right), \left(\frac{\frac{1}{4}}{r}\right)\right)\right) \]
      7. /-lowering-/.f328.6%

        \[\leadsto \mathsf{/.f32}\left(1, \mathsf{/.f32}\left(\mathsf{*.f32}\left(s, \mathsf{PI.f32}\left(\right)\right), \mathsf{/.f32}\left(\frac{1}{4}, \color{blue}{r}\right)\right)\right) \]
    10. Applied egg-rr8.6%

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

    Alternative 14: 9.1% accurate, 25.7× speedup?

    \[\begin{array}{l} \\ \frac{0.25}{r} \cdot \frac{1}{s \cdot \pi} \end{array} \]
    (FPCore (s r) :precision binary32 (* (/ 0.25 r) (/ 1.0 (* s PI))))
    float code(float s, float r) {
    	return (0.25f / r) * (1.0f / (s * ((float) M_PI)));
    }
    
    function code(s, r)
    	return Float32(Float32(Float32(0.25) / r) * Float32(Float32(1.0) / Float32(s * Float32(pi))))
    end
    
    function tmp = code(s, r)
    	tmp = (single(0.25) / r) * (single(1.0) / (s * single(pi)));
    end
    
    \begin{array}{l}
    
    \\
    \frac{0.25}{r} \cdot \frac{1}{s \cdot \pi}
    \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. Simplified97.6%

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

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

        \[\leadsto \mathsf{/.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, \left(r \cdot s\right)\right), \mathsf{PI.f32}\left(\right)\right) \]
      2. *-lowering-*.f328.6%

        \[\leadsto \mathsf{/.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, s\right)\right), \mathsf{PI.f32}\left(\right)\right) \]
    6. Simplified8.6%

      \[\leadsto \frac{\color{blue}{\frac{0.25}{r \cdot s}}}{\pi} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

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

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

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

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

        \[\leadsto \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{*.f32}\left(s, \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right) \]
      6. PI-lowering-PI.f328.6%

        \[\leadsto \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{*.f32}\left(s, \mathsf{PI.f32}\left(\right)\right)\right)\right) \]
    8. Applied egg-rr8.6%

      \[\leadsto \color{blue}{\frac{0.25}{r \cdot \left(s \cdot \pi\right)}} \]
    9. Step-by-step derivation
      1. associate-/r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, r\right), \mathsf{/.f32}\left(1, \mathsf{*.f32}\left(s, \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right) \]
      7. PI-lowering-PI.f328.6%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, r\right), \mathsf{/.f32}\left(1, \mathsf{*.f32}\left(s, \mathsf{PI.f32}\left(\right)\right)\right)\right) \]
    10. Applied egg-rr8.6%

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

    Alternative 15: 9.1% accurate, 33.0× speedup?

    \[\begin{array}{l} \\ \frac{\frac{\frac{0.25}{r}}{s}}{\pi} \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(Float32(Float32(0.25) / r) / s) / Float32(pi))
    end
    
    function tmp = code(s, r)
    	tmp = ((single(0.25) / r) / s) / single(pi);
    end
    
    \begin{array}{l}
    
    \\
    \frac{\frac{\frac{0.25}{r}}{s}}{\pi}
    \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. Simplified97.6%

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

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

        \[\leadsto \mathsf{/.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, \left(r \cdot s\right)\right), \mathsf{PI.f32}\left(\right)\right) \]
      2. *-lowering-*.f328.6%

        \[\leadsto \mathsf{/.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, s\right)\right), \mathsf{PI.f32}\left(\right)\right) \]
    6. Simplified8.6%

      \[\leadsto \frac{\color{blue}{\frac{0.25}{r \cdot s}}}{\pi} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \mathsf{/.f32}\left(\left(\frac{\frac{\frac{1}{4}}{r}}{s}\right), \mathsf{PI.f32}\left(\right)\right) \]
      2. /-lowering-/.f32N/A

        \[\leadsto \mathsf{/.f32}\left(\mathsf{/.f32}\left(\left(\frac{\frac{1}{4}}{r}\right), s\right), \mathsf{PI.f32}\left(\right)\right) \]
      3. /-lowering-/.f328.6%

        \[\leadsto \mathsf{/.f32}\left(\mathsf{/.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, r\right), s\right), \mathsf{PI.f32}\left(\right)\right) \]
    8. Applied egg-rr8.6%

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

    Alternative 16: 9.1% accurate, 33.0× speedup?

    \[\begin{array}{l} \\ \frac{\frac{0.25}{r}}{s \cdot \pi} \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(Float32(0.25) / r) / Float32(s * Float32(pi)))
    end
    
    function tmp = code(s, r)
    	tmp = (single(0.25) / r) / (s * single(pi));
    end
    
    \begin{array}{l}
    
    \\
    \frac{\frac{0.25}{r}}{s \cdot \pi}
    \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. Simplified97.6%

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

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

        \[\leadsto \mathsf{/.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, \left(r \cdot s\right)\right), \mathsf{PI.f32}\left(\right)\right) \]
      2. *-lowering-*.f328.6%

        \[\leadsto \mathsf{/.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, s\right)\right), \mathsf{PI.f32}\left(\right)\right) \]
    6. Simplified8.6%

      \[\leadsto \frac{\color{blue}{\frac{0.25}{r \cdot s}}}{\pi} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{/.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, r\right), \mathsf{*.f32}\left(s, \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \]
      7. PI-lowering-PI.f328.6%

        \[\leadsto \mathsf{/.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, r\right), \mathsf{*.f32}\left(s, \mathsf{PI.f32}\left(\right)\right)\right) \]
    8. Applied egg-rr8.6%

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

    Alternative 17: 9.1% accurate, 33.0× 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. Simplified97.6%

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

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

        \[\leadsto \mathsf{/.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, \left(r \cdot s\right)\right), \mathsf{PI.f32}\left(\right)\right) \]
      2. *-lowering-*.f328.6%

        \[\leadsto \mathsf{/.f32}\left(\mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, s\right)\right), \mathsf{PI.f32}\left(\right)\right) \]
    6. Simplified8.6%

      \[\leadsto \frac{\color{blue}{\frac{0.25}{r \cdot s}}}{\pi} \]
    7. Step-by-step derivation
      1. associate-/r*N/A

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

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

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

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

        \[\leadsto \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{*.f32}\left(s, \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right) \]
      6. PI-lowering-PI.f328.6%

        \[\leadsto \mathsf{/.f32}\left(\frac{1}{4}, \mathsf{*.f32}\left(r, \mathsf{*.f32}\left(s, \mathsf{PI.f32}\left(\right)\right)\right)\right) \]
    8. Applied egg-rr8.6%

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

    Reproduce

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