VandenBroeck and Keller, Equation (20)

Percentage Accurate: 6.9% → 99.1%
Time: 16.1s
Alternatives: 7
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 7 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.9% 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: 99.1% accurate, 2.2× speedup?

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

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

    \[-\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. distribute-rgt-neg-inN/A

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

      \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}}} \cdot \left(\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)\right)\right) \]
    5. inv-powN/A

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

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

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

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

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

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

      \[\leadsto \left(\color{blue}{{\left(\frac{4}{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{2}}} \cdot {\left(\frac{4}{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{2}}\right) \cdot \log \tanh \left(f \cdot \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right) \]
    5. unpow1/2N/A

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

      \[\leadsto \left(\sqrt{\frac{4}{\mathsf{PI}\left(\right)}} \cdot \color{blue}{{\left(\frac{4}{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{2}}}\right) \cdot \log \tanh \left(f \cdot \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right) \]
    7. unpow1/2N/A

      \[\leadsto \left(\sqrt{\frac{4}{\mathsf{PI}\left(\right)}} \cdot \color{blue}{\sqrt{\frac{4}{\mathsf{PI}\left(\right)}}}\right) \cdot \log \tanh \left(f \cdot \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right) \]
    8. rem-square-sqrtN/A

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

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

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

      \[\leadsto \color{blue}{\frac{4 \cdot \log \tanh \left(f \cdot \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right)}{\mathsf{PI}\left(\right)}} \]
  6. Applied rewrites99.0%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{4 \cdot \log \tanh \left(\frac{1 \cdot f}{\frac{\color{blue}{2 \cdot 2}}{\mathsf{PI}\left(\right)}}\right)}{\mathsf{PI}\left(\right)} \]
    9. rem-square-sqrtN/A

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

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

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

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

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

      \[\leadsto \frac{4 \cdot \log \tanh \left(\frac{1 \cdot f}{\frac{2}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \color{blue}{\frac{2}{\sqrt{\mathsf{PI}\left(\right)}}}}\right)}{\mathsf{PI}\left(\right)} \]
    15. times-fracN/A

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

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

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

      \[\leadsto \frac{4 \cdot \log \tanh \left(\frac{-1}{\color{blue}{-\frac{2}{\sqrt{\mathsf{PI}\left(\right)}}}} \cdot \frac{f}{\frac{2}{\sqrt{\mathsf{PI}\left(\right)}}}\right)}{\mathsf{PI}\left(\right)} \]
    19. times-fracN/A

      \[\leadsto \frac{4 \cdot \log \tanh \color{blue}{\left(\frac{-1 \cdot f}{\left(-\frac{2}{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \frac{2}{\sqrt{\mathsf{PI}\left(\right)}}}\right)}}{\mathsf{PI}\left(\right)} \]
  8. Applied rewrites99.0%

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

Alternative 2: 99.0% accurate, 2.3× speedup?

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

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

    \[-\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. distribute-rgt-neg-inN/A

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

      \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{PI}\left(\right)}{4}}} \cdot \left(\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)\right)\right) \]
    5. inv-powN/A

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

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

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

      \[\leadsto \color{blue}{{\left(\frac{4}{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{2}}} \cdot \left({\left(\frac{4}{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{2}} \cdot \log \tanh \left(f \cdot \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
    2. unpow1/2N/A

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\sqrt{\mathsf{PI}\left(\right)}}} \cdot \left({\left(\frac{4}{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{2}} \cdot \log \tanh \left(f \cdot \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
    7. lower-/.f6499.0

      \[\leadsto \color{blue}{\frac{2}{\sqrt{\mathsf{PI}\left(\right)}}} \cdot \left({\left(\frac{4}{\mathsf{PI}\left(\right)}\right)}^{0.5} \cdot \log \tanh \left(f \cdot \left(0.25 \cdot \mathsf{PI}\left(\right)\right)\right)\right) \]
    8. lift-*.f64N/A

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

      \[\leadsto \frac{2}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \color{blue}{\left(\log \tanh \left(f \cdot \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot {\left(\frac{4}{\mathsf{PI}\left(\right)}\right)}^{\frac{1}{2}}\right)} \]
    10. lower-*.f6499.0

      \[\leadsto \frac{2}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \color{blue}{\left(\log \tanh \left(f \cdot \left(0.25 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot {\left(\frac{4}{\mathsf{PI}\left(\right)}\right)}^{0.5}\right)} \]
  6. Applied rewrites99.0%

    \[\leadsto \color{blue}{\frac{2}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \left(\log \tanh \left(\left(0.25 \cdot \mathsf{PI}\left(\right)\right) \cdot f\right) \cdot \frac{2}{\sqrt{\mathsf{PI}\left(\right)}}\right)} \]
  7. Add Preprocessing

Alternative 3: 99.1% accurate, 2.7× speedup?

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

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

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

    \[\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. Add Preprocessing

Alternative 4: 96.2% accurate, 3.2× speedup?

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

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

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

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

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

Alternative 5: 95.8% accurate, 3.8× speedup?

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

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

    \[-\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 rewrites98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 95.8% accurate, 4.8× speedup?

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

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

    \[-\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 rewrites98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 95.7% accurate, 4.8× speedup?

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

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

    \[-\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 rewrites98.8%

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\frac{0.25 \cdot \mathsf{PI}\left(\right)}{\color{blue}{\log \left(0.25 \cdot \mathsf{PI}\left(\right)\right) + \log f}}} \]
  8. Applied rewrites95.3%

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

Reproduce

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