Sample trimmed logistic on [-pi, pi]

Percentage Accurate: 98.9% → 98.9%
Time: 16.4s
Alternatives: 10
Speedup: N/A×

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 10 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: 98.9% 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: 98.9% accurate, 1.0× speedup?

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

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

    \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. Applied egg-rr99.0%

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(s\right)\right) \cdot \log \left(\frac{1}{\mathsf{fma}\left(\frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, u, \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \mathsf{PI}\left(\right)}}}\right)} - 1\right) \]
      5. lift-*.f3299.0

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

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

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

    Alternative 2: 98.9% 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(\frac{1}{1 + e^{\frac{\pi}{-s}}} + \frac{-1}{t\_0}, u, \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
            (+ (/ 1.0 (+ 1.0 (exp (/ PI (- s))))) (/ -1.0 t_0))
            u
            (/ 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(((1.0f / (1.0f + expf((((float) M_PI) / -s)))) + (-1.0f / t_0)), u, (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(Float32(Float32(Float32(1.0) / Float32(Float32(1.0) + exp(Float32(Float32(pi) / Float32(-s))))) + Float32(Float32(-1.0) / t_0)), u, 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(\frac{1}{1 + e^{\frac{\pi}{-s}}} + \frac{-1}{t\_0}, u, \frac{1}{t\_0}\right)}\right)
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 99.0%

      \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. Applied egg-rr99.0%

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

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

      Alternative 3: 97.6% accurate, 1.3× speedup?

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

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

        \[\leadsto \left(\mathsf{neg}\left(s\right)\right) \cdot \log \left(\frac{1}{\color{blue}{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)}} - 1\right) \]
      4. Step-by-step derivation
        1. lower-*.f32N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 4: 24.8% accurate, 3.6× speedup?

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

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

        \[\leadsto \left(\mathsf{neg}\left(s\right)\right) \cdot \log \color{blue}{\left(1 + 4 \cdot \frac{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)}{s}\right)} \]
      4. Step-by-step derivation
        1. associate-*r/N/A

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

          \[\leadsto \left(\mathsf{neg}\left(s\right)\right) \cdot \log \color{blue}{\left(\frac{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)}{s} + 1\right)} \]
        3. *-commutativeN/A

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

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

          \[\leadsto \left(\mathsf{neg}\left(s\right)\right) \cdot \log \color{blue}{\left(\mathsf{fma}\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), \frac{4}{s}, 1\right)\right)} \]
      5. Simplified24.3%

        \[\leadsto \left(-s\right) \cdot \log \color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), \frac{4}{s}, 1\right)\right)} \]
      6. Final simplification24.3%

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

      Alternative 5: 13.2% accurate, 5.3× speedup?

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

        \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
      2. Add Preprocessing
      3. 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) + \frac{-1}{2} \cdot \frac{-16 \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} + -2 \cdot \left(-8 \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} + -4 \cdot \left(\frac{-1}{8} \cdot {\mathsf{PI}\left(\right)}^{2} + \frac{1}{8} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)}{s}} \]
      4. Simplified8.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -4\right)} \]
      5. Step-by-step derivation
        1. add-log-expN/A

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\log \left(e^{\mathsf{PI}\left(\right)}\right)}, \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -4\right) \]
        2. *-un-lft-identityN/A

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

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\log \left(e^{1 \cdot \color{blue}{\mathsf{PI}\left(\right)}}\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -4\right) \]
        4. exp-prodN/A

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right) \cdot \color{blue}{\log \left(e^{1}\right)}, \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -4\right) \]
        8. exp-1-eN/A

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right) \cdot \log \color{blue}{\mathsf{E}\left(\right)}, \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -4\right) \]
        9. lower-E.f326.9

          \[\leadsto \mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\pi \cdot \log \color{blue}{e}, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -4\right) \]
      6. Applied egg-rr6.9%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\pi \cdot \log e}, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -4\right) \]
      7. Taylor expanded in s around 0

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(s \cdot \left(\frac{-1}{2} \cdot \left(u \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right) + \frac{-1}{2} \cdot \left(-16 \cdot {\left(\frac{-1}{2} \cdot \left(u \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)}^{2} + 16 \cdot \left(\left(\frac{-1}{2} \cdot \left(u \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\frac{-1}{2} \cdot \left(u \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{4} \cdot \left(\mathsf{PI}\left(\right) \cdot \log \mathsf{E}\left(\right)\right)\right)\right)\right)}{s}} \]
      8. Simplified13.3%

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

      Alternative 6: 11.5% accurate, 15.0× speedup?

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

        \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
      2. Add Preprocessing
      3. Taylor expanded in 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) + \frac{-1}{2} \cdot \frac{-16 \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} + -2 \cdot \left(-8 \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} + -4 \cdot \left(\frac{-1}{8} \cdot {\mathsf{PI}\left(\right)}^{2} + \frac{1}{8} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)}{s}} \]
      4. Simplified8.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -4\right)} \]
      5. Step-by-step derivation
        1. lift-PI.f32N/A

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \left(\frac{-1}{2} \cdot u\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot -4\right) \]
        5. add-sqr-sqrtN/A

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \left(\frac{-1}{2} \cdot u\right) \cdot \color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right) \cdot -4\right) \]
        6. associate-*r*N/A

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \left(\left(u \cdot \frac{-1}{2}\right) \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot -4\right) \]
        14. lift-PI.f32N/A

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \left(\left(u \cdot \frac{-1}{2}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}\right) \cdot -4\right) \]
        15. lower-sqrt.f328.7

          \[\leadsto \mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\pi, 0.25, \left(\left(u \cdot -0.5\right) \cdot \sqrt{\pi}\right) \cdot \color{blue}{\sqrt{\pi}}\right) \cdot -4\right) \]
      6. Applied egg-rr8.7%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\pi, 0.25, \color{blue}{\left(\left(u \cdot -0.5\right) \cdot \sqrt{\pi}\right) \cdot \sqrt{\pi}}\right) \cdot -4\right) \]
      7. Taylor expanded in s around 0

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

          \[\leadsto \color{blue}{\frac{-4 \cdot \left(s \cdot \left(\frac{-1}{2} \cdot \left(u \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right) + \frac{-1}{2} \cdot \left(-16 \cdot {\left(\frac{-1}{2} \cdot \left(u \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)}^{2} + 16 \cdot {\left(\frac{-1}{2} \cdot \left(u \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)}^{2}\right)}{s}} \]
      9. Simplified11.6%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-4 \cdot s, \pi \cdot \mathsf{fma}\left(-0.5, u, 0.25\right), 0\right)}{s}} \]
      10. Final simplification11.6%

        \[\leadsto \frac{\mathsf{fma}\left(s \cdot -4, \pi \cdot \mathsf{fma}\left(-0.5, u, 0.25\right), 0\right)}{s} \]
      11. Add Preprocessing

      Alternative 7: 11.5% accurate, 30.0× speedup?

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

        \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
      2. Add Preprocessing
      3. Taylor expanded in 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) + \frac{-1}{2} \cdot \frac{-16 \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} + -2 \cdot \left(-8 \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} + -4 \cdot \left(\frac{-1}{8} \cdot {\mathsf{PI}\left(\right)}^{2} + \frac{1}{8} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)}{s}} \]
      4. Simplified8.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -4\right)} \]
      5. Step-by-step derivation
        1. add-log-expN/A

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\log \left(e^{\mathsf{PI}\left(\right)}\right)}, \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -4\right) \]
        2. *-un-lft-identityN/A

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

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\log \left(e^{1 \cdot \color{blue}{\mathsf{PI}\left(\right)}}\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -4\right) \]
        4. exp-prodN/A

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right) \cdot \color{blue}{\log \left(e^{1}\right)}, \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -4\right) \]
        8. exp-1-eN/A

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{PI}\left(\right) \cdot \log \color{blue}{\mathsf{E}\left(\right)}, \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -4\right) \]
        9. lower-E.f326.9

          \[\leadsto \mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\pi \cdot \log \color{blue}{e}, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -4\right) \]
      6. Applied egg-rr6.9%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\pi \cdot \log e}, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -4\right) \]
      7. Taylor expanded in u around -inf

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, \color{blue}{{u}^{2} \cdot \left(-4 \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{s} + \left(-1 \cdot \frac{-4 \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{s} + 16 \cdot \frac{\frac{1}{8} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \log \mathsf{E}\left(\right)\right) + \frac{1}{8} \cdot {\mathsf{PI}\left(\right)}^{2}}{s}}{u} + 4 \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{s}\right)\right)}, \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{4}, \mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u\right)\right) \cdot -4\right) \]
      8. Simplified9.0%

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

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

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

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

          \[\leadsto -4 \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{2} \cdot u + \frac{1}{4}\right)\right)} \]
        4. 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)} \]
        5. 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) \]
        6. lower-fma.f3211.6

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

        \[\leadsto \color{blue}{-4 \cdot \left(\pi \cdot \mathsf{fma}\left(-0.5, u, 0.25\right)\right)} \]
      12. Final simplification11.6%

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

      Alternative 8: 11.5% accurate, 36.4× speedup?

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

        \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. Applied egg-rr99.0%

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

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

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

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

            \[\leadsto \left(\mathsf{neg}\left(s\right)\right) \cdot \log \left(\frac{1}{\mathsf{fma}\left(\frac{1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{\mathsf{neg}\left(s\right)}}} + \frac{-1}{1 + e^{\frac{\mathsf{PI}\left(\right)}{s}}}, u, \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \mathsf{PI}\left(\right)}}}\right)} - 1\right) \]
          5. lift-*.f3299.0

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

          \[\leadsto \left(-s\right) \cdot \log \left(\frac{1}{\mathsf{fma}\left(\frac{1}{1 + e^{\frac{\pi}{-s}}} + \frac{-1}{1 + e^{\frac{\pi}{s}}}, u, \frac{1}{1 + e^{\color{blue}{\frac{1}{s} \cdot \pi}}}\right)} - 1\right) \]
        4. 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)} \]
        5. Step-by-step derivation
          1. 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)} \]
          2. 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) \]
          3. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 9: 11.3% 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 99.0%

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

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

            \[\leadsto \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.2

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

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

        Alternative 10: 10.3% accurate, 510.0× speedup?

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

          \[\left(-s\right) \cdot \log \left(\frac{1}{u \cdot \left(\frac{1}{1 + e^{\frac{-\pi}{s}}} - \frac{1}{1 + e^{\frac{\pi}{s}}}\right) + \frac{1}{1 + e^{\frac{\pi}{s}}}} - 1\right) \]
        2. Add Preprocessing
        3. 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) + \frac{-1}{2} \cdot \frac{-16 \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} + -2 \cdot \left(-8 \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} + -4 \cdot \left(\frac{-1}{8} \cdot {\mathsf{PI}\left(\right)}^{2} + \frac{1}{8} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)}{s}} \]
        4. Simplified8.7%

          \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -16, \mathsf{fma}\left(\mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right), 16, 0\right)\right)}{s}, \mathsf{fma}\left(\pi, 0.25, \pi \cdot \left(-0.5 \cdot u\right)\right) \cdot -4\right)} \]
        5. Taylor expanded in s around 0

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

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

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

            \[\leadsto \frac{\frac{-1}{2} \cdot \left({\left(\frac{-1}{2} \cdot \left(u \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)}^{2} \cdot \color{blue}{0}\right)}{s} \]
          4. mul0-rgtN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{0}}{s} \]
          5. metadata-evalN/A

            \[\leadsto \frac{\color{blue}{0}}{s} \]
          6. lower-/.f3210.3

            \[\leadsto \color{blue}{\frac{0}{s}} \]
        7. Simplified10.3%

          \[\leadsto \color{blue}{\frac{0}{s}} \]
        8. Step-by-step derivation
          1. div010.3

            \[\leadsto \color{blue}{0} \]
        9. Applied egg-rr10.3%

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

        Reproduce

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