VandenBroeck and Keller, Equation (20)

Percentage Accurate: 6.8% → 96.8%
Time: 16.5s
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.8% 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.8% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{\mathsf{PI}\left(\right)}{4} \cdot f\\
t_1 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
\left(\frac{\log \cosh t\_0 \cdot \mathsf{PI}\left(\right)}{t\_1} - \frac{\log \sinh t\_0 \cdot \mathsf{PI}\left(\right)}{t\_1}\right) \cdot -4
\end{array}
\end{array}
Derivation
  1. Initial program 8.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 rewrites96.3%

    \[\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-/.f64N/A

      \[\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 \]
    2. 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 \]
    3. 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 \]
    4. 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 \]
    5. div-subN/A

      \[\leadsto \color{blue}{\left(\frac{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\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 \]
    6. lower--.f64N/A

      \[\leadsto \color{blue}{\left(\frac{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\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 \]
  6. Applied rewrites96.2%

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

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

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

      \[\leadsto \left(\frac{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}{\mathsf{PI}\left(\right)} - \color{blue}{\frac{\log \sinh \left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}{\mathsf{PI}\left(\right)}}\right) \cdot -4 \]
    4. frac-subN/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 \]
    5. lift-PI.f64N/A

      \[\leadsto \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)}{\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)} \cdot -4 \]
    6. lift-PI.f64N/A

      \[\leadsto \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 \color{blue}{\mathsf{PI}\left(\right)}} \cdot -4 \]
    7. div-subN/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{\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)}\right)} \cdot -4 \]
    8. lower--.f64N/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{\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)}\right)} \cdot -4 \]
  8. Applied rewrites96.3%

    \[\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{\log \sinh \left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right) \cdot \mathsf{PI}\left(\right)}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}\right)} \cdot -4 \]
  9. Add Preprocessing

Alternative 2: 96.9% 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 8.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 rewrites96.3%

    \[\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.f6496.3

      \[\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 rewrites96.3%

    \[\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 3: 96.1% 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 8.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 rewrites95.2%

    \[\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 4: 96.0% accurate, 2.4× speedup?

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

\\
\left(\left(\left(f \cdot f\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 0.03125 - \frac{\log \sinh \left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right) \cdot \mathsf{PI}\left(\right)}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}\right) \cdot -4
\end{array}
Derivation
  1. Initial program 8.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 rewrites96.3%

    \[\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-/.f64N/A

      \[\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 \]
    2. 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 \]
    3. 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 \]
    4. 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 \]
    5. div-subN/A

      \[\leadsto \color{blue}{\left(\frac{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\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 \]
    6. lower--.f64N/A

      \[\leadsto \color{blue}{\left(\frac{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{-4} \cdot f\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 \]
  6. Applied rewrites96.2%

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

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

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

      \[\leadsto \left(\frac{\log \cosh \left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}{\mathsf{PI}\left(\right)} - \color{blue}{\frac{\log \sinh \left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}{\mathsf{PI}\left(\right)}}\right) \cdot -4 \]
    4. frac-subN/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 \]
    5. lift-PI.f64N/A

      \[\leadsto \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)}{\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)} \cdot -4 \]
    6. lift-PI.f64N/A

      \[\leadsto \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 \color{blue}{\mathsf{PI}\left(\right)}} \cdot -4 \]
    7. div-subN/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{\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)}\right)} \cdot -4 \]
    8. lower--.f64N/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{\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)}\right)} \cdot -4 \]
  8. Applied rewrites96.3%

    \[\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{\log \sinh \left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right) \cdot \mathsf{PI}\left(\right)}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}\right)} \cdot -4 \]
  9. Taylor expanded in f around 0

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

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

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

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

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

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

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

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

Alternative 5: 96.1% accurate, 2.5× speedup?

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

\\
\frac{\left(0.03125 \cdot \left(f \cdot f\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) - \log \sinh \left(0.25 \cdot \left(f \cdot \mathsf{PI}\left(\right)\right)\right)}{\mathsf{PI}\left(\right)} \cdot -4
\end{array}
Derivation
  1. Initial program 8.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 rewrites96.3%

    \[\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.f6496.3

      \[\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 rewrites96.3%

    \[\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. 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(\left(\mathsf{PI}\left(\right) \cdot f\right) \cdot \frac{1}{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(\left(\mathsf{PI}\left(\right) \cdot f\right) \cdot \frac{1}{4}\right)}\right)}}{\mathsf{PI}\left(\right)} \cdot -4 \]
    3. lift-cosh.f64N/A

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

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

      \[\leadsto \frac{\log \left(\frac{\cosh \left(\mathsf{neg}\left(\color{blue}{\frac{\mathsf{PI}\left(\right)}{-4} \cdot f}\right)\right)}{\sinh \left(\left(\mathsf{PI}\left(\right) \cdot f\right) \cdot \frac{1}{4}\right)}\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
    6. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{1}{32} \cdot \left({f}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)} - \log \sinh \left(\frac{1}{4} \cdot \left(f \cdot \mathsf{PI}\left(\right)\right)\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
  11. Step-by-step derivation
    1. associate-*r*N/A

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(0.03125 \cdot \left(f \cdot f\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) - \log \sinh \left(0.25 \cdot \left(f \cdot \mathsf{PI}\left(\right)\right)\right)}{\mathsf{PI}\left(\right)} \cdot -4 \]
  12. Applied rewrites95.1%

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

Alternative 6: 96.0% 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 8.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 rewrites95.1%

    \[\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 simplification95.1%

    \[\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 7: 95.6% 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 8.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 rewrites96.3%

    \[\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. lower-*.f64N/A

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

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

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

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

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

    Alternative 8: 95.5% accurate, 4.6× speedup?

    \[\begin{array}{l} \\ \log \left(\frac{4}{f \cdot \mathsf{PI}\left(\right)}\right) \cdot \frac{-4}{\mathsf{PI}\left(\right)} \end{array} \]
    (FPCore (f) :precision binary64 (* (log (/ 4.0 (* f (PI)))) (/ -4.0 (PI))))
    \begin{array}{l}
    
    \\
    \log \left(\frac{4}{f \cdot \mathsf{PI}\left(\right)}\right) \cdot \frac{-4}{\mathsf{PI}\left(\right)}
    \end{array}
    
    Derivation
    1. Initial program 8.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 rewrites96.3%

      \[\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. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

      Reproduce

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