Average Error: 61.4 → 2.3
Time: 15.2s
Precision: binary64
\[-\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{e^{\frac{\pi}{4} \cdot f} - e^{-\frac{\pi}{4} \cdot f}}\right) \]
\[\left(\log \left(\frac{e^{\frac{\pi}{4} \cdot f} + {\left(e^{-0.25}\right)}^{\left(\pi \cdot f\right)}}{\mathsf{fma}\left(0.005208333333333333, {\left(\pi \cdot f\right)}^{3}, \mathsf{fma}\left(1.6276041666666666 \cdot 10^{-5}, {f}^{5} \cdot {\pi}^{5}, \mathsf{fma}\left(0.5, \pi \cdot f, 2.422030009920635 \cdot 10^{-8} \cdot \left({f}^{7} \cdot {\pi}^{7}\right)\right)\right)\right)}\right) \cdot \frac{1}{\sqrt{\pi}}\right) \cdot \frac{-4}{\sqrt{\pi}} \]
-\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{e^{\frac{\pi}{4} \cdot f} - e^{-\frac{\pi}{4} \cdot f}}\right)
\left(\log \left(\frac{e^{\frac{\pi}{4} \cdot f} + {\left(e^{-0.25}\right)}^{\left(\pi \cdot f\right)}}{\mathsf{fma}\left(0.005208333333333333, {\left(\pi \cdot f\right)}^{3}, \mathsf{fma}\left(1.6276041666666666 \cdot 10^{-5}, {f}^{5} \cdot {\pi}^{5}, \mathsf{fma}\left(0.5, \pi \cdot f, 2.422030009920635 \cdot 10^{-8} \cdot \left({f}^{7} \cdot {\pi}^{7}\right)\right)\right)\right)}\right) \cdot \frac{1}{\sqrt{\pi}}\right) \cdot \frac{-4}{\sqrt{\pi}}
(FPCore (f)
 :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)))))))))
(FPCore (f)
 :precision binary64
 (*
  (*
   (log
    (/
     (+ (exp (* (/ PI 4.0) f)) (pow (exp -0.25) (* PI f)))
     (fma
      0.005208333333333333
      (pow (* PI f) 3.0)
      (fma
       1.6276041666666666e-5
       (* (pow f 5.0) (pow PI 5.0))
       (fma
        0.5
        (* PI f)
        (* 2.422030009920635e-8 (* (pow f 7.0) (pow PI 7.0))))))))
   (/ 1.0 (sqrt PI)))
  (/ -4.0 (sqrt PI))))
double code(double f) {
	return -((1.0 / (((double) M_PI) / 4.0)) * log((exp((((double) M_PI) / 4.0) * f) + exp(-((((double) M_PI) / 4.0) * f))) / (exp((((double) M_PI) / 4.0) * f) - exp(-((((double) M_PI) / 4.0) * f)))));
}
double code(double f) {
	return (log((exp((((double) M_PI) / 4.0) * f) + pow(exp(-0.25), (((double) M_PI) * f))) / fma(0.005208333333333333, pow((((double) M_PI) * f), 3.0), fma(1.6276041666666666e-5, (pow(f, 5.0) * pow(((double) M_PI), 5.0)), fma(0.5, (((double) M_PI) * f), (2.422030009920635e-8 * (pow(f, 7.0) * pow(((double) M_PI), 7.0))))))) * (1.0 / sqrt((double) M_PI))) * (-4.0 / sqrt((double) M_PI));
}

Error

Bits error versus f

Derivation

  1. Initial program 61.4

    \[-\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{e^{\frac{\pi}{4} \cdot f} - e^{-\frac{\pi}{4} \cdot f}}\right) \]
  2. Simplified61.4

    \[\leadsto \color{blue}{\log \left(\frac{e^{\frac{\pi}{4} \cdot f} + {\left(e^{-0.25}\right)}^{\left(\pi \cdot f\right)}}{e^{\frac{\pi}{4} \cdot f} - {\left(e^{-0.25}\right)}^{\left(\pi \cdot f\right)}}\right) \cdot \frac{-4}{\pi}} \]
  3. Taylor expanded in f around 0 2.4

    \[\leadsto \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + {\left(e^{-0.25}\right)}^{\left(\pi \cdot f\right)}}{\color{blue}{0.005208333333333333 \cdot \left({f}^{3} \cdot {\pi}^{3}\right) + \left(1.6276041666666666 \cdot 10^{-5} \cdot \left({f}^{5} \cdot {\pi}^{5}\right) + \left(2.422030009920635 \cdot 10^{-8} \cdot \left({f}^{7} \cdot {\pi}^{7}\right) + 0.5 \cdot \left(f \cdot \pi\right)\right)\right)}}\right) \cdot \frac{-4}{\pi} \]
  4. Simplified2.4

    \[\leadsto \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + {\left(e^{-0.25}\right)}^{\left(\pi \cdot f\right)}}{\color{blue}{\mathsf{fma}\left(0.005208333333333333, {\left(f \cdot \pi\right)}^{3}, \mathsf{fma}\left(1.6276041666666666 \cdot 10^{-5}, {f}^{5} \cdot {\pi}^{5}, \mathsf{fma}\left(0.5, f \cdot \pi, 2.422030009920635 \cdot 10^{-8} \cdot \left({f}^{7} \cdot {\pi}^{7}\right)\right)\right)\right)}}\right) \cdot \frac{-4}{\pi} \]
  5. Applied add-sqr-sqrt_binary643.2

    \[\leadsto \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + {\left(e^{-0.25}\right)}^{\left(\pi \cdot f\right)}}{\mathsf{fma}\left(0.005208333333333333, {\left(f \cdot \pi\right)}^{3}, \mathsf{fma}\left(1.6276041666666666 \cdot 10^{-5}, {f}^{5} \cdot {\pi}^{5}, \mathsf{fma}\left(0.5, f \cdot \pi, 2.422030009920635 \cdot 10^{-8} \cdot \left({f}^{7} \cdot {\pi}^{7}\right)\right)\right)\right)}\right) \cdot \frac{-4}{\color{blue}{\sqrt{\pi} \cdot \sqrt{\pi}}} \]
  6. Applied *-un-lft-identity_binary643.2

    \[\leadsto \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + {\left(e^{-0.25}\right)}^{\left(\pi \cdot f\right)}}{\mathsf{fma}\left(0.005208333333333333, {\left(f \cdot \pi\right)}^{3}, \mathsf{fma}\left(1.6276041666666666 \cdot 10^{-5}, {f}^{5} \cdot {\pi}^{5}, \mathsf{fma}\left(0.5, f \cdot \pi, 2.422030009920635 \cdot 10^{-8} \cdot \left({f}^{7} \cdot {\pi}^{7}\right)\right)\right)\right)}\right) \cdot \frac{\color{blue}{1 \cdot -4}}{\sqrt{\pi} \cdot \sqrt{\pi}} \]
  7. Applied times-frac_binary642.6

    \[\leadsto \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + {\left(e^{-0.25}\right)}^{\left(\pi \cdot f\right)}}{\mathsf{fma}\left(0.005208333333333333, {\left(f \cdot \pi\right)}^{3}, \mathsf{fma}\left(1.6276041666666666 \cdot 10^{-5}, {f}^{5} \cdot {\pi}^{5}, \mathsf{fma}\left(0.5, f \cdot \pi, 2.422030009920635 \cdot 10^{-8} \cdot \left({f}^{7} \cdot {\pi}^{7}\right)\right)\right)\right)}\right) \cdot \color{blue}{\left(\frac{1}{\sqrt{\pi}} \cdot \frac{-4}{\sqrt{\pi}}\right)} \]
  8. Applied associate-*r*_binary642.3

    \[\leadsto \color{blue}{\left(\log \left(\frac{e^{\frac{\pi}{4} \cdot f} + {\left(e^{-0.25}\right)}^{\left(\pi \cdot f\right)}}{\mathsf{fma}\left(0.005208333333333333, {\left(f \cdot \pi\right)}^{3}, \mathsf{fma}\left(1.6276041666666666 \cdot 10^{-5}, {f}^{5} \cdot {\pi}^{5}, \mathsf{fma}\left(0.5, f \cdot \pi, 2.422030009920635 \cdot 10^{-8} \cdot \left({f}^{7} \cdot {\pi}^{7}\right)\right)\right)\right)}\right) \cdot \frac{1}{\sqrt{\pi}}\right) \cdot \frac{-4}{\sqrt{\pi}}} \]
  9. Final simplification2.3

    \[\leadsto \left(\log \left(\frac{e^{\frac{\pi}{4} \cdot f} + {\left(e^{-0.25}\right)}^{\left(\pi \cdot f\right)}}{\mathsf{fma}\left(0.005208333333333333, {\left(\pi \cdot f\right)}^{3}, \mathsf{fma}\left(1.6276041666666666 \cdot 10^{-5}, {f}^{5} \cdot {\pi}^{5}, \mathsf{fma}\left(0.5, \pi \cdot f, 2.422030009920635 \cdot 10^{-8} \cdot \left({f}^{7} \cdot {\pi}^{7}\right)\right)\right)\right)}\right) \cdot \frac{1}{\sqrt{\pi}}\right) \cdot \frac{-4}{\sqrt{\pi}} \]

Reproduce

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