VandenBroeck and Keller, Equation (20)

Percentage Accurate: 6.6% → 99.0%
Time: 18.1s
Alternatives: 8
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 8 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.6% 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 \left(\frac{1}{\tanh \left(\frac{\pi \cdot f}{4}\right)}\right)}{-0.25}}{\pi} \end{array} \]
(FPCore (f)
 :precision binary64
 (/ (/ (log (/ 1.0 (tanh (/ (* PI f) 4.0)))) -0.25) PI))
double code(double f) {
	return (log((1.0 / tanh(((((double) M_PI) * f) / 4.0)))) / -0.25) / ((double) M_PI);
}
public static double code(double f) {
	return (Math.log((1.0 / Math.tanh(((Math.PI * f) / 4.0)))) / -0.25) / Math.PI;
}
def code(f):
	return (math.log((1.0 / math.tanh(((math.pi * f) / 4.0)))) / -0.25) / math.pi
function code(f)
	return Float64(Float64(log(Float64(1.0 / tanh(Float64(Float64(pi * f) / 4.0)))) / -0.25) / pi)
end
function tmp = code(f)
	tmp = (log((1.0 / tanh(((pi * f) / 4.0)))) / -0.25) / pi;
end
code[f_] := N[(N[(N[Log[N[(1.0 / N[Tanh[N[(N[(Pi * f), $MachinePrecision] / 4.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / -0.25), $MachinePrecision] / Pi), $MachinePrecision]
\begin{array}{l}

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

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

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

      \[\leadsto \frac{1}{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4}\right)} \cdot \log \color{blue}{\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)} \]
    3. associate-*l/N/A

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

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

      \[\leadsto \mathsf{/.f64}\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), \color{blue}{\left(\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4}\right)\right)}\right) \]
  3. Simplified5.1%

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\log \left(\frac{e^{\mathsf{PI}\left(\right) \cdot \frac{f}{4}} + e^{\frac{\mathsf{PI}\left(\right) \cdot f}{-4}}}{e^{\mathsf{PI}\left(\right) \cdot \frac{f}{4}} - e^{\frac{\mathsf{PI}\left(\right) \cdot f}{-4}}}\right)}{\frac{1}{-4}}\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
  6. Applied egg-rr99.5%

    \[\leadsto \color{blue}{\frac{\frac{\log \left(\frac{1}{\tanh \left(\frac{\pi}{\frac{4}{f}}\right)}\right)}{-0.25}}{\pi}} \]
  7. Step-by-step derivation
    1. associate-/r/N/A

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(1, \mathsf{tanh.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), f\right), 4\right)\right)\right)\right), \frac{-1}{4}\right), \mathsf{PI.f64}\left(\right)\right) \]
  8. Applied egg-rr99.5%

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

Alternative 2: 98.9% accurate, 2.5× speedup?

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

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

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

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

      \[\leadsto \frac{1}{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4}\right)} \cdot \log \color{blue}{\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)} \]
    3. associate-*l/N/A

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

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

      \[\leadsto \mathsf{/.f64}\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), \color{blue}{\left(\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4}\right)\right)}\right) \]
  3. Simplified5.1%

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\log \left(\frac{e^{\mathsf{PI}\left(\right) \cdot \frac{f}{4}} + e^{\frac{\mathsf{PI}\left(\right) \cdot f}{-4}}}{e^{\mathsf{PI}\left(\right) \cdot \frac{f}{4}} - e^{\frac{\mathsf{PI}\left(\right) \cdot f}{-4}}}\right)}{\frac{1}{-4}}\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
  6. Applied egg-rr99.5%

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

Alternative 3: 99.0% accurate, 2.5× speedup?

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

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

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

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

      \[\leadsto \frac{1}{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4}\right)} \cdot \log \color{blue}{\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)} \]
    3. associate-*l/N/A

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

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

      \[\leadsto \mathsf{/.f64}\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), \color{blue}{\left(\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4}\right)\right)}\right) \]
  3. Simplified5.1%

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\log \left(\frac{e^{\mathsf{PI}\left(\right) \cdot \frac{f}{4}} + e^{\frac{\mathsf{PI}\left(\right) \cdot f}{-4}}}{e^{\mathsf{PI}\left(\right) \cdot \frac{f}{4}} - e^{\frac{\mathsf{PI}\left(\right) \cdot f}{-4}}}\right)}{\frac{1}{-4}}\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
  6. Applied egg-rr99.5%

    \[\leadsto \color{blue}{\frac{\frac{\log \left(\frac{1}{\tanh \left(\frac{\pi}{\frac{4}{f}}\right)}\right)}{-0.25}}{\pi}} \]
  7. Step-by-step derivation
    1. associate-/r/N/A

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(1, \mathsf{tanh.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), f\right), 4\right)\right)\right)\right), \frac{-1}{4}\right), \mathsf{PI.f64}\left(\right)\right) \]
  8. Applied egg-rr99.5%

    \[\leadsto \frac{\frac{\log \left(\frac{1}{\tanh \color{blue}{\left(\frac{\pi \cdot f}{4}\right)}}\right)}{-0.25}}{\pi} \]
  9. Step-by-step derivation
    1. /-lowering-/.f64N/A

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \tanh \left(\frac{\mathsf{PI}\left(\right) \cdot f}{4}\right)\right)\right)\right)}{\mathsf{neg}\left(\frac{-1}{4}\right)}\right), \mathsf{PI}\left(\right)\right) \]
    4. remove-double-negN/A

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

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{tanh.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), f\right), 4\right)\right)\right), \frac{1}{4}\right), \mathsf{PI}\left(\right)\right) \]
    12. PI-lowering-PI.f6499.5%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{tanh.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), f\right), 4\right)\right)\right), \frac{1}{4}\right), \mathsf{PI.f64}\left(\right)\right) \]
  10. Applied egg-rr99.5%

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

Alternative 4: 98.8% accurate, 2.5× speedup?

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

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

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

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

      \[\leadsto \frac{1}{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4}\right)} \cdot \log \color{blue}{\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)} \]
    3. associate-*l/N/A

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

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

      \[\leadsto \mathsf{/.f64}\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), \color{blue}{\left(\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4}\right)\right)}\right) \]
  3. Simplified5.1%

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

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

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

      \[\leadsto \frac{1}{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{-4}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{e^{\mathsf{PI}\left(\right) \cdot \frac{f}{4}} + e^{\frac{\mathsf{PI}\left(\right) \cdot f}{-4}}}{e^{\mathsf{PI}\left(\right) \cdot \frac{f}{4}} - e^{\frac{\mathsf{PI}\left(\right) \cdot f}{-4}}}\right)\right)\right)} \]
    4. distribute-frac-neg2N/A

      \[\leadsto \left(\mathsf{neg}\left(\frac{1}{\frac{\mathsf{PI}\left(\right)}{-4}}\right)\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{e^{\mathsf{PI}\left(\right) \cdot \frac{f}{4}} + e^{\frac{\mathsf{PI}\left(\right) \cdot f}{-4}}}{e^{\mathsf{PI}\left(\right) \cdot \frac{f}{4}} - e^{\frac{\mathsf{PI}\left(\right) \cdot f}{-4}}}\right)}\right)\right) \]
    5. clear-numN/A

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

      \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{neg}\left(\frac{-4}{\mathsf{PI}\left(\right)}\right)\right), \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{e^{\mathsf{PI}\left(\right) \cdot \frac{f}{4}} + e^{\frac{\mathsf{PI}\left(\right) \cdot f}{-4}}}{e^{\mathsf{PI}\left(\right) \cdot \frac{f}{4}} - e^{\frac{\mathsf{PI}\left(\right) \cdot f}{-4}}}\right)\right)\right)}\right) \]
  6. Applied egg-rr99.4%

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

Alternative 5: 96.6% accurate, 4.2× speedup?

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

\\
\frac{\frac{\log \left(\frac{\frac{4}{\pi} + \left(f \cdot f\right) \cdot \frac{\left(-16 \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right) \cdot -0.005208333333333333}{\pi \cdot \pi}}{f}\right)}{-0.25}}{\pi}
\end{array}
Derivation
  1. Initial program 5.1%

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

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

      \[\leadsto \frac{1}{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4}\right)} \cdot \log \color{blue}{\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)} \]
    3. associate-*l/N/A

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

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

      \[\leadsto \mathsf{/.f64}\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), \color{blue}{\left(\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4}\right)\right)}\right) \]
  3. Simplified5.1%

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\log \left(\frac{e^{\mathsf{PI}\left(\right) \cdot \frac{f}{4}} + e^{\frac{\mathsf{PI}\left(\right) \cdot f}{-4}}}{e^{\mathsf{PI}\left(\right) \cdot \frac{f}{4}} - e^{\frac{\mathsf{PI}\left(\right) \cdot f}{-4}}}\right)}{\frac{1}{-4}}\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
  6. Applied egg-rr99.5%

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

    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(\color{blue}{\left(\frac{f \cdot \left(-1 \cdot \left(f \cdot \left(-16 \cdot \frac{{\left(\frac{-1}{16} \cdot {\mathsf{PI}\left(\right)}^{2} + \frac{1}{16} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}^{2}}{{\mathsf{PI}\left(\right)}^{3}} + 16 \cdot \frac{\frac{1}{2} \cdot \left(\frac{-1}{4} \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{16} \cdot {\mathsf{PI}\left(\right)}^{2} + \frac{1}{32} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + \left(\frac{-1}{128} \cdot {\mathsf{PI}\left(\right)}^{3} + \frac{1}{192} \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right) - \frac{1}{128} \cdot {\mathsf{PI}\left(\right)}^{3}}{{\mathsf{PI}\left(\right)}^{2}}\right)\right) - 8 \cdot \frac{\frac{-1}{16} \cdot {\mathsf{PI}\left(\right)}^{2} + \frac{1}{16} \cdot {\mathsf{PI}\left(\right)}^{2}}{{\mathsf{PI}\left(\right)}^{2}}\right) + 4 \cdot \frac{1}{\mathsf{PI}\left(\right)}}{f}\right)}\right), \frac{-1}{4}\right), \mathsf{PI.f64}\left(\right)\right) \]
  8. Simplified96.7%

    \[\leadsto \frac{\frac{\log \color{blue}{\left(\frac{\frac{4}{\pi} + f \cdot \left(\frac{0}{\pi \cdot \pi} + \left(0 - f \cdot \left(\frac{16 \cdot \left(\left(\pi \cdot \left(\left(\pi \cdot \pi\right) \cdot -0.03125\right)\right) \cdot -0.125 + \left(\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot -0.0013020833333333333 + \left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot -0.0078125\right)\right)}{\pi \cdot \pi} + \frac{\frac{0}{\pi \cdot \pi}}{\pi}\right)\right)\right)}{f}\right)}}{-0.25}}{\pi} \]
  9. Taylor expanded in f around 0

    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(\color{blue}{\left(\frac{-16 \cdot \frac{{f}^{2} \cdot \left(\frac{-1}{128} \cdot {\mathsf{PI}\left(\right)}^{3} + \left(\frac{-1}{768} \cdot {\mathsf{PI}\left(\right)}^{3} + \frac{1}{256} \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)}{{\mathsf{PI}\left(\right)}^{2}} + 4 \cdot \frac{1}{\mathsf{PI}\left(\right)}}{f}\right)}\right), \frac{-1}{4}\right), \mathsf{PI.f64}\left(\right)\right) \]
  10. Step-by-step derivation
    1. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(-16 \cdot \frac{{f}^{2} \cdot \left(\frac{-1}{128} \cdot {\mathsf{PI}\left(\right)}^{3} + \left(\frac{-1}{768} \cdot {\mathsf{PI}\left(\right)}^{3} + \frac{1}{256} \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)}{{\mathsf{PI}\left(\right)}^{2}} + 4 \cdot \frac{1}{\mathsf{PI}\left(\right)}\right), f\right)\right), \frac{-1}{4}\right), \mathsf{PI.f64}\left(\right)\right) \]
  11. Simplified96.7%

    \[\leadsto \frac{\frac{\log \color{blue}{\left(\frac{\frac{4}{\pi} + \left(f \cdot f\right) \cdot \frac{\left(-16 \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right) \cdot -0.005208333333333333}{\pi \cdot \pi}}{f}\right)}}{-0.25}}{\pi} \]
  12. Add Preprocessing

Alternative 6: 96.1% accurate, 4.9× speedup?

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

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

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

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

      \[\leadsto \frac{1}{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4}\right)} \cdot \log \color{blue}{\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)} \]
    3. associate-*l/N/A

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

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

      \[\leadsto \mathsf{/.f64}\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), \color{blue}{\left(\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4}\right)\right)}\right) \]
  3. Simplified5.1%

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

    \[\leadsto \mathsf{/.f64}\left(\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), \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), -4\right)\right) \]
  6. Step-by-step derivation
    1. *-commutativeN/A

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

      \[\leadsto \mathsf{/.f64}\left(\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), \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), -4\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\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), \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), -4\right)\right) \]
    4. associate-*r/N/A

      \[\leadsto \mathsf{/.f64}\left(\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), \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), -4\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\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), \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), -4\right)\right) \]
    6. associate-*r/N/A

      \[\leadsto \mathsf{/.f64}\left(\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), \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), -4\right)\right) \]
    7. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\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), \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), -4\right)\right) \]
    8. /-lowering-/.f64N/A

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

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

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

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

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

    \[\leadsto \frac{\log \color{blue}{\left(\frac{\frac{2}{\pi \cdot 0.5}}{f}\right)}}{\frac{\pi}{-4}} \]
  8. Step-by-step derivation
    1. /-lowering-/.f64N/A

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

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

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

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

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

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

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

Alternative 7: 96.0% accurate, 4.9× speedup?

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

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

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

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

      \[\leadsto \frac{1}{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4}\right)} \cdot \log \color{blue}{\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)} \]
    3. associate-*l/N/A

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

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

      \[\leadsto \mathsf{/.f64}\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), \color{blue}{\left(\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4}\right)\right)}\right) \]
  3. Simplified5.1%

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\log \left(\frac{e^{\mathsf{PI}\left(\right) \cdot \frac{f}{4}} + e^{\frac{\mathsf{PI}\left(\right) \cdot f}{-4}}}{e^{\mathsf{PI}\left(\right) \cdot \frac{f}{4}} - e^{\frac{\mathsf{PI}\left(\right) \cdot f}{-4}}}\right)}{\frac{1}{-4}}\right), \color{blue}{\mathsf{PI}\left(\right)}\right) \]
  6. Applied egg-rr99.5%

    \[\leadsto \color{blue}{\frac{\frac{\log \left(\frac{1}{\tanh \left(\frac{\pi}{\frac{4}{f}}\right)}\right)}{-0.25}}{\pi}} \]
  7. Step-by-step derivation
    1. associate-/r/N/A

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(1, \mathsf{tanh.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{PI.f64}\left(\right), f\right), 4\right)\right)\right)\right), \frac{-1}{4}\right), \mathsf{PI.f64}\left(\right)\right) \]
  8. Applied egg-rr99.5%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\frac{\log \color{blue}{\left(\frac{\frac{4}{\pi}}{f}\right)}}{-0.25}}{\pi} \]
  12. Step-by-step derivation
    1. div-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), \mathsf{log.f64}\left(\mathsf{/.f64}\left(4, \left(\mathsf{PI}\left(\right) \cdot f\right)\right)\right)\right)\right) \]
  13. Applied egg-rr96.4%

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

Alternative 8: 95.9% accurate, 4.9× speedup?

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

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

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

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

      \[\leadsto \frac{1}{\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4}\right)} \cdot \log \color{blue}{\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)} \]
    3. associate-*l/N/A

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

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

      \[\leadsto \mathsf{/.f64}\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), \color{blue}{\left(\mathsf{neg}\left(\frac{\mathsf{PI}\left(\right)}{4}\right)\right)}\right) \]
  3. Simplified5.1%

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

    \[\leadsto \mathsf{/.f64}\left(\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), \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), -4\right)\right) \]
  6. Step-by-step derivation
    1. *-commutativeN/A

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

      \[\leadsto \mathsf{/.f64}\left(\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), \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), -4\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\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), \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), -4\right)\right) \]
    4. associate-*r/N/A

      \[\leadsto \mathsf{/.f64}\left(\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), \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), -4\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\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), \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), -4\right)\right) \]
    6. associate-*r/N/A

      \[\leadsto \mathsf{/.f64}\left(\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), \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), -4\right)\right) \]
    7. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\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), \mathsf{/.f64}\left(\mathsf{PI.f64}\left(\right), -4\right)\right) \]
    8. /-lowering-/.f64N/A

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

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

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

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

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

    \[\leadsto \frac{\log \color{blue}{\left(\frac{\frac{2}{\pi \cdot 0.5}}{f}\right)}}{\frac{\pi}{-4}} \]
  8. Step-by-step derivation
    1. diff-logN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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