Disney BSSRDF, PDF of scattering profile

Percentage Accurate: 99.6% → 99.6%
Time: 5.8s
Alternatives: 21
Speedup: 1.1×

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}

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 21 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.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}
Derivation
  1. Initial program 99.6%

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

Alternative 2: 99.6% accurate, 1.1× speedup?

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

\\
\mathsf{fma}\left(\frac{e^{\frac{r}{-3 \cdot s}}}{\left(\left(6 \cdot \pi\right) \cdot s\right) \cdot r}, 0.75, \frac{0.125 \cdot \frac{e^{\frac{-r}{s}}}{\pi \cdot s}}{r}\right)
\end{array}
Derivation
  1. Initial program 99.6%

    \[\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. Step-by-step derivation
    1. lift-+.f32N/A

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{e^{\frac{r}{-3 \cdot s}}}{\left(\left(6 \cdot \pi\right) \cdot s\right) \cdot r}, 0.75, \frac{0.125 \cdot \frac{e^{\frac{-r}{s}}}{\pi \cdot s}}{r}\right)} \]
  4. Add Preprocessing

Alternative 3: 99.6% accurate, 1.1× speedup?

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

\\
\frac{\frac{e^{\frac{-r}{s}} \cdot 0.25}{\pi + \pi} + \frac{e^{\frac{r}{-3 \cdot s}} \cdot 0.75}{6 \cdot \pi}}{s \cdot r}
\end{array}
Derivation
  1. Initial program 99.6%

    \[\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. Applied rewrites99.6%

    \[\leadsto \color{blue}{\frac{\frac{e^{\frac{-r}{s}} \cdot 0.25}{\pi + \pi} + \frac{e^{\frac{r}{-3 \cdot s}} \cdot 0.75}{6 \cdot \pi}}{s \cdot r}} \]
  3. Add Preprocessing

Alternative 4: 99.6% accurate, 1.2× speedup?

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

\\
\frac{\mathsf{fma}\left(\frac{0.125}{\pi \cdot s}, e^{\frac{-r}{s}}, 0.125 \cdot \frac{e^{\frac{r}{-3 \cdot s}}}{\pi \cdot s}\right)}{r}
\end{array}
Derivation
  1. Initial program 99.6%

    \[\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. Applied rewrites99.6%

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

Alternative 5: 99.6% accurate, 1.2× speedup?

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

\\
\frac{\mathsf{fma}\left(0.125, \frac{e^{\frac{-r}{s}}}{\pi \cdot s}, 0.125 \cdot \frac{e^{\frac{r}{-3 \cdot s}}}{\pi \cdot s}\right)}{r}
\end{array}
Derivation
  1. Initial program 99.6%

    \[\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. Step-by-step derivation
    1. lift-+.f32N/A

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

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

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

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

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

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

      \[\leadsto \frac{\frac{\frac{1}{4} \cdot e^{\frac{-r}{s}}}{\left(2 \cdot \pi\right) \cdot s}}{r} + \color{blue}{\frac{\frac{\frac{3}{4} \cdot e^{\frac{-r}{3 \cdot s}}}{\left(6 \cdot \pi\right) \cdot s}}{r}} \]
    8. div-add-revN/A

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

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

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(0.125, \frac{e^{\frac{-r}{s}}}{\pi \cdot s}, 0.125 \cdot \frac{e^{\frac{r}{-3 \cdot s}}}{\pi \cdot s}\right)}{r}} \]
  4. Add Preprocessing

Alternative 6: 99.6% accurate, 1.4× speedup?

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

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

    \[\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. Applied rewrites99.6%

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{0.125}{\pi \cdot s}, e^{\frac{-r}{s}}, \frac{0.125}{\pi \cdot s} \cdot e^{\frac{r}{-3 \cdot s}}\right)}{r}} \]
  3. Applied rewrites99.6%

    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\frac{e^{\frac{-r}{s}}}{\pi \cdot s}, 0.125, 0.125 \cdot \frac{e^{\frac{r}{s \cdot -3}}}{\pi \cdot s}\right)}}{r} \]
  4. Applied rewrites99.6%

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

Alternative 7: 99.6% accurate, 1.4× speedup?

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

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

    \[\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. Applied rewrites99.6%

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

      \[\leadsto \frac{\color{blue}{\frac{\frac{1}{8}}{\pi \cdot s} \cdot e^{\frac{-r}{s}} + \frac{\frac{1}{8}}{\pi \cdot s} \cdot e^{\frac{r}{-3 \cdot s}}}}{r} \]
    2. lift-*.f32N/A

      \[\leadsto \frac{\frac{\frac{1}{8}}{\pi \cdot s} \cdot e^{\frac{-r}{s}} + \color{blue}{\frac{\frac{1}{8}}{\pi \cdot s} \cdot e^{\frac{r}{-3 \cdot s}}}}{r} \]
    3. distribute-lft-outN/A

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

      \[\leadsto \frac{\color{blue}{\frac{\frac{1}{8}}{\pi \cdot s} \cdot \left(e^{\frac{-r}{s}} + e^{\frac{r}{-3 \cdot s}}\right)}}{r} \]
    5. lower-+.f3299.6

      \[\leadsto \frac{\frac{0.125}{\pi \cdot s} \cdot \color{blue}{\left(e^{\frac{-r}{s}} + e^{\frac{r}{-3 \cdot s}}\right)}}{r} \]
    6. lift-*.f32N/A

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

      \[\leadsto \frac{\frac{\frac{1}{8}}{\pi \cdot s} \cdot \left(e^{\frac{-r}{s}} + e^{\frac{r}{\color{blue}{s \cdot -3}}}\right)}{r} \]
    8. lower-*.f3299.6

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

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

Alternative 8: 99.6% accurate, 1.4× speedup?

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

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

    \[\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. Applied rewrites99.6%

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{0.125}{\pi \cdot s}, e^{\frac{-r}{s}}, \frac{0.125}{\pi \cdot s} \cdot e^{\frac{r}{-3 \cdot s}}\right)}{r}} \]
  3. Applied rewrites99.6%

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

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

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

Alternative 9: 97.7% accurate, 1.4× speedup?

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

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

    \[\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. Applied rewrites99.6%

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{0.125}{\pi \cdot s}, e^{\frac{-r}{s}}, \frac{0.125}{\pi \cdot s} \cdot e^{\frac{r}{-3 \cdot s}}\right)}{r}} \]
  3. Applied rewrites99.6%

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

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

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

Alternative 10: 43.6% accurate, 1.7× speedup?

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

\\
\frac{0.25}{\log \left({\left(e^{\pi}\right)}^{r}\right) \cdot s}
\end{array}
Derivation
  1. Initial program 99.6%

    \[\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. Taylor expanded in s around inf

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

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

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

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

      \[\leadsto \frac{0.25}{r \cdot \left(s \cdot \pi\right)} \]
  4. Applied rewrites8.9%

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \pi\right) \cdot \color{blue}{s}} \]
    6. lower-*.f328.9

      \[\leadsto \frac{0.25}{\left(r \cdot \pi\right) \cdot s} \]
  6. Applied rewrites8.9%

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

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \pi\right) \cdot s} \]
    2. lift-PI.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \mathsf{PI}\left(\right)\right) \cdot s} \]
    3. add-log-expN/A

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \log \left(e^{\mathsf{PI}\left(\right)}\right)\right) \cdot s} \]
    4. log-pow-revN/A

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

      \[\leadsto \frac{\frac{1}{4}}{\log \left({\left(e^{\mathsf{PI}\left(\right)}\right)}^{r}\right) \cdot s} \]
    6. lower-pow.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\log \left({\left(e^{\mathsf{PI}\left(\right)}\right)}^{r}\right) \cdot s} \]
    7. lift-PI.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\log \left({\left(e^{\pi}\right)}^{r}\right) \cdot s} \]
    8. lower-exp.f3243.6

      \[\leadsto \frac{0.25}{\log \left({\left(e^{\pi}\right)}^{r}\right) \cdot s} \]
  8. Applied rewrites43.6%

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

Alternative 11: 43.6% accurate, 2.5× speedup?

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

\\
\frac{0.25}{\log \left(e^{\pi \cdot r}\right) \cdot s}
\end{array}
Derivation
  1. Initial program 99.6%

    \[\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. Taylor expanded in s around inf

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

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

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

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

      \[\leadsto \frac{0.25}{r \cdot \left(s \cdot \pi\right)} \]
  4. Applied rewrites8.9%

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \pi\right) \cdot \color{blue}{s}} \]
    6. lower-*.f328.9

      \[\leadsto \frac{0.25}{\left(r \cdot \pi\right) \cdot s} \]
  6. Applied rewrites8.9%

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

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \pi\right) \cdot s} \]
    2. rem-square-sqrtN/A

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right) \cdot s} \]
    3. lift-sqrt.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right) \cdot s} \]
    4. lift-sqrt.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right) \cdot s} \]
    5. associate-*r*N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(\left(r \cdot \sqrt{\pi}\right) \cdot \sqrt{\pi}\right) \cdot s} \]
    6. lower-*.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(\left(r \cdot \sqrt{\pi}\right) \cdot \sqrt{\pi}\right) \cdot s} \]
    7. *-commutativeN/A

      \[\leadsto \frac{\frac{1}{4}}{\left(\left(\sqrt{\pi} \cdot r\right) \cdot \sqrt{\pi}\right) \cdot s} \]
    8. lower-*.f328.9

      \[\leadsto \frac{0.25}{\left(\left(\sqrt{\pi} \cdot r\right) \cdot \sqrt{\pi}\right) \cdot s} \]
  8. Applied rewrites8.9%

    \[\leadsto \frac{0.25}{\left(\left(\sqrt{\pi} \cdot r\right) \cdot \sqrt{\pi}\right) \cdot s} \]
  9. Step-by-step derivation
    1. lift-*.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(\left(\sqrt{\pi} \cdot r\right) \cdot \sqrt{\pi}\right) \cdot s} \]
    2. lift-*.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(\left(\sqrt{\pi} \cdot r\right) \cdot \sqrt{\pi}\right) \cdot s} \]
    3. *-commutativeN/A

      \[\leadsto \frac{\frac{1}{4}}{\left(\left(r \cdot \sqrt{\pi}\right) \cdot \sqrt{\pi}\right) \cdot s} \]
    4. associate-*l*N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right) \cdot s} \]
    5. lift-sqrt.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right) \cdot s} \]
    6. lift-sqrt.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right) \cdot s} \]
    7. rem-square-sqrtN/A

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \pi\right) \cdot s} \]
    8. lift-PI.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \mathsf{PI}\left(\right)\right) \cdot s} \]
    9. add-log-expN/A

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \log \left(e^{\mathsf{PI}\left(\right)}\right)\right) \cdot s} \]
    10. log-pow-revN/A

      \[\leadsto \frac{\frac{1}{4}}{\log \left({\left(e^{\mathsf{PI}\left(\right)}\right)}^{r}\right) \cdot s} \]
    11. lower-log.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\log \left({\left(e^{\mathsf{PI}\left(\right)}\right)}^{r}\right) \cdot s} \]
    12. lift-PI.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\log \left({\left(e^{\pi}\right)}^{r}\right) \cdot s} \]
    13. pow-expN/A

      \[\leadsto \frac{\frac{1}{4}}{\log \left(e^{\pi \cdot r}\right) \cdot s} \]
    14. lift-*.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\log \left(e^{\pi \cdot r}\right) \cdot s} \]
    15. lower-exp.f3243.6

      \[\leadsto \frac{0.25}{\log \left(e^{\pi \cdot r}\right) \cdot s} \]
  10. Applied rewrites43.6%

    \[\leadsto \frac{0.25}{\log \left(e^{\pi \cdot r}\right) \cdot s} \]
  11. Add Preprocessing

Alternative 12: 10.0% accurate, 2.5× speedup?

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

\\
\frac{0.25}{\log \left(e^{\left(\pi \cdot r\right) \cdot s}\right)}
\end{array}
Derivation
  1. Initial program 99.6%

    \[\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. Taylor expanded in s around inf

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

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

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

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

      \[\leadsto \frac{0.25}{r \cdot \left(s \cdot \pi\right)} \]
  4. Applied rewrites8.9%

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{4}}{\left(s \cdot r\right) \cdot \color{blue}{\pi}} \]
    6. lower-*.f328.9

      \[\leadsto \frac{0.25}{\left(s \cdot r\right) \cdot \pi} \]
  6. Applied rewrites8.9%

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

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

      \[\leadsto \frac{\frac{1}{4}}{\left(s \cdot r\right) \cdot \mathsf{PI}\left(\right)} \]
    3. add-log-expN/A

      \[\leadsto \frac{\frac{1}{4}}{\left(s \cdot r\right) \cdot \log \left(e^{\mathsf{PI}\left(\right)}\right)} \]
    4. log-pow-revN/A

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

      \[\leadsto \frac{\frac{1}{4}}{\log \left({\left(e^{\mathsf{PI}\left(\right)}\right)}^{\left(s \cdot r\right)}\right)} \]
    6. pow-to-expN/A

      \[\leadsto \frac{\frac{1}{4}}{\log \left(e^{\log \left(e^{\mathsf{PI}\left(\right)}\right) \cdot \left(s \cdot r\right)}\right)} \]
    7. add-log-expN/A

      \[\leadsto \frac{\frac{1}{4}}{\log \left(e^{\mathsf{PI}\left(\right) \cdot \left(s \cdot r\right)}\right)} \]
    8. lift-PI.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\log \left(e^{\pi \cdot \left(s \cdot r\right)}\right)} \]
    9. lift-*.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\log \left(e^{\pi \cdot \left(s \cdot r\right)}\right)} \]
    10. *-commutativeN/A

      \[\leadsto \frac{\frac{1}{4}}{\log \left(e^{\pi \cdot \left(r \cdot s\right)}\right)} \]
    11. associate-*l*N/A

      \[\leadsto \frac{\frac{1}{4}}{\log \left(e^{\left(\pi \cdot r\right) \cdot s}\right)} \]
    12. lift-*.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\log \left(e^{\left(\pi \cdot r\right) \cdot s}\right)} \]
    13. lift-*.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\log \left(e^{\left(\pi \cdot r\right) \cdot s}\right)} \]
    14. lower-exp.f3210.0

      \[\leadsto \frac{0.25}{\log \left(e^{\left(\pi \cdot r\right) \cdot s}\right)} \]
  8. Applied rewrites10.0%

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

Alternative 13: 8.9% accurate, 3.7× speedup?

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

\\
\frac{\frac{0.25}{\sqrt{\pi}}}{\left(\sqrt{\pi} \cdot s\right) \cdot r}
\end{array}
Derivation
  1. Initial program 99.6%

    \[\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. Taylor expanded in s around inf

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

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

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

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

      \[\leadsto \frac{0.25}{r \cdot \left(s \cdot \pi\right)} \]
  4. Applied rewrites8.9%

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \pi\right) \cdot \color{blue}{s}} \]
    6. lower-*.f328.9

      \[\leadsto \frac{0.25}{\left(r \cdot \pi\right) \cdot s} \]
  6. Applied rewrites8.9%

    \[\leadsto \frac{0.25}{\left(r \cdot \pi\right) \cdot \color{blue}{s}} \]
  7. Step-by-step derivation
    1. lift-/.f32N/A

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{4}}{\left(s \cdot r\right) \cdot \pi} \]
    7. rem-square-sqrtN/A

      \[\leadsto \frac{\frac{1}{4}}{\left(s \cdot r\right) \cdot \left(\sqrt{\pi} \cdot \color{blue}{\sqrt{\pi}}\right)} \]
    8. lift-sqrt.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(s \cdot r\right) \cdot \left(\sqrt{\pi} \cdot \sqrt{\color{blue}{\pi}}\right)} \]
    9. lift-sqrt.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(s \cdot r\right) \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \]
    10. associate-*l*N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(\left(s \cdot r\right) \cdot \sqrt{\pi}\right) \cdot \color{blue}{\sqrt{\pi}}} \]
    11. lift-*.f32N/A

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

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

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

      \[\leadsto \frac{\frac{\frac{1}{4}}{\sqrt{\pi}}}{\color{blue}{\left(s \cdot r\right) \cdot \sqrt{\pi}}} \]
    15. lower-/.f328.9

      \[\leadsto \frac{\frac{0.25}{\sqrt{\pi}}}{\color{blue}{\left(s \cdot r\right)} \cdot \sqrt{\pi}} \]
    16. lift-*.f32N/A

      \[\leadsto \frac{\frac{\frac{1}{4}}{\sqrt{\pi}}}{\left(s \cdot r\right) \cdot \color{blue}{\sqrt{\pi}}} \]
    17. lift-*.f32N/A

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

      \[\leadsto \frac{\frac{\frac{1}{4}}{\sqrt{\pi}}}{\left(r \cdot s\right) \cdot \sqrt{\color{blue}{\pi}}} \]
    19. lift-*.f32N/A

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

      \[\leadsto \frac{\frac{\frac{1}{4}}{\sqrt{\pi}}}{\sqrt{\pi} \cdot \color{blue}{\left(r \cdot s\right)}} \]
    21. lift-*.f32N/A

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

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

      \[\leadsto \frac{\frac{\frac{1}{4}}{\sqrt{\pi}}}{\left(\sqrt{\pi} \cdot s\right) \cdot \color{blue}{r}} \]
  8. Applied rewrites8.9%

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

Alternative 14: 8.9% accurate, 3.9× speedup?

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

\\
\frac{0.25}{\left(\left(\sqrt{\pi} \cdot s\right) \cdot r\right) \cdot \sqrt{\pi}}
\end{array}
Derivation
  1. Initial program 99.6%

    \[\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. Taylor expanded in s around inf

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

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

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

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

      \[\leadsto \frac{0.25}{r \cdot \left(s \cdot \pi\right)} \]
  4. Applied rewrites8.9%

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \pi\right) \cdot \color{blue}{s}} \]
    6. lower-*.f328.9

      \[\leadsto \frac{0.25}{\left(r \cdot \pi\right) \cdot s} \]
  6. Applied rewrites8.9%

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{4}}{\left(s \cdot r\right) \cdot \pi} \]
    6. rem-square-sqrtN/A

      \[\leadsto \frac{\frac{1}{4}}{\left(s \cdot r\right) \cdot \left(\sqrt{\pi} \cdot \color{blue}{\sqrt{\pi}}\right)} \]
    7. lift-sqrt.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(s \cdot r\right) \cdot \left(\sqrt{\pi} \cdot \sqrt{\color{blue}{\pi}}\right)} \]
    8. lift-sqrt.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(s \cdot r\right) \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \]
    9. associate-*l*N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(\left(s \cdot r\right) \cdot \sqrt{\pi}\right) \cdot \color{blue}{\sqrt{\pi}}} \]
    10. lift-*.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(\left(s \cdot r\right) \cdot \sqrt{\pi}\right) \cdot \sqrt{\color{blue}{\pi}}} \]
    11. lift-*.f328.9

      \[\leadsto \frac{0.25}{\left(\left(s \cdot r\right) \cdot \sqrt{\pi}\right) \cdot \color{blue}{\sqrt{\pi}}} \]
    12. lift-*.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(\left(s \cdot r\right) \cdot \sqrt{\pi}\right) \cdot \sqrt{\color{blue}{\pi}}} \]
    13. lift-*.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(\left(s \cdot r\right) \cdot \sqrt{\pi}\right) \cdot \sqrt{\pi}} \]
    14. *-commutativeN/A

      \[\leadsto \frac{\frac{1}{4}}{\left(\left(r \cdot s\right) \cdot \sqrt{\pi}\right) \cdot \sqrt{\pi}} \]
    15. lift-*.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(\left(r \cdot s\right) \cdot \sqrt{\pi}\right) \cdot \sqrt{\pi}} \]
    16. *-commutativeN/A

      \[\leadsto \frac{\frac{1}{4}}{\left(\sqrt{\pi} \cdot \left(r \cdot s\right)\right) \cdot \sqrt{\color{blue}{\pi}}} \]
    17. lift-*.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(\sqrt{\pi} \cdot \left(r \cdot s\right)\right) \cdot \sqrt{\pi}} \]
    18. *-commutativeN/A

      \[\leadsto \frac{\frac{1}{4}}{\left(\sqrt{\pi} \cdot \left(s \cdot r\right)\right) \cdot \sqrt{\pi}} \]
    19. associate-*r*N/A

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

      \[\leadsto \frac{\frac{1}{4}}{\left(\left(\sqrt{\pi} \cdot s\right) \cdot r\right) \cdot \sqrt{\color{blue}{\pi}}} \]
    21. lower-*.f328.9

      \[\leadsto \frac{0.25}{\left(\left(\sqrt{\pi} \cdot s\right) \cdot r\right) \cdot \sqrt{\pi}} \]
  8. Applied rewrites8.9%

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

Alternative 15: 8.9% accurate, 3.9× speedup?

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

\\
\frac{0.25}{\left(\sqrt{\pi} \cdot s\right) \cdot \left(\sqrt{\pi} \cdot r\right)}
\end{array}
Derivation
  1. Initial program 99.6%

    \[\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. Taylor expanded in s around inf

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

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

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

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

      \[\leadsto \frac{0.25}{r \cdot \left(s \cdot \pi\right)} \]
  4. Applied rewrites8.9%

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{4}}{\left(r \cdot \pi\right) \cdot \color{blue}{s}} \]
    6. lower-*.f328.9

      \[\leadsto \frac{0.25}{\left(r \cdot \pi\right) \cdot s} \]
  6. Applied rewrites8.9%

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{4}}{\left(s \cdot r\right) \cdot \pi} \]
    6. rem-square-sqrtN/A

      \[\leadsto \frac{\frac{1}{4}}{\left(s \cdot r\right) \cdot \left(\sqrt{\pi} \cdot \color{blue}{\sqrt{\pi}}\right)} \]
    7. lift-sqrt.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(s \cdot r\right) \cdot \left(\sqrt{\pi} \cdot \sqrt{\color{blue}{\pi}}\right)} \]
    8. lift-sqrt.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(s \cdot r\right) \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)} \]
    9. associate-*l*N/A

      \[\leadsto \frac{\frac{1}{4}}{\left(\left(s \cdot r\right) \cdot \sqrt{\pi}\right) \cdot \color{blue}{\sqrt{\pi}}} \]
    10. lift-*.f32N/A

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

      \[\leadsto \frac{\frac{1}{4}}{\sqrt{\pi} \cdot \color{blue}{\left(\left(s \cdot r\right) \cdot \sqrt{\pi}\right)}} \]
    12. lift-*.f32N/A

      \[\leadsto \frac{\frac{1}{4}}{\sqrt{\pi} \cdot \left(\left(s \cdot r\right) \cdot \color{blue}{\sqrt{\pi}}\right)} \]
    13. lift-*.f32N/A

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{4}}{\left(\sqrt{\pi} \cdot s\right) \cdot \left(\sqrt{\pi} \cdot \color{blue}{r}\right)} \]
    19. lower-*.f328.9

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

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

Alternative 16: 8.9% accurate, 5.7× speedup?

\[\begin{array}{l} \\ \frac{\frac{\frac{0.25}{r}}{\pi}}{s} \end{array} \]
(FPCore (s r) :precision binary32 (/ (/ (/ 0.25 r) PI) s))
float code(float s, float r) {
	return ((0.25f / r) / ((float) M_PI)) / s;
}
function code(s, r)
	return Float32(Float32(Float32(Float32(0.25) / r) / Float32(pi)) / s)
end
function tmp = code(s, r)
	tmp = ((single(0.25) / r) / single(pi)) / s;
end
\begin{array}{l}

\\
\frac{\frac{\frac{0.25}{r}}{\pi}}{s}
\end{array}
Derivation
  1. Initial program 99.6%

    \[\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. Taylor expanded in s around inf

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

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

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

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

      \[\leadsto \frac{0.25}{r \cdot \left(s \cdot \pi\right)} \]
  4. Applied rewrites8.9%

    \[\leadsto \color{blue}{\frac{0.25}{r \cdot \left(s \cdot \pi\right)}} \]
  5. Step-by-step derivation
    1. lift-/.f32N/A

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

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

      \[\leadsto \frac{\frac{\frac{1}{4}}{r}}{\color{blue}{s \cdot \pi}} \]
    4. lift-*.f32N/A

      \[\leadsto \frac{\frac{\frac{1}{4}}{r}}{s \cdot \color{blue}{\pi}} \]
    5. *-commutativeN/A

      \[\leadsto \frac{\frac{\frac{1}{4}}{r}}{\pi \cdot \color{blue}{s}} \]
    6. associate-/r*N/A

      \[\leadsto \frac{\frac{\frac{\frac{1}{4}}{r}}{\pi}}{\color{blue}{s}} \]
    7. lower-/.f32N/A

      \[\leadsto \frac{\frac{\frac{\frac{1}{4}}{r}}{\pi}}{\color{blue}{s}} \]
    8. lower-/.f32N/A

      \[\leadsto \frac{\frac{\frac{\frac{1}{4}}{r}}{\pi}}{s} \]
    9. lower-/.f328.9

      \[\leadsto \frac{\frac{\frac{0.25}{r}}{\pi}}{s} \]
  6. Applied rewrites8.9%

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

Alternative 17: 8.9% accurate, 5.7× 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.6%

    \[\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. Taylor expanded in s around inf

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

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

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

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

      \[\leadsto \frac{0.25}{r \cdot \left(s \cdot \pi\right)} \]
  4. Applied rewrites8.9%

    \[\leadsto \color{blue}{\frac{0.25}{r \cdot \left(s \cdot \pi\right)}} \]
  5. Step-by-step derivation
    1. lift-/.f32N/A

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

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

      \[\leadsto \frac{\frac{\frac{1}{4}}{r}}{\color{blue}{s \cdot \pi}} \]
    4. lift-*.f32N/A

      \[\leadsto \frac{\frac{\frac{1}{4}}{r}}{s \cdot \color{blue}{\pi}} \]
    5. associate-/r*N/A

      \[\leadsto \frac{\frac{\frac{\frac{1}{4}}{r}}{s}}{\color{blue}{\pi}} \]
    6. lower-/.f32N/A

      \[\leadsto \frac{\frac{\frac{\frac{1}{4}}{r}}{s}}{\color{blue}{\pi}} \]
    7. lower-/.f32N/A

      \[\leadsto \frac{\frac{\frac{\frac{1}{4}}{r}}{s}}{\pi} \]
    8. lower-/.f328.9

      \[\leadsto \frac{\frac{\frac{0.25}{r}}{s}}{\pi} \]
  6. Applied rewrites8.9%

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

Alternative 18: 8.9% accurate, 6.0× speedup?

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

\\
\frac{\frac{0.25}{\pi}}{r \cdot s}
\end{array}
Derivation
  1. Initial program 99.6%

    \[\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. Applied rewrites99.6%

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

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

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

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

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

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

      \[\leadsto \frac{\frac{0.25}{\pi}}{r \cdot s} \]
  8. Applied rewrites8.9%

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

Alternative 19: 8.9% accurate, 6.0× speedup?

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

\\
\frac{\frac{0.25}{s \cdot r}}{\pi}
\end{array}
Derivation
  1. Initial program 99.6%

    \[\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. Taylor expanded in s around inf

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

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

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

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

      \[\leadsto \frac{0.25}{r \cdot \left(s \cdot \pi\right)} \]
  4. Applied rewrites8.9%

    \[\leadsto \color{blue}{\frac{0.25}{r \cdot \left(s \cdot \pi\right)}} \]
  5. Step-by-step derivation
    1. lift-/.f32N/A

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

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

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

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

      \[\leadsto \frac{\frac{\frac{1}{4}}{r \cdot s}}{\color{blue}{\pi}} \]
    6. *-commutativeN/A

      \[\leadsto \frac{\frac{\frac{1}{4}}{s \cdot r}}{\pi} \]
    7. lower-/.f32N/A

      \[\leadsto \frac{\frac{\frac{1}{4}}{s \cdot r}}{\color{blue}{\pi}} \]
    8. lower-/.f32N/A

      \[\leadsto \frac{\frac{\frac{1}{4}}{s \cdot r}}{\pi} \]
    9. lower-*.f328.9

      \[\leadsto \frac{\frac{0.25}{s \cdot r}}{\pi} \]
  6. Applied rewrites8.9%

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

Alternative 20: 8.9% accurate, 6.4× speedup?

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

\\
\frac{0.25}{\left(s \cdot r\right) \cdot \pi}
\end{array}
Derivation
  1. Initial program 99.6%

    \[\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. Taylor expanded in s around inf

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

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

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

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

      \[\leadsto \frac{0.25}{r \cdot \left(s \cdot \pi\right)} \]
  4. Applied rewrites8.9%

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{4}}{\left(s \cdot r\right) \cdot \color{blue}{\pi}} \]
    6. lower-*.f328.9

      \[\leadsto \frac{0.25}{\left(s \cdot r\right) \cdot \pi} \]
  6. Applied rewrites8.9%

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

Alternative 21: 8.9% accurate, 6.4× 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.6%

    \[\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. Taylor expanded in s around inf

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

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

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

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

      \[\leadsto \frac{0.25}{r \cdot \left(s \cdot \pi\right)} \]
  4. Applied rewrites8.9%

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

Reproduce

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