Sample trimmed logistic on [-pi, pi]

Percentage Accurate: 99.0% → 99.0%
Time: 14.1s
Alternatives: 13
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 13 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, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := 1 + e^{\frac{\pi}{s}}\\
\left(-s\right) \cdot \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + e^{\frac{-\pi}{s}}} + \frac{-1}{t\_0}, \frac{1}{t\_0}\right)}\right)
\end{array}
\end{array}
Derivation
  1. Initial program 98.9%

    \[\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 s around 0

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

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

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

      \[\leadsto \color{blue}{\log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{-1 \cdot \frac{\mathsf{PI}\left(\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) + \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right) \cdot \left(-1 \cdot s\right)} \]
  5. Simplified98.9%

    \[\leadsto \color{blue}{\log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + e^{\frac{\pi}{-s}}} + \frac{-1}{1 + e^{\frac{\pi}{s}}}, \frac{1}{1 + e^{\frac{\pi}{s}}}\right)}\right) \cdot \left(-s\right)} \]
  6. Final simplification98.9%

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

Alternative 2: 37.6% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_0 := 1 + e^{\frac{\pi}{s}}\\
\left(-s\right) \cdot \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{-1}{t\_0} + 0.5, \frac{1}{t\_0}\right)}\right)
\end{array}
\end{array}
Derivation
  1. Initial program 98.9%

    \[\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 s around 0

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

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

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

      \[\leadsto \color{blue}{\log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{-1 \cdot \frac{\mathsf{PI}\left(\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) + \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right) \cdot \left(-1 \cdot s\right)} \]
  5. Simplified98.9%

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

    \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + \color{blue}{1}} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
  7. Step-by-step derivation
    1. Simplified38.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log \left(\frac{1}{u \cdot \left(\frac{1}{2} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) + \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right) \cdot \left(-1 \cdot s\right)} \]
    4. Simplified38.0%

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

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

    Alternative 3: 37.6% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \left(-s\right) \cdot \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, 0.5 + \frac{-1}{1 + \left(1 + \frac{\pi + \frac{\mathsf{fma}\left(0.16666666666666666, \frac{\pi \cdot \left(\pi \cdot \pi\right)}{s}, \pi \cdot \left(\pi \cdot 0.5\right)\right)}{s}}{s}\right)}, \frac{1}{1 + e^{\frac{\pi}{s}}}\right)}\right) \end{array} \]
    (FPCore (u s)
     :precision binary32
     (*
      (- s)
      (log
       (+
        -1.0
        (/
         1.0
         (fma
          u
          (+
           0.5
           (/
            -1.0
            (+
             1.0
             (+
              1.0
              (/
               (+
                PI
                (/
                 (fma 0.16666666666666666 (/ (* PI (* PI PI)) s) (* PI (* PI 0.5)))
                 s))
               s)))))
          (/ 1.0 (+ 1.0 (exp (/ PI s))))))))))
    float code(float u, float s) {
    	return -s * logf((-1.0f + (1.0f / fmaf(u, (0.5f + (-1.0f / (1.0f + (1.0f + ((((float) M_PI) + (fmaf(0.16666666666666666f, ((((float) M_PI) * (((float) M_PI) * ((float) M_PI))) / s), (((float) M_PI) * (((float) M_PI) * 0.5f))) / s)) / s))))), (1.0f / (1.0f + expf((((float) M_PI) / s))))))));
    }
    
    function code(u, s)
    	return Float32(Float32(-s) * log(Float32(Float32(-1.0) + Float32(Float32(1.0) / fma(u, Float32(Float32(0.5) + Float32(Float32(-1.0) / Float32(Float32(1.0) + Float32(Float32(1.0) + Float32(Float32(Float32(pi) + Float32(fma(Float32(0.16666666666666666), Float32(Float32(Float32(pi) * Float32(Float32(pi) * Float32(pi))) / s), Float32(Float32(pi) * Float32(Float32(pi) * Float32(0.5)))) / s)) / s))))), Float32(Float32(1.0) / Float32(Float32(1.0) + exp(Float32(Float32(pi) / s)))))))))
    end
    
    \begin{array}{l}
    
    \\
    \left(-s\right) \cdot \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, 0.5 + \frac{-1}{1 + \left(1 + \frac{\pi + \frac{\mathsf{fma}\left(0.16666666666666666, \frac{\pi \cdot \left(\pi \cdot \pi\right)}{s}, \pi \cdot \left(\pi \cdot 0.5\right)\right)}{s}}{s}\right)}, \frac{1}{1 + e^{\frac{\pi}{s}}}\right)}\right)
    \end{array}
    
    Derivation
    1. Initial program 98.9%

      \[\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 s around 0

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

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

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

        \[\leadsto \color{blue}{\log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{-1 \cdot \frac{\mathsf{PI}\left(\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) + \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right) \cdot \left(-1 \cdot s\right)} \]
    5. Simplified98.9%

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

      \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + \color{blue}{1}} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
    7. Step-by-step derivation
      1. Simplified38.0%

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

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

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

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

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

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

          \[\leadsto \color{blue}{\log \left(\frac{1}{u \cdot \left(\frac{1}{2} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) + \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right) \cdot \left(-1 \cdot s\right)} \]
      4. Simplified38.0%

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

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

          \[\leadsto \log \left(\frac{1}{\mathsf{fma}\left(u, \frac{1}{2} + \frac{-1}{1 + \left(1 + \color{blue}{\left(\mathsf{neg}\left(\frac{-1 \cdot \mathsf{PI}\left(\right) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{s} + \frac{1}{2} \cdot {\mathsf{PI}\left(\right)}^{2}}{s}}{s}\right)\right)}\right)}, \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + -1\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
        2. unsub-negN/A

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

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

          \[\leadsto \log \left(\frac{1}{\mathsf{fma}\left(u, \frac{1}{2} + \frac{-1}{1 + \left(1 - \color{blue}{\frac{-1 \cdot \mathsf{PI}\left(\right) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{s} + \frac{1}{2} \cdot {\mathsf{PI}\left(\right)}^{2}}{s}}{s}}\right)}, \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + -1\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
      7. Simplified38.0%

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

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

      Alternative 4: 37.6% accurate, 1.7× speedup?

      \[\begin{array}{l} \\ \left(-s\right) \cdot \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, 0.5 + \frac{-1}{1 + \left(1 - \frac{\mathsf{fma}\left(-0.5, \frac{\pi \cdot \pi}{s}, -\pi\right)}{s}\right)}, \frac{1}{1 + e^{\frac{\pi}{s}}}\right)}\right) \end{array} \]
      (FPCore (u s)
       :precision binary32
       (*
        (- s)
        (log
         (+
          -1.0
          (/
           1.0
           (fma
            u
            (+ 0.5 (/ -1.0 (+ 1.0 (- 1.0 (/ (fma -0.5 (/ (* PI PI) s) (- PI)) s)))))
            (/ 1.0 (+ 1.0 (exp (/ PI s))))))))))
      float code(float u, float s) {
      	return -s * logf((-1.0f + (1.0f / fmaf(u, (0.5f + (-1.0f / (1.0f + (1.0f - (fmaf(-0.5f, ((((float) M_PI) * ((float) M_PI)) / s), -((float) M_PI)) / s))))), (1.0f / (1.0f + expf((((float) M_PI) / s))))))));
      }
      
      function code(u, s)
      	return Float32(Float32(-s) * log(Float32(Float32(-1.0) + Float32(Float32(1.0) / fma(u, Float32(Float32(0.5) + Float32(Float32(-1.0) / Float32(Float32(1.0) + Float32(Float32(1.0) - Float32(fma(Float32(-0.5), Float32(Float32(Float32(pi) * Float32(pi)) / s), Float32(-Float32(pi))) / s))))), Float32(Float32(1.0) / Float32(Float32(1.0) + exp(Float32(Float32(pi) / s)))))))))
      end
      
      \begin{array}{l}
      
      \\
      \left(-s\right) \cdot \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, 0.5 + \frac{-1}{1 + \left(1 - \frac{\mathsf{fma}\left(-0.5, \frac{\pi \cdot \pi}{s}, -\pi\right)}{s}\right)}, \frac{1}{1 + e^{\frac{\pi}{s}}}\right)}\right)
      \end{array}
      
      Derivation
      1. Initial program 98.9%

        \[\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 s around 0

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

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

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

          \[\leadsto \color{blue}{\log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{-1 \cdot \frac{\mathsf{PI}\left(\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) + \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right) \cdot \left(-1 \cdot s\right)} \]
      5. Simplified98.9%

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

        \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + \color{blue}{1}} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
      7. Step-by-step derivation
        1. Simplified38.0%

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

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

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

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

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

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

            \[\leadsto \color{blue}{\log \left(\frac{1}{u \cdot \left(\frac{1}{2} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) + \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right) \cdot \left(-1 \cdot s\right)} \]
        4. Simplified38.0%

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

          \[\leadsto \log \left(\frac{1}{\mathsf{fma}\left(u, \frac{1}{2} + \frac{-1}{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)}}, \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + -1\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
        6. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \log \left(\frac{1}{\mathsf{fma}\left(u, \frac{1}{2} + \frac{-1}{1 + \left(1 + \color{blue}{\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)}, \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + -1\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
          2. unsub-negN/A

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

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

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

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

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

            \[\leadsto \log \left(\frac{1}{\mathsf{fma}\left(u, \frac{1}{2} + \frac{-1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \color{blue}{\frac{{\mathsf{PI}\left(\right)}^{2}}{s}}, -1 \cdot \mathsf{PI}\left(\right)\right)}{s}\right)}, \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + -1\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
          8. unpow2N/A

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

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

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

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

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

            \[\leadsto \log \left(\frac{1}{\mathsf{fma}\left(u, \frac{1}{2} + \frac{-1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \color{blue}{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}\right)}{s}\right)}, \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + -1\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
          14. lower-PI.f3238.0

            \[\leadsto \log \left(\frac{1}{\mathsf{fma}\left(u, 0.5 + \frac{-1}{1 + \left(1 - \frac{\mathsf{fma}\left(-0.5, \frac{\pi \cdot \pi}{s}, -\color{blue}{\pi}\right)}{s}\right)}, \frac{1}{1 + e^{\frac{\pi}{s}}}\right)} + -1\right) \cdot \left(-s\right) \]
        7. Simplified38.0%

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

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

        Alternative 5: 37.6% accurate, 1.8× speedup?

        \[\begin{array}{l} \\ \left(-s\right) \cdot \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, 0.5 + \frac{-1}{1 + \left(1 + \frac{\pi}{s}\right)}, \frac{1}{1 + e^{\frac{\pi}{s}}}\right)}\right) \end{array} \]
        (FPCore (u s)
         :precision binary32
         (*
          (- s)
          (log
           (+
            -1.0
            (/
             1.0
             (fma
              u
              (+ 0.5 (/ -1.0 (+ 1.0 (+ 1.0 (/ PI s)))))
              (/ 1.0 (+ 1.0 (exp (/ PI s))))))))))
        float code(float u, float s) {
        	return -s * logf((-1.0f + (1.0f / fmaf(u, (0.5f + (-1.0f / (1.0f + (1.0f + (((float) M_PI) / s))))), (1.0f / (1.0f + expf((((float) M_PI) / s))))))));
        }
        
        function code(u, s)
        	return Float32(Float32(-s) * log(Float32(Float32(-1.0) + Float32(Float32(1.0) / fma(u, Float32(Float32(0.5) + Float32(Float32(-1.0) / Float32(Float32(1.0) + Float32(Float32(1.0) + Float32(Float32(pi) / s))))), Float32(Float32(1.0) / Float32(Float32(1.0) + exp(Float32(Float32(pi) / s)))))))))
        end
        
        \begin{array}{l}
        
        \\
        \left(-s\right) \cdot \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, 0.5 + \frac{-1}{1 + \left(1 + \frac{\pi}{s}\right)}, \frac{1}{1 + e^{\frac{\pi}{s}}}\right)}\right)
        \end{array}
        
        Derivation
        1. Initial program 98.9%

          \[\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 s around 0

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

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

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

            \[\leadsto \color{blue}{\log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{-1 \cdot \frac{\mathsf{PI}\left(\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) + \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right) \cdot \left(-1 \cdot s\right)} \]
        5. Simplified98.9%

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

          \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + \color{blue}{1}} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
        7. Step-by-step derivation
          1. Simplified38.0%

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

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

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

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

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

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

              \[\leadsto \color{blue}{\log \left(\frac{1}{u \cdot \left(\frac{1}{2} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) + \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right) \cdot \left(-1 \cdot s\right)} \]
          4. Simplified38.0%

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

            \[\leadsto \log \left(\frac{1}{\mathsf{fma}\left(u, \frac{1}{2} + \frac{-1}{1 + \color{blue}{\left(1 + \frac{\mathsf{PI}\left(\right)}{s}\right)}}, \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + -1\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
          6. Step-by-step derivation
            1. +-commutativeN/A

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

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

              \[\leadsto \log \left(\frac{1}{\mathsf{fma}\left(u, \frac{1}{2} + \frac{-1}{1 + \left(\color{blue}{\frac{\mathsf{PI}\left(\right)}{s}} + 1\right)}, \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + -1\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
            4. lower-PI.f3238.0

              \[\leadsto \log \left(\frac{1}{\mathsf{fma}\left(u, 0.5 + \frac{-1}{1 + \left(\frac{\color{blue}{\pi}}{s} + 1\right)}, \frac{1}{1 + e^{\frac{\pi}{s}}}\right)} + -1\right) \cdot \left(-s\right) \]
          7. Simplified38.0%

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

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

          Alternative 6: 37.1% accurate, 2.0× speedup?

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

            \[\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 s around 0

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

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

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

              \[\leadsto \color{blue}{\log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{-1 \cdot \frac{\mathsf{PI}\left(\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) + \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right) \cdot \left(-1 \cdot s\right)} \]
          5. Simplified98.9%

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

            \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + \color{blue}{1}} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
          7. Step-by-step derivation
            1. Simplified38.0%

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

              \[\leadsto \log \color{blue}{\left(\frac{1}{u \cdot \left(\frac{1}{2} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} - 1\right)} \cdot \left(\mathsf{neg}\left(s\right)\right) \]
            3. Step-by-step derivation
              1. sub-negN/A

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

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

                \[\leadsto \log \color{blue}{\left(\frac{1}{u \cdot \left(\frac{1}{2} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)} + -1\right)} \cdot \left(\mathsf{neg}\left(s\right)\right) \]
            4. Simplified37.7%

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

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

            Alternative 7: 36.8% accurate, 2.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 + \left(1 - \frac{\mathsf{fma}\left(-0.5, \frac{\pi \cdot \pi}{s}, -\pi\right)}{s}\right)\\ \left(-s\right) \cdot \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{-1}{t\_0} + \frac{1}{1 + 1}, \frac{1}{t\_0}\right)}\right) \end{array} \end{array} \]
            (FPCore (u s)
             :precision binary32
             (let* ((t_0 (+ 1.0 (- 1.0 (/ (fma -0.5 (/ (* PI PI) s) (- PI)) s)))))
               (*
                (- s)
                (log
                 (+
                  -1.0
                  (/ 1.0 (fma u (+ (/ -1.0 t_0) (/ 1.0 (+ 1.0 1.0))) (/ 1.0 t_0))))))))
            float code(float u, float s) {
            	float t_0 = 1.0f + (1.0f - (fmaf(-0.5f, ((((float) M_PI) * ((float) M_PI)) / s), -((float) M_PI)) / s));
            	return -s * logf((-1.0f + (1.0f / fmaf(u, ((-1.0f / t_0) + (1.0f / (1.0f + 1.0f))), (1.0f / t_0)))));
            }
            
            function code(u, s)
            	t_0 = Float32(Float32(1.0) + Float32(Float32(1.0) - Float32(fma(Float32(-0.5), Float32(Float32(Float32(pi) * Float32(pi)) / s), Float32(-Float32(pi))) / s)))
            	return Float32(Float32(-s) * log(Float32(Float32(-1.0) + Float32(Float32(1.0) / fma(u, Float32(Float32(Float32(-1.0) / t_0) + Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(1.0)))), Float32(Float32(1.0) / t_0))))))
            end
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := 1 + \left(1 - \frac{\mathsf{fma}\left(-0.5, \frac{\pi \cdot \pi}{s}, -\pi\right)}{s}\right)\\
            \left(-s\right) \cdot \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{-1}{t\_0} + \frac{1}{1 + 1}, \frac{1}{t\_0}\right)}\right)
            \end{array}
            \end{array}
            
            Derivation
            1. Initial program 98.9%

              \[\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 s around 0

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

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

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

                \[\leadsto \color{blue}{\log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{-1 \cdot \frac{\mathsf{PI}\left(\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) + \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right) \cdot \left(-1 \cdot s\right)} \]
            5. Simplified98.9%

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

              \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + \color{blue}{1}} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
            7. Step-by-step derivation
              1. Simplified38.0%

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

                \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, \frac{1}{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) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
              3. Step-by-step derivation
                1. mul-1-negN/A

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, \frac{1}{1 + \left(1 + \color{blue}{\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) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                2. unsub-negN/A

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

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

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

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

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

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \color{blue}{\frac{{\mathsf{PI}\left(\right)}^{2}}{s}}, -1 \cdot \mathsf{PI}\left(\right)\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                8. unpow2N/A

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

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

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

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

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

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \color{blue}{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                14. lower-PI.f3237.5

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + e^{\frac{\pi}{s}}}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(-0.5, \frac{\pi \cdot \pi}{s}, -\color{blue}{\pi}\right)}{s}\right)}\right)}\right) \cdot \left(-s\right) \]
              4. Simplified37.5%

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

                \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{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)}}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
              6. Step-by-step derivation
                1. mul-1-negN/A

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \left(1 + \color{blue}{\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)}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                2. unsub-negN/A

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \color{blue}{\left(1 - \frac{-1 \cdot \mathsf{PI}\left(\right) + \frac{-1}{2} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{s}}{s}\right)}}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                3. lower--.f32N/A

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

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

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \left(1 - \frac{\color{blue}{\frac{-1}{2} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{s} + -1 \cdot \mathsf{PI}\left(\right)}}{s}\right)}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                6. lower-fma.f32N/A

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \left(1 - \frac{\color{blue}{\mathsf{fma}\left(\frac{-1}{2}, \frac{{\mathsf{PI}\left(\right)}^{2}}{s}, -1 \cdot \mathsf{PI}\left(\right)\right)}}{s}\right)}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                7. lower-/.f32N/A

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \color{blue}{\frac{{\mathsf{PI}\left(\right)}^{2}}{s}}, -1 \cdot \mathsf{PI}\left(\right)\right)}{s}\right)}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                8. unpow2N/A

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}}{s}, -1 \cdot \mathsf{PI}\left(\right)\right)}{s}\right)}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                9. lower-*.f32N/A

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}}{s}, -1 \cdot \mathsf{PI}\left(\right)\right)}{s}\right)}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                10. lower-PI.f32N/A

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)}{s}, -1 \cdot \mathsf{PI}\left(\right)\right)}{s}\right)}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                11. lower-PI.f32N/A

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}}{s}, -1 \cdot \mathsf{PI}\left(\right)\right)}{s}\right)}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                12. mul-1-negN/A

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \color{blue}{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}\right)}{s}\right)}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                13. lower-neg.f32N/A

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \color{blue}{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}\right)}{s}\right)}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                14. lower-PI.f3237.5

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \left(1 - \frac{\mathsf{fma}\left(-0.5, \frac{\pi \cdot \pi}{s}, -\color{blue}{\pi}\right)}{s}\right)}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(-0.5, \frac{\pi \cdot \pi}{s}, -\pi\right)}{s}\right)}\right)}\right) \cdot \left(-s\right) \]
              7. Simplified37.5%

                \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \color{blue}{\left(1 - \frac{\mathsf{fma}\left(-0.5, \frac{\pi \cdot \pi}{s}, -\pi\right)}{s}\right)}}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(-0.5, \frac{\pi \cdot \pi}{s}, -\pi\right)}{s}\right)}\right)}\right) \cdot \left(-s\right) \]
              8. Final simplification37.5%

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

              Alternative 8: 36.8% accurate, 2.3× speedup?

              \[\begin{array}{l} \\ \left(-s\right) \cdot \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{-1}{1 + \left(1 + \frac{\pi}{s}\right)} + \frac{1}{1 + 1}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(-0.5, \frac{\pi \cdot \pi}{s}, -\pi\right)}{s}\right)}\right)}\right) \end{array} \]
              (FPCore (u s)
               :precision binary32
               (*
                (- s)
                (log
                 (+
                  -1.0
                  (/
                   1.0
                   (fma
                    u
                    (+ (/ -1.0 (+ 1.0 (+ 1.0 (/ PI s)))) (/ 1.0 (+ 1.0 1.0)))
                    (/ 1.0 (+ 1.0 (- 1.0 (/ (fma -0.5 (/ (* PI PI) s) (- PI)) s))))))))))
              float code(float u, float s) {
              	return -s * logf((-1.0f + (1.0f / fmaf(u, ((-1.0f / (1.0f + (1.0f + (((float) M_PI) / s)))) + (1.0f / (1.0f + 1.0f))), (1.0f / (1.0f + (1.0f - (fmaf(-0.5f, ((((float) M_PI) * ((float) M_PI)) / s), -((float) M_PI)) / s))))))));
              }
              
              function code(u, s)
              	return Float32(Float32(-s) * log(Float32(Float32(-1.0) + Float32(Float32(1.0) / fma(u, Float32(Float32(Float32(-1.0) / Float32(Float32(1.0) + Float32(Float32(1.0) + Float32(Float32(pi) / s)))) + Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(1.0)))), Float32(Float32(1.0) / Float32(Float32(1.0) + Float32(Float32(1.0) - Float32(fma(Float32(-0.5), Float32(Float32(Float32(pi) * Float32(pi)) / s), Float32(-Float32(pi))) / s)))))))))
              end
              
              \begin{array}{l}
              
              \\
              \left(-s\right) \cdot \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{-1}{1 + \left(1 + \frac{\pi}{s}\right)} + \frac{1}{1 + 1}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(-0.5, \frac{\pi \cdot \pi}{s}, -\pi\right)}{s}\right)}\right)}\right)
              \end{array}
              
              Derivation
              1. Initial program 98.9%

                \[\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 s around 0

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

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

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

                  \[\leadsto \color{blue}{\log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{-1 \cdot \frac{\mathsf{PI}\left(\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) + \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right) \cdot \left(-1 \cdot s\right)} \]
              5. Simplified98.9%

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

                \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + \color{blue}{1}} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
              7. Step-by-step derivation
                1. Simplified38.0%

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

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, \frac{1}{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) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                3. Step-by-step derivation
                  1. mul-1-negN/A

                    \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, \frac{1}{1 + \left(1 + \color{blue}{\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) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                  2. unsub-negN/A

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

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

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

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

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

                    \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \color{blue}{\frac{{\mathsf{PI}\left(\right)}^{2}}{s}}, -1 \cdot \mathsf{PI}\left(\right)\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                  8. unpow2N/A

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

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

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

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

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

                    \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \color{blue}{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                  14. lower-PI.f3237.5

                    \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + e^{\frac{\pi}{s}}}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(-0.5, \frac{\pi \cdot \pi}{s}, -\color{blue}{\pi}\right)}{s}\right)}\right)}\right) \cdot \left(-s\right) \]
                4. Simplified37.5%

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

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

                    \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{s} + 1\right)}}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                  2. lower-+.f32N/A

                    \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{s} + 1\right)}}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                  3. lower-/.f32N/A

                    \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \left(\color{blue}{\frac{\mathsf{PI}\left(\right)}{s}} + 1\right)}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}{s}, \mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)}{s}\right)}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                  4. lower-PI.f3237.5

                    \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \left(\frac{\color{blue}{\pi}}{s} + 1\right)}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(-0.5, \frac{\pi \cdot \pi}{s}, -\pi\right)}{s}\right)}\right)}\right) \cdot \left(-s\right) \]
                7. Simplified37.5%

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + 1} + \frac{-1}{1 + \color{blue}{\left(\frac{\pi}{s} + 1\right)}}, \frac{1}{1 + \left(1 - \frac{\mathsf{fma}\left(-0.5, \frac{\pi \cdot \pi}{s}, -\pi\right)}{s}\right)}\right)}\right) \cdot \left(-s\right) \]
                8. Final simplification37.5%

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

                Alternative 9: 25.2% accurate, 3.9× speedup?

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

                  \[\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 s around 0

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

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

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

                    \[\leadsto \color{blue}{\log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{-1 \cdot \frac{\mathsf{PI}\left(\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) + \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right) \cdot \left(-1 \cdot s\right)} \]
                5. Simplified98.9%

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

                  \[\leadsto \log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + \color{blue}{1}} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                7. Step-by-step derivation
                  1. Simplified38.0%

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\log \left(\frac{1}{u \cdot \left(\frac{1}{2} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) + \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right) \cdot \left(-1 \cdot s\right)} \]
                  4. Simplified38.0%

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

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

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

                      \[\leadsto \log \left(1 + \color{blue}{\frac{-4 \cdot \left(\frac{1}{4} \cdot \left(u \cdot \mathsf{PI}\left(\right)\right) - \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)}{s}}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                    3. distribute-lft-out--N/A

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

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

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

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

                      \[\leadsto \log \left(1 + \color{blue}{\left(\mathsf{neg}\left(\frac{u \cdot \mathsf{PI}\left(\right) - \mathsf{PI}\left(\right)}{s}\right)\right)}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                    8. distribute-neg-frac2N/A

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

                      \[\leadsto \log \left(1 + \frac{u \cdot \mathsf{PI}\left(\right) - \mathsf{PI}\left(\right)}{\color{blue}{-1 \cdot s}}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                    10. lower-/.f32N/A

                      \[\leadsto \log \left(1 + \color{blue}{\frac{u \cdot \mathsf{PI}\left(\right) - \mathsf{PI}\left(\right)}{-1 \cdot s}}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                    11. sub-negN/A

                      \[\leadsto \log \left(1 + \frac{\color{blue}{u \cdot \mathsf{PI}\left(\right) + \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)}}{-1 \cdot s}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                    12. *-commutativeN/A

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

                      \[\leadsto \log \left(1 + \frac{\mathsf{PI}\left(\right) \cdot u + \color{blue}{-1 \cdot \mathsf{PI}\left(\right)}}{-1 \cdot s}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                    14. lower-fma.f32N/A

                      \[\leadsto \log \left(1 + \frac{\color{blue}{\mathsf{fma}\left(\mathsf{PI}\left(\right), u, -1 \cdot \mathsf{PI}\left(\right)\right)}}{-1 \cdot s}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                    15. lower-PI.f32N/A

                      \[\leadsto \log \left(1 + \frac{\mathsf{fma}\left(\color{blue}{\mathsf{PI}\left(\right)}, u, -1 \cdot \mathsf{PI}\left(\right)\right)}{-1 \cdot s}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                    16. mul-1-negN/A

                      \[\leadsto \log \left(1 + \frac{\mathsf{fma}\left(\mathsf{PI}\left(\right), u, \color{blue}{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}\right)}{-1 \cdot s}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                    17. lower-neg.f32N/A

                      \[\leadsto \log \left(1 + \frac{\mathsf{fma}\left(\mathsf{PI}\left(\right), u, \color{blue}{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)}\right)}{-1 \cdot s}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                    18. lower-PI.f32N/A

                      \[\leadsto \log \left(1 + \frac{\mathsf{fma}\left(\mathsf{PI}\left(\right), u, \mathsf{neg}\left(\color{blue}{\mathsf{PI}\left(\right)}\right)\right)}{-1 \cdot s}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                    19. mul-1-negN/A

                      \[\leadsto \log \left(1 + \frac{\mathsf{fma}\left(\mathsf{PI}\left(\right), u, \mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)}{\color{blue}{\mathsf{neg}\left(s\right)}}\right) \cdot \left(\mathsf{neg}\left(s\right)\right) \]
                    20. lower-neg.f3225.2

                      \[\leadsto \log \left(1 + \frac{\mathsf{fma}\left(\pi, u, -\pi\right)}{\color{blue}{-s}}\right) \cdot \left(-s\right) \]
                  7. Simplified25.2%

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

                    \[\leadsto \left(-s\right) \cdot \log \left(1 - \frac{\mathsf{fma}\left(\pi, u, -\pi\right)}{s}\right) \]
                  9. Add Preprocessing

                  Alternative 10: 11.6% accurate, 17.0× speedup?

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

                    \[\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 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)} \]
                  4. Step-by-step derivation
                    1. lower-*.f32N/A

                      \[\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)} \]
                    2. cancel-sign-sub-invN/A

                      \[\leadsto 4 \cdot \color{blue}{\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)} \]
                    3. metadata-evalN/A

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

                      \[\leadsto 4 \cdot \left(\color{blue}{\left(\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right) \cdot u} + \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right) \]
                    5. distribute-rgt-out--N/A

                      \[\leadsto 4 \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{4} - \frac{-1}{4}\right)\right)} \cdot u + \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right) \]
                    6. metadata-evalN/A

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

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

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

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

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

                      \[\leadsto 4 \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{1}{2} \cdot u + \frac{-1}{4}\right)\right) \]
                    12. lower-fma.f3211.3

                      \[\leadsto 4 \cdot \left(\pi \cdot \color{blue}{\mathsf{fma}\left(0.5, u, -0.25\right)}\right) \]
                  5. Simplified11.3%

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

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

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

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

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

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

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

                      \[\leadsto \left(\color{blue}{\mathsf{PI}\left(\right) \cdot -2} + \frac{\mathsf{PI}\left(\right)}{u}\right) \cdot \left(-1 \cdot u\right) \]
                    7. lower-fma.f32N/A

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{PI}\left(\right), -2, \frac{\mathsf{PI}\left(\right)}{u}\right)} \cdot \left(-1 \cdot u\right) \]
                    8. lower-PI.f32N/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{PI}\left(\right)}, -2, \frac{\mathsf{PI}\left(\right)}{u}\right) \cdot \left(-1 \cdot u\right) \]
                    9. lower-/.f32N/A

                      \[\leadsto \mathsf{fma}\left(\mathsf{PI}\left(\right), -2, \color{blue}{\frac{\mathsf{PI}\left(\right)}{u}}\right) \cdot \left(-1 \cdot u\right) \]
                    10. lower-PI.f32N/A

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

                      \[\leadsto \mathsf{fma}\left(\mathsf{PI}\left(\right), -2, \frac{\mathsf{PI}\left(\right)}{u}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(u\right)\right)} \]
                    12. lower-neg.f3211.3

                      \[\leadsto \mathsf{fma}\left(\pi, -2, \frac{\pi}{u}\right) \cdot \color{blue}{\left(-u\right)} \]
                  8. Simplified11.3%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\pi, -2, \frac{\pi}{u}\right) \cdot \left(-u\right)} \]
                  9. Taylor expanded in u around 0

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

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

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

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

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

                      \[\leadsto \frac{\color{blue}{\left(\mathsf{PI}\left(\right) \cdot -2\right)} \cdot u + \mathsf{PI}\left(\right)}{u} \cdot \left(\mathsf{neg}\left(u\right)\right) \]
                    6. associate-*l*N/A

                      \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \left(-2 \cdot u\right)} + \mathsf{PI}\left(\right)}{u} \cdot \left(\mathsf{neg}\left(u\right)\right) \]
                    7. lower-fma.f32N/A

                      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{PI}\left(\right), -2 \cdot u, \mathsf{PI}\left(\right)\right)}}{u} \cdot \left(\mathsf{neg}\left(u\right)\right) \]
                    8. lower-PI.f32N/A

                      \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\mathsf{PI}\left(\right)}, -2 \cdot u, \mathsf{PI}\left(\right)\right)}{u} \cdot \left(\mathsf{neg}\left(u\right)\right) \]
                    9. lower-*.f32N/A

                      \[\leadsto \frac{\mathsf{fma}\left(\mathsf{PI}\left(\right), \color{blue}{-2 \cdot u}, \mathsf{PI}\left(\right)\right)}{u} \cdot \left(\mathsf{neg}\left(u\right)\right) \]
                    10. lower-PI.f3211.3

                      \[\leadsto \frac{\mathsf{fma}\left(\pi, -2 \cdot u, \color{blue}{\pi}\right)}{u} \cdot \left(-u\right) \]
                  11. Simplified11.3%

                    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\pi, -2 \cdot u, \pi\right)}{u}} \cdot \left(-u\right) \]
                  12. Final simplification11.3%

                    \[\leadsto u \cdot \frac{\mathsf{fma}\left(\pi, u \cdot -2, \pi\right)}{-u} \]
                  13. Add Preprocessing

                  Alternative 11: 11.6% accurate, 23.2× speedup?

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

                    \[\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 s around 0

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

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

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

                      \[\leadsto \color{blue}{\log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{-1 \cdot \frac{\mathsf{PI}\left(\right)}{s}}} - \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}\right) + \frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}} - 1\right) \cdot \left(-1 \cdot s\right)} \]
                  5. Simplified98.9%

                    \[\leadsto \color{blue}{\log \left(-1 + \frac{1}{\mathsf{fma}\left(u, \frac{1}{1 + e^{\frac{\pi}{-s}}} + \frac{-1}{1 + e^{\frac{\pi}{s}}}, \frac{1}{1 + e^{\frac{\pi}{s}}}\right)}\right) \cdot \left(-s\right)} \]
                  6. 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)} \]
                  7. Step-by-step derivation
                    1. lower-*.f32N/A

                      \[\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)} \]
                    2. cancel-sign-sub-invN/A

                      \[\leadsto 4 \cdot \color{blue}{\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)} \]
                    3. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

                      \[\leadsto 4 \cdot \mathsf{fma}\left(u, \mathsf{PI}\left(\right) \cdot \frac{1}{2}, \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{-1}{4}}\right) \]
                    13. lower-PI.f3211.3

                      \[\leadsto 4 \cdot \mathsf{fma}\left(u, \pi \cdot 0.5, \color{blue}{\pi} \cdot -0.25\right) \]
                  8. Simplified11.3%

                    \[\leadsto \color{blue}{4 \cdot \mathsf{fma}\left(u, \pi \cdot 0.5, \pi \cdot -0.25\right)} \]
                  9. Add Preprocessing

                  Alternative 12: 11.6% accurate, 42.5× speedup?

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

                    \[\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 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)} \]
                  4. Step-by-step derivation
                    1. lower-*.f32N/A

                      \[\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)} \]
                    2. cancel-sign-sub-invN/A

                      \[\leadsto 4 \cdot \color{blue}{\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)} \]
                    3. metadata-evalN/A

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

                      \[\leadsto 4 \cdot \left(\color{blue}{\left(\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right) \cdot u} + \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right) \]
                    5. distribute-rgt-out--N/A

                      \[\leadsto 4 \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\frac{1}{4} - \frac{-1}{4}\right)\right)} \cdot u + \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right) \]
                    6. metadata-evalN/A

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

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

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

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

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

                      \[\leadsto 4 \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{1}{2} \cdot u + \frac{-1}{4}\right)\right) \]
                    12. lower-fma.f3211.3

                      \[\leadsto 4 \cdot \left(\pi \cdot \color{blue}{\mathsf{fma}\left(0.5, u, -0.25\right)}\right) \]
                  5. Simplified11.3%

                    \[\leadsto \color{blue}{4 \cdot \left(\pi \cdot \mathsf{fma}\left(0.5, u, -0.25\right)\right)} \]
                  6. 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)} \]
                  7. Step-by-step derivation
                    1. +-commutativeN/A

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{PI}\left(\right)} \cdot \left(2 \cdot u + -1\right) \]
                    6. lower-fma.f3211.3

                      \[\leadsto \pi \cdot \color{blue}{\mathsf{fma}\left(2, u, -1\right)} \]
                  8. Simplified11.3%

                    \[\leadsto \color{blue}{\pi \cdot \mathsf{fma}\left(2, u, -1\right)} \]
                  9. Add Preprocessing

                  Alternative 13: 11.4% accurate, 170.0× 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 98.9%

                    \[\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 \color{blue}{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)} \]
                    2. lower-neg.f32N/A

                      \[\leadsto \color{blue}{\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)} \]
                    3. lower-PI.f3211.3

                      \[\leadsto -\color{blue}{\pi} \]
                  5. Simplified11.3%

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

                  Reproduce

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