Sample trimmed logistic on [-pi, pi]

Percentage Accurate: 99.0% → 99.0%
Time: 22.4s
Alternatives: 19
Speedup: 1.0×

Specification

?
\[\left(2.328306437 \cdot 10^{-10} \leq u \land u \leq 1\right) \land \left(0 \leq s \land s \leq 1.0651631\right)\]
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{1 + e^{\frac{\pi}{s}}}\\ \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - t\_0\right) + t\_0} - 1\right) \end{array} \end{array} \]
(FPCore (u s)
 :precision binary32
 (let* ((t_0 (/ 1.0 (+ 1.0 (exp (/ PI s))))))
   (*
    (- s)
    (log
     (-
      (/ 1.0 (+ (* u (- (/ 1.0 (+ 1.0 (exp (/ (- PI) s)))) t_0)) t_0))
      1.0)))))
float code(float u, float s) {
	float t_0 = 1.0f / (1.0f + expf((((float) M_PI) / s)));
	return -s * logf(((1.0f / ((u * ((1.0f / (1.0f + expf((-((float) M_PI) / s)))) - t_0)) + t_0)) - 1.0f));
}
function code(u, s)
	t_0 = Float32(Float32(1.0) / Float32(Float32(1.0) + exp(Float32(Float32(pi) / s))))
	return Float32(Float32(-s) * log(Float32(Float32(Float32(1.0) / Float32(Float32(u * Float32(Float32(Float32(1.0) / Float32(Float32(1.0) + exp(Float32(Float32(-Float32(pi)) / s)))) - t_0)) + t_0)) - Float32(1.0))))
end
function tmp = code(u, s)
	t_0 = single(1.0) / (single(1.0) + exp((single(pi) / s)));
	tmp = -s * log(((single(1.0) / ((u * ((single(1.0) / (single(1.0) + exp((-single(pi) / s)))) - t_0)) + t_0)) - single(1.0)));
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1}{1 + e^{\frac{\pi}{s}}}\\
\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - t\_0\right) + t\_0} - 1\right)
\end{array}
\end{array}

Sampling outcomes in binary32 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 99.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{1}{1 + e^{\frac{\pi}{s}}}\\
\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - t\_0\right) + t\_0} - 1\right)
\end{array}
\end{array}

Alternative 1: 99.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{\frac{\pi}{s}}\\ t_1 := e^{0 - \frac{\pi}{s}}\\ t_2 := \frac{u}{1 + t\_1} + \frac{-1 + u}{-1 - t\_0}\\ \left(-s\right) \cdot \log \left(\frac{-1 + {t\_2}^{-3}}{{t\_2}^{-2} + \left(1 + \frac{-1}{\frac{-1 + u}{1 + t\_0} + \frac{u}{-1 - t\_1}}\right)}\right) \end{array} \end{array} \]
(FPCore (u s)
 :precision binary32
 (let* ((t_0 (exp (/ PI s)))
        (t_1 (exp (- 0.0 (/ PI s))))
        (t_2 (+ (/ u (+ 1.0 t_1)) (/ (+ -1.0 u) (- -1.0 t_0)))))
   (*
    (- s)
    (log
     (/
      (+ -1.0 (pow t_2 -3.0))
      (+
       (pow t_2 -2.0)
       (+ 1.0 (/ -1.0 (+ (/ (+ -1.0 u) (+ 1.0 t_0)) (/ u (- -1.0 t_1)))))))))))
float code(float u, float s) {
	float t_0 = expf((((float) M_PI) / s));
	float t_1 = expf((0.0f - (((float) M_PI) / s)));
	float t_2 = (u / (1.0f + t_1)) + ((-1.0f + u) / (-1.0f - t_0));
	return -s * logf(((-1.0f + powf(t_2, -3.0f)) / (powf(t_2, -2.0f) + (1.0f + (-1.0f / (((-1.0f + u) / (1.0f + t_0)) + (u / (-1.0f - t_1))))))));
}
function code(u, s)
	t_0 = exp(Float32(Float32(pi) / s))
	t_1 = exp(Float32(Float32(0.0) - Float32(Float32(pi) / s)))
	t_2 = Float32(Float32(u / Float32(Float32(1.0) + t_1)) + Float32(Float32(Float32(-1.0) + u) / Float32(Float32(-1.0) - t_0)))
	return Float32(Float32(-s) * log(Float32(Float32(Float32(-1.0) + (t_2 ^ Float32(-3.0))) / Float32((t_2 ^ Float32(-2.0)) + Float32(Float32(1.0) + Float32(Float32(-1.0) / Float32(Float32(Float32(Float32(-1.0) + u) / Float32(Float32(1.0) + t_0)) + Float32(u / Float32(Float32(-1.0) - t_1)))))))))
end
function tmp = code(u, s)
	t_0 = exp((single(pi) / s));
	t_1 = exp((single(0.0) - (single(pi) / s)));
	t_2 = (u / (single(1.0) + t_1)) + ((single(-1.0) + u) / (single(-1.0) - t_0));
	tmp = -s * log(((single(-1.0) + (t_2 ^ single(-3.0))) / ((t_2 ^ single(-2.0)) + (single(1.0) + (single(-1.0) / (((single(-1.0) + u) / (single(1.0) + t_0)) + (u / (single(-1.0) - t_1))))))));
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{\frac{\pi}{s}}\\
t_1 := e^{0 - \frac{\pi}{s}}\\
t_2 := \frac{u}{1 + t\_1} + \frac{-1 + u}{-1 - t\_0}\\
\left(-s\right) \cdot \log \left(\frac{-1 + {t\_2}^{-3}}{{t\_2}^{-2} + \left(1 + \frac{-1}{\frac{-1 + u}{1 + t\_0} + \frac{u}{-1 - t\_1}}\right)}\right)
\end{array}
\end{array}
Derivation
  1. Initial program 99.0%

    \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. clear-numN/A

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

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{s}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    4. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    5. PI-lowering-PI.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
  4. Applied egg-rr99.0%

    \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}} - 1\right) \]
  5. Applied egg-rr99.0%

    \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{\color{blue}{\frac{u}{1 + e^{\frac{-\pi}{s}}} + \left(\frac{u}{-\left(1 + e^{\frac{\pi}{s}}\right)} - \frac{-1}{1 + e^{\frac{\pi}{s}}}\right)}} - 1\right) \]
  6. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(s\right)\right), \color{blue}{\log \left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} - 1\right)}\right) \]
    2. neg-lowering-neg.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \log \color{blue}{\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} - 1\right)}\right) \]
    3. log-lowering-log.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} - 1\right)\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + -1\right)\right)\right) \]
    6. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{+.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)}\right), -1\right)\right)\right) \]
  7. Applied egg-rr99.0%

    \[\leadsto \color{blue}{\left(-s\right) \cdot \log \left(\frac{1}{\frac{u}{1 + e^{\frac{\pi}{-s}}} + \frac{u - 1}{-1 - e^{\frac{\pi}{s}}}} + -1\right)} \]
  8. Applied egg-rr99.1%

    \[\leadsto \left(-s\right) \cdot \log \color{blue}{\left(\frac{-1 + {\left(\frac{u}{1 + e^{0 - \frac{\pi}{s}}} + \frac{u + -1}{-1 - e^{\frac{\pi}{s}}}\right)}^{-3}}{{\left(\frac{u}{1 + e^{0 - \frac{\pi}{s}}} + \frac{u + -1}{-1 - e^{\frac{\pi}{s}}}\right)}^{-2} + \left(1 + \frac{1}{\frac{u}{1 + e^{0 - \frac{\pi}{s}}} + \frac{u + -1}{-1 - e^{\frac{\pi}{s}}}}\right)}\right)} \]
  9. Final simplification99.1%

    \[\leadsto \left(-s\right) \cdot \log \left(\frac{-1 + {\left(\frac{u}{1 + e^{0 - \frac{\pi}{s}}} + \frac{-1 + u}{-1 - e^{\frac{\pi}{s}}}\right)}^{-3}}{{\left(\frac{u}{1 + e^{0 - \frac{\pi}{s}}} + \frac{-1 + u}{-1 - e^{\frac{\pi}{s}}}\right)}^{-2} + \left(1 + \frac{-1}{\frac{-1 + u}{1 + e^{\frac{\pi}{s}}} + \frac{u}{-1 - e^{0 - \frac{\pi}{s}}}}\right)}\right) \]
  10. Add Preprocessing

Alternative 2: 98.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{\frac{\pi}{s}}\\ t_1 := e^{0 - \frac{\pi}{s}}\\ \left(-s\right) \cdot \log \left(\frac{1}{\frac{1 + \frac{-1}{\frac{-1 + u}{1 + t\_0} + \frac{u}{-1 - t\_1}}}{-1 + {\left(\frac{u}{1 + t\_1} + \frac{-1 + u}{-1 - t\_0}\right)}^{-2}}}\right) \end{array} \end{array} \]
(FPCore (u s)
 :precision binary32
 (let* ((t_0 (exp (/ PI s))) (t_1 (exp (- 0.0 (/ PI s)))))
   (*
    (- s)
    (log
     (/
      1.0
      (/
       (+ 1.0 (/ -1.0 (+ (/ (+ -1.0 u) (+ 1.0 t_0)) (/ u (- -1.0 t_1)))))
       (+
        -1.0
        (pow (+ (/ u (+ 1.0 t_1)) (/ (+ -1.0 u) (- -1.0 t_0))) -2.0))))))))
float code(float u, float s) {
	float t_0 = expf((((float) M_PI) / s));
	float t_1 = expf((0.0f - (((float) M_PI) / s)));
	return -s * logf((1.0f / ((1.0f + (-1.0f / (((-1.0f + u) / (1.0f + t_0)) + (u / (-1.0f - t_1))))) / (-1.0f + powf(((u / (1.0f + t_1)) + ((-1.0f + u) / (-1.0f - t_0))), -2.0f)))));
}
function code(u, s)
	t_0 = exp(Float32(Float32(pi) / s))
	t_1 = exp(Float32(Float32(0.0) - Float32(Float32(pi) / s)))
	return Float32(Float32(-s) * log(Float32(Float32(1.0) / Float32(Float32(Float32(1.0) + Float32(Float32(-1.0) / Float32(Float32(Float32(Float32(-1.0) + u) / Float32(Float32(1.0) + t_0)) + Float32(u / Float32(Float32(-1.0) - t_1))))) / Float32(Float32(-1.0) + (Float32(Float32(u / Float32(Float32(1.0) + t_1)) + Float32(Float32(Float32(-1.0) + u) / Float32(Float32(-1.0) - t_0))) ^ Float32(-2.0)))))))
end
function tmp = code(u, s)
	t_0 = exp((single(pi) / s));
	t_1 = exp((single(0.0) - (single(pi) / s)));
	tmp = -s * log((single(1.0) / ((single(1.0) + (single(-1.0) / (((single(-1.0) + u) / (single(1.0) + t_0)) + (u / (single(-1.0) - t_1))))) / (single(-1.0) + (((u / (single(1.0) + t_1)) + ((single(-1.0) + u) / (single(-1.0) - t_0))) ^ single(-2.0))))));
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{\frac{\pi}{s}}\\
t_1 := e^{0 - \frac{\pi}{s}}\\
\left(-s\right) \cdot \log \left(\frac{1}{\frac{1 + \frac{-1}{\frac{-1 + u}{1 + t\_0} + \frac{u}{-1 - t\_1}}}{-1 + {\left(\frac{u}{1 + t\_1} + \frac{-1 + u}{-1 - t\_0}\right)}^{-2}}}\right)
\end{array}
\end{array}
Derivation
  1. Initial program 99.0%

    \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. clear-numN/A

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

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{s}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    4. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    5. PI-lowering-PI.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
  4. Applied egg-rr99.0%

    \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}} - 1\right) \]
  5. Applied egg-rr99.0%

    \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{\color{blue}{\frac{u}{1 + e^{\frac{-\pi}{s}}} + \left(\frac{u}{-\left(1 + e^{\frac{\pi}{s}}\right)} - \frac{-1}{1 + e^{\frac{\pi}{s}}}\right)}} - 1\right) \]
  6. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(s\right)\right), \color{blue}{\log \left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} - 1\right)}\right) \]
    2. neg-lowering-neg.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \log \color{blue}{\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} - 1\right)}\right) \]
    3. log-lowering-log.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} - 1\right)\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + -1\right)\right)\right) \]
    6. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{+.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)}\right), -1\right)\right)\right) \]
  7. Applied egg-rr99.0%

    \[\leadsto \color{blue}{\left(-s\right) \cdot \log \left(\frac{1}{\frac{u}{1 + e^{\frac{\pi}{-s}}} + \frac{u - 1}{-1 - e^{\frac{\pi}{s}}}} + -1\right)} \]
  8. Step-by-step derivation
    1. flip-+N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} \cdot \frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - -1 \cdot -1}{\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - -1}\right)\right)\right) \]
    2. clear-numN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - -1}{\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} \cdot \frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - -1 \cdot -1}}\right)\right)\right) \]
    3. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{/.f32}\left(1, \left(\frac{\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - -1}{\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} \cdot \frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - -1 \cdot -1}\right)\right)\right)\right) \]
  9. Applied egg-rr99.1%

    \[\leadsto \left(-s\right) \cdot \log \color{blue}{\left(\frac{1}{\frac{\frac{1}{\frac{u}{1 + e^{0 - \frac{\pi}{s}}} + \frac{u + -1}{-1 - e^{\frac{\pi}{s}}}} + 1}{{\left(\frac{u}{1 + e^{0 - \frac{\pi}{s}}} + \frac{u + -1}{-1 - e^{\frac{\pi}{s}}}\right)}^{-2} + -1}}\right)} \]
  10. Final simplification99.1%

    \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{\frac{1 + \frac{-1}{\frac{-1 + u}{1 + e^{\frac{\pi}{s}}} + \frac{u}{-1 - e^{0 - \frac{\pi}{s}}}}}{-1 + {\left(\frac{u}{1 + e^{0 - \frac{\pi}{s}}} + \frac{-1 + u}{-1 - e^{\frac{\pi}{s}}}\right)}^{-2}}}\right) \]
  11. Add Preprocessing

Alternative 3: 99.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{0 - \frac{\pi}{s}}\\ t_1 := e^{\frac{\pi}{s}}\\ s \cdot \log \left(\frac{1 + \frac{-1}{\frac{-1 + u}{1 + t\_1} + \frac{u}{-1 - t\_0}}}{-1 + {\left(\frac{u}{1 + t\_0} + \frac{-1 + u}{-1 - t\_1}\right)}^{-2}}\right) \end{array} \end{array} \]
(FPCore (u s)
 :precision binary32
 (let* ((t_0 (exp (- 0.0 (/ PI s)))) (t_1 (exp (/ PI s))))
   (*
    s
    (log
     (/
      (+ 1.0 (/ -1.0 (+ (/ (+ -1.0 u) (+ 1.0 t_1)) (/ u (- -1.0 t_0)))))
      (+
       -1.0
       (pow (+ (/ u (+ 1.0 t_0)) (/ (+ -1.0 u) (- -1.0 t_1))) -2.0)))))))
float code(float u, float s) {
	float t_0 = expf((0.0f - (((float) M_PI) / s)));
	float t_1 = expf((((float) M_PI) / s));
	return s * logf(((1.0f + (-1.0f / (((-1.0f + u) / (1.0f + t_1)) + (u / (-1.0f - t_0))))) / (-1.0f + powf(((u / (1.0f + t_0)) + ((-1.0f + u) / (-1.0f - t_1))), -2.0f))));
}
function code(u, s)
	t_0 = exp(Float32(Float32(0.0) - Float32(Float32(pi) / s)))
	t_1 = exp(Float32(Float32(pi) / s))
	return Float32(s * log(Float32(Float32(Float32(1.0) + Float32(Float32(-1.0) / Float32(Float32(Float32(Float32(-1.0) + u) / Float32(Float32(1.0) + t_1)) + Float32(u / Float32(Float32(-1.0) - t_0))))) / Float32(Float32(-1.0) + (Float32(Float32(u / Float32(Float32(1.0) + t_0)) + Float32(Float32(Float32(-1.0) + u) / Float32(Float32(-1.0) - t_1))) ^ Float32(-2.0))))))
end
function tmp = code(u, s)
	t_0 = exp((single(0.0) - (single(pi) / s)));
	t_1 = exp((single(pi) / s));
	tmp = s * log(((single(1.0) + (single(-1.0) / (((single(-1.0) + u) / (single(1.0) + t_1)) + (u / (single(-1.0) - t_0))))) / (single(-1.0) + (((u / (single(1.0) + t_0)) + ((single(-1.0) + u) / (single(-1.0) - t_1))) ^ single(-2.0)))));
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{0 - \frac{\pi}{s}}\\
t_1 := e^{\frac{\pi}{s}}\\
s \cdot \log \left(\frac{1 + \frac{-1}{\frac{-1 + u}{1 + t\_1} + \frac{u}{-1 - t\_0}}}{-1 + {\left(\frac{u}{1 + t\_0} + \frac{-1 + u}{-1 - t\_1}\right)}^{-2}}\right)
\end{array}
\end{array}
Derivation
  1. Initial program 99.0%

    \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. clear-numN/A

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

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{s}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    4. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    5. PI-lowering-PI.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
  4. Applied egg-rr99.0%

    \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}} - 1\right) \]
  5. Applied egg-rr99.0%

    \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{\color{blue}{\frac{u}{1 + e^{\frac{-\pi}{s}}} + \left(\frac{u}{-\left(1 + e^{\frac{\pi}{s}}\right)} - \frac{-1}{1 + e^{\frac{\pi}{s}}}\right)}} - 1\right) \]
  6. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(s\right)\right), \color{blue}{\log \left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} - 1\right)}\right) \]
    2. neg-lowering-neg.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \log \color{blue}{\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} - 1\right)}\right) \]
    3. log-lowering-log.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} - 1\right)\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + -1\right)\right)\right) \]
    6. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{+.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)}\right), -1\right)\right)\right) \]
  7. Applied egg-rr99.0%

    \[\leadsto \color{blue}{\left(-s\right) \cdot \log \left(\frac{1}{\frac{u}{1 + e^{\frac{\pi}{-s}}} + \frac{u - 1}{-1 - e^{\frac{\pi}{s}}}} + -1\right)} \]
  8. Step-by-step derivation
    1. flip-+N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \log \left(\frac{\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} \cdot \frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - -1 \cdot -1}{\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - -1}\right)\right) \]
    2. clear-numN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \log \left(\frac{1}{\frac{\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - -1}{\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} \cdot \frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - -1 \cdot -1}}\right)\right) \]
    3. log-recN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \left(\mathsf{neg}\left(\log \left(\frac{\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - -1}{\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} \cdot \frac{1}{\frac{u}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{u - 1}{-1 - e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - -1 \cdot -1}\right)\right)\right)\right) \]
  9. Applied egg-rr99.0%

    \[\leadsto \left(-s\right) \cdot \color{blue}{\left(-\log \left(\frac{\frac{1}{\frac{u}{1 + e^{0 - \frac{\pi}{s}}} + \frac{u + -1}{-1 - e^{\frac{\pi}{s}}}} + 1}{{\left(\frac{u}{1 + e^{0 - \frac{\pi}{s}}} + \frac{u + -1}{-1 - e^{\frac{\pi}{s}}}\right)}^{-2} + -1}\right)\right)} \]
  10. Final simplification99.0%

    \[\leadsto s \cdot \log \left(\frac{1 + \frac{-1}{\frac{-1 + u}{1 + e^{\frac{\pi}{s}}} + \frac{u}{-1 - e^{0 - \frac{\pi}{s}}}}}{-1 + {\left(\frac{u}{1 + e^{0 - \frac{\pi}{s}}} + \frac{-1 + u}{-1 - e^{\frac{\pi}{s}}}\right)}^{-2}}\right) \]
  11. Add Preprocessing

Alternative 4: 99.0% accurate, 1.0× speedup?

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

\\
\left(-s\right) \cdot \log \left(-1 + \frac{1}{u \cdot \left(\frac{-1}{-1 - e^{0 - \frac{\pi}{s}}} + \frac{-1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\pi \cdot \frac{1}{s}}}}\right)
\end{array}
Derivation
  1. Initial program 99.0%

    \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. clear-numN/A

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

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{s}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    4. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    5. PI-lowering-PI.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
  4. Applied egg-rr99.0%

    \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}} - 1\right) \]
  5. Final simplification99.0%

    \[\leadsto \left(-s\right) \cdot \log \left(-1 + \frac{1}{u \cdot \left(\frac{-1}{-1 - e^{0 - \frac{\pi}{s}}} + \frac{-1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\pi \cdot \frac{1}{s}}}}\right) \]
  6. Add Preprocessing

Alternative 5: 99.0% accurate, 1.3× speedup?

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

\\
\left(-s\right) \cdot \log \left(-1 + \frac{-1}{\frac{-1 + u}{1 + e^{\frac{\pi}{s}}} + \frac{u}{-1 - e^{0 - \frac{\pi}{s}}}}\right)
\end{array}
Derivation
  1. Initial program 99.0%

    \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. clear-numN/A

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

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{s}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    4. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    5. PI-lowering-PI.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
  4. Applied egg-rr99.0%

    \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}} - 1\right) \]
  5. Applied egg-rr99.0%

    \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{\color{blue}{\frac{u}{1 + e^{\frac{-\pi}{s}}} + \left(\frac{u}{-\left(1 + e^{\frac{\pi}{s}}\right)} - \frac{-1}{1 + e^{\frac{\pi}{s}}}\right)}} - 1\right) \]
  6. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(s\right)\right), \color{blue}{\log \left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} - 1\right)}\right) \]
    2. neg-lowering-neg.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \log \color{blue}{\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} - 1\right)}\right) \]
    3. log-lowering-log.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} - 1\right)\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + -1\right)\right)\right) \]
    6. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{+.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)}\right), -1\right)\right)\right) \]
  7. Applied egg-rr99.0%

    \[\leadsto \color{blue}{\left(-s\right) \cdot \log \left(\frac{1}{\frac{u}{1 + e^{\frac{\pi}{-s}}} + \frac{u - 1}{-1 - e^{\frac{\pi}{s}}}} + -1\right)} \]
  8. Final simplification99.0%

    \[\leadsto \left(-s\right) \cdot \log \left(-1 + \frac{-1}{\frac{-1 + u}{1 + e^{\frac{\pi}{s}}} + \frac{u}{-1 - e^{0 - \frac{\pi}{s}}}}\right) \]
  9. Add Preprocessing

Alternative 6: 98.7% accurate, 1.3× speedup?

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

\\
\left(-s\right) \cdot \log \left(-1 + \frac{-1}{\frac{-1}{1 + e^{\frac{\pi}{s}}} + \frac{u}{-1 - e^{0 - \frac{\pi}{s}}}}\right)
\end{array}
Derivation
  1. Initial program 99.0%

    \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. clear-numN/A

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

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{s}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    4. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    5. PI-lowering-PI.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
  4. Applied egg-rr99.0%

    \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}} - 1\right) \]
  5. Taylor expanded in s around -inf

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{\_.f32}\left(1, \mathsf{/.f32}\left(\left(\frac{-1}{2} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{s} + -1 \cdot \mathsf{PI}\left(\right)\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    6. mul-1-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{\_.f32}\left(1, \mathsf{/.f32}\left(\left(\frac{-1}{2} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{s} + \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    7. unsub-negN/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{\_.f32}\left(1, \mathsf{/.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{-1}{2}, \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right), s\right), \mathsf{PI}\left(\right)\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    13. *-lowering-*.f32N/A

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

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{\_.f32}\left(1, \mathsf{/.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), s\right), \mathsf{PI}\left(\right)\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    16. PI-lowering-PI.f3297.1%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{\_.f32}\left(1, \mathsf{/.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), s\right), \mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
  7. Simplified97.1%

    \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + \color{blue}{\left(1 - \frac{\frac{-0.5 \cdot \left(\pi \cdot \pi\right)}{s} - \pi}{s}\right)}}\right) + \frac{1}{1 + e^{\frac{1}{s} \cdot \pi}}} - 1\right) \]
  8. Taylor expanded in s around 0

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

      \[\leadsto \left(-1 \cdot s\right) \cdot \color{blue}{\log \left(\frac{1}{\frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}} + \frac{u}{1 + e^{-1 \cdot \frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right)} \]
    2. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(-1 \cdot s\right), \color{blue}{\log \left(\frac{1}{\frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}} + \frac{u}{1 + e^{-1 \cdot \frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right)}\right) \]
    3. mul-1-negN/A

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \log \color{blue}{\left(\frac{1}{\frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}} + \frac{u}{1 + e^{-1 \cdot \frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right)}\right) \]
    5. log-lowering-log.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}} + \frac{u}{1 + e^{-1 \cdot \frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right)\right)\right) \]
    6. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}} + \frac{u}{1 + e^{-1 \cdot \frac{\mathsf{PI}\left(\right)}{s}}}} + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right) \]
    7. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}} + \frac{u}{1 + e^{-1 \cdot \frac{\mathsf{PI}\left(\right)}{s}}}} + -1\right)\right)\right) \]
    8. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{+.f32}\left(\left(\frac{1}{\frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}} + \frac{u}{1 + e^{-1 \cdot \frac{\mathsf{PI}\left(\right)}{s}}}}\right), -1\right)\right)\right) \]
  10. Simplified98.8%

    \[\leadsto \color{blue}{\left(-s\right) \cdot \log \left(\frac{1}{\frac{1}{1 + e^{\frac{\pi}{s}}} + \frac{u}{1 + e^{0 - \frac{\pi}{s}}}} + -1\right)} \]
  11. Final simplification98.8%

    \[\leadsto \left(-s\right) \cdot \log \left(-1 + \frac{-1}{\frac{-1}{1 + e^{\frac{\pi}{s}}} + \frac{u}{-1 - e^{0 - \frac{\pi}{s}}}}\right) \]
  12. Add Preprocessing

Alternative 7: 37.6% accurate, 2.0× speedup?

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

\\
\left(-s\right) \cdot \log \left(-1 + \frac{-1}{\frac{-1 + u}{1 + e^{\frac{\pi}{s}}} + \frac{u}{-1 + -1}}\right)
\end{array}
Derivation
  1. Initial program 99.0%

    \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. clear-numN/A

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

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

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{s}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    4. /-lowering-/.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    5. PI-lowering-PI.f3299.0%

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
  4. Applied egg-rr99.0%

    \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}} - 1\right) \]
  5. Applied egg-rr99.0%

    \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{\color{blue}{\frac{u}{1 + e^{\frac{-\pi}{s}}} + \left(\frac{u}{-\left(1 + e^{\frac{\pi}{s}}\right)} - \frac{-1}{1 + e^{\frac{\pi}{s}}}\right)}} - 1\right) \]
  6. Step-by-step derivation
    1. *-lowering-*.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\left(\mathsf{neg}\left(s\right)\right), \color{blue}{\log \left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} - 1\right)}\right) \]
    2. neg-lowering-neg.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \log \color{blue}{\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} - 1\right)}\right) \]
    3. log-lowering-log.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} - 1\right)\right)\right) \]
    4. sub-negN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + -1\right)\right)\right) \]
    6. +-lowering-+.f32N/A

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{+.f32}\left(\left(\frac{1}{\frac{u}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} + \left(\frac{u}{\mathsf{neg}\left(\left(1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}\right)\right)} - \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)}\right), -1\right)\right)\right) \]
  7. Applied egg-rr99.0%

    \[\leadsto \color{blue}{\left(-s\right) \cdot \log \left(\frac{1}{\frac{u}{1 + e^{\frac{\pi}{-s}}} + \frac{u - 1}{-1 - e^{\frac{\pi}{s}}}} + -1\right)} \]
  8. Taylor expanded in s around inf

    \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{+.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{/.f32}\left(u, \mathsf{+.f32}\left(1, \color{blue}{1}\right)\right), \mathsf{/.f32}\left(\mathsf{\_.f32}\left(u, 1\right), \mathsf{\_.f32}\left(-1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), -1\right)\right)\right) \]
  9. Step-by-step derivation
    1. Simplified38.4%

      \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{\frac{u}{1 + \color{blue}{1}} + \frac{u - 1}{-1 - e^{\frac{\pi}{s}}}} + -1\right) \]
    2. Final simplification38.4%

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

    Alternative 8: 24.9% accurate, 3.5× speedup?

    \[\begin{array}{l} \\ \left(-s\right) \cdot \log \left(-1 + \left(2 - \frac{\left(\pi + -4 \cdot \left(\pi \cdot \left(u \cdot -0.5\right)\right)\right) + \pi \cdot -2}{s}\right)\right) \end{array} \]
    (FPCore (u s)
     :precision binary32
     (*
      (- s)
      (log
       (+ -1.0 (- 2.0 (/ (+ (+ PI (* -4.0 (* PI (* u -0.5)))) (* PI -2.0)) s))))))
    float code(float u, float s) {
    	return -s * logf((-1.0f + (2.0f - (((((float) M_PI) + (-4.0f * (((float) M_PI) * (u * -0.5f)))) + (((float) M_PI) * -2.0f)) / s))));
    }
    
    function code(u, s)
    	return Float32(Float32(-s) * log(Float32(Float32(-1.0) + Float32(Float32(2.0) - Float32(Float32(Float32(Float32(pi) + Float32(Float32(-4.0) * Float32(Float32(pi) * Float32(u * Float32(-0.5))))) + Float32(Float32(pi) * Float32(-2.0))) / s)))))
    end
    
    function tmp = code(u, s)
    	tmp = -s * log((single(-1.0) + (single(2.0) - (((single(pi) + (single(-4.0) * (single(pi) * (u * single(-0.5))))) + (single(pi) * single(-2.0))) / s))));
    end
    
    \begin{array}{l}
    
    \\
    \left(-s\right) \cdot \log \left(-1 + \left(2 - \frac{\left(\pi + -4 \cdot \left(\pi \cdot \left(u \cdot -0.5\right)\right)\right) + \pi \cdot -2}{s}\right)\right)
    \end{array}
    
    Derivation
    1. Initial program 99.0%

      \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. flip-+N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \left(\frac{\left(u \cdot \left(\frac{1}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)\right) \cdot \left(u \cdot \left(\frac{1}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)\right) - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}} \cdot \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}}{u \cdot \left(\frac{1}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}}\right)\right), 1\right)\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \left(\frac{1}{\frac{u \cdot \left(\frac{1}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}}{\left(u \cdot \left(\frac{1}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)\right) \cdot \left(u \cdot \left(\frac{1}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)\right) - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}} \cdot \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}}}\right)\right), 1\right)\right)\right) \]
      3. /-lowering-/.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{/.f32}\left(1, \left(\frac{u \cdot \left(\frac{1}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}}{\left(u \cdot \left(\frac{1}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)\right) \cdot \left(u \cdot \left(\frac{1}{1 + e^{\frac{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)\right) - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}} \cdot \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}}\right)\right)\right), 1\right)\right)\right) \]
    4. Applied egg-rr99.0%

      \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{\color{blue}{\frac{1}{\frac{u \cdot \left(\frac{1}{1 + \frac{1}{e^{\frac{\pi}{s}}}} + \frac{-1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{-1}{1 + e^{\frac{\pi}{s}}}}{{\left(u \cdot \left(\frac{1}{1 + \frac{1}{e^{\frac{\pi}{s}}}} + \frac{-1}{1 + e^{\frac{\pi}{s}}}\right)\right)}^{2} - {\left(1 + e^{\frac{\pi}{s}}\right)}^{-2}}}}} - 1\right) \]
    5. Taylor expanded in s around -inf

      \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\color{blue}{\left(2 + -1 \cdot \frac{-4 \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) + u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right) - 2 \cdot \mathsf{PI}\left(\right)}{s}\right)}, 1\right)\right)\right) \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\left(2 + \left(\mathsf{neg}\left(\frac{-4 \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) + u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right) - 2 \cdot \mathsf{PI}\left(\right)}{s}\right)\right)\right), 1\right)\right)\right) \]
      2. unsub-negN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{\_.f32}\left(2, \left(\frac{-4 \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) + u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right) - 2 \cdot \mathsf{PI}\left(\right)}{s}\right)\right), 1\right)\right)\right) \]
      4. /-lowering-/.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{\_.f32}\left(2, \mathsf{/.f32}\left(\left(-4 \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) + u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right) - 2 \cdot \mathsf{PI}\left(\right)\right), s\right)\right), 1\right)\right)\right) \]
    7. Simplified25.6%

      \[\leadsto \left(-s\right) \cdot \log \left(\color{blue}{\left(2 - \frac{\left(1 \cdot \pi + -4 \cdot \left(\pi \cdot \left(-0.5 \cdot u\right)\right)\right) + \pi \cdot -2}{s}\right)} - 1\right) \]
    8. Final simplification25.6%

      \[\leadsto \left(-s\right) \cdot \log \left(-1 + \left(2 - \frac{\left(\pi + -4 \cdot \left(\pi \cdot \left(u \cdot -0.5\right)\right)\right) + \pi \cdot -2}{s}\right)\right) \]
    9. Add Preprocessing

    Alternative 9: 11.5% accurate, 4.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := u \cdot \left(\pi \cdot -0.5\right)\\ t_1 := \pi \cdot \left(\pi \cdot \pi\right)\\ t_2 := t\_1 \cdot \left(\left(u \cdot \left(u \cdot u\right)\right) \cdot -0.125\right)\\ -4 \cdot \frac{\frac{-1}{\frac{\pi \cdot \left(\left(\pi \cdot \pi\right) \cdot 0.015625\right) - t\_2}{t\_2 \cdot t\_2 - t\_1 \cdot \left(t\_1 \cdot 0.000244140625\right)}}}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot t\_0\right) - t\_0 \cdot \left(\pi \cdot 0.25\right)\right)} \end{array} \end{array} \]
    (FPCore (u s)
     :precision binary32
     (let* ((t_0 (* u (* PI -0.5)))
            (t_1 (* PI (* PI PI)))
            (t_2 (* t_1 (* (* u (* u u)) -0.125))))
       (*
        -4.0
        (/
         (/
          -1.0
          (/
           (- (* PI (* (* PI PI) 0.015625)) t_2)
           (- (* t_2 t_2) (* t_1 (* t_1 0.000244140625)))))
         (+
          (* (* PI PI) 0.0625)
          (- (* (* u -0.5) (* PI t_0)) (* t_0 (* PI 0.25))))))))
    float code(float u, float s) {
    	float t_0 = u * (((float) M_PI) * -0.5f);
    	float t_1 = ((float) M_PI) * (((float) M_PI) * ((float) M_PI));
    	float t_2 = t_1 * ((u * (u * u)) * -0.125f);
    	return -4.0f * ((-1.0f / (((((float) M_PI) * ((((float) M_PI) * ((float) M_PI)) * 0.015625f)) - t_2) / ((t_2 * t_2) - (t_1 * (t_1 * 0.000244140625f))))) / (((((float) M_PI) * ((float) M_PI)) * 0.0625f) + (((u * -0.5f) * (((float) M_PI) * t_0)) - (t_0 * (((float) M_PI) * 0.25f)))));
    }
    
    function code(u, s)
    	t_0 = Float32(u * Float32(Float32(pi) * Float32(-0.5)))
    	t_1 = Float32(Float32(pi) * Float32(Float32(pi) * Float32(pi)))
    	t_2 = Float32(t_1 * Float32(Float32(u * Float32(u * u)) * Float32(-0.125)))
    	return Float32(Float32(-4.0) * Float32(Float32(Float32(-1.0) / Float32(Float32(Float32(Float32(pi) * Float32(Float32(Float32(pi) * Float32(pi)) * Float32(0.015625))) - t_2) / Float32(Float32(t_2 * t_2) - Float32(t_1 * Float32(t_1 * Float32(0.000244140625)))))) / Float32(Float32(Float32(Float32(pi) * Float32(pi)) * Float32(0.0625)) + Float32(Float32(Float32(u * Float32(-0.5)) * Float32(Float32(pi) * t_0)) - Float32(t_0 * Float32(Float32(pi) * Float32(0.25)))))))
    end
    
    function tmp = code(u, s)
    	t_0 = u * (single(pi) * single(-0.5));
    	t_1 = single(pi) * (single(pi) * single(pi));
    	t_2 = t_1 * ((u * (u * u)) * single(-0.125));
    	tmp = single(-4.0) * ((single(-1.0) / (((single(pi) * ((single(pi) * single(pi)) * single(0.015625))) - t_2) / ((t_2 * t_2) - (t_1 * (t_1 * single(0.000244140625)))))) / (((single(pi) * single(pi)) * single(0.0625)) + (((u * single(-0.5)) * (single(pi) * t_0)) - (t_0 * (single(pi) * single(0.25))))));
    end
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := u \cdot \left(\pi \cdot -0.5\right)\\
    t_1 := \pi \cdot \left(\pi \cdot \pi\right)\\
    t_2 := t\_1 \cdot \left(\left(u \cdot \left(u \cdot u\right)\right) \cdot -0.125\right)\\
    -4 \cdot \frac{\frac{-1}{\frac{\pi \cdot \left(\left(\pi \cdot \pi\right) \cdot 0.015625\right) - t\_2}{t\_2 \cdot t\_2 - t\_1 \cdot \left(t\_1 \cdot 0.000244140625\right)}}}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot t\_0\right) - t\_0 \cdot \left(\pi \cdot 0.25\right)\right)}
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 99.0%

      \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{s}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      4. /-lowering-/.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      5. PI-lowering-PI.f3299.0%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    4. Applied egg-rr99.0%

      \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}} - 1\right) \]
    5. Taylor expanded in s around -inf

      \[\leadsto \color{blue}{-4 \cdot \left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right), \color{blue}{-4}\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) + \left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) \cdot \mathsf{PI}\left(\right)\right), -4\right) \]
      4. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      6. distribute-rgt-out--N/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{-1}{2}\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot u\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      10. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      12. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      13. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right)\right), -4\right) \]
      16. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
      17. PI-lowering-PI.f3212.1%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
    7. Simplified12.1%

      \[\leadsto \color{blue}{\left(\pi \cdot \left(-0.5 \cdot u\right) + \pi \cdot 0.25\right) \cdot -4} \]
    8. Step-by-step derivation
      1. +-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\left({\left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right)}^{3} + {\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right)}^{3}\right), \left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right) + \left(\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) - \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right)\right)\right)\right), -4\right) \]
    9. Applied egg-rr12.1%

      \[\leadsto \color{blue}{\frac{\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot 0.015625 + \left(u \cdot \left(-0.5 \cdot \pi\right)\right) \cdot \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right)\right)}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right) - \left(\pi \cdot 0.25\right) \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right)}} \cdot -4 \]
    10. Applied egg-rr12.1%

      \[\leadsto \frac{\color{blue}{\frac{1}{\frac{\pi \cdot \left(\left(\pi \cdot \pi\right) \cdot 0.015625\right) - \left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\left(u \cdot \left(u \cdot u\right)\right) \cdot -0.125\right)}{\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot 0.000244140625\right) - \left(\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\left(u \cdot \left(u \cdot u\right)\right) \cdot -0.125\right)\right) \cdot \left(\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\left(u \cdot \left(u \cdot u\right)\right) \cdot -0.125\right)\right)}}}}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right) - \left(\pi \cdot 0.25\right) \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right)} \cdot -4 \]
    11. Final simplification12.1%

      \[\leadsto -4 \cdot \frac{\frac{-1}{\frac{\pi \cdot \left(\left(\pi \cdot \pi\right) \cdot 0.015625\right) - \left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\left(u \cdot \left(u \cdot u\right)\right) \cdot -0.125\right)}{\left(\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\left(u \cdot \left(u \cdot u\right)\right) \cdot -0.125\right)\right) \cdot \left(\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\left(u \cdot \left(u \cdot u\right)\right) \cdot -0.125\right)\right) - \left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot 0.000244140625\right)}}}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(\pi \cdot -0.5\right)\right)\right) - \left(u \cdot \left(\pi \cdot -0.5\right)\right) \cdot \left(\pi \cdot 0.25\right)\right)} \]
    12. Add Preprocessing

    Alternative 10: 11.5% accurate, 7.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := u \cdot \left(\pi \cdot -0.5\right)\\ t_1 := \pi \cdot \left(\pi \cdot \pi\right)\\ -4 \cdot \frac{\left(u \cdot \left(u \cdot u\right)\right) \cdot \left(\frac{t\_1}{u \cdot u} \cdot \frac{0.015625}{u} + t\_1 \cdot -0.125\right)}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot t\_0\right) - t\_0 \cdot \left(\pi \cdot 0.25\right)\right)} \end{array} \end{array} \]
    (FPCore (u s)
     :precision binary32
     (let* ((t_0 (* u (* PI -0.5))) (t_1 (* PI (* PI PI))))
       (*
        -4.0
        (/
         (* (* u (* u u)) (+ (* (/ t_1 (* u u)) (/ 0.015625 u)) (* t_1 -0.125)))
         (+
          (* (* PI PI) 0.0625)
          (- (* (* u -0.5) (* PI t_0)) (* t_0 (* PI 0.25))))))))
    float code(float u, float s) {
    	float t_0 = u * (((float) M_PI) * -0.5f);
    	float t_1 = ((float) M_PI) * (((float) M_PI) * ((float) M_PI));
    	return -4.0f * (((u * (u * u)) * (((t_1 / (u * u)) * (0.015625f / u)) + (t_1 * -0.125f))) / (((((float) M_PI) * ((float) M_PI)) * 0.0625f) + (((u * -0.5f) * (((float) M_PI) * t_0)) - (t_0 * (((float) M_PI) * 0.25f)))));
    }
    
    function code(u, s)
    	t_0 = Float32(u * Float32(Float32(pi) * Float32(-0.5)))
    	t_1 = Float32(Float32(pi) * Float32(Float32(pi) * Float32(pi)))
    	return Float32(Float32(-4.0) * Float32(Float32(Float32(u * Float32(u * u)) * Float32(Float32(Float32(t_1 / Float32(u * u)) * Float32(Float32(0.015625) / u)) + Float32(t_1 * Float32(-0.125)))) / Float32(Float32(Float32(Float32(pi) * Float32(pi)) * Float32(0.0625)) + Float32(Float32(Float32(u * Float32(-0.5)) * Float32(Float32(pi) * t_0)) - Float32(t_0 * Float32(Float32(pi) * Float32(0.25)))))))
    end
    
    function tmp = code(u, s)
    	t_0 = u * (single(pi) * single(-0.5));
    	t_1 = single(pi) * (single(pi) * single(pi));
    	tmp = single(-4.0) * (((u * (u * u)) * (((t_1 / (u * u)) * (single(0.015625) / u)) + (t_1 * single(-0.125)))) / (((single(pi) * single(pi)) * single(0.0625)) + (((u * single(-0.5)) * (single(pi) * t_0)) - (t_0 * (single(pi) * single(0.25))))));
    end
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := u \cdot \left(\pi \cdot -0.5\right)\\
    t_1 := \pi \cdot \left(\pi \cdot \pi\right)\\
    -4 \cdot \frac{\left(u \cdot \left(u \cdot u\right)\right) \cdot \left(\frac{t\_1}{u \cdot u} \cdot \frac{0.015625}{u} + t\_1 \cdot -0.125\right)}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot t\_0\right) - t\_0 \cdot \left(\pi \cdot 0.25\right)\right)}
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 99.0%

      \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{s}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      4. /-lowering-/.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      5. PI-lowering-PI.f3299.0%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    4. Applied egg-rr99.0%

      \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}} - 1\right) \]
    5. Taylor expanded in s around -inf

      \[\leadsto \color{blue}{-4 \cdot \left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right), \color{blue}{-4}\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) + \left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) \cdot \mathsf{PI}\left(\right)\right), -4\right) \]
      4. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      6. distribute-rgt-out--N/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{-1}{2}\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot u\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      10. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      12. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      13. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right)\right), -4\right) \]
      16. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
      17. PI-lowering-PI.f3212.1%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
    7. Simplified12.1%

      \[\leadsto \color{blue}{\left(\pi \cdot \left(-0.5 \cdot u\right) + \pi \cdot 0.25\right) \cdot -4} \]
    8. Step-by-step derivation
      1. +-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\left({\left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right)}^{3} + {\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right)}^{3}\right), \left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right) + \left(\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) - \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right)\right)\right)\right), -4\right) \]
    9. Applied egg-rr12.1%

      \[\leadsto \color{blue}{\frac{\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot 0.015625 + \left(u \cdot \left(-0.5 \cdot \pi\right)\right) \cdot \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right)\right)}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right) - \left(\pi \cdot 0.25\right) \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right)}} \cdot -4 \]
    10. Taylor expanded in u around inf

      \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\color{blue}{\left({u}^{3} \cdot \left(\frac{-1}{8} \cdot {\mathsf{PI}\left(\right)}^{3} + \frac{1}{64} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{u}^{3}}\right)\right)}, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
    11. Step-by-step derivation
      1. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\left({u}^{3}\right), \left(\frac{-1}{8} \cdot {\mathsf{PI}\left(\right)}^{3} + \frac{1}{64} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{u}^{3}}\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      2. cube-multN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\left(u \cdot \left(u \cdot u\right)\right), \left(\frac{-1}{8} \cdot {\mathsf{PI}\left(\right)}^{3} + \frac{1}{64} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{u}^{3}}\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\left(u \cdot {u}^{2}\right), \left(\frac{-1}{8} \cdot {\mathsf{PI}\left(\right)}^{3} + \frac{1}{64} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{u}^{3}}\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left({u}^{2}\right)\right), \left(\frac{-1}{8} \cdot {\mathsf{PI}\left(\right)}^{3} + \frac{1}{64} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{u}^{3}}\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \left(u \cdot u\right)\right), \left(\frac{-1}{8} \cdot {\mathsf{PI}\left(\right)}^{3} + \frac{1}{64} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{u}^{3}}\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(u, u\right)\right), \left(\frac{-1}{8} \cdot {\mathsf{PI}\left(\right)}^{3} + \frac{1}{64} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{u}^{3}}\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(u, u\right)\right), \left(\frac{1}{64} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{u}^{3}} + \frac{-1}{8} \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(u, u\right)\right), \left(\frac{1}{64} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{u}^{3}} + {\mathsf{PI}\left(\right)}^{3} \cdot \frac{-1}{8}\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      9. cube-multN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(u, u\right)\right), \left(\frac{1}{64} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{u}^{3}} + \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \frac{-1}{8}\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(u, u\right)\right), \left(\frac{1}{64} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{u}^{3}} + \left(\mathsf{PI}\left(\right) \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot \frac{-1}{8}\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      11. associate-*r*N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(u, u\right)\right), \left(\frac{1}{64} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{u}^{3}} + \mathsf{PI}\left(\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \frac{-1}{8}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(u, u\right)\right), \left(\frac{1}{64} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{u}^{3}} + \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{8} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      13. +-lowering-+.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(u, u\right)\right), \mathsf{+.f32}\left(\left(\frac{1}{64} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{u}^{3}}\right), \left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{8} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
    12. Simplified12.1%

      \[\leadsto \frac{\color{blue}{\left(u \cdot \left(u \cdot u\right)\right) \cdot \left(\frac{\pi \cdot \left(\pi \cdot \pi\right)}{u \cdot u} \cdot \frac{0.015625}{u} + -0.125 \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right)}}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right) - \left(\pi \cdot 0.25\right) \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right)} \cdot -4 \]
    13. Final simplification12.1%

      \[\leadsto -4 \cdot \frac{\left(u \cdot \left(u \cdot u\right)\right) \cdot \left(\frac{\pi \cdot \left(\pi \cdot \pi\right)}{u \cdot u} \cdot \frac{0.015625}{u} + \left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot -0.125\right)}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(\pi \cdot -0.5\right)\right)\right) - \left(u \cdot \left(\pi \cdot -0.5\right)\right) \cdot \left(\pi \cdot 0.25\right)\right)} \]
    14. Add Preprocessing

    Alternative 11: 11.5% accurate, 7.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \pi \cdot \left(u \cdot -0.5\right)\\ t_1 := u \cdot \left(\pi \cdot -0.5\right)\\ -4 \cdot \frac{0.015625 \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right) + \left(u \cdot -0.5\right) \cdot \left(t\_0 \cdot \left(\pi \cdot t\_0\right)\right)}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot t\_1\right) - t\_1 \cdot \left(\pi \cdot 0.25\right)\right)} \end{array} \end{array} \]
    (FPCore (u s)
     :precision binary32
     (let* ((t_0 (* PI (* u -0.5))) (t_1 (* u (* PI -0.5))))
       (*
        -4.0
        (/
         (+ (* 0.015625 (* PI (* PI PI))) (* (* u -0.5) (* t_0 (* PI t_0))))
         (+
          (* (* PI PI) 0.0625)
          (- (* (* u -0.5) (* PI t_1)) (* t_1 (* PI 0.25))))))))
    float code(float u, float s) {
    	float t_0 = ((float) M_PI) * (u * -0.5f);
    	float t_1 = u * (((float) M_PI) * -0.5f);
    	return -4.0f * (((0.015625f * (((float) M_PI) * (((float) M_PI) * ((float) M_PI)))) + ((u * -0.5f) * (t_0 * (((float) M_PI) * t_0)))) / (((((float) M_PI) * ((float) M_PI)) * 0.0625f) + (((u * -0.5f) * (((float) M_PI) * t_1)) - (t_1 * (((float) M_PI) * 0.25f)))));
    }
    
    function code(u, s)
    	t_0 = Float32(Float32(pi) * Float32(u * Float32(-0.5)))
    	t_1 = Float32(u * Float32(Float32(pi) * Float32(-0.5)))
    	return Float32(Float32(-4.0) * Float32(Float32(Float32(Float32(0.015625) * Float32(Float32(pi) * Float32(Float32(pi) * Float32(pi)))) + Float32(Float32(u * Float32(-0.5)) * Float32(t_0 * Float32(Float32(pi) * t_0)))) / Float32(Float32(Float32(Float32(pi) * Float32(pi)) * Float32(0.0625)) + Float32(Float32(Float32(u * Float32(-0.5)) * Float32(Float32(pi) * t_1)) - Float32(t_1 * Float32(Float32(pi) * Float32(0.25)))))))
    end
    
    function tmp = code(u, s)
    	t_0 = single(pi) * (u * single(-0.5));
    	t_1 = u * (single(pi) * single(-0.5));
    	tmp = single(-4.0) * (((single(0.015625) * (single(pi) * (single(pi) * single(pi)))) + ((u * single(-0.5)) * (t_0 * (single(pi) * t_0)))) / (((single(pi) * single(pi)) * single(0.0625)) + (((u * single(-0.5)) * (single(pi) * t_1)) - (t_1 * (single(pi) * single(0.25))))));
    end
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \pi \cdot \left(u \cdot -0.5\right)\\
    t_1 := u \cdot \left(\pi \cdot -0.5\right)\\
    -4 \cdot \frac{0.015625 \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right) + \left(u \cdot -0.5\right) \cdot \left(t\_0 \cdot \left(\pi \cdot t\_0\right)\right)}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot t\_1\right) - t\_1 \cdot \left(\pi \cdot 0.25\right)\right)}
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 99.0%

      \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{s}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      4. /-lowering-/.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      5. PI-lowering-PI.f3299.0%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    4. Applied egg-rr99.0%

      \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}} - 1\right) \]
    5. Taylor expanded in s around -inf

      \[\leadsto \color{blue}{-4 \cdot \left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right), \color{blue}{-4}\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) + \left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) \cdot \mathsf{PI}\left(\right)\right), -4\right) \]
      4. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      6. distribute-rgt-out--N/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{-1}{2}\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot u\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      10. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      12. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      13. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right)\right), -4\right) \]
      16. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
      17. PI-lowering-PI.f3212.1%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
    7. Simplified12.1%

      \[\leadsto \color{blue}{\left(\pi \cdot \left(-0.5 \cdot u\right) + \pi \cdot 0.25\right) \cdot -4} \]
    8. Step-by-step derivation
      1. +-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\left({\left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right)}^{3} + {\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right)}^{3}\right), \left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right) + \left(\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) - \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right)\right)\right)\right), -4\right) \]
    9. Applied egg-rr12.1%

      \[\leadsto \color{blue}{\frac{\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot 0.015625 + \left(u \cdot \left(-0.5 \cdot \pi\right)\right) \cdot \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right)\right)}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right) - \left(\pi \cdot 0.25\right) \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right)}} \cdot -4 \]
    10. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \left(\left(\left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \cdot \left(u \cdot \frac{-1}{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      3. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\left(\left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(u \cdot \frac{-1}{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\mathsf{PI}\left(\right) \cdot \left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(u \cdot \frac{-1}{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(\left(u \cdot \frac{-1}{2}\right) \cdot \mathsf{PI}\left(\right)\right), \left(\mathsf{PI}\left(\right) \cdot \left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(u \cdot \frac{-1}{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\left(\mathsf{PI}\left(\right) \cdot \left(u \cdot \frac{-1}{2}\right)\right), \left(\mathsf{PI}\left(\right) \cdot \left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(u \cdot \frac{-1}{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      7. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI}\left(\right), \left(u \cdot \frac{-1}{2}\right)\right), \left(\mathsf{PI}\left(\right) \cdot \left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(u \cdot \frac{-1}{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      8. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \left(u \cdot \frac{-1}{2}\right)\right), \left(\mathsf{PI}\left(\right) \cdot \left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(u \cdot \frac{-1}{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      9. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \frac{-1}{2}\right)\right), \left(\mathsf{PI}\left(\right) \cdot \left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(u \cdot \frac{-1}{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      10. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \frac{-1}{2}\right)\right), \mathsf{*.f32}\left(\mathsf{PI}\left(\right), \left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(u \cdot \frac{-1}{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      11. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \frac{-1}{2}\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(u \cdot \frac{-1}{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      12. associate-*r*N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \frac{-1}{2}\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \left(\left(u \cdot \frac{-1}{2}\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(u \cdot \frac{-1}{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \frac{-1}{2}\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \left(\mathsf{PI}\left(\right) \cdot \left(u \cdot \frac{-1}{2}\right)\right)\right)\right), \left(u \cdot \frac{-1}{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \frac{-1}{2}\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI}\left(\right), \left(u \cdot \frac{-1}{2}\right)\right)\right)\right), \left(u \cdot \frac{-1}{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      15. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \frac{-1}{2}\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \left(u \cdot \frac{-1}{2}\right)\right)\right)\right), \left(u \cdot \frac{-1}{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      16. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \frac{-1}{2}\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \frac{-1}{2}\right)\right)\right)\right), \left(u \cdot \frac{-1}{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
      17. *-lowering-*.f3212.1%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \frac{-1}{2}\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \frac{-1}{2}\right)\right)\right)\right), \mathsf{*.f32}\left(u, \frac{-1}{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right), \frac{1}{16}\right), \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), -4\right) \]
    11. Applied egg-rr12.1%

      \[\leadsto \frac{\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot 0.015625 + \color{blue}{\left(\left(\pi \cdot \left(u \cdot -0.5\right)\right) \cdot \left(\pi \cdot \left(\pi \cdot \left(u \cdot -0.5\right)\right)\right)\right) \cdot \left(u \cdot -0.5\right)}}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right) - \left(\pi \cdot 0.25\right) \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right)} \cdot -4 \]
    12. Final simplification12.1%

      \[\leadsto -4 \cdot \frac{0.015625 \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right) + \left(u \cdot -0.5\right) \cdot \left(\left(\pi \cdot \left(u \cdot -0.5\right)\right) \cdot \left(\pi \cdot \left(\pi \cdot \left(u \cdot -0.5\right)\right)\right)\right)}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(\pi \cdot -0.5\right)\right)\right) - \left(u \cdot \left(\pi \cdot -0.5\right)\right) \cdot \left(\pi \cdot 0.25\right)\right)} \]
    13. Add Preprocessing

    Alternative 12: 11.5% accurate, 7.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := u \cdot \left(\pi \cdot -0.5\right)\\ t_1 := \left(u \cdot -0.5\right) \cdot \left(\pi \cdot t\_0\right)\\ -4 \cdot \frac{0.015625 \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right) + t\_0 \cdot t\_1}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(t\_1 - t\_0 \cdot \left(\pi \cdot 0.25\right)\right)} \end{array} \end{array} \]
    (FPCore (u s)
     :precision binary32
     (let* ((t_0 (* u (* PI -0.5))) (t_1 (* (* u -0.5) (* PI t_0))))
       (*
        -4.0
        (/
         (+ (* 0.015625 (* PI (* PI PI))) (* t_0 t_1))
         (+ (* (* PI PI) 0.0625) (- t_1 (* t_0 (* PI 0.25))))))))
    float code(float u, float s) {
    	float t_0 = u * (((float) M_PI) * -0.5f);
    	float t_1 = (u * -0.5f) * (((float) M_PI) * t_0);
    	return -4.0f * (((0.015625f * (((float) M_PI) * (((float) M_PI) * ((float) M_PI)))) + (t_0 * t_1)) / (((((float) M_PI) * ((float) M_PI)) * 0.0625f) + (t_1 - (t_0 * (((float) M_PI) * 0.25f)))));
    }
    
    function code(u, s)
    	t_0 = Float32(u * Float32(Float32(pi) * Float32(-0.5)))
    	t_1 = Float32(Float32(u * Float32(-0.5)) * Float32(Float32(pi) * t_0))
    	return Float32(Float32(-4.0) * Float32(Float32(Float32(Float32(0.015625) * Float32(Float32(pi) * Float32(Float32(pi) * Float32(pi)))) + Float32(t_0 * t_1)) / Float32(Float32(Float32(Float32(pi) * Float32(pi)) * Float32(0.0625)) + Float32(t_1 - Float32(t_0 * Float32(Float32(pi) * Float32(0.25)))))))
    end
    
    function tmp = code(u, s)
    	t_0 = u * (single(pi) * single(-0.5));
    	t_1 = (u * single(-0.5)) * (single(pi) * t_0);
    	tmp = single(-4.0) * (((single(0.015625) * (single(pi) * (single(pi) * single(pi)))) + (t_0 * t_1)) / (((single(pi) * single(pi)) * single(0.0625)) + (t_1 - (t_0 * (single(pi) * single(0.25))))));
    end
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := u \cdot \left(\pi \cdot -0.5\right)\\
    t_1 := \left(u \cdot -0.5\right) \cdot \left(\pi \cdot t\_0\right)\\
    -4 \cdot \frac{0.015625 \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right) + t\_0 \cdot t\_1}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(t\_1 - t\_0 \cdot \left(\pi \cdot 0.25\right)\right)}
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 99.0%

      \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{s}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      4. /-lowering-/.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      5. PI-lowering-PI.f3299.0%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    4. Applied egg-rr99.0%

      \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}} - 1\right) \]
    5. Taylor expanded in s around -inf

      \[\leadsto \color{blue}{-4 \cdot \left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right), \color{blue}{-4}\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) + \left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) \cdot \mathsf{PI}\left(\right)\right), -4\right) \]
      4. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      6. distribute-rgt-out--N/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{-1}{2}\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot u\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      10. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      12. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      13. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right)\right), -4\right) \]
      16. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
      17. PI-lowering-PI.f3212.1%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
    7. Simplified12.1%

      \[\leadsto \color{blue}{\left(\pi \cdot \left(-0.5 \cdot u\right) + \pi \cdot 0.25\right) \cdot -4} \]
    8. Step-by-step derivation
      1. +-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\left({\left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right)}^{3} + {\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right)}^{3}\right), \left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right) + \left(\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) - \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right)\right)\right)\right), -4\right) \]
    9. Applied egg-rr12.1%

      \[\leadsto \color{blue}{\frac{\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot 0.015625 + \left(u \cdot \left(-0.5 \cdot \pi\right)\right) \cdot \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right)\right)}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right) - \left(\pi \cdot 0.25\right) \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right)}} \cdot -4 \]
    10. Final simplification12.1%

      \[\leadsto -4 \cdot \frac{0.015625 \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right) + \left(u \cdot \left(\pi \cdot -0.5\right)\right) \cdot \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(\pi \cdot -0.5\right)\right)\right)\right)}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(\pi \cdot -0.5\right)\right)\right) - \left(u \cdot \left(\pi \cdot -0.5\right)\right) \cdot \left(\pi \cdot 0.25\right)\right)} \]
    11. Add Preprocessing

    Alternative 13: 11.5% accurate, 7.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := u \cdot \left(\pi \cdot -0.5\right)\\ -4 \cdot \frac{0.015625 \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right) + t\_0 \cdot \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot t\_0\right)\right)}{\left(u \cdot u\right) \cdot \left(\frac{\left(\pi \cdot \pi\right) \cdot 0.0625}{u \cdot u} + \left(0.125 \cdot \frac{\pi \cdot \pi}{u} + \left(\pi \cdot \pi\right) \cdot 0.25\right)\right)} \end{array} \end{array} \]
    (FPCore (u s)
     :precision binary32
     (let* ((t_0 (* u (* PI -0.5))))
       (*
        -4.0
        (/
         (+ (* 0.015625 (* PI (* PI PI))) (* t_0 (* (* u -0.5) (* PI t_0))))
         (*
          (* u u)
          (+
           (/ (* (* PI PI) 0.0625) (* u u))
           (+ (* 0.125 (/ (* PI PI) u)) (* (* PI PI) 0.25))))))))
    float code(float u, float s) {
    	float t_0 = u * (((float) M_PI) * -0.5f);
    	return -4.0f * (((0.015625f * (((float) M_PI) * (((float) M_PI) * ((float) M_PI)))) + (t_0 * ((u * -0.5f) * (((float) M_PI) * t_0)))) / ((u * u) * ((((((float) M_PI) * ((float) M_PI)) * 0.0625f) / (u * u)) + ((0.125f * ((((float) M_PI) * ((float) M_PI)) / u)) + ((((float) M_PI) * ((float) M_PI)) * 0.25f)))));
    }
    
    function code(u, s)
    	t_0 = Float32(u * Float32(Float32(pi) * Float32(-0.5)))
    	return Float32(Float32(-4.0) * Float32(Float32(Float32(Float32(0.015625) * Float32(Float32(pi) * Float32(Float32(pi) * Float32(pi)))) + Float32(t_0 * Float32(Float32(u * Float32(-0.5)) * Float32(Float32(pi) * t_0)))) / Float32(Float32(u * u) * Float32(Float32(Float32(Float32(Float32(pi) * Float32(pi)) * Float32(0.0625)) / Float32(u * u)) + Float32(Float32(Float32(0.125) * Float32(Float32(Float32(pi) * Float32(pi)) / u)) + Float32(Float32(Float32(pi) * Float32(pi)) * Float32(0.25)))))))
    end
    
    function tmp = code(u, s)
    	t_0 = u * (single(pi) * single(-0.5));
    	tmp = single(-4.0) * (((single(0.015625) * (single(pi) * (single(pi) * single(pi)))) + (t_0 * ((u * single(-0.5)) * (single(pi) * t_0)))) / ((u * u) * ((((single(pi) * single(pi)) * single(0.0625)) / (u * u)) + ((single(0.125) * ((single(pi) * single(pi)) / u)) + ((single(pi) * single(pi)) * single(0.25))))));
    end
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := u \cdot \left(\pi \cdot -0.5\right)\\
    -4 \cdot \frac{0.015625 \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right) + t\_0 \cdot \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot t\_0\right)\right)}{\left(u \cdot u\right) \cdot \left(\frac{\left(\pi \cdot \pi\right) \cdot 0.0625}{u \cdot u} + \left(0.125 \cdot \frac{\pi \cdot \pi}{u} + \left(\pi \cdot \pi\right) \cdot 0.25\right)\right)}
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 99.0%

      \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{s}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      4. /-lowering-/.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      5. PI-lowering-PI.f3299.0%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    4. Applied egg-rr99.0%

      \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}} - 1\right) \]
    5. Taylor expanded in s around -inf

      \[\leadsto \color{blue}{-4 \cdot \left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right), \color{blue}{-4}\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) + \left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) \cdot \mathsf{PI}\left(\right)\right), -4\right) \]
      4. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      6. distribute-rgt-out--N/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{-1}{2}\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot u\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      10. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      12. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      13. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right)\right), -4\right) \]
      16. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
      17. PI-lowering-PI.f3212.1%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
    7. Simplified12.1%

      \[\leadsto \color{blue}{\left(\pi \cdot \left(-0.5 \cdot u\right) + \pi \cdot 0.25\right) \cdot -4} \]
    8. Step-by-step derivation
      1. +-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\left({\left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right)}^{3} + {\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right)}^{3}\right), \left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right) + \left(\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) - \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right)\right)\right)\right), -4\right) \]
    9. Applied egg-rr12.1%

      \[\leadsto \color{blue}{\frac{\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot 0.015625 + \left(u \cdot \left(-0.5 \cdot \pi\right)\right) \cdot \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right)\right)}{\left(\pi \cdot \pi\right) \cdot 0.0625 + \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right) - \left(\pi \cdot 0.25\right) \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right)}} \cdot -4 \]
    10. Taylor expanded in u around inf

      \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), \color{blue}{\left({u}^{2} \cdot \left(\left(\frac{1}{16} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{{u}^{2}} + \frac{1}{4} \cdot {\mathsf{PI}\left(\right)}^{2}\right) - \frac{-1}{8} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{u}\right)\right)}\right), -4\right) \]
    11. Step-by-step derivation
      1. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\left({u}^{2}\right), \left(\left(\frac{1}{16} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{{u}^{2}} + \frac{1}{4} \cdot {\mathsf{PI}\left(\right)}^{2}\right) - \frac{-1}{8} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{u}\right)\right)\right), -4\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\left(u \cdot u\right), \left(\left(\frac{1}{16} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{{u}^{2}} + \frac{1}{4} \cdot {\mathsf{PI}\left(\right)}^{2}\right) - \frac{-1}{8} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{u}\right)\right)\right), -4\right) \]
      3. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \left(\left(\frac{1}{16} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{{u}^{2}} + \frac{1}{4} \cdot {\mathsf{PI}\left(\right)}^{2}\right) - \frac{-1}{8} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{u}\right)\right)\right), -4\right) \]
      4. cancel-sign-sub-invN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \left(\left(\frac{1}{16} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{{u}^{2}} + \frac{1}{4} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{8} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{u}\right)\right)\right), -4\right) \]
      6. associate-+l+N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \left(\frac{1}{16} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{{u}^{2}} + \left(\frac{1}{4} \cdot {\mathsf{PI}\left(\right)}^{2} + \frac{1}{8} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{u}\right)\right)\right)\right), -4\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \left(\frac{1}{16} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{{u}^{2}} + \left(\frac{1}{8} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{u} + \frac{1}{4} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right), -4\right) \]
      8. +-lowering-+.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{/.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{64}\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, \frac{-1}{2}\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(u, \mathsf{*.f32}\left(\frac{-1}{2}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(u, u\right), \mathsf{+.f32}\left(\left(\frac{1}{16} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{{u}^{2}}\right), \left(\frac{1}{8} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{u} + \frac{1}{4} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right), -4\right) \]
    12. Simplified12.1%

      \[\leadsto \frac{\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot 0.015625 + \left(u \cdot \left(-0.5 \cdot \pi\right)\right) \cdot \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(-0.5 \cdot \pi\right)\right)\right)\right)}{\color{blue}{\left(u \cdot u\right) \cdot \left(\frac{\left(\pi \cdot \pi\right) \cdot 0.0625}{u \cdot u} + \left(0.125 \cdot \frac{\pi \cdot \pi}{u} + 0.25 \cdot \left(\pi \cdot \pi\right)\right)\right)}} \cdot -4 \]
    13. Final simplification12.1%

      \[\leadsto -4 \cdot \frac{0.015625 \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right) + \left(u \cdot \left(\pi \cdot -0.5\right)\right) \cdot \left(\left(u \cdot -0.5\right) \cdot \left(\pi \cdot \left(u \cdot \left(\pi \cdot -0.5\right)\right)\right)\right)}{\left(u \cdot u\right) \cdot \left(\frac{\left(\pi \cdot \pi\right) \cdot 0.0625}{u \cdot u} + \left(0.125 \cdot \frac{\pi \cdot \pi}{u} + \left(\pi \cdot \pi\right) \cdot 0.25\right)\right)} \]
    14. Add Preprocessing

    Alternative 14: 11.5% accurate, 10.1× speedup?

    \[\begin{array}{l} \\ \frac{-4 \cdot \left(\pi \cdot \left(\left(\pi \cdot \pi\right) \cdot 0.015625\right) + \left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\left(u \cdot \left(u \cdot u\right)\right) \cdot -0.125\right)\right)}{\left(\pi \cdot \left(u \cdot -0.5\right)\right) \cdot \left(\pi \cdot \left(u \cdot -0.5 - 0.25\right)\right) + \pi \cdot \left(\pi \cdot 0.0625\right)} \end{array} \]
    (FPCore (u s)
     :precision binary32
     (/
      (*
       -4.0
       (+
        (* PI (* (* PI PI) 0.015625))
        (* (* PI (* PI PI)) (* (* u (* u u)) -0.125))))
      (+ (* (* PI (* u -0.5)) (* PI (- (* u -0.5) 0.25))) (* PI (* PI 0.0625)))))
    float code(float u, float s) {
    	return (-4.0f * ((((float) M_PI) * ((((float) M_PI) * ((float) M_PI)) * 0.015625f)) + ((((float) M_PI) * (((float) M_PI) * ((float) M_PI))) * ((u * (u * u)) * -0.125f)))) / (((((float) M_PI) * (u * -0.5f)) * (((float) M_PI) * ((u * -0.5f) - 0.25f))) + (((float) M_PI) * (((float) M_PI) * 0.0625f)));
    }
    
    function code(u, s)
    	return Float32(Float32(Float32(-4.0) * Float32(Float32(Float32(pi) * Float32(Float32(Float32(pi) * Float32(pi)) * Float32(0.015625))) + Float32(Float32(Float32(pi) * Float32(Float32(pi) * Float32(pi))) * Float32(Float32(u * Float32(u * u)) * Float32(-0.125))))) / Float32(Float32(Float32(Float32(pi) * Float32(u * Float32(-0.5))) * Float32(Float32(pi) * Float32(Float32(u * Float32(-0.5)) - Float32(0.25)))) + Float32(Float32(pi) * Float32(Float32(pi) * Float32(0.0625)))))
    end
    
    function tmp = code(u, s)
    	tmp = (single(-4.0) * ((single(pi) * ((single(pi) * single(pi)) * single(0.015625))) + ((single(pi) * (single(pi) * single(pi))) * ((u * (u * u)) * single(-0.125))))) / (((single(pi) * (u * single(-0.5))) * (single(pi) * ((u * single(-0.5)) - single(0.25)))) + (single(pi) * (single(pi) * single(0.0625))));
    end
    
    \begin{array}{l}
    
    \\
    \frac{-4 \cdot \left(\pi \cdot \left(\left(\pi \cdot \pi\right) \cdot 0.015625\right) + \left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\left(u \cdot \left(u \cdot u\right)\right) \cdot -0.125\right)\right)}{\left(\pi \cdot \left(u \cdot -0.5\right)\right) \cdot \left(\pi \cdot \left(u \cdot -0.5 - 0.25\right)\right) + \pi \cdot \left(\pi \cdot 0.0625\right)}
    \end{array}
    
    Derivation
    1. Initial program 99.0%

      \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{s}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      4. /-lowering-/.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      5. PI-lowering-PI.f3299.0%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    4. Applied egg-rr99.0%

      \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}} - 1\right) \]
    5. Taylor expanded in s around -inf

      \[\leadsto \color{blue}{-4 \cdot \left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right), \color{blue}{-4}\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) + \left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) \cdot \mathsf{PI}\left(\right)\right), -4\right) \]
      4. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      6. distribute-rgt-out--N/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{-1}{2}\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot u\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      10. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      12. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      13. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right)\right), -4\right) \]
      16. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
      17. PI-lowering-PI.f3212.1%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
    7. Simplified12.1%

      \[\leadsto \color{blue}{\left(\pi \cdot \left(-0.5 \cdot u\right) + \pi \cdot 0.25\right) \cdot -4} \]
    8. Step-by-step derivation
      1. add-exp-logN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\left(e^{\log \mathsf{PI}\left(\right)}\right), \frac{1}{4}\right)\right), -4\right) \]
      2. exp-lowering-exp.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{exp.f32}\left(\log \mathsf{PI}\left(\right)\right), \frac{1}{4}\right)\right), -4\right) \]
      3. log-lowering-log.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{exp.f32}\left(\mathsf{log.f32}\left(\mathsf{PI}\left(\right)\right)\right), \frac{1}{4}\right)\right), -4\right) \]
      4. PI-lowering-PI.f3212.1%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{exp.f32}\left(\mathsf{log.f32}\left(\mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{4}\right)\right), -4\right) \]
    9. Applied egg-rr12.1%

      \[\leadsto \left(\pi \cdot \left(-0.5 \cdot u\right) + \color{blue}{e^{\log \pi}} \cdot 0.25\right) \cdot -4 \]
    10. Applied egg-rr12.1%

      \[\leadsto \color{blue}{\frac{\left(\pi \cdot \left(\left(\pi \cdot \pi\right) \cdot 0.015625\right) + \left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\left(u \cdot \left(u \cdot u\right)\right) \cdot -0.125\right)\right) \cdot -4}{\left(\pi \cdot \left(u \cdot -0.5\right)\right) \cdot \left(\pi \cdot \left(u \cdot -0.5 - 0.25\right)\right) + \pi \cdot \left(\pi \cdot 0.0625\right)}} \]
    11. Final simplification12.1%

      \[\leadsto \frac{-4 \cdot \left(\pi \cdot \left(\left(\pi \cdot \pi\right) \cdot 0.015625\right) + \left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\left(u \cdot \left(u \cdot u\right)\right) \cdot -0.125\right)\right)}{\left(\pi \cdot \left(u \cdot -0.5\right)\right) \cdot \left(\pi \cdot \left(u \cdot -0.5 - 0.25\right)\right) + \pi \cdot \left(\pi \cdot 0.0625\right)} \]
    12. Add Preprocessing

    Alternative 15: 11.5% accurate, 48.1× speedup?

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

      \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{s}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      4. /-lowering-/.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      5. PI-lowering-PI.f3299.0%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    4. Applied egg-rr99.0%

      \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}} - 1\right) \]
    5. Taylor expanded in s around -inf

      \[\leadsto \color{blue}{-4 \cdot \left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right), \color{blue}{-4}\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) + \left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) \cdot \mathsf{PI}\left(\right)\right), -4\right) \]
      4. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      6. distribute-rgt-out--N/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{-1}{2}\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot u\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      10. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      12. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      13. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right)\right), -4\right) \]
      16. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
      17. PI-lowering-PI.f3212.1%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
    7. Simplified12.1%

      \[\leadsto \color{blue}{\left(\pi \cdot \left(-0.5 \cdot u\right) + \pi \cdot 0.25\right) \cdot -4} \]
    8. Taylor expanded in u around inf

      \[\leadsto \color{blue}{u \cdot \left(-1 \cdot \frac{\mathsf{PI}\left(\right)}{u} + 2 \cdot \mathsf{PI}\left(\right)\right)} \]
    9. Step-by-step derivation
      1. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(u, \color{blue}{\left(-1 \cdot \frac{\mathsf{PI}\left(\right)}{u} + 2 \cdot \mathsf{PI}\left(\right)\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(u, \left(2 \cdot \mathsf{PI}\left(\right) + \color{blue}{-1 \cdot \frac{\mathsf{PI}\left(\right)}{u}}\right)\right) \]
      3. mul-1-negN/A

        \[\leadsto \mathsf{*.f32}\left(u, \left(2 \cdot \mathsf{PI}\left(\right) + \left(\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{u}\right)\right)\right)\right) \]
      4. unsub-negN/A

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

        \[\leadsto \mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\left(2 \cdot \mathsf{PI}\left(\right)\right), \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{u}\right)}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\left(\mathsf{PI}\left(\right) \cdot 2\right), \left(\frac{\color{blue}{\mathsf{PI}\left(\right)}}{u}\right)\right)\right) \]
      7. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{PI}\left(\right), 2\right), \left(\frac{\color{blue}{\mathsf{PI}\left(\right)}}{u}\right)\right)\right) \]
      8. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), 2\right), \left(\frac{\mathsf{PI}\left(\right)}{u}\right)\right)\right) \]
      9. /-lowering-/.f32N/A

        \[\leadsto \mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), 2\right), \mathsf{/.f32}\left(\mathsf{PI}\left(\right), \color{blue}{u}\right)\right)\right) \]
      10. PI-lowering-PI.f3212.1%

        \[\leadsto \mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), 2\right), \mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), u\right)\right)\right) \]
    10. Simplified12.1%

      \[\leadsto \color{blue}{u \cdot \left(\pi \cdot 2 - \frac{\pi}{u}\right)} \]
    11. Add Preprocessing

    Alternative 16: 11.5% accurate, 61.9× speedup?

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

      \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{s}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      4. /-lowering-/.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      5. PI-lowering-PI.f3299.0%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    4. Applied egg-rr99.0%

      \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}} - 1\right) \]
    5. Taylor expanded in s around -inf

      \[\leadsto \color{blue}{-4 \cdot \left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right), \color{blue}{-4}\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) + \left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) \cdot \mathsf{PI}\left(\right)\right), -4\right) \]
      4. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      6. distribute-rgt-out--N/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{-1}{2}\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot u\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      10. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      12. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      13. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right)\right), -4\right) \]
      16. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
      17. PI-lowering-PI.f3212.1%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
    7. Simplified12.1%

      \[\leadsto \color{blue}{\left(\pi \cdot \left(-0.5 \cdot u\right) + \pi \cdot 0.25\right) \cdot -4} \]
    8. Taylor expanded in u around 0

      \[\leadsto \color{blue}{-1 \cdot \mathsf{PI}\left(\right) + 2 \cdot \left(u \cdot \mathsf{PI}\left(\right)\right)} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto 2 \cdot \left(u \cdot \mathsf{PI}\left(\right)\right) + \color{blue}{-1 \cdot \mathsf{PI}\left(\right)} \]
      2. mul-1-negN/A

        \[\leadsto 2 \cdot \left(u \cdot \mathsf{PI}\left(\right)\right) + \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{\_.f32}\left(\left(2 \cdot \left(u \cdot \mathsf{PI}\left(\right)\right)\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{\_.f32}\left(\mathsf{*.f32}\left(2, \left(u \cdot \mathsf{PI}\left(\right)\right)\right), \mathsf{PI}\left(\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{\_.f32}\left(\mathsf{*.f32}\left(2, \left(\mathsf{PI}\left(\right) \cdot u\right)\right), \mathsf{PI}\left(\right)\right) \]
      7. *-lowering-*.f32N/A

        \[\leadsto \mathsf{\_.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\mathsf{PI}\left(\right), u\right)\right), \mathsf{PI}\left(\right)\right) \]
      8. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{\_.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), u\right)\right), \mathsf{PI}\left(\right)\right) \]
      9. PI-lowering-PI.f3212.1%

        \[\leadsto \mathsf{\_.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), u\right)\right), \mathsf{PI.f32}\left(\right)\right) \]
    10. Simplified12.1%

      \[\leadsto \color{blue}{2 \cdot \left(\pi \cdot u\right) - \pi} \]
    11. Final simplification12.1%

      \[\leadsto 2 \cdot \left(u \cdot \pi\right) - \pi \]
    12. Add Preprocessing

    Alternative 17: 11.5% accurate, 61.9× speedup?

    \[\begin{array}{l} \\ \pi \cdot \left(-1 + u \cdot 2\right) \end{array} \]
    (FPCore (u s) :precision binary32 (* PI (+ -1.0 (* u 2.0))))
    float code(float u, float s) {
    	return ((float) M_PI) * (-1.0f + (u * 2.0f));
    }
    
    function code(u, s)
    	return Float32(Float32(pi) * Float32(Float32(-1.0) + Float32(u * Float32(2.0))))
    end
    
    function tmp = code(u, s)
    	tmp = single(pi) * (single(-1.0) + (u * single(2.0)));
    end
    
    \begin{array}{l}
    
    \\
    \pi \cdot \left(-1 + u \cdot 2\right)
    \end{array}
    
    Derivation
    1. Initial program 99.0%

      \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{s}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      4. /-lowering-/.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      5. PI-lowering-PI.f3299.0%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    4. Applied egg-rr99.0%

      \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}} - 1\right) \]
    5. Taylor expanded in s around -inf

      \[\leadsto \color{blue}{-4 \cdot \left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right), \color{blue}{-4}\right) \]
      3. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{*.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) + \left(\mathsf{neg}\left(\frac{-1}{4}\right)\right) \cdot \mathsf{PI}\left(\right)\right), -4\right) \]
      4. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{4} \cdot \mathsf{PI}\left(\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      6. distribute-rgt-out--N/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{-1}{2}\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(u \cdot \left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\left(\frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot u\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      10. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      12. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      13. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \left(\frac{-1}{2} \cdot u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right), -4\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \left(\mathsf{PI}\left(\right) \cdot \frac{1}{4}\right)\right), -4\right) \]
      16. *-lowering-*.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
      17. PI-lowering-PI.f3212.1%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{4}\right)\right), -4\right) \]
    7. Simplified12.1%

      \[\leadsto \color{blue}{\left(\pi \cdot \left(-0.5 \cdot u\right) + \pi \cdot 0.25\right) \cdot -4} \]
    8. Step-by-step derivation
      1. add-exp-logN/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\left(e^{\log \mathsf{PI}\left(\right)}\right), \frac{1}{4}\right)\right), -4\right) \]
      2. exp-lowering-exp.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{exp.f32}\left(\log \mathsf{PI}\left(\right)\right), \frac{1}{4}\right)\right), -4\right) \]
      3. log-lowering-log.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{exp.f32}\left(\mathsf{log.f32}\left(\mathsf{PI}\left(\right)\right)\right), \frac{1}{4}\right)\right), -4\right) \]
      4. PI-lowering-PI.f3212.1%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(\frac{-1}{2}, u\right)\right), \mathsf{*.f32}\left(\mathsf{exp.f32}\left(\mathsf{log.f32}\left(\mathsf{PI.f32}\left(\right)\right)\right), \frac{1}{4}\right)\right), -4\right) \]
    9. Applied egg-rr12.1%

      \[\leadsto \left(\pi \cdot \left(-0.5 \cdot u\right) + \color{blue}{e^{\log \pi}} \cdot 0.25\right) \cdot -4 \]
    10. Taylor expanded in u around 0

      \[\leadsto \color{blue}{-1 \cdot \mathsf{PI}\left(\right) + 2 \cdot \left(u \cdot \mathsf{PI}\left(\right)\right)} \]
    11. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto -1 \cdot \mathsf{PI}\left(\right) + \left(2 \cdot u\right) \cdot \color{blue}{\mathsf{PI}\left(\right)} \]
      2. distribute-rgt-outN/A

        \[\leadsto \mathsf{PI}\left(\right) \cdot \color{blue}{\left(-1 + 2 \cdot u\right)} \]
      3. *-lowering-*.f32N/A

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \left(\color{blue}{-1} + 2 \cdot u\right)\right) \]
      5. +-lowering-+.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{+.f32}\left(-1, \color{blue}{\left(2 \cdot u\right)}\right)\right) \]
      6. *-lowering-*.f3212.1%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{+.f32}\left(-1, \mathsf{*.f32}\left(2, \color{blue}{u}\right)\right)\right) \]
    12. Simplified12.1%

      \[\leadsto \color{blue}{\pi \cdot \left(-1 + 2 \cdot u\right)} \]
    13. Final simplification12.1%

      \[\leadsto \pi \cdot \left(-1 + u \cdot 2\right) \]
    14. Add Preprocessing

    Alternative 18: 11.3% accurate, 216.5× speedup?

    \[\begin{array}{l} \\ -\pi \end{array} \]
    (FPCore (u s) :precision binary32 (- PI))
    float code(float u, float s) {
    	return -((float) M_PI);
    }
    
    function code(u, s)
    	return Float32(-Float32(pi))
    end
    
    function tmp = code(u, s)
    	tmp = -single(pi);
    end
    
    \begin{array}{l}
    
    \\
    -\pi
    \end{array}
    
    Derivation
    1. Initial program 99.0%

      \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
    2. Add Preprocessing
    3. Taylor expanded in u around 0

      \[\leadsto \color{blue}{-1 \cdot \mathsf{PI}\left(\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\mathsf{PI}\left(\right)\right) \]
      2. neg-lowering-neg.f32N/A

        \[\leadsto \mathsf{neg.f32}\left(\mathsf{PI}\left(\right)\right) \]
      3. PI-lowering-PI.f3212.0%

        \[\leadsto \mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right) \]
    5. Simplified12.0%

      \[\leadsto \color{blue}{-\pi} \]
    6. Add Preprocessing

    Alternative 19: 10.4% accurate, 433.0× speedup?

    \[\begin{array}{l} \\ 0 \end{array} \]
    (FPCore (u s) :precision binary32 0.0)
    float code(float u, float s) {
    	return 0.0f;
    }
    
    real(4) function code(u, s)
        real(4), intent (in) :: u
        real(4), intent (in) :: s
        code = 0.0e0
    end function
    
    function code(u, s)
    	return Float32(0.0)
    end
    
    function tmp = code(u, s)
    	tmp = single(0.0);
    end
    
    \begin{array}{l}
    
    \\
    0
    \end{array}
    
    Derivation
    1. Initial program 99.0%

      \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\left(\frac{1}{s}\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      4. /-lowering-/.f32N/A

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
      5. PI-lowering-PI.f3299.0%

        \[\leadsto \mathsf{*.f32}\left(\mathsf{neg.f32}\left(s\right), \mathsf{log.f32}\left(\mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(\mathsf{*.f32}\left(u, \mathsf{\_.f32}\left(\mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{neg.f32}\left(\mathsf{PI.f32}\left(\right)\right), s\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{/.f32}\left(\mathsf{PI.f32}\left(\right), s\right)\right)\right)\right)\right)\right), \mathsf{/.f32}\left(1, \mathsf{+.f32}\left(1, \mathsf{exp.f32}\left(\mathsf{*.f32}\left(\mathsf{/.f32}\left(1, s\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right)\right), 1\right)\right)\right) \]
    4. Applied egg-rr99.0%

      \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}} - 1\right) \]
    5. Applied egg-rr99.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(s \cdot \log \left(\frac{1}{\frac{1}{2} + \left(\frac{-1}{2} \cdot u + \frac{1}{2} \cdot u\right)} - 1\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(s \cdot \log \left(\frac{1}{\frac{1}{2} + \left(\frac{-1}{2} \cdot u + \frac{1}{2} \cdot u\right)} - 1\right)\right) \]
      2. distribute-rgt-neg-inN/A

        \[\leadsto s \cdot \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{\frac{1}{2} + \left(\frac{-1}{2} \cdot u + \frac{1}{2} \cdot u\right)} - 1\right)\right)\right)} \]
      3. distribute-rgt-outN/A

        \[\leadsto s \cdot \left(\mathsf{neg}\left(\log \left(\frac{1}{\frac{1}{2} + u \cdot \left(\frac{-1}{2} + \frac{1}{2}\right)} - 1\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto s \cdot \left(\mathsf{neg}\left(\log \left(\frac{1}{\frac{1}{2} + u \cdot 0} - 1\right)\right)\right) \]
      5. mul0-rgtN/A

        \[\leadsto s \cdot \left(\mathsf{neg}\left(\log \left(\frac{1}{\frac{1}{2} + 0} - 1\right)\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto s \cdot \left(\mathsf{neg}\left(\log \left(\frac{1}{\frac{1}{2}} - 1\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto s \cdot \left(\mathsf{neg}\left(\log \left(2 - 1\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto s \cdot \left(\mathsf{neg}\left(\log 1\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto s \cdot \left(\mathsf{neg}\left(0\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto s \cdot 0 \]
      11. *-lowering-*.f329.8%

        \[\leadsto \mathsf{*.f32}\left(s, \color{blue}{0}\right) \]
    8. Simplified9.8%

      \[\leadsto \color{blue}{s \cdot 0} \]
    9. Step-by-step derivation
      1. mul0-rgt9.8%

        \[\leadsto 0 \]
    10. Applied egg-rr9.8%

      \[\leadsto \color{blue}{0} \]
    11. Add Preprocessing

    Reproduce

    ?
    herbie shell --seed 2024192 
    (FPCore (u s)
      :name "Sample trimmed logistic on [-pi, pi]"
      :precision binary32
      :pre (and (and (<= 2.328306437e-10 u) (<= u 1.0)) (and (<= 0.0 s) (<= s 1.0651631)))
      (* (- s) (log (- (/ 1.0 (+ (* u (- (/ 1.0 (+ 1.0 (exp (/ (- PI) s)))) (/ 1.0 (+ 1.0 (exp (/ PI s)))))) (/ 1.0 (+ 1.0 (exp (/ PI s)))))) 1.0))))