VandenBroeck and Keller, Equation (20)

Percentage Accurate: 7.1% → 98.9%
Time: 14.5s
Alternatives: 4
Speedup: 4.8×

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 4 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: 7.1% 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: 98.9% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot 0.25\\
\frac{\log \tanh \left(t\_0 \cdot f\right)}{t\_0}
\end{array}
\end{array}
Derivation
  1. Initial program 6.6%

    \[-\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. un-div-invN/A

      \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{\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)}{\frac{\mathsf{PI}\left(\right)}{4}}}\right) \]
  4. Applied rewrites99.5%

    \[\leadsto \color{blue}{\frac{\log \tanh \left(f \cdot \left(0.25 \cdot \mathsf{PI}\left(\right)\right)\right)}{0.25 \cdot \mathsf{PI}\left(\right)}} \]
  5. Final simplification99.5%

    \[\leadsto \frac{\log \tanh \left(\left(\mathsf{PI}\left(\right) \cdot 0.25\right) \cdot f\right)}{\mathsf{PI}\left(\right) \cdot 0.25} \]
  6. Add Preprocessing

Alternative 2: 96.4% accurate, 4.0× speedup?

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

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

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

    \[\leadsto -\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}} \cdot \log \color{blue}{\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(-2, \mathsf{PI}\left(\right) \cdot 0.020833333333333332, 0.125 \cdot \mathsf{PI}\left(\right)\right) \cdot f, f, \frac{4}{\mathsf{PI}\left(\right)}\right)}{f}\right)} \]
  5. 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{\mathsf{fma}\left(\mathsf{fma}\left(-2, \mathsf{PI}\left(\right) \cdot \frac{1}{48}, \frac{1}{8} \cdot \mathsf{PI}\left(\right)\right) \cdot f, f, \frac{4}{\mathsf{PI}\left(\right)}\right)}{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{\mathsf{fma}\left(\mathsf{fma}\left(-2, \mathsf{PI}\left(\right) \cdot \frac{1}{48}, \frac{1}{8} \cdot \mathsf{PI}\left(\right)\right) \cdot f, f, \frac{4}{\mathsf{PI}\left(\right)}\right)}{f}\right)}\right) \]
  6. Applied rewrites97.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\log \left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{24}, \mathsf{PI}\left(\right), \frac{1}{8} \cdot \mathsf{PI}\left(\right)\right) \cdot f, f, \frac{4}{\mathsf{PI}\left(\right)}\right)}{f}\right)}{\frac{-1}{4}}}{\mathsf{PI}\left(\right)}} \]
  8. Applied rewrites97.5%

    \[\leadsto \color{blue}{\frac{\log \left(\frac{\mathsf{fma}\left(\left(0.08333333333333333 \cdot \mathsf{PI}\left(\right)\right) \cdot f, f, \frac{4}{\mathsf{PI}\left(\right)}\right)}{f}\right) \cdot -4}{\mathsf{PI}\left(\right)}} \]
  9. Final simplification97.5%

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

Alternative 3: 95.8% accurate, 4.8× speedup?

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

\\
\frac{\log \left(\left(\mathsf{PI}\left(\right) \cdot f\right) \cdot 0.25\right)}{\mathsf{PI}\left(\right) \cdot 0.25}
\end{array}
Derivation
  1. Initial program 6.6%

    \[-\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. un-div-invN/A

      \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{\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)}{\frac{\mathsf{PI}\left(\right)}{4}}}\right) \]
  4. Applied rewrites99.5%

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

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

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

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

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

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

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

    \[\leadsto \frac{\log \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot f\right) \cdot 0.25\right)}}{0.25 \cdot \mathsf{PI}\left(\right)} \]
  8. Final simplification97.1%

    \[\leadsto \frac{\log \left(\left(\mathsf{PI}\left(\right) \cdot f\right) \cdot 0.25\right)}{\mathsf{PI}\left(\right) \cdot 0.25} \]
  9. Add Preprocessing

Alternative 4: 95.6% accurate, 4.8× speedup?

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

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

    \[-\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. un-div-invN/A

      \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{\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)}{\frac{\mathsf{PI}\left(\right)}{4}}}\right) \]
  4. Applied rewrites99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{4}{\mathsf{PI}\left(\right)} \cdot \log \left(\left(f \cdot \mathsf{PI}\left(\right)\right) \cdot 0.25\right)} \]
  10. Final simplification96.9%

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

Reproduce

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