
(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:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (f) :precision binary64 (* (/ (- (log (cosh (* (* f (PI)) -0.25))) (log (sinh (* (* 0.25 f) (PI))))) (PI)) -4.0))
\begin{array}{l}
\\
\frac{\log \cosh \left(\left(f \cdot \mathsf{PI}\left(\right)\right) \cdot -0.25\right) - \log \sinh \left(\left(0.25 \cdot f\right) \cdot \mathsf{PI}\left(\right)\right)}{\mathsf{PI}\left(\right)} \cdot -4
\end{array}
Initial program 7.1%
Taylor expanded in f around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.6%
Applied rewrites98.6%
lift-log.f64N/A
lift-/.f64N/A
lift-cosh.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-sinh.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
log-divN/A
lower--.f64N/A
Applied rewrites98.7%
(FPCore (f) :precision binary64 (let* ((t_0 (* (* f (PI)) 0.25))) (* (/ (log (/ (cosh t_0) (sinh t_0))) (PI)) -4.0)))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(f \cdot \mathsf{PI}\left(\right)\right) \cdot 0.25\\
\frac{\log \left(\frac{\cosh t\_0}{\sinh t\_0}\right)}{\mathsf{PI}\left(\right)} \cdot -4
\end{array}
\end{array}
Initial program 7.1%
Taylor expanded in f around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.6%
Applied rewrites98.6%
(FPCore (f) :precision binary64 (* (/ (- (* (pow (* f (PI)) 2.0) 0.03125) (log (sinh (* (* 0.25 f) (PI))))) (PI)) -4.0))
\begin{array}{l}
\\
\frac{{\left(f \cdot \mathsf{PI}\left(\right)\right)}^{2} \cdot 0.03125 - \log \sinh \left(\left(0.25 \cdot f\right) \cdot \mathsf{PI}\left(\right)\right)}{\mathsf{PI}\left(\right)} \cdot -4
\end{array}
Initial program 7.1%
Taylor expanded in f around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.6%
Applied rewrites98.6%
lift-log.f64N/A
lift-/.f64N/A
lift-cosh.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-sinh.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
log-divN/A
lower--.f64N/A
Applied rewrites98.7%
Taylor expanded in f around 0
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lift-*.f64N/A
lift-PI.f6497.8
Applied rewrites97.8%
(FPCore (f) :precision binary64 (* (/ (- (log (/ 4.0 (PI))) (log f)) (PI)) -4.0))
\begin{array}{l}
\\
\frac{\log \left(\frac{4}{\mathsf{PI}\left(\right)}\right) - \log f}{\mathsf{PI}\left(\right)} \cdot -4
\end{array}
Initial program 7.1%
Taylor expanded in f around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites97.4%
lift-log.f64N/A
lift-/.f64N/A
log-divN/A
lower--.f64N/A
lower-log.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
metadata-evalN/A
distribute-rgt-out--N/A
*-commutativeN/A
lower-log.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-rgt-out--N/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6497.3
Applied rewrites97.3%
lift--.f64N/A
lift-log.f64N/A
lift-log.f64N/A
diff-logN/A
lift-*.f64N/A
associate-/l/N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
metadata-evalN/A
associate-*r/N/A
*-commutativeN/A
associate-/r/N/A
log-divN/A
Applied rewrites97.4%
(FPCore (f) :precision binary64 (* (/ (- (log (* (* (* 0.5 (PI)) 0.5) f))) (PI)) -4.0))
\begin{array}{l}
\\
\frac{-\log \left(\left(\left(0.5 \cdot \mathsf{PI}\left(\right)\right) \cdot 0.5\right) \cdot f\right)}{\mathsf{PI}\left(\right)} \cdot -4
\end{array}
Initial program 7.1%
Taylor expanded in f around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.6%
Applied rewrites98.6%
lift-log.f64N/A
lift-/.f64N/A
lift-cosh.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-sinh.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
log-divN/A
lower--.f64N/A
Applied rewrites98.7%
Taylor expanded in f around 0
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
sum-logN/A
lower-log.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-rgt-out--N/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6497.4
Applied rewrites97.4%
(FPCore (f) :precision binary64 (* (/ (log (/ 4.0 (* f (PI)))) (PI)) -4.0))
\begin{array}{l}
\\
\frac{\log \left(\frac{4}{f \cdot \mathsf{PI}\left(\right)}\right)}{\mathsf{PI}\left(\right)} \cdot -4
\end{array}
Initial program 7.1%
Taylor expanded in f around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites97.4%
Taylor expanded in f around 0
lower-/.f64N/A
lower-*.f64N/A
lift-PI.f6497.4
Applied rewrites97.4%
(FPCore (f) :precision binary64 (* (/ (- 4.0) (PI)) (log (* (* 0.08333333333333333 (PI)) f))))
\begin{array}{l}
\\
\frac{-4}{\mathsf{PI}\left(\right)} \cdot \log \left(\left(0.08333333333333333 \cdot \mathsf{PI}\left(\right)\right) \cdot f\right)
\end{array}
Initial program 7.1%
Taylor expanded in f around 0
Applied rewrites97.6%
Applied rewrites97.7%
Taylor expanded in f around inf
*-commutativeN/A
lower-*.f64N/A
distribute-rgt-outN/A
lower-*.f64N/A
lift-PI.f64N/A
metadata-eval1.6
Applied rewrites1.6%
Applied rewrites1.6%
Final simplification1.6%
herbie shell --seed 2025054
(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)))))))))