VandenBroeck and Keller, Equation (20)

Percentage Accurate: 6.5% → 96.9%
Time: 17.1s
Alternatives: 8
Speedup: 4.6×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\mathsf{PI}\left(\right)}{4}\\ t_1 := t\_0 \cdot f\\ t_2 := e^{t\_1}\\ t_3 := e^{-t\_1}\\ -\frac{1}{t\_0} \cdot \log \left(\frac{t\_2 + t\_3}{t\_2 - t\_3}\right) \end{array} \end{array} \]
(FPCore (f)
 :precision binary64
 (let* ((t_0 (/ (PI) 4.0)) (t_1 (* t_0 f)) (t_2 (exp t_1)) (t_3 (exp (- t_1))))
   (- (* (/ 1.0 t_0) (log (/ (+ t_2 t_3) (- t_2 t_3)))))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\mathsf{PI}\left(\right)}{4}\\
t_1 := t\_0 \cdot f\\
t_2 := e^{t\_1}\\
t_3 := e^{-t\_1}\\
-\frac{1}{t\_0} \cdot \log \left(\frac{t\_2 + t\_3}{t\_2 - t\_3}\right)
\end{array}
\end{array}

Sampling outcomes in binary64 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 8 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: 6.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\mathsf{PI}\left(\right)}{4}\\ t_1 := t\_0 \cdot f\\ t_2 := e^{t\_1}\\ t_3 := e^{-t\_1}\\ -\frac{1}{t\_0} \cdot \log \left(\frac{t\_2 + t\_3}{t\_2 - t\_3}\right) \end{array} \end{array} \]
(FPCore (f)
 :precision binary64
 (let* ((t_0 (/ (PI) 4.0)) (t_1 (* t_0 f)) (t_2 (exp t_1)) (t_3 (exp (- t_1))))
   (- (* (/ 1.0 t_0) (log (/ (+ t_2 t_3) (- t_2 t_3)))))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\mathsf{PI}\left(\right)}{4}\\
t_1 := t\_0 \cdot f\\
t_2 := e^{t\_1}\\
t_3 := e^{-t\_1}\\
-\frac{1}{t\_0} \cdot \log \left(\frac{t\_2 + t\_3}{t\_2 - t\_3}\right)
\end{array}
\end{array}

Alternative 1: 96.9% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{\log \cosh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{-4}\right)}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}, \frac{\log \sinh \left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}{-\mathsf{PI}\left(\right)}\right) \cdot -4 \end{array} \]
(FPCore (f)
 :precision binary64
 (*
  (fma
   (PI)
   (/ (log (cosh (* f (/ (PI) -4.0)))) (* (PI) (PI)))
   (/ (log (sinh (* (/ (PI) 4.0) f))) (- (PI))))
  -4.0))
\begin{array}{l}

\\
\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{\log \cosh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{-4}\right)}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}, \frac{\log \sinh \left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}{-\mathsf{PI}\left(\right)}\right) \cdot -4
\end{array}
Derivation
  1. Initial program 7.2%

    \[-\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}} \cdot \log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-neg.f64N/A

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

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

      \[\leadsto \mathsf{neg}\left(\color{blue}{\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \frac{1}{\frac{\mathsf{PI}\left(\right)}{4}}}\right) \]
    4. lift-/.f64N/A

      \[\leadsto \mathsf{neg}\left(\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \color{blue}{\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}}}\right) \]
    5. lift-/.f64N/A

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

      \[\leadsto \mathsf{neg}\left(\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \color{blue}{\left(\frac{1}{\mathsf{PI}\left(\right)} \cdot 4\right)}\right) \]
  4. Applied rewrites97.4%

    \[\leadsto \color{blue}{\frac{\log \left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}\right)}{\mathsf{PI}\left(\right)} \cdot -4} \]
  5. Step-by-step derivation
    1. lift-log.f64N/A

      \[\leadsto \frac{\color{blue}{\log \left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
    2. lift-/.f64N/A

      \[\leadsto \frac{\log \color{blue}{\left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
    3. log-divN/A

      \[\leadsto \frac{\color{blue}{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right) - \log \sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
    4. lift-log.f64N/A

      \[\leadsto \frac{\color{blue}{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)} - \log \sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
    5. lower--.f64N/A

      \[\leadsto \frac{\color{blue}{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right) - \log \sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
  6. Applied rewrites97.8%

    \[\leadsto \frac{\color{blue}{\log \cosh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right) - \log \sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
  7. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{\log \cosh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right) - \log \sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}{\mathsf{PI}\left(\right)}} \cdot -4 \]
    2. lift--.f64N/A

      \[\leadsto \frac{\color{blue}{\log \cosh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right) - \log \sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
    3. div-subN/A

      \[\leadsto \color{blue}{\left(\frac{\log \cosh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}{\mathsf{PI}\left(\right)} - \frac{\log \sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}{\mathsf{PI}\left(\right)}\right)} \cdot -4 \]
    4. frac-subN/A

      \[\leadsto \color{blue}{\frac{\log \cosh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right) \cdot \mathsf{PI}\left(\right) - \mathsf{PI}\left(\right) \cdot \log \sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}} \cdot -4 \]
    5. lift-PI.f64N/A

      \[\leadsto \frac{\log \cosh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right) \cdot \mathsf{PI}\left(\right) - \mathsf{PI}\left(\right) \cdot \log \sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}{\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)} \cdot -4 \]
    6. lift-PI.f64N/A

      \[\leadsto \frac{\log \cosh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right) \cdot \mathsf{PI}\left(\right) - \mathsf{PI}\left(\right) \cdot \log \sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}{\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}} \cdot -4 \]
    7. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{\log \cosh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right) \cdot \mathsf{PI}\left(\right) - \mathsf{PI}\left(\right) \cdot \log \sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}} \cdot -4 \]
  8. Applied rewrites97.7%

    \[\leadsto \color{blue}{\frac{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right) \cdot \mathsf{PI}\left(\right) - \mathsf{PI}\left(\right) \cdot \log \sinh \left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}} \cdot -4 \]
  9. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right) \cdot \mathsf{PI}\left(\right) - \mathsf{PI}\left(\right) \cdot \log \sinh \left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}} \cdot -4 \]
    2. lift--.f64N/A

      \[\leadsto \frac{\color{blue}{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right) \cdot \mathsf{PI}\left(\right) - \mathsf{PI}\left(\right) \cdot \log \sinh \left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)} \cdot -4 \]
    3. lift-*.f64N/A

      \[\leadsto \frac{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right) \cdot \mathsf{PI}\left(\right) - \color{blue}{\mathsf{PI}\left(\right) \cdot \log \sinh \left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)} \cdot -4 \]
    4. fp-cancel-sub-sign-invN/A

      \[\leadsto \frac{\color{blue}{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right) \cdot \mathsf{PI}\left(\right) + \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right) \cdot \log \sinh \left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)} \cdot -4 \]
    5. div-addN/A

      \[\leadsto \color{blue}{\left(\frac{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right) \cdot \mathsf{PI}\left(\right)}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)} + \frac{\left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right) \cdot \log \sinh \left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}\right)} \cdot -4 \]
  10. Applied rewrites97.8%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{\log \cosh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{-4}\right)}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}, \frac{\log \sinh \left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}{-\mathsf{PI}\left(\right)} \cdot 1\right)} \cdot -4 \]
  11. Final simplification97.8%

    \[\leadsto \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{\log \cosh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{-4}\right)}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}, \frac{\log \sinh \left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}{-\mathsf{PI}\left(\right)}\right) \cdot -4 \]
  12. Add Preprocessing

Alternative 2: 97.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := f \cdot \frac{\mathsf{PI}\left(\right)}{4}\\ \frac{\log \cosh t\_0 - \log \sinh t\_0}{\mathsf{PI}\left(\right)} \cdot -4 \end{array} \end{array} \]
(FPCore (f)
 :precision binary64
 (let* ((t_0 (* f (/ (PI) 4.0))))
   (* (/ (- (log (cosh t_0)) (log (sinh t_0))) (PI)) -4.0)))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := f \cdot \frac{\mathsf{PI}\left(\right)}{4}\\
\frac{\log \cosh t\_0 - \log \sinh t\_0}{\mathsf{PI}\left(\right)} \cdot -4
\end{array}
\end{array}
Derivation
  1. Initial program 7.2%

    \[-\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}} \cdot \log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-neg.f64N/A

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

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

      \[\leadsto \mathsf{neg}\left(\color{blue}{\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \frac{1}{\frac{\mathsf{PI}\left(\right)}{4}}}\right) \]
    4. lift-/.f64N/A

      \[\leadsto \mathsf{neg}\left(\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \color{blue}{\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}}}\right) \]
    5. lift-/.f64N/A

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

      \[\leadsto \mathsf{neg}\left(\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \color{blue}{\left(\frac{1}{\mathsf{PI}\left(\right)} \cdot 4\right)}\right) \]
  4. Applied rewrites97.4%

    \[\leadsto \color{blue}{\frac{\log \left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}\right)}{\mathsf{PI}\left(\right)} \cdot -4} \]
  5. Step-by-step derivation
    1. lift-log.f64N/A

      \[\leadsto \frac{\color{blue}{\log \left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
    2. lift-/.f64N/A

      \[\leadsto \frac{\log \color{blue}{\left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
    3. log-divN/A

      \[\leadsto \frac{\color{blue}{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right) - \log \sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
    4. lift-log.f64N/A

      \[\leadsto \frac{\color{blue}{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)} - \log \sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
    5. lower--.f64N/A

      \[\leadsto \frac{\color{blue}{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right) - \log \sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
  6. Applied rewrites97.8%

    \[\leadsto \frac{\color{blue}{\log \cosh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right) - \log \sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
  7. Add Preprocessing

Alternative 3: 97.0% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \frac{\log \left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \left(\left(\mathsf{PI}\left(\right) \cdot f\right) \cdot 0.25\right)}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \end{array} \]
(FPCore (f)
 :precision binary64
 (*
  (/ (log (/ (cosh (* (/ (PI) -4.0) f)) (sinh (* (* (PI) f) 0.25)))) (PI))
  -4.0))
\begin{array}{l}

\\
\frac{\log \left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \left(\left(\mathsf{PI}\left(\right) \cdot f\right) \cdot 0.25\right)}\right)}{\mathsf{PI}\left(\right)} \cdot -4
\end{array}
Derivation
  1. Initial program 7.2%

    \[-\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}} \cdot \log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-neg.f64N/A

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

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

      \[\leadsto \mathsf{neg}\left(\color{blue}{\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \frac{1}{\frac{\mathsf{PI}\left(\right)}{4}}}\right) \]
    4. lift-/.f64N/A

      \[\leadsto \mathsf{neg}\left(\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \color{blue}{\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}}}\right) \]
    5. lift-/.f64N/A

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

      \[\leadsto \mathsf{neg}\left(\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \color{blue}{\left(\frac{1}{\mathsf{PI}\left(\right)} \cdot 4\right)}\right) \]
  4. Applied rewrites97.4%

    \[\leadsto \color{blue}{\frac{\log \left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}\right)}{\mathsf{PI}\left(\right)} \cdot -4} \]
  5. Taylor expanded in f around 0

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

      \[\leadsto \frac{\log \left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \color{blue}{\left(\left(f \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{4}\right)}}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
    2. lower-*.f64N/A

      \[\leadsto \frac{\log \left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \color{blue}{\left(\left(f \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{4}\right)}}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
    3. *-commutativeN/A

      \[\leadsto \frac{\log \left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot f\right)} \cdot \frac{1}{4}\right)}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
    4. lower-*.f64N/A

      \[\leadsto \frac{\log \left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot f\right)} \cdot \frac{1}{4}\right)}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
    5. lower-PI.f6497.4

      \[\leadsto \frac{\log \left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot f\right) \cdot 0.25\right)}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
  7. Applied rewrites97.4%

    \[\leadsto \frac{\log \left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot f\right) \cdot 0.25\right)}}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
  8. Add Preprocessing

Alternative 4: 96.4% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot 2\\ t_1 := 0.5 \cdot \mathsf{PI}\left(\right)\\ -\frac{\mathsf{fma}\left(4, \log \left(\frac{2}{t\_1}\right) - \log f, \left(\left(2 \cdot f\right) \cdot \left(\mathsf{fma}\left(\left(t\_0 \cdot 2\right) \cdot 0.005208333333333333, -2, t\_0 \cdot 0.0625\right) \cdot t\_1\right)\right) \cdot f\right)}{\mathsf{PI}\left(\right)} \end{array} \end{array} \]
(FPCore (f)
 :precision binary64
 (let* ((t_0 (* (PI) 2.0)) (t_1 (* 0.5 (PI))))
   (-
    (/
     (fma
      4.0
      (- (log (/ 2.0 t_1)) (log f))
      (*
       (*
        (* 2.0 f)
        (* (fma (* (* t_0 2.0) 0.005208333333333333) -2.0 (* t_0 0.0625)) t_1))
       f))
     (PI)))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot 2\\
t_1 := 0.5 \cdot \mathsf{PI}\left(\right)\\
-\frac{\mathsf{fma}\left(4, \log \left(\frac{2}{t\_1}\right) - \log f, \left(\left(2 \cdot f\right) \cdot \left(\mathsf{fma}\left(\left(t\_0 \cdot 2\right) \cdot 0.005208333333333333, -2, t\_0 \cdot 0.0625\right) \cdot t\_1\right)\right) \cdot f\right)}{\mathsf{PI}\left(\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 7.2%

    \[-\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}} \cdot \log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \]
  2. Add Preprocessing
  3. Taylor expanded in f around 0

    \[\leadsto -\color{blue}{\left(4 \cdot \frac{\log \left(\frac{2}{\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)}\right) + -1 \cdot \log f}{\mathsf{PI}\left(\right)} + f \cdot \left(2 \cdot \frac{f \cdot \left(\frac{-1}{4} \cdot \left({\left(\frac{-1}{4} \cdot \frac{\mathsf{PI}\left(\right)}{\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)} + \frac{1}{4} \cdot \frac{\mathsf{PI}\left(\right)}{\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)}\right)}^{2} \cdot {\left(\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)}^{2}\right) + \left(\frac{1}{16} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)} - 2 \cdot \frac{\frac{1}{384} \cdot {\mathsf{PI}\left(\right)}^{3} - \frac{-1}{384} \cdot {\mathsf{PI}\left(\right)}^{3}}{{\left(\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)}^{2}}\right) \cdot \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)\right)}{\mathsf{PI}\left(\right)} + 2 \cdot \frac{\left(\frac{-1}{4} \cdot \frac{\mathsf{PI}\left(\right)}{\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)} + \frac{1}{4} \cdot \frac{\mathsf{PI}\left(\right)}{\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)}\right) \cdot \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)}{\mathsf{PI}\left(\right)}\right)\right)} \]
  4. Applied rewrites96.6%

    \[\leadsto -\color{blue}{\frac{\mathsf{fma}\left(4, \log \left(\frac{2}{0.5 \cdot \mathsf{PI}\left(\right)}\right) - \log f, \left(\left(2 \cdot f\right) \cdot \left(\mathsf{fma}\left(\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot 2\right) \cdot 0.005208333333333333, -2, \left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot 0.0625\right) \cdot \left(0.5 \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot f\right)}{\mathsf{PI}\left(\right)}} \]
  5. Add Preprocessing

Alternative 5: 96.2% accurate, 3.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot 2\\ \frac{-1}{\frac{\mathsf{PI}\left(\right)}{4}} \cdot \log \left(\mathsf{fma}\left(\mathsf{fma}\left(\left(t\_0 \cdot 2\right) \cdot 0.005208333333333333, -2, t\_0 \cdot 0.0625\right) \cdot f, 1, \frac{\frac{2}{0.5 \cdot \mathsf{PI}\left(\right)}}{f}\right)\right) \end{array} \end{array} \]
(FPCore (f)
 :precision binary64
 (let* ((t_0 (* (PI) 2.0)))
   (*
    (/ -1.0 (/ (PI) 4.0))
    (log
     (fma
      (* (fma (* (* t_0 2.0) 0.005208333333333333) -2.0 (* t_0 0.0625)) f)
      1.0
      (/ (/ 2.0 (* 0.5 (PI))) f))))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot 2\\
\frac{-1}{\frac{\mathsf{PI}\left(\right)}{4}} \cdot \log \left(\mathsf{fma}\left(\mathsf{fma}\left(\left(t\_0 \cdot 2\right) \cdot 0.005208333333333333, -2, t\_0 \cdot 0.0625\right) \cdot f, 1, \frac{\frac{2}{0.5 \cdot \mathsf{PI}\left(\right)}}{f}\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 7.2%

    \[-\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}} \cdot \log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \]
  2. Add Preprocessing
  3. Taylor expanded in f around 0

    \[\leadsto -\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}} \cdot \log \color{blue}{\left(\frac{f \cdot \left(\frac{-1}{4} \cdot \frac{\mathsf{PI}\left(\right)}{\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)} + \left(\frac{1}{4} \cdot \frac{\mathsf{PI}\left(\right)}{\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)} + f \cdot \left(\frac{1}{16} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)} - 2 \cdot \frac{\frac{1}{384} \cdot {\mathsf{PI}\left(\right)}^{3} - \frac{-1}{384} \cdot {\mathsf{PI}\left(\right)}^{3}}{{\left(\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)}^{2}}\right)\right)\right) + 2 \cdot \frac{1}{\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)}}{f}\right)} \]
  4. Applied rewrites96.2%

    \[\leadsto -\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}} \cdot \log \color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot 2\right) \cdot 0.005208333333333333, -2, \left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot 0.0625\right) \cdot f, 1, \frac{\frac{2}{0.5 \cdot \mathsf{PI}\left(\right)}}{f}\right)\right)} \]
  5. Final simplification96.2%

    \[\leadsto \frac{-1}{\frac{\mathsf{PI}\left(\right)}{4}} \cdot \log \left(\mathsf{fma}\left(\mathsf{fma}\left(\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot 2\right) \cdot 0.005208333333333333, -2, \left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot 0.0625\right) \cdot f, 1, \frac{\frac{2}{0.5 \cdot \mathsf{PI}\left(\right)}}{f}\right)\right) \]
  6. Add Preprocessing

Alternative 6: 95.8% accurate, 3.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\mathsf{PI}\left(\right)}\\ \frac{\log \left(\frac{2}{\left(0.5 \cdot \left(t\_0 \cdot t\_0\right)\right) \cdot f}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \end{array} \end{array} \]
(FPCore (f)
 :precision binary64
 (let* ((t_0 (sqrt (PI))))
   (* (/ (log (/ 2.0 (* (* 0.5 (* t_0 t_0)) f))) (PI)) -4.0)))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
\frac{\log \left(\frac{2}{\left(0.5 \cdot \left(t\_0 \cdot t\_0\right)\right) \cdot f}\right)}{\mathsf{PI}\left(\right)} \cdot -4
\end{array}
\end{array}
Derivation
  1. Initial program 7.2%

    \[-\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}} \cdot \log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-neg.f64N/A

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

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

      \[\leadsto \mathsf{neg}\left(\color{blue}{\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \frac{1}{\frac{\mathsf{PI}\left(\right)}{4}}}\right) \]
    4. lift-/.f64N/A

      \[\leadsto \mathsf{neg}\left(\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \color{blue}{\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}}}\right) \]
    5. lift-/.f64N/A

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

      \[\leadsto \mathsf{neg}\left(\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \color{blue}{\left(\frac{1}{\mathsf{PI}\left(\right)} \cdot 4\right)}\right) \]
  4. Applied rewrites97.4%

    \[\leadsto \color{blue}{\frac{\log \left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}\right)}{\mathsf{PI}\left(\right)} \cdot -4} \]
  5. Taylor expanded in f around 0

    \[\leadsto \frac{\log \color{blue}{\left(\frac{2}{f \cdot \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
  6. Step-by-step derivation
    1. lower-/.f64N/A

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

      \[\leadsto \frac{\log \left(\frac{2}{\color{blue}{\left(\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right) \cdot f}}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
    3. lower-*.f64N/A

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

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

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

      \[\leadsto \frac{\log \left(\frac{2}{\color{blue}{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \cdot f}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
    7. lower-*.f64N/A

      \[\leadsto \frac{\log \left(\frac{2}{\color{blue}{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \cdot f}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
    8. lower-PI.f6495.7

      \[\leadsto \frac{\log \left(\frac{2}{\left(0.5 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot f}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
  7. Applied rewrites95.7%

    \[\leadsto \frac{\log \color{blue}{\left(\frac{2}{\left(0.5 \cdot \mathsf{PI}\left(\right)\right) \cdot f}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
  8. Step-by-step derivation
    1. Applied rewrites95.7%

      \[\leadsto \frac{\log \left(\frac{2}{\left(0.5 \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right) \cdot f}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
    2. Add Preprocessing

    Alternative 7: 95.8% accurate, 4.4× speedup?

    \[\begin{array}{l} \\ \frac{\log \left(\frac{\frac{4}{\mathsf{PI}\left(\right)}}{f}\right) \cdot -4}{\mathsf{PI}\left(\right)} \end{array} \]
    (FPCore (f) :precision binary64 (/ (* (log (/ (/ 4.0 (PI)) f)) -4.0) (PI)))
    \begin{array}{l}
    
    \\
    \frac{\log \left(\frac{\frac{4}{\mathsf{PI}\left(\right)}}{f}\right) \cdot -4}{\mathsf{PI}\left(\right)}
    \end{array}
    
    Derivation
    1. Initial program 7.2%

      \[-\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}} \cdot \log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-neg.f64N/A

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \frac{1}{\frac{\mathsf{PI}\left(\right)}{4}}}\right) \]
      4. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \color{blue}{\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}}}\right) \]
      5. lift-/.f64N/A

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

        \[\leadsto \mathsf{neg}\left(\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \color{blue}{\left(\frac{1}{\mathsf{PI}\left(\right)} \cdot 4\right)}\right) \]
    4. Applied rewrites97.4%

      \[\leadsto \color{blue}{\frac{\log \left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}\right)}{\mathsf{PI}\left(\right)} \cdot -4} \]
    5. Taylor expanded in f around 0

      \[\leadsto \frac{\log \color{blue}{\left(\frac{2}{f \cdot \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \frac{\log \left(\frac{2}{\color{blue}{\left(\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right) \cdot f}}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
      3. lower-*.f64N/A

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

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

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

        \[\leadsto \frac{\log \left(\frac{2}{\color{blue}{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \cdot f}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
      7. lower-*.f64N/A

        \[\leadsto \frac{\log \left(\frac{2}{\color{blue}{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \cdot f}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
      8. lower-PI.f6495.7

        \[\leadsto \frac{\log \left(\frac{2}{\left(0.5 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot f}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
    7. Applied rewrites95.7%

      \[\leadsto \frac{\log \color{blue}{\left(\frac{2}{\left(0.5 \cdot \mathsf{PI}\left(\right)\right) \cdot f}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{\log \left(\frac{2}{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot f}\right)}{\mathsf{PI}\left(\right)} \cdot -4} \]
      2. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{\log \left(\frac{2}{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot f}\right) \cdot -4}{\mathsf{PI}\left(\right)}} \]
      4. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\log \left(\frac{2}{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot f}\right) \cdot -4}{\mathsf{PI}\left(\right)}} \]
    9. Applied rewrites95.7%

      \[\leadsto \color{blue}{\frac{\log \left(\frac{\frac{4}{\mathsf{PI}\left(\right)}}{f}\right) \cdot -4}{\mathsf{PI}\left(\right)}} \]
    10. Add Preprocessing

    Alternative 8: 95.8% accurate, 4.6× speedup?

    \[\begin{array}{l} \\ \frac{\log \left(\frac{4}{\mathsf{PI}\left(\right) \cdot f}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \end{array} \]
    (FPCore (f) :precision binary64 (* (/ (log (/ 4.0 (* (PI) f))) (PI)) -4.0))
    \begin{array}{l}
    
    \\
    \frac{\log \left(\frac{4}{\mathsf{PI}\left(\right) \cdot f}\right)}{\mathsf{PI}\left(\right)} \cdot -4
    \end{array}
    
    Derivation
    1. Initial program 7.2%

      \[-\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}} \cdot \log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-neg.f64N/A

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \frac{1}{\frac{\mathsf{PI}\left(\right)}{4}}}\right) \]
      4. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \color{blue}{\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}}}\right) \]
      5. lift-/.f64N/A

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

        \[\leadsto \mathsf{neg}\left(\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{-\frac{\mathsf{PI}\left(\right)}{4} \cdot f}}\right) \cdot \color{blue}{\left(\frac{1}{\mathsf{PI}\left(\right)} \cdot 4\right)}\right) \]
    4. Applied rewrites97.4%

      \[\leadsto \color{blue}{\frac{\log \left(\frac{\cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\right)}{\sinh \left(f \cdot \frac{\mathsf{PI}\left(\right)}{4}\right)}\right)}{\mathsf{PI}\left(\right)} \cdot -4} \]
    5. Taylor expanded in f around 0

      \[\leadsto \frac{\log \color{blue}{\left(\frac{2}{f \cdot \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \frac{\log \left(\frac{2}{\color{blue}{\left(\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right) \cdot f}}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
      3. lower-*.f64N/A

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

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

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

        \[\leadsto \frac{\log \left(\frac{2}{\color{blue}{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \cdot f}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
      7. lower-*.f64N/A

        \[\leadsto \frac{\log \left(\frac{2}{\color{blue}{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \cdot f}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
      8. lower-PI.f6495.7

        \[\leadsto \frac{\log \left(\frac{2}{\left(0.5 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot f}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
    7. Applied rewrites95.7%

      \[\leadsto \frac{\log \color{blue}{\left(\frac{2}{\left(0.5 \cdot \mathsf{PI}\left(\right)\right) \cdot f}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
    8. Step-by-step derivation
      1. Applied rewrites95.7%

        \[\leadsto \frac{\log \left(\frac{4}{\color{blue}{\mathsf{PI}\left(\right) \cdot f}}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
      2. Add Preprocessing

      Reproduce

      ?
      herbie shell --seed 2024353 
      (FPCore (f)
        :name "VandenBroeck and Keller, Equation (20)"
        :precision binary64
        (- (* (/ 1.0 (/ (PI) 4.0)) (log (/ (+ (exp (* (/ (PI) 4.0) f)) (exp (- (* (/ (PI) 4.0) f)))) (- (exp (* (/ (PI) 4.0) f)) (exp (- (* (/ (PI) 4.0) f)))))))))