VandenBroeck and Keller, Equation (20)

Percentage Accurate: 6.7% → 99.0%
Time: 18.2s
Alternatives: 5
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 5 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.7% 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: 99.0% accurate, 2.5× speedup?

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

\\
\frac{\frac{\log \tanh \left(\frac{f}{\frac{4}{\pi}}\right)}{\pi}}{0.25}
\end{array}
Derivation
  1. Initial program 7.9%

    \[-\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. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{neg}\left(\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}}\right) \cdot \frac{1}{\frac{\mathsf{PI}\left(\right)}{4}}\right) \]
    2. un-div-invN/A

      \[\leadsto \mathsf{neg}\left(\frac{\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}}\right)}{\frac{\mathsf{PI}\left(\right)}{4}}\right) \]
    3. div-invN/A

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

      \[\leadsto \mathsf{neg}\left(\frac{\frac{\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}}\right)}{\mathsf{PI}\left(\right)}}{\frac{1}{4}}\right) \]
  4. Applied egg-rr98.9%

    \[\leadsto \color{blue}{\frac{\frac{\log \tanh \left(\frac{f}{\frac{4}{\pi}}\right)}{\pi}}{0.25}} \]
  5. Add Preprocessing

Alternative 2: 96.5% accurate, 3.9× speedup?

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

\\
\begin{array}{l}
t_0 := f \cdot \left(f \cdot \pi\right)\\
\frac{4 \cdot \log \left(\frac{f}{\frac{16}{\pi \cdot \pi} - \left(t\_0 \cdot t\_0\right) \cdot 0.006944444444444444} \cdot \left(\frac{4}{\pi} - f \cdot \left(f \cdot \left(\pi \cdot 0.08333333333333333\right)\right)\right)\right)}{\pi}
\end{array}
\end{array}
Derivation
  1. Initial program 7.9%

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

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

    \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 4\right)\right), \mathsf{log.f64}\left(\color{blue}{\left(\frac{4 \cdot \left({f}^{2} \cdot \left(\left(\frac{-1}{48} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) - \frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)}^{2}} + \frac{1}{16} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{\frac{1}{2} \cdot \mathsf{PI}\left(\right) - \frac{-1}{2} \cdot \mathsf{PI}\left(\right)}\right) - \frac{1}{48} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) - \frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)}^{2}}\right)\right) + 4 \cdot \frac{1}{\frac{1}{2} \cdot \mathsf{PI}\left(\right) - \frac{-1}{2} \cdot \mathsf{PI}\left(\right)}}{f}\right)}\right)\right)\right) \]
  5. Simplified96.6%

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \color{blue}{\left(\frac{\frac{4}{\pi} + \left(\pi \cdot 0.0625 + \pi \cdot -0.041666666666666664\right) \cdot \left(4 \cdot \left(f \cdot f\right)\right)}{f}\right)} \]
  6. Step-by-step derivation
    1. clear-numN/A

      \[\leadsto \mathsf{neg}\left(\frac{4}{\mathsf{PI}\left(\right)} \cdot \log \left(\frac{\frac{4}{\mathsf{PI}\left(\right)} + \left(\mathsf{PI}\left(\right) \cdot \frac{1}{16} + \mathsf{PI}\left(\right) \cdot \frac{-1}{24}\right) \cdot \left(4 \cdot \left(f \cdot f\right)\right)}{f}\right)\right) \]
    2. distribute-rgt-neg-inN/A

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(4 \cdot \left(\mathsf{neg}\left(\log \left(\frac{\frac{4}{\mathsf{PI}\left(\right)} + \left(\mathsf{PI}\left(\right) \cdot \frac{1}{16} + \mathsf{PI}\left(\right) \cdot \frac{-1}{24}\right) \cdot \left(4 \cdot \left(f \cdot f\right)\right)}{f}\right)\right)\right)\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
  7. Applied egg-rr96.7%

    \[\leadsto \color{blue}{\frac{4 \cdot \log \left(\frac{f}{\frac{4}{\pi} + \left(f \cdot f\right) \cdot \left(\pi \cdot 0.08333333333333333\right)}\right)}{\pi}} \]
  8. Step-by-step derivation
    1. flip-+N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(4, \mathsf{log.f64}\left(\left(\frac{f}{\frac{\frac{4}{\mathsf{PI}\left(\right)} \cdot \frac{4}{\mathsf{PI}\left(\right)} - \left(\left(f \cdot f\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{12}\right)\right) \cdot \left(\left(f \cdot f\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{12}\right)\right)}{\frac{4}{\mathsf{PI}\left(\right)} - \left(f \cdot f\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{12}\right)}}\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    2. associate-/r/N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(4, \mathsf{log.f64}\left(\left(\frac{f}{\frac{4}{\mathsf{PI}\left(\right)} \cdot \frac{4}{\mathsf{PI}\left(\right)} - \left(\left(f \cdot f\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{12}\right)\right) \cdot \left(\left(f \cdot f\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{12}\right)\right)} \cdot \left(\frac{4}{\mathsf{PI}\left(\right)} - \left(f \cdot f\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{12}\right)\right)\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(4, \mathsf{log.f64}\left(\mathsf{*.f64}\left(\left(\frac{f}{\frac{4}{\mathsf{PI}\left(\right)} \cdot \frac{4}{\mathsf{PI}\left(\right)} - \left(\left(f \cdot f\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{12}\right)\right) \cdot \left(\left(f \cdot f\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{12}\right)\right)}\right), \left(\frac{4}{\mathsf{PI}\left(\right)} - \left(f \cdot f\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{1}{12}\right)\right)\right)\right)\right), \mathsf{PI.f64}\left(\right)\right) \]
  9. Applied egg-rr96.7%

    \[\leadsto \frac{4 \cdot \log \color{blue}{\left(\frac{f}{\frac{16}{\pi \cdot \pi} - \left(\left(f \cdot \left(f \cdot \pi\right)\right) \cdot \left(f \cdot \left(f \cdot \pi\right)\right)\right) \cdot 0.006944444444444444} \cdot \left(\frac{4}{\pi} - f \cdot \left(f \cdot \left(\pi \cdot 0.08333333333333333\right)\right)\right)\right)}}{\pi} \]
  10. Add Preprocessing

Alternative 3: 96.5% accurate, 4.5× speedup?

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

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

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

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

    \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 4\right)\right), \mathsf{log.f64}\left(\color{blue}{\left(\frac{4 \cdot \left({f}^{2} \cdot \left(\left(\frac{-1}{48} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) - \frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)}^{2}} + \frac{1}{16} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{\frac{1}{2} \cdot \mathsf{PI}\left(\right) - \frac{-1}{2} \cdot \mathsf{PI}\left(\right)}\right) - \frac{1}{48} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) - \frac{-1}{2} \cdot \mathsf{PI}\left(\right)\right)}^{2}}\right)\right) + 4 \cdot \frac{1}{\frac{1}{2} \cdot \mathsf{PI}\left(\right) - \frac{-1}{2} \cdot \mathsf{PI}\left(\right)}}{f}\right)}\right)\right)\right) \]
  5. Simplified96.6%

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \color{blue}{\left(\frac{\frac{4}{\pi} + \left(\pi \cdot 0.0625 + \pi \cdot -0.041666666666666664\right) \cdot \left(4 \cdot \left(f \cdot f\right)\right)}{f}\right)} \]
  6. Step-by-step derivation
    1. clear-numN/A

      \[\leadsto \mathsf{neg}\left(\frac{4}{\mathsf{PI}\left(\right)} \cdot \log \left(\frac{\frac{4}{\mathsf{PI}\left(\right)} + \left(\mathsf{PI}\left(\right) \cdot \frac{1}{16} + \mathsf{PI}\left(\right) \cdot \frac{-1}{24}\right) \cdot \left(4 \cdot \left(f \cdot f\right)\right)}{f}\right)\right) \]
    2. distribute-rgt-neg-inN/A

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(4 \cdot \left(\mathsf{neg}\left(\log \left(\frac{\frac{4}{\mathsf{PI}\left(\right)} + \left(\mathsf{PI}\left(\right) \cdot \frac{1}{16} + \mathsf{PI}\left(\right) \cdot \frac{-1}{24}\right) \cdot \left(4 \cdot \left(f \cdot f\right)\right)}{f}\right)\right)\right)\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
  7. Applied egg-rr96.7%

    \[\leadsto \color{blue}{\frac{4 \cdot \log \left(\frac{f}{\frac{4}{\pi} + \left(f \cdot f\right) \cdot \left(\pi \cdot 0.08333333333333333\right)}\right)}{\pi}} \]
  8. Final simplification96.7%

    \[\leadsto \frac{4 \cdot \log \left(\frac{f}{\frac{4}{\pi} + \left(\pi \cdot 0.08333333333333333\right) \cdot \left(f \cdot f\right)}\right)}{\pi} \]
  9. Add Preprocessing

Alternative 4: 96.0% accurate, 4.9× speedup?

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

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

    \[-\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. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{neg}\left(\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}}\right) \cdot \frac{1}{\frac{\mathsf{PI}\left(\right)}{4}}\right) \]
    2. un-div-invN/A

      \[\leadsto \mathsf{neg}\left(\frac{\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}}\right)}{\frac{\mathsf{PI}\left(\right)}{4}}\right) \]
    3. div-invN/A

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

      \[\leadsto \mathsf{neg}\left(\frac{\frac{\log \left(\frac{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} + e^{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}}{e^{\frac{\mathsf{PI}\left(\right)}{4} \cdot f} - e^{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4} \cdot f\right)}}\right)}{\mathsf{PI}\left(\right)}}{\frac{1}{4}}\right) \]
  4. Applied egg-rr98.9%

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(f, \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right)\right)\right)\right), \mathsf{PI.f64}\left(\right)\right), \frac{1}{4}\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(f, \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{PI}\left(\right)\right)\right)\right), \mathsf{PI.f64}\left(\right)\right), \frac{1}{4}\right) \]
    6. PI-lowering-PI.f6496.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{*.f64}\left(f, \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{PI.f64}\left(\right)\right)\right)\right), \mathsf{PI.f64}\left(\right)\right), \frac{1}{4}\right) \]
  7. Simplified96.0%

    \[\leadsto \frac{\frac{\log \color{blue}{\left(f \cdot \left(0.25 \cdot \pi\right)\right)}}{\pi}}{0.25} \]
  8. Final simplification96.0%

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

Alternative 5: 95.9% accurate, 4.9× speedup?

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

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

    \[-\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

    \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 4\right)\right), \mathsf{log.f64}\left(\color{blue}{\left(\frac{2}{f \cdot \left(\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)\right)}\right)}\right)\right)\right) \]
  4. Step-by-step derivation
    1. associate-/l/N/A

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 4\right)\right), \mathsf{log.f64}\left(\left(\frac{\frac{2}{\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)}}{f}\right)\right)\right)\right) \]
    2. metadata-evalN/A

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

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 4\right)\right), \mathsf{log.f64}\left(\left(\frac{2 \cdot \frac{1}{\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)}}{f}\right)\right)\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 4\right)\right), \mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot \frac{1}{\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)}\right), f\right)\right)\right)\right) \]
    5. associate-*r/N/A

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 4\right)\right), \mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot 1}{\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)}\right), f\right)\right)\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 4\right)\right), \mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(\frac{2}{\frac{1}{4} \cdot \mathsf{PI}\left(\right) - \frac{-1}{4} \cdot \mathsf{PI}\left(\right)}\right), f\right)\right)\right)\right) \]
    7. distribute-rgt-out--N/A

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 4\right)\right), \mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(\frac{2}{\mathsf{PI}\left(\right) \cdot \left(\frac{1}{4} - \frac{-1}{4}\right)}\right), f\right)\right)\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 4\right)\right), \mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(\frac{2}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}\right), f\right)\right)\right)\right) \]
    9. *-commutativeN/A

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 4\right)\right), \mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(\frac{2}{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}\right), f\right)\right)\right)\right) \]
    10. associate-/r*N/A

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 4\right)\right), \mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{2}{\frac{1}{2}}}{\mathsf{PI}\left(\right)}\right), f\right)\right)\right)\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 4\right)\right), \mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(\frac{4}{\mathsf{PI}\left(\right)}\right), f\right)\right)\right)\right) \]
    12. /-lowering-/.f64N/A

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 4\right)\right), \mathsf{log.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(4, \mathsf{PI}\left(\right)\right), f\right)\right)\right)\right) \]
    13. PI-lowering-PI.f6495.9%

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), 4\right)\right), \mathsf{log.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(4, \mathsf{PI.f64}\left(\right)\right), f\right)\right)\right)\right) \]
  5. Simplified95.9%

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \color{blue}{\left(\frac{\frac{4}{\pi}}{f}\right)} \]
  6. Step-by-step derivation
    1. clear-numN/A

      \[\leadsto \mathsf{neg}\left(\frac{4}{\mathsf{PI}\left(\right)} \cdot \log \left(\frac{\frac{4}{\mathsf{PI}\left(\right)}}{f}\right)\right) \]
    2. distribute-rgt-neg-inN/A

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

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{4}{\mathsf{PI}\left(\right)}\right), \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{\frac{4}{\mathsf{PI}\left(\right)}}{f}\right)\right)\right)}\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(4, \mathsf{PI}\left(\right)\right), \left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{\frac{4}{\mathsf{PI}\left(\right)}}{f}\right)}\right)\right)\right) \]
    5. PI-lowering-PI.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(4, \mathsf{PI.f64}\left(\right)\right), \left(\mathsf{neg}\left(\log \left(\frac{\frac{4}{\mathsf{PI}\left(\right)}}{f}\right)\right)\right)\right) \]
    6. neg-logN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(4, \mathsf{PI.f64}\left(\right)\right), \log \left(\frac{1}{\frac{\frac{4}{\mathsf{PI}\left(\right)}}{f}}\right)\right) \]
    7. clear-numN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(4, \mathsf{PI.f64}\left(\right)\right), \log \left(\frac{f}{\frac{4}{\mathsf{PI}\left(\right)}}\right)\right) \]
    8. log-lowering-log.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(4, \mathsf{PI.f64}\left(\right)\right), \mathsf{log.f64}\left(\left(\frac{f}{\frac{4}{\mathsf{PI}\left(\right)}}\right)\right)\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(4, \mathsf{PI.f64}\left(\right)\right), \mathsf{log.f64}\left(\mathsf{/.f64}\left(f, \left(\frac{4}{\mathsf{PI}\left(\right)}\right)\right)\right)\right) \]
    10. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(4, \mathsf{PI.f64}\left(\right)\right), \mathsf{log.f64}\left(\mathsf{/.f64}\left(f, \mathsf{/.f64}\left(4, \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
    11. PI-lowering-PI.f6495.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(4, \mathsf{PI.f64}\left(\right)\right), \mathsf{log.f64}\left(\mathsf{/.f64}\left(f, \mathsf{/.f64}\left(4, \mathsf{PI.f64}\left(\right)\right)\right)\right)\right) \]
  7. Applied egg-rr95.9%

    \[\leadsto \color{blue}{\frac{4}{\pi} \cdot \log \left(\frac{f}{\frac{4}{\pi}}\right)} \]
  8. Add Preprocessing

Reproduce

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