VandenBroeck and Keller, Equation (20)

Percentage Accurate: 7.1% → 96.6%
Time: 1.2min
Alternatives: 6
Speedup: 4.9×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\pi}{4} \cdot f\\ t_1 := e^{t\_0}\\ t_2 := e^{-t\_0}\\ -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{t\_1 + t\_2}{t\_1 - t\_2}\right) \end{array} \end{array} \]
(FPCore (f)
 :precision binary64
 (let* ((t_0 (* (/ PI 4.0) f)) (t_1 (exp t_0)) (t_2 (exp (- t_0))))
   (- (* (/ 1.0 (/ PI 4.0)) (log (/ (+ t_1 t_2) (- t_1 t_2)))))))
double code(double f) {
	double t_0 = (((double) M_PI) / 4.0) * f;
	double t_1 = exp(t_0);
	double t_2 = exp(-t_0);
	return -((1.0 / (((double) M_PI) / 4.0)) * log(((t_1 + t_2) / (t_1 - t_2))));
}
public static double code(double f) {
	double t_0 = (Math.PI / 4.0) * f;
	double t_1 = Math.exp(t_0);
	double t_2 = Math.exp(-t_0);
	return -((1.0 / (Math.PI / 4.0)) * Math.log(((t_1 + t_2) / (t_1 - t_2))));
}
def code(f):
	t_0 = (math.pi / 4.0) * f
	t_1 = math.exp(t_0)
	t_2 = math.exp(-t_0)
	return -((1.0 / (math.pi / 4.0)) * math.log(((t_1 + t_2) / (t_1 - t_2))))
function code(f)
	t_0 = Float64(Float64(pi / 4.0) * f)
	t_1 = exp(t_0)
	t_2 = exp(Float64(-t_0))
	return Float64(-Float64(Float64(1.0 / Float64(pi / 4.0)) * log(Float64(Float64(t_1 + t_2) / Float64(t_1 - t_2)))))
end
function tmp = code(f)
	t_0 = (pi / 4.0) * f;
	t_1 = exp(t_0);
	t_2 = exp(-t_0);
	tmp = -((1.0 / (pi / 4.0)) * log(((t_1 + t_2) / (t_1 - t_2))));
end
code[f_] := Block[{t$95$0 = N[(N[(Pi / 4.0), $MachinePrecision] * f), $MachinePrecision]}, Block[{t$95$1 = N[Exp[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Exp[(-t$95$0)], $MachinePrecision]}, (-N[(N[(1.0 / N[(Pi / 4.0), $MachinePrecision]), $MachinePrecision] * N[Log[N[(N[(t$95$1 + t$95$2), $MachinePrecision] / N[(t$95$1 - t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision])]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\pi}{4} \cdot f\\
t_1 := e^{t\_0}\\
t_2 := e^{-t\_0}\\
-\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{t\_1 + t\_2}{t\_1 - t\_2}\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 6 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{\pi}{4} \cdot f\\ t_1 := e^{t\_0}\\ t_2 := e^{-t\_0}\\ -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{t\_1 + t\_2}{t\_1 - t\_2}\right) \end{array} \end{array} \]
(FPCore (f)
 :precision binary64
 (let* ((t_0 (* (/ PI 4.0) f)) (t_1 (exp t_0)) (t_2 (exp (- t_0))))
   (- (* (/ 1.0 (/ PI 4.0)) (log (/ (+ t_1 t_2) (- t_1 t_2)))))))
double code(double f) {
	double t_0 = (((double) M_PI) / 4.0) * f;
	double t_1 = exp(t_0);
	double t_2 = exp(-t_0);
	return -((1.0 / (((double) M_PI) / 4.0)) * log(((t_1 + t_2) / (t_1 - t_2))));
}
public static double code(double f) {
	double t_0 = (Math.PI / 4.0) * f;
	double t_1 = Math.exp(t_0);
	double t_2 = Math.exp(-t_0);
	return -((1.0 / (Math.PI / 4.0)) * Math.log(((t_1 + t_2) / (t_1 - t_2))));
}
def code(f):
	t_0 = (math.pi / 4.0) * f
	t_1 = math.exp(t_0)
	t_2 = math.exp(-t_0)
	return -((1.0 / (math.pi / 4.0)) * math.log(((t_1 + t_2) / (t_1 - t_2))))
function code(f)
	t_0 = Float64(Float64(pi / 4.0) * f)
	t_1 = exp(t_0)
	t_2 = exp(Float64(-t_0))
	return Float64(-Float64(Float64(1.0 / Float64(pi / 4.0)) * log(Float64(Float64(t_1 + t_2) / Float64(t_1 - t_2)))))
end
function tmp = code(f)
	t_0 = (pi / 4.0) * f;
	t_1 = exp(t_0);
	t_2 = exp(-t_0);
	tmp = -((1.0 / (pi / 4.0)) * log(((t_1 + t_2) / (t_1 - t_2))));
end
code[f_] := Block[{t$95$0 = N[(N[(Pi / 4.0), $MachinePrecision] * f), $MachinePrecision]}, Block[{t$95$1 = N[Exp[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Exp[(-t$95$0)], $MachinePrecision]}, (-N[(N[(1.0 / N[(Pi / 4.0), $MachinePrecision]), $MachinePrecision] * N[Log[N[(N[(t$95$1 + t$95$2), $MachinePrecision] / N[(t$95$1 - t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision])]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\pi}{4} \cdot f\\
t_1 := e^{t\_0}\\
t_2 := e^{-t\_0}\\
-\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{t\_1 + t\_2}{t\_1 - t\_2}\right)
\end{array}
\end{array}

Alternative 1: 96.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \left(2 \cdot \log \left(\sqrt{2 \cdot \frac{\cosh \left(f \cdot \left(\pi \cdot 0.25\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, {\left(\pi \cdot f\right)}^{3} \cdot 0.005208333333333333 + {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)}}\right)\right) \cdot \frac{-1}{\frac{\pi}{4}} \end{array} \]
(FPCore (f)
 :precision binary64
 (*
  (*
   2.0
   (log
    (sqrt
     (*
      2.0
      (/
       (cosh (* f (* PI 0.25)))
       (fma
        f
        (* PI 0.5)
        (+
         (* (pow (* PI f) 3.0) 0.005208333333333333)
         (* (pow (* PI f) 5.0) 1.6276041666666666e-5))))))))
  (/ -1.0 (/ PI 4.0))))
double code(double f) {
	return (2.0 * log(sqrt((2.0 * (cosh((f * (((double) M_PI) * 0.25))) / fma(f, (((double) M_PI) * 0.5), ((pow((((double) M_PI) * f), 3.0) * 0.005208333333333333) + (pow((((double) M_PI) * f), 5.0) * 1.6276041666666666e-5)))))))) * (-1.0 / (((double) M_PI) / 4.0));
}
function code(f)
	return Float64(Float64(2.0 * log(sqrt(Float64(2.0 * Float64(cosh(Float64(f * Float64(pi * 0.25))) / fma(f, Float64(pi * 0.5), Float64(Float64((Float64(pi * f) ^ 3.0) * 0.005208333333333333) + Float64((Float64(pi * f) ^ 5.0) * 1.6276041666666666e-5)))))))) * Float64(-1.0 / Float64(pi / 4.0)))
end
code[f_] := N[(N[(2.0 * N[Log[N[Sqrt[N[(2.0 * N[(N[Cosh[N[(f * N[(Pi * 0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(f * N[(Pi * 0.5), $MachinePrecision] + N[(N[(N[Power[N[(Pi * f), $MachinePrecision], 3.0], $MachinePrecision] * 0.005208333333333333), $MachinePrecision] + N[(N[Power[N[(Pi * f), $MachinePrecision], 5.0], $MachinePrecision] * 1.6276041666666666e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[(Pi / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(2 \cdot \log \left(\sqrt{2 \cdot \frac{\cosh \left(f \cdot \left(\pi \cdot 0.25\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, {\left(\pi \cdot f\right)}^{3} \cdot 0.005208333333333333 + {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)}}\right)\right) \cdot \frac{-1}{\frac{\pi}{4}}
\end{array}
Derivation
  1. Initial program 7.3%

    \[-\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. Add Preprocessing
  3. Taylor expanded in f around 0 95.6%

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\color{blue}{f \cdot \left(0.25 \cdot \pi - -0.25 \cdot \pi\right) + \left({f}^{3} \cdot \left(0.0026041666666666665 \cdot {\pi}^{3} - -0.0026041666666666665 \cdot {\pi}^{3}\right) + {f}^{5} \cdot \left(8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5} - -8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5}\right)\right)}}\right) \]
  4. Step-by-step derivation
    1. fma-define95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\color{blue}{\mathsf{fma}\left(f, 0.25 \cdot \pi - -0.25 \cdot \pi, {f}^{3} \cdot \left(0.0026041666666666665 \cdot {\pi}^{3} - -0.0026041666666666665 \cdot {\pi}^{3}\right) + {f}^{5} \cdot \left(8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5} - -8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5}\right)\right)}}\right) \]
    2. distribute-rgt-out--95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\mathsf{fma}\left(f, \color{blue}{\pi \cdot \left(0.25 - -0.25\right)}, {f}^{3} \cdot \left(0.0026041666666666665 \cdot {\pi}^{3} - -0.0026041666666666665 \cdot {\pi}^{3}\right) + {f}^{5} \cdot \left(8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5} - -8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5}\right)\right)}\right) \]
    3. metadata-eval95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\mathsf{fma}\left(f, \pi \cdot \color{blue}{0.5}, {f}^{3} \cdot \left(0.0026041666666666665 \cdot {\pi}^{3} - -0.0026041666666666665 \cdot {\pi}^{3}\right) + {f}^{5} \cdot \left(8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5} - -8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5}\right)\right)}\right) \]
    4. fma-define95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\mathsf{fma}\left(f, \pi \cdot 0.5, \color{blue}{\mathsf{fma}\left({f}^{3}, 0.0026041666666666665 \cdot {\pi}^{3} - -0.0026041666666666665 \cdot {\pi}^{3}, {f}^{5} \cdot \left(8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5} - -8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5}\right)\right)}\right)}\right) \]
    5. distribute-rgt-out--95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, \color{blue}{{\pi}^{3} \cdot \left(0.0026041666666666665 - -0.0026041666666666665\right)}, {f}^{5} \cdot \left(8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5} - -8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5}\right)\right)\right)}\right) \]
    6. metadata-eval95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot \color{blue}{0.005208333333333333}, {f}^{5} \cdot \left(8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5} - -8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5}\right)\right)\right)}\right) \]
    7. distribute-rgt-out--95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {f}^{5} \cdot \color{blue}{\left({\pi}^{5} \cdot \left(8.138020833333333 \cdot 10^{-6} - -8.138020833333333 \cdot 10^{-6}\right)\right)}\right)\right)}\right) \]
    8. metadata-eval95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {f}^{5} \cdot \left({\pi}^{5} \cdot \color{blue}{1.6276041666666666 \cdot 10^{-5}}\right)\right)\right)}\right) \]
  5. Simplified95.6%

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\color{blue}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {f}^{5} \cdot \left({\pi}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)\right)}}\right) \]
  6. Step-by-step derivation
    1. div-inv95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \color{blue}{\left(\left(e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}\right) \cdot \frac{1}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {f}^{5} \cdot \left({\pi}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)\right)}\right)} \]
    2. log-prod95.5%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \color{blue}{\left(\log \left(e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}\right) + \log \left(\frac{1}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {f}^{5} \cdot \left({\pi}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)\right)}\right)\right)} \]
    3. cosh-undef95.5%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \left(\log \color{blue}{\left(2 \cdot \cosh \left(\frac{\pi}{4} \cdot f\right)\right)} + \log \left(\frac{1}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {f}^{5} \cdot \left({\pi}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)\right)}\right)\right) \]
    4. div-inv95.5%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \left(\log \left(2 \cdot \cosh \left(\color{blue}{\left(\pi \cdot \frac{1}{4}\right)} \cdot f\right)\right) + \log \left(\frac{1}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {f}^{5} \cdot \left({\pi}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)\right)}\right)\right) \]
    5. metadata-eval95.5%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \left(\log \left(2 \cdot \cosh \left(\left(\pi \cdot \color{blue}{0.25}\right) \cdot f\right)\right) + \log \left(\frac{1}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {f}^{5} \cdot \left({\pi}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)\right)}\right)\right) \]
  7. Applied egg-rr95.5%

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \color{blue}{\left(\log \left(2 \cdot \cosh \left(\left(\pi \cdot 0.25\right) \cdot f\right)\right) + \log \left(\frac{1}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(f \cdot \pi\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right)\right)} \]
  8. Step-by-step derivation
    1. log-rec95.5%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \left(\log \left(2 \cdot \cosh \left(\left(\pi \cdot 0.25\right) \cdot f\right)\right) + \color{blue}{\left(-\log \left(\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(f \cdot \pi\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)\right)\right)}\right) \]
    2. sub-neg95.5%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \color{blue}{\left(\log \left(2 \cdot \cosh \left(\left(\pi \cdot 0.25\right) \cdot f\right)\right) - \log \left(\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(f \cdot \pi\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)\right)\right)} \]
    3. log-div95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \color{blue}{\log \left(\frac{2 \cdot \cosh \left(\left(\pi \cdot 0.25\right) \cdot f\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(f \cdot \pi\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right)} \]
    4. associate-*l*95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{2 \cdot \cosh \color{blue}{\left(\pi \cdot \left(0.25 \cdot f\right)\right)}}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(f \cdot \pi\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right) \]
    5. *-commutative95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{2 \cdot \cosh \left(\pi \cdot \left(0.25 \cdot f\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\color{blue}{\left(\pi \cdot f\right)}}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right) \]
  9. Simplified95.6%

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \color{blue}{\log \left(\frac{2 \cdot \cosh \left(\pi \cdot \left(0.25 \cdot f\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right)} \]
  10. Step-by-step derivation
    1. add-sqr-sqrt95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \color{blue}{\left(\sqrt{\frac{2 \cdot \cosh \left(\pi \cdot \left(0.25 \cdot f\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}} \cdot \sqrt{\frac{2 \cdot \cosh \left(\pi \cdot \left(0.25 \cdot f\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}}\right)} \]
    2. log-prod95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \color{blue}{\left(\log \left(\sqrt{\frac{2 \cdot \cosh \left(\pi \cdot \left(0.25 \cdot f\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}}\right) + \log \left(\sqrt{\frac{2 \cdot \cosh \left(\pi \cdot \left(0.25 \cdot f\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}}\right)\right)} \]
  11. Applied egg-rr95.6%

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \color{blue}{\left(\log \left(\sqrt{2 \cdot \frac{\cosh \left(\pi \cdot \left(0.25 \cdot f\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}}\right) + \log \left(\sqrt{2 \cdot \frac{\cosh \left(\pi \cdot \left(0.25 \cdot f\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}}\right)\right)} \]
  12. Step-by-step derivation
    1. count-295.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \color{blue}{\left(2 \cdot \log \left(\sqrt{2 \cdot \frac{\cosh \left(\pi \cdot \left(0.25 \cdot f\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}}\right)\right)} \]
    2. *-commutative95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \left(2 \cdot \log \left(\sqrt{2 \cdot \frac{\cosh \color{blue}{\left(\left(0.25 \cdot f\right) \cdot \pi\right)}}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}}\right)\right) \]
    3. *-commutative95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \left(2 \cdot \log \left(\sqrt{2 \cdot \frac{\cosh \left(\color{blue}{\left(f \cdot 0.25\right)} \cdot \pi\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}}\right)\right) \]
    4. associate-*l*95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \left(2 \cdot \log \left(\sqrt{2 \cdot \frac{\cosh \color{blue}{\left(f \cdot \left(0.25 \cdot \pi\right)\right)}}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}}\right)\right) \]
    5. *-commutative95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \left(2 \cdot \log \left(\sqrt{2 \cdot \frac{\cosh \left(f \cdot \color{blue}{\left(\pi \cdot 0.25\right)}\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}}\right)\right) \]
  13. Simplified95.6%

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \color{blue}{\left(2 \cdot \log \left(\sqrt{2 \cdot \frac{\cosh \left(f \cdot \left(\pi \cdot 0.25\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, {\left(\pi \cdot f\right)}^{3} \cdot 0.005208333333333333 + {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)}}\right)\right)} \]
  14. Final simplification95.6%

    \[\leadsto \left(2 \cdot \log \left(\sqrt{2 \cdot \frac{\cosh \left(f \cdot \left(\pi \cdot 0.25\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, {\left(\pi \cdot f\right)}^{3} \cdot 0.005208333333333333 + {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)}}\right)\right) \cdot \frac{-1}{\frac{\pi}{4}} \]
  15. Add Preprocessing

Alternative 2: 96.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{4}{\pi} \cdot \left(-\log \left(2 \cdot \frac{\cosh \left(f \cdot \left(\pi \cdot 0.25\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, {\left(\pi \cdot f\right)}^{3} \cdot 0.005208333333333333 + {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)}\right)\right) \end{array} \]
(FPCore (f)
 :precision binary64
 (*
  (/ 4.0 PI)
  (-
   (log
    (*
     2.0
     (/
      (cosh (* f (* PI 0.25)))
      (fma
       f
       (* PI 0.5)
       (+
        (* (pow (* PI f) 3.0) 0.005208333333333333)
        (* (pow (* PI f) 5.0) 1.6276041666666666e-5)))))))))
double code(double f) {
	return (4.0 / ((double) M_PI)) * -log((2.0 * (cosh((f * (((double) M_PI) * 0.25))) / fma(f, (((double) M_PI) * 0.5), ((pow((((double) M_PI) * f), 3.0) * 0.005208333333333333) + (pow((((double) M_PI) * f), 5.0) * 1.6276041666666666e-5))))));
}
function code(f)
	return Float64(Float64(4.0 / pi) * Float64(-log(Float64(2.0 * Float64(cosh(Float64(f * Float64(pi * 0.25))) / fma(f, Float64(pi * 0.5), Float64(Float64((Float64(pi * f) ^ 3.0) * 0.005208333333333333) + Float64((Float64(pi * f) ^ 5.0) * 1.6276041666666666e-5))))))))
end
code[f_] := N[(N[(4.0 / Pi), $MachinePrecision] * (-N[Log[N[(2.0 * N[(N[Cosh[N[(f * N[(Pi * 0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(f * N[(Pi * 0.5), $MachinePrecision] + N[(N[(N[Power[N[(Pi * f), $MachinePrecision], 3.0], $MachinePrecision] * 0.005208333333333333), $MachinePrecision] + N[(N[Power[N[(Pi * f), $MachinePrecision], 5.0], $MachinePrecision] * 1.6276041666666666e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}

\\
\frac{4}{\pi} \cdot \left(-\log \left(2 \cdot \frac{\cosh \left(f \cdot \left(\pi \cdot 0.25\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, {\left(\pi \cdot f\right)}^{3} \cdot 0.005208333333333333 + {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)}\right)\right)
\end{array}
Derivation
  1. Initial program 7.3%

    \[-\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. Add Preprocessing
  3. Taylor expanded in f around 0 95.6%

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\color{blue}{f \cdot \left(0.25 \cdot \pi - -0.25 \cdot \pi\right) + \left({f}^{3} \cdot \left(0.0026041666666666665 \cdot {\pi}^{3} - -0.0026041666666666665 \cdot {\pi}^{3}\right) + {f}^{5} \cdot \left(8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5} - -8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5}\right)\right)}}\right) \]
  4. Step-by-step derivation
    1. fma-define95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\color{blue}{\mathsf{fma}\left(f, 0.25 \cdot \pi - -0.25 \cdot \pi, {f}^{3} \cdot \left(0.0026041666666666665 \cdot {\pi}^{3} - -0.0026041666666666665 \cdot {\pi}^{3}\right) + {f}^{5} \cdot \left(8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5} - -8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5}\right)\right)}}\right) \]
    2. distribute-rgt-out--95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\mathsf{fma}\left(f, \color{blue}{\pi \cdot \left(0.25 - -0.25\right)}, {f}^{3} \cdot \left(0.0026041666666666665 \cdot {\pi}^{3} - -0.0026041666666666665 \cdot {\pi}^{3}\right) + {f}^{5} \cdot \left(8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5} - -8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5}\right)\right)}\right) \]
    3. metadata-eval95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\mathsf{fma}\left(f, \pi \cdot \color{blue}{0.5}, {f}^{3} \cdot \left(0.0026041666666666665 \cdot {\pi}^{3} - -0.0026041666666666665 \cdot {\pi}^{3}\right) + {f}^{5} \cdot \left(8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5} - -8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5}\right)\right)}\right) \]
    4. fma-define95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\mathsf{fma}\left(f, \pi \cdot 0.5, \color{blue}{\mathsf{fma}\left({f}^{3}, 0.0026041666666666665 \cdot {\pi}^{3} - -0.0026041666666666665 \cdot {\pi}^{3}, {f}^{5} \cdot \left(8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5} - -8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5}\right)\right)}\right)}\right) \]
    5. distribute-rgt-out--95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, \color{blue}{{\pi}^{3} \cdot \left(0.0026041666666666665 - -0.0026041666666666665\right)}, {f}^{5} \cdot \left(8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5} - -8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5}\right)\right)\right)}\right) \]
    6. metadata-eval95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot \color{blue}{0.005208333333333333}, {f}^{5} \cdot \left(8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5} - -8.138020833333333 \cdot 10^{-6} \cdot {\pi}^{5}\right)\right)\right)}\right) \]
    7. distribute-rgt-out--95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {f}^{5} \cdot \color{blue}{\left({\pi}^{5} \cdot \left(8.138020833333333 \cdot 10^{-6} - -8.138020833333333 \cdot 10^{-6}\right)\right)}\right)\right)}\right) \]
    8. metadata-eval95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {f}^{5} \cdot \left({\pi}^{5} \cdot \color{blue}{1.6276041666666666 \cdot 10^{-5}}\right)\right)\right)}\right) \]
  5. Simplified95.6%

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\color{blue}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {f}^{5} \cdot \left({\pi}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)\right)}}\right) \]
  6. Step-by-step derivation
    1. div-inv95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \color{blue}{\left(\left(e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}\right) \cdot \frac{1}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {f}^{5} \cdot \left({\pi}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)\right)}\right)} \]
    2. log-prod95.5%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \color{blue}{\left(\log \left(e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}\right) + \log \left(\frac{1}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {f}^{5} \cdot \left({\pi}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)\right)}\right)\right)} \]
    3. cosh-undef95.5%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \left(\log \color{blue}{\left(2 \cdot \cosh \left(\frac{\pi}{4} \cdot f\right)\right)} + \log \left(\frac{1}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {f}^{5} \cdot \left({\pi}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)\right)}\right)\right) \]
    4. div-inv95.5%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \left(\log \left(2 \cdot \cosh \left(\color{blue}{\left(\pi \cdot \frac{1}{4}\right)} \cdot f\right)\right) + \log \left(\frac{1}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {f}^{5} \cdot \left({\pi}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)\right)}\right)\right) \]
    5. metadata-eval95.5%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \left(\log \left(2 \cdot \cosh \left(\left(\pi \cdot \color{blue}{0.25}\right) \cdot f\right)\right) + \log \left(\frac{1}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {f}^{5} \cdot \left({\pi}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)\right)}\right)\right) \]
  7. Applied egg-rr95.5%

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \color{blue}{\left(\log \left(2 \cdot \cosh \left(\left(\pi \cdot 0.25\right) \cdot f\right)\right) + \log \left(\frac{1}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(f \cdot \pi\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right)\right)} \]
  8. Step-by-step derivation
    1. log-rec95.5%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \left(\log \left(2 \cdot \cosh \left(\left(\pi \cdot 0.25\right) \cdot f\right)\right) + \color{blue}{\left(-\log \left(\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(f \cdot \pi\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)\right)\right)}\right) \]
    2. sub-neg95.5%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \color{blue}{\left(\log \left(2 \cdot \cosh \left(\left(\pi \cdot 0.25\right) \cdot f\right)\right) - \log \left(\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(f \cdot \pi\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)\right)\right)} \]
    3. log-div95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \color{blue}{\log \left(\frac{2 \cdot \cosh \left(\left(\pi \cdot 0.25\right) \cdot f\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(f \cdot \pi\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right)} \]
    4. associate-*l*95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{2 \cdot \cosh \color{blue}{\left(\pi \cdot \left(0.25 \cdot f\right)\right)}}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(f \cdot \pi\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right) \]
    5. *-commutative95.6%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{2 \cdot \cosh \left(\pi \cdot \left(0.25 \cdot f\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\color{blue}{\left(\pi \cdot f\right)}}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right) \]
  9. Simplified95.6%

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \color{blue}{\log \left(\frac{2 \cdot \cosh \left(\pi \cdot \left(0.25 \cdot f\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right)} \]
  10. Step-by-step derivation
    1. pow195.6%

      \[\leadsto -\color{blue}{{\left(\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{2 \cdot \cosh \left(\pi \cdot \left(0.25 \cdot f\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right)\right)}^{1}} \]
  11. Applied egg-rr95.6%

    \[\leadsto -\color{blue}{{\left(\log \left(2 \cdot \frac{\cosh \left(\pi \cdot \left(0.25 \cdot f\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right) \cdot \frac{4}{\pi}\right)}^{1}} \]
  12. Step-by-step derivation
    1. unpow195.6%

      \[\leadsto -\color{blue}{\log \left(2 \cdot \frac{\cosh \left(\pi \cdot \left(0.25 \cdot f\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right) \cdot \frac{4}{\pi}} \]
    2. *-commutative95.6%

      \[\leadsto -\color{blue}{\frac{4}{\pi} \cdot \log \left(2 \cdot \frac{\cosh \left(\pi \cdot \left(0.25 \cdot f\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right)} \]
    3. *-commutative95.6%

      \[\leadsto -\frac{4}{\pi} \cdot \log \left(2 \cdot \frac{\cosh \color{blue}{\left(\left(0.25 \cdot f\right) \cdot \pi\right)}}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right) \]
    4. *-commutative95.6%

      \[\leadsto -\frac{4}{\pi} \cdot \log \left(2 \cdot \frac{\cosh \left(\color{blue}{\left(f \cdot 0.25\right)} \cdot \pi\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right) \]
    5. associate-*l*95.6%

      \[\leadsto -\frac{4}{\pi} \cdot \log \left(2 \cdot \frac{\cosh \color{blue}{\left(f \cdot \left(0.25 \cdot \pi\right)\right)}}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right) \]
    6. *-commutative95.6%

      \[\leadsto -\frac{4}{\pi} \cdot \log \left(2 \cdot \frac{\cosh \left(f \cdot \color{blue}{\left(\pi \cdot 0.25\right)}\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, \mathsf{fma}\left({f}^{3}, {\pi}^{3} \cdot 0.005208333333333333, {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)\right)}\right) \]
  13. Simplified95.6%

    \[\leadsto -\color{blue}{\frac{4}{\pi} \cdot \log \left(2 \cdot \frac{\cosh \left(f \cdot \left(\pi \cdot 0.25\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, {\left(\pi \cdot f\right)}^{3} \cdot 0.005208333333333333 + {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)}\right)} \]
  14. Final simplification95.6%

    \[\leadsto \frac{4}{\pi} \cdot \left(-\log \left(2 \cdot \frac{\cosh \left(f \cdot \left(\pi \cdot 0.25\right)\right)}{\mathsf{fma}\left(f, \pi \cdot 0.5, {\left(\pi \cdot f\right)}^{3} \cdot 0.005208333333333333 + {\left(\pi \cdot f\right)}^{5} \cdot 1.6276041666666666 \cdot 10^{-5}\right)}\right)\right) \]
  15. Add Preprocessing

Alternative 3: 96.4% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \log \left(\mathsf{fma}\left(f, 0.0625 \cdot \left(\pi \cdot 2\right) + \left(\left(\pi \cdot 2\right) \cdot 0.010416666666666666\right) \cdot -2, \frac{\frac{4}{\pi}}{f}\right)\right) \cdot \frac{-1}{\frac{\pi}{4}} \end{array} \]
(FPCore (f)
 :precision binary64
 (*
  (log
   (fma
    f
    (+ (* 0.0625 (* PI 2.0)) (* (* (* PI 2.0) 0.010416666666666666) -2.0))
    (/ (/ 4.0 PI) f)))
  (/ -1.0 (/ PI 4.0))))
double code(double f) {
	return log(fma(f, ((0.0625 * (((double) M_PI) * 2.0)) + (((((double) M_PI) * 2.0) * 0.010416666666666666) * -2.0)), ((4.0 / ((double) M_PI)) / f))) * (-1.0 / (((double) M_PI) / 4.0));
}
function code(f)
	return Float64(log(fma(f, Float64(Float64(0.0625 * Float64(pi * 2.0)) + Float64(Float64(Float64(pi * 2.0) * 0.010416666666666666) * -2.0)), Float64(Float64(4.0 / pi) / f))) * Float64(-1.0 / Float64(pi / 4.0)))
end
code[f_] := N[(N[Log[N[(f * N[(N[(0.0625 * N[(Pi * 2.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(Pi * 2.0), $MachinePrecision] * 0.010416666666666666), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] + N[(N[(4.0 / Pi), $MachinePrecision] / f), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / N[(Pi / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[-\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. Add Preprocessing
  3. Taylor expanded in f around 0 95.4%

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \color{blue}{\left(-0.25 \cdot \frac{\pi}{0.25 \cdot \pi - -0.25 \cdot \pi} + \left(0.25 \cdot \frac{\pi}{0.25 \cdot \pi - -0.25 \cdot \pi} + \left(f \cdot \left(0.0625 \cdot \frac{{\pi}^{2}}{0.25 \cdot \pi - -0.25 \cdot \pi} - 2 \cdot \frac{0.0026041666666666665 \cdot {\pi}^{3} - -0.0026041666666666665 \cdot {\pi}^{3}}{{\left(0.25 \cdot \pi - -0.25 \cdot \pi\right)}^{2}}\right) + 2 \cdot \frac{1}{f \cdot \left(0.25 \cdot \pi - -0.25 \cdot \pi\right)}\right)\right)\right)} \]
  4. Simplified95.4%

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \color{blue}{\left(\mathsf{fma}\left(f, \mathsf{fma}\left(0.0625, \pi \cdot 2, \left(0.005208333333333333 \cdot \left(2 \cdot \left(\pi \cdot 2\right)\right)\right) \cdot -2\right), \frac{\frac{4}{\pi}}{f}\right)\right)} \]
  5. Step-by-step derivation
    1. fma-undefine95.4%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\mathsf{fma}\left(f, \color{blue}{0.0625 \cdot \left(\pi \cdot 2\right) + \left(0.005208333333333333 \cdot \left(2 \cdot \left(\pi \cdot 2\right)\right)\right) \cdot -2}, \frac{\frac{4}{\pi}}{f}\right)\right) \]
    2. associate-*r*95.4%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\mathsf{fma}\left(f, 0.0625 \cdot \left(\pi \cdot 2\right) + \color{blue}{\left(\left(0.005208333333333333 \cdot 2\right) \cdot \left(\pi \cdot 2\right)\right)} \cdot -2, \frac{\frac{4}{\pi}}{f}\right)\right) \]
    3. metadata-eval95.4%

      \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\mathsf{fma}\left(f, 0.0625 \cdot \left(\pi \cdot 2\right) + \left(\color{blue}{0.010416666666666666} \cdot \left(\pi \cdot 2\right)\right) \cdot -2, \frac{\frac{4}{\pi}}{f}\right)\right) \]
  6. Applied egg-rr95.4%

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\mathsf{fma}\left(f, \color{blue}{0.0625 \cdot \left(\pi \cdot 2\right) + \left(0.010416666666666666 \cdot \left(\pi \cdot 2\right)\right) \cdot -2}, \frac{\frac{4}{\pi}}{f}\right)\right) \]
  7. Final simplification95.4%

    \[\leadsto \log \left(\mathsf{fma}\left(f, 0.0625 \cdot \left(\pi \cdot 2\right) + \left(\left(\pi \cdot 2\right) \cdot 0.010416666666666666\right) \cdot -2, \frac{\frac{4}{\pi}}{f}\right)\right) \cdot \frac{-1}{\frac{\pi}{4}} \]
  8. Add Preprocessing

Alternative 4: 95.8% accurate, 4.9× speedup?

\[\begin{array}{l} \\ \log \left(\frac{4}{\pi \cdot f}\right) \cdot \frac{-4}{\pi} \end{array} \]
(FPCore (f) :precision binary64 (* (log (/ 4.0 (* PI f))) (/ -4.0 PI)))
double code(double f) {
	return log((4.0 / (((double) M_PI) * f))) * (-4.0 / ((double) M_PI));
}
public static double code(double f) {
	return Math.log((4.0 / (Math.PI * f))) * (-4.0 / Math.PI);
}
def code(f):
	return math.log((4.0 / (math.pi * f))) * (-4.0 / math.pi)
function code(f)
	return Float64(log(Float64(4.0 / Float64(pi * f))) * Float64(-4.0 / pi))
end
function tmp = code(f)
	tmp = log((4.0 / (pi * f))) * (-4.0 / pi);
end
code[f_] := N[(N[Log[N[(4.0 / N[(Pi * f), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-4.0 / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[-\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. Step-by-step derivation
    1. *-commutative7.3%

      \[\leadsto -\color{blue}{\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) \cdot \frac{1}{\frac{\pi}{4}}} \]
    2. distribute-rgt-neg-in7.3%

      \[\leadsto \color{blue}{\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) \cdot \left(-\frac{1}{\frac{\pi}{4}}\right)} \]
  3. Simplified7.3%

    \[\leadsto \color{blue}{\log \left(\frac{{\left(e^{\frac{\pi}{-4}}\right)}^{f} + {\left(e^{f}\right)}^{\left(\frac{\pi}{4}\right)}}{{\left(e^{f}\right)}^{\left(\frac{\pi}{4}\right)} - {\left(e^{\frac{\pi}{-4}}\right)}^{f}}\right) \cdot \frac{-4}{\pi}} \]
  4. Add Preprocessing
  5. Taylor expanded in f around 0 95.0%

    \[\leadsto \color{blue}{-4 \cdot \frac{\log \left(\frac{2}{0.25 \cdot \pi - -0.25 \cdot \pi}\right) + -1 \cdot \log f}{\pi}} \]
  6. Step-by-step derivation
    1. *-commutative95.0%

      \[\leadsto \color{blue}{\frac{\log \left(\frac{2}{0.25 \cdot \pi - -0.25 \cdot \pi}\right) + -1 \cdot \log f}{\pi} \cdot -4} \]
    2. associate-*l/95.0%

      \[\leadsto \color{blue}{\frac{\left(\log \left(\frac{2}{0.25 \cdot \pi - -0.25 \cdot \pi}\right) + -1 \cdot \log f\right) \cdot -4}{\pi}} \]
    3. associate-/l*95.0%

      \[\leadsto \color{blue}{\left(\log \left(\frac{2}{0.25 \cdot \pi - -0.25 \cdot \pi}\right) + -1 \cdot \log f\right) \cdot \frac{-4}{\pi}} \]
    4. mul-1-neg95.0%

      \[\leadsto \left(\log \left(\frac{2}{0.25 \cdot \pi - -0.25 \cdot \pi}\right) + \color{blue}{\left(-\log f\right)}\right) \cdot \frac{-4}{\pi} \]
    5. unsub-neg95.0%

      \[\leadsto \color{blue}{\left(\log \left(\frac{2}{0.25 \cdot \pi - -0.25 \cdot \pi}\right) - \log f\right)} \cdot \frac{-4}{\pi} \]
    6. distribute-rgt-out--95.0%

      \[\leadsto \left(\log \left(\frac{2}{\color{blue}{\pi \cdot \left(0.25 - -0.25\right)}}\right) - \log f\right) \cdot \frac{-4}{\pi} \]
    7. metadata-eval95.0%

      \[\leadsto \left(\log \left(\frac{2}{\pi \cdot \color{blue}{0.5}}\right) - \log f\right) \cdot \frac{-4}{\pi} \]
    8. *-commutative95.0%

      \[\leadsto \left(\log \left(\frac{2}{\color{blue}{0.5 \cdot \pi}}\right) - \log f\right) \cdot \frac{-4}{\pi} \]
    9. associate-/r*95.0%

      \[\leadsto \left(\log \color{blue}{\left(\frac{\frac{2}{0.5}}{\pi}\right)} - \log f\right) \cdot \frac{-4}{\pi} \]
    10. metadata-eval95.0%

      \[\leadsto \left(\log \left(\frac{\color{blue}{4}}{\pi}\right) - \log f\right) \cdot \frac{-4}{\pi} \]
  7. Simplified95.0%

    \[\leadsto \color{blue}{\left(\log \left(\frac{4}{\pi}\right) - \log f\right) \cdot \frac{-4}{\pi}} \]
  8. Step-by-step derivation
    1. diff-log94.9%

      \[\leadsto \color{blue}{\log \left(\frac{\frac{4}{\pi}}{f}\right)} \cdot \frac{-4}{\pi} \]
    2. associate-/l/94.9%

      \[\leadsto \log \color{blue}{\left(\frac{4}{f \cdot \pi}\right)} \cdot \frac{-4}{\pi} \]
  9. Applied egg-rr94.9%

    \[\leadsto \color{blue}{\log \left(\frac{4}{f \cdot \pi}\right)} \cdot \frac{-4}{\pi} \]
  10. Final simplification94.9%

    \[\leadsto \log \left(\frac{4}{\pi \cdot f}\right) \cdot \frac{-4}{\pi} \]
  11. Add Preprocessing

Alternative 5: 96.0% accurate, 4.9× speedup?

\[\begin{array}{l} \\ \frac{\log \left(\frac{4}{\pi \cdot f}\right) \cdot -4}{\pi} \end{array} \]
(FPCore (f) :precision binary64 (/ (* (log (/ 4.0 (* PI f))) -4.0) PI))
double code(double f) {
	return (log((4.0 / (((double) M_PI) * f))) * -4.0) / ((double) M_PI);
}
public static double code(double f) {
	return (Math.log((4.0 / (Math.PI * f))) * -4.0) / Math.PI;
}
def code(f):
	return (math.log((4.0 / (math.pi * f))) * -4.0) / math.pi
function code(f)
	return Float64(Float64(log(Float64(4.0 / Float64(pi * f))) * -4.0) / pi)
end
function tmp = code(f)
	tmp = (log((4.0 / (pi * f))) * -4.0) / pi;
end
code[f_] := N[(N[(N[Log[N[(4.0 / N[(Pi * f), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -4.0), $MachinePrecision] / Pi), $MachinePrecision]
\begin{array}{l}

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

    \[-\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. Step-by-step derivation
    1. *-commutative7.3%

      \[\leadsto -\color{blue}{\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) \cdot \frac{1}{\frac{\pi}{4}}} \]
    2. distribute-rgt-neg-in7.3%

      \[\leadsto \color{blue}{\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) \cdot \left(-\frac{1}{\frac{\pi}{4}}\right)} \]
  3. Simplified7.3%

    \[\leadsto \color{blue}{\log \left(\frac{{\left(e^{\frac{\pi}{-4}}\right)}^{f} + {\left(e^{f}\right)}^{\left(\frac{\pi}{4}\right)}}{{\left(e^{f}\right)}^{\left(\frac{\pi}{4}\right)} - {\left(e^{\frac{\pi}{-4}}\right)}^{f}}\right) \cdot \frac{-4}{\pi}} \]
  4. Add Preprocessing
  5. Taylor expanded in f around 0 95.0%

    \[\leadsto \color{blue}{-4 \cdot \frac{\log \left(\frac{2}{0.25 \cdot \pi - -0.25 \cdot \pi}\right) + -1 \cdot \log f}{\pi}} \]
  6. Step-by-step derivation
    1. *-commutative95.0%

      \[\leadsto \color{blue}{\frac{\log \left(\frac{2}{0.25 \cdot \pi - -0.25 \cdot \pi}\right) + -1 \cdot \log f}{\pi} \cdot -4} \]
    2. associate-*l/95.0%

      \[\leadsto \color{blue}{\frac{\left(\log \left(\frac{2}{0.25 \cdot \pi - -0.25 \cdot \pi}\right) + -1 \cdot \log f\right) \cdot -4}{\pi}} \]
    3. associate-/l*95.0%

      \[\leadsto \color{blue}{\left(\log \left(\frac{2}{0.25 \cdot \pi - -0.25 \cdot \pi}\right) + -1 \cdot \log f\right) \cdot \frac{-4}{\pi}} \]
    4. mul-1-neg95.0%

      \[\leadsto \left(\log \left(\frac{2}{0.25 \cdot \pi - -0.25 \cdot \pi}\right) + \color{blue}{\left(-\log f\right)}\right) \cdot \frac{-4}{\pi} \]
    5. unsub-neg95.0%

      \[\leadsto \color{blue}{\left(\log \left(\frac{2}{0.25 \cdot \pi - -0.25 \cdot \pi}\right) - \log f\right)} \cdot \frac{-4}{\pi} \]
    6. distribute-rgt-out--95.0%

      \[\leadsto \left(\log \left(\frac{2}{\color{blue}{\pi \cdot \left(0.25 - -0.25\right)}}\right) - \log f\right) \cdot \frac{-4}{\pi} \]
    7. metadata-eval95.0%

      \[\leadsto \left(\log \left(\frac{2}{\pi \cdot \color{blue}{0.5}}\right) - \log f\right) \cdot \frac{-4}{\pi} \]
    8. *-commutative95.0%

      \[\leadsto \left(\log \left(\frac{2}{\color{blue}{0.5 \cdot \pi}}\right) - \log f\right) \cdot \frac{-4}{\pi} \]
    9. associate-/r*95.0%

      \[\leadsto \left(\log \color{blue}{\left(\frac{\frac{2}{0.5}}{\pi}\right)} - \log f\right) \cdot \frac{-4}{\pi} \]
    10. metadata-eval95.0%

      \[\leadsto \left(\log \left(\frac{\color{blue}{4}}{\pi}\right) - \log f\right) \cdot \frac{-4}{\pi} \]
  7. Simplified95.0%

    \[\leadsto \color{blue}{\left(\log \left(\frac{4}{\pi}\right) - \log f\right) \cdot \frac{-4}{\pi}} \]
  8. Step-by-step derivation
    1. associate-*r/95.0%

      \[\leadsto \color{blue}{\frac{\left(\log \left(\frac{4}{\pi}\right) - \log f\right) \cdot -4}{\pi}} \]
    2. diff-log95.0%

      \[\leadsto \frac{\color{blue}{\log \left(\frac{\frac{4}{\pi}}{f}\right)} \cdot -4}{\pi} \]
    3. associate-/l/95.0%

      \[\leadsto \frac{\log \color{blue}{\left(\frac{4}{f \cdot \pi}\right)} \cdot -4}{\pi} \]
  9. Applied egg-rr95.0%

    \[\leadsto \color{blue}{\frac{\log \left(\frac{4}{f \cdot \pi}\right) \cdot -4}{\pi}} \]
  10. Final simplification95.0%

    \[\leadsto \frac{\log \left(\frac{4}{\pi \cdot f}\right) \cdot -4}{\pi} \]
  11. Add Preprocessing

Alternative 6: 1.6% accurate, 5.0× speedup?

\[\begin{array}{l} \\ 4 \cdot \frac{\log 0.07407407407407407}{-\pi} \end{array} \]
(FPCore (f) :precision binary64 (* 4.0 (/ (log 0.07407407407407407) (- PI))))
double code(double f) {
	return 4.0 * (log(0.07407407407407407) / -((double) M_PI));
}
public static double code(double f) {
	return 4.0 * (Math.log(0.07407407407407407) / -Math.PI);
}
def code(f):
	return 4.0 * (math.log(0.07407407407407407) / -math.pi)
function code(f)
	return Float64(4.0 * Float64(log(0.07407407407407407) / Float64(-pi)))
end
function tmp = code(f)
	tmp = 4.0 * (log(0.07407407407407407) / -pi);
end
code[f_] := N[(4.0 * N[(N[Log[0.07407407407407407], $MachinePrecision] / (-Pi)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
4 \cdot \frac{\log 0.07407407407407407}{-\pi}
\end{array}
Derivation
  1. Initial program 7.3%

    \[-\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. Add Preprocessing
  3. Applied egg-rr1.7%

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

    \[\leadsto -\color{blue}{4 \cdot \frac{\log 0.07407407407407407}{\pi}} \]
  5. Final simplification1.6%

    \[\leadsto 4 \cdot \frac{\log 0.07407407407407407}{-\pi} \]
  6. Add Preprocessing

Reproduce

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