bug500, discussion (missed optimization)

Percentage Accurate: 52.1% → 97.9%
Time: 19.3s
Alternatives: 9
Speedup: 40.6×

Specification

?
\[\begin{array}{l} \\ \log \left(\frac{\sinh x}{x}\right) \end{array} \]
(FPCore (x) :precision binary64 (log (/ (sinh x) x)))
double code(double x) {
	return log((sinh(x) / x));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = log((sinh(x) / x))
end function
public static double code(double x) {
	return Math.log((Math.sinh(x) / x));
}
def code(x):
	return math.log((math.sinh(x) / x))
function code(x)
	return log(Float64(sinh(x) / x))
end
function tmp = code(x)
	tmp = log((sinh(x) / x));
end
code[x_] := N[Log[N[(N[Sinh[x], $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\log \left(\frac{\sinh x}{x}\right)
\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 9 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: 52.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \log \left(\frac{\sinh x}{x}\right) \end{array} \]
(FPCore (x) :precision binary64 (log (/ (sinh x) x)))
double code(double x) {
	return log((sinh(x) / x));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = log((sinh(x) / x))
end function
public static double code(double x) {
	return Math.log((Math.sinh(x) / x));
}
def code(x):
	return math.log((math.sinh(x) / x))
function code(x)
	return log(Float64(sinh(x) / x))
end
function tmp = code(x)
	tmp = log((sinh(x) / x));
end
code[x_] := N[Log[N[(N[Sinh[x], $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\log \left(\frac{\sinh x}{x}\right)
\end{array}

Alternative 1: 97.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sinh x}{x}\\ \mathbf{if}\;t_0 \leq 1.001:\\ \;\;\;\;\mathsf{fma}\left(0.16666666666666666, x \cdot x, -0.005555555555555556 \cdot {x}^{4}\right)\\ \mathbf{elif}\;t_0 \leq 10^{+245}:\\ \;\;\;\;\log t_0\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \log \left(\mathsf{fma}\left(0.0006944444444444445, {x}^{4}, 1 + \left(x \cdot x\right) \cdot 0.08333333333333333\right)\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (/ (sinh x) x)))
   (if (<= t_0 1.001)
     (fma 0.16666666666666666 (* x x) (* -0.005555555555555556 (pow x 4.0)))
     (if (<= t_0 1e+245)
       (log t_0)
       (*
        2.0
        (log
         (fma
          0.0006944444444444445
          (pow x 4.0)
          (+ 1.0 (* (* x x) 0.08333333333333333)))))))))
double code(double x) {
	double t_0 = sinh(x) / x;
	double tmp;
	if (t_0 <= 1.001) {
		tmp = fma(0.16666666666666666, (x * x), (-0.005555555555555556 * pow(x, 4.0)));
	} else if (t_0 <= 1e+245) {
		tmp = log(t_0);
	} else {
		tmp = 2.0 * log(fma(0.0006944444444444445, pow(x, 4.0), (1.0 + ((x * x) * 0.08333333333333333))));
	}
	return tmp;
}
function code(x)
	t_0 = Float64(sinh(x) / x)
	tmp = 0.0
	if (t_0 <= 1.001)
		tmp = fma(0.16666666666666666, Float64(x * x), Float64(-0.005555555555555556 * (x ^ 4.0)));
	elseif (t_0 <= 1e+245)
		tmp = log(t_0);
	else
		tmp = Float64(2.0 * log(fma(0.0006944444444444445, (x ^ 4.0), Float64(1.0 + Float64(Float64(x * x) * 0.08333333333333333)))));
	end
	return tmp
end
code[x_] := Block[{t$95$0 = N[(N[Sinh[x], $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, 1.001], N[(0.16666666666666666 * N[(x * x), $MachinePrecision] + N[(-0.005555555555555556 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+245], N[Log[t$95$0], $MachinePrecision], N[(2.0 * N[Log[N[(0.0006944444444444445 * N[Power[x, 4.0], $MachinePrecision] + N[(1.0 + N[(N[(x * x), $MachinePrecision] * 0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sinh x}{x}\\
\mathbf{if}\;t_0 \leq 1.001:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, x \cdot x, -0.005555555555555556 \cdot {x}^{4}\right)\\

\mathbf{elif}\;t_0 \leq 10^{+245}:\\
\;\;\;\;\log t_0\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \log \left(\mathsf{fma}\left(0.0006944444444444445, {x}^{4}, 1 + \left(x \cdot x\right) \cdot 0.08333333333333333\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (sinh.f64 x) x) < 1.0009999999999999

    1. Initial program 58.2%

      \[\log \left(\frac{\sinh x}{x}\right) \]
    2. Taylor expanded in x around 0 99.8%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot {x}^{2} + -0.005555555555555556 \cdot {x}^{4}} \]
    3. Step-by-step derivation
      1. fma-def99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, {x}^{2}, -0.005555555555555556 \cdot {x}^{4}\right)} \]
      2. unpow299.8%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, \color{blue}{x \cdot x}, -0.005555555555555556 \cdot {x}^{4}\right) \]
    4. Simplified99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, x \cdot x, -0.005555555555555556 \cdot {x}^{4}\right)} \]

    if 1.0009999999999999 < (/.f64 (sinh.f64 x) x) < 1.00000000000000004e245

    1. Initial program 95.9%

      \[\log \left(\frac{\sinh x}{x}\right) \]

    if 1.00000000000000004e245 < (/.f64 (sinh.f64 x) x)

    1. Initial program 3.2%

      \[\log \left(\frac{\sinh x}{x}\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube3.2%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\log \left(\frac{\sinh x}{x}\right) \cdot \log \left(\frac{\sinh x}{x}\right)\right) \cdot \log \left(\frac{\sinh x}{x}\right)}} \]
      2. pow1/33.2%

        \[\leadsto \color{blue}{{\left(\left(\log \left(\frac{\sinh x}{x}\right) \cdot \log \left(\frac{\sinh x}{x}\right)\right) \cdot \log \left(\frac{\sinh x}{x}\right)\right)}^{0.3333333333333333}} \]
      3. pow33.2%

        \[\leadsto {\color{blue}{\left({\log \left(\frac{\sinh x}{x}\right)}^{3}\right)}}^{0.3333333333333333} \]
    3. Applied egg-rr3.2%

      \[\leadsto \color{blue}{{\left({\log \left(\frac{\sinh x}{x}\right)}^{3}\right)}^{0.3333333333333333}} \]
    4. Step-by-step derivation
      1. unpow1/33.2%

        \[\leadsto \color{blue}{\sqrt[3]{{\log \left(\frac{\sinh x}{x}\right)}^{3}}} \]
      2. rem-cbrt-cube3.2%

        \[\leadsto \color{blue}{\log \left(\frac{\sinh x}{x}\right)} \]
      3. add-sqr-sqrt3.2%

        \[\leadsto \log \color{blue}{\left(\sqrt{\frac{\sinh x}{x}} \cdot \sqrt{\frac{\sinh x}{x}}\right)} \]
      4. log-prod3.2%

        \[\leadsto \color{blue}{\log \left(\sqrt{\frac{\sinh x}{x}}\right) + \log \left(\sqrt{\frac{\sinh x}{x}}\right)} \]
    5. Applied egg-rr3.2%

      \[\leadsto \color{blue}{\log \left(\sqrt{\frac{\sinh x}{x}}\right) + \log \left(\sqrt{\frac{\sinh x}{x}}\right)} \]
    6. Step-by-step derivation
      1. count-23.2%

        \[\leadsto \color{blue}{2 \cdot \log \left(\sqrt{\frac{\sinh x}{x}}\right)} \]
    7. Simplified3.2%

      \[\leadsto \color{blue}{2 \cdot \log \left(\sqrt{\frac{\sinh x}{x}}\right)} \]
    8. Taylor expanded in x around 0 13.5%

      \[\leadsto 2 \cdot \log \color{blue}{\left(0.0006944444444444445 \cdot {x}^{4} + \left(1 + 0.08333333333333333 \cdot {x}^{2}\right)\right)} \]
    9. Step-by-step derivation
      1. fma-def13.5%

        \[\leadsto 2 \cdot \log \color{blue}{\left(\mathsf{fma}\left(0.0006944444444444445, {x}^{4}, 1 + 0.08333333333333333 \cdot {x}^{2}\right)\right)} \]
      2. *-commutative13.5%

        \[\leadsto 2 \cdot \log \left(\mathsf{fma}\left(0.0006944444444444445, {x}^{4}, 1 + \color{blue}{{x}^{2} \cdot 0.08333333333333333}\right)\right) \]
      3. unpow213.5%

        \[\leadsto 2 \cdot \log \left(\mathsf{fma}\left(0.0006944444444444445, {x}^{4}, 1 + \color{blue}{\left(x \cdot x\right)} \cdot 0.08333333333333333\right)\right) \]
    10. Simplified13.5%

      \[\leadsto 2 \cdot \log \color{blue}{\left(\mathsf{fma}\left(0.0006944444444444445, {x}^{4}, 1 + \left(x \cdot x\right) \cdot 0.08333333333333333\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sinh x}{x} \leq 1.001:\\ \;\;\;\;\mathsf{fma}\left(0.16666666666666666, x \cdot x, -0.005555555555555556 \cdot {x}^{4}\right)\\ \mathbf{elif}\;\frac{\sinh x}{x} \leq 10^{+245}:\\ \;\;\;\;\log \left(\frac{\sinh x}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \log \left(\mathsf{fma}\left(0.0006944444444444445, {x}^{4}, 1 + \left(x \cdot x\right) \cdot 0.08333333333333333\right)\right)\\ \end{array} \]

Alternative 2: 97.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sinh x}{x}\\ \mathbf{if}\;t_0 \leq 1.001:\\ \;\;\;\;\mathsf{fma}\left(0.16666666666666666, x \cdot x, -0.005555555555555556 \cdot {x}^{4}\right)\\ \mathbf{elif}\;t_0 \leq 10^{+245}:\\ \;\;\;\;\log t_0\\ \mathbf{else}:\\ \;\;\;\;\log \left({x}^{6} \cdot 0.0001984126984126984\right) + \frac{42}{x \cdot x}\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (/ (sinh x) x)))
   (if (<= t_0 1.001)
     (fma 0.16666666666666666 (* x x) (* -0.005555555555555556 (pow x 4.0)))
     (if (<= t_0 1e+245)
       (log t_0)
       (+ (log (* (pow x 6.0) 0.0001984126984126984)) (/ 42.0 (* x x)))))))
double code(double x) {
	double t_0 = sinh(x) / x;
	double tmp;
	if (t_0 <= 1.001) {
		tmp = fma(0.16666666666666666, (x * x), (-0.005555555555555556 * pow(x, 4.0)));
	} else if (t_0 <= 1e+245) {
		tmp = log(t_0);
	} else {
		tmp = log((pow(x, 6.0) * 0.0001984126984126984)) + (42.0 / (x * x));
	}
	return tmp;
}
function code(x)
	t_0 = Float64(sinh(x) / x)
	tmp = 0.0
	if (t_0 <= 1.001)
		tmp = fma(0.16666666666666666, Float64(x * x), Float64(-0.005555555555555556 * (x ^ 4.0)));
	elseif (t_0 <= 1e+245)
		tmp = log(t_0);
	else
		tmp = Float64(log(Float64((x ^ 6.0) * 0.0001984126984126984)) + Float64(42.0 / Float64(x * x)));
	end
	return tmp
end
code[x_] := Block[{t$95$0 = N[(N[Sinh[x], $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, 1.001], N[(0.16666666666666666 * N[(x * x), $MachinePrecision] + N[(-0.005555555555555556 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+245], N[Log[t$95$0], $MachinePrecision], N[(N[Log[N[(N[Power[x, 6.0], $MachinePrecision] * 0.0001984126984126984), $MachinePrecision]], $MachinePrecision] + N[(42.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sinh x}{x}\\
\mathbf{if}\;t_0 \leq 1.001:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, x \cdot x, -0.005555555555555556 \cdot {x}^{4}\right)\\

\mathbf{elif}\;t_0 \leq 10^{+245}:\\
\;\;\;\;\log t_0\\

\mathbf{else}:\\
\;\;\;\;\log \left({x}^{6} \cdot 0.0001984126984126984\right) + \frac{42}{x \cdot x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (sinh.f64 x) x) < 1.0009999999999999

    1. Initial program 58.2%

      \[\log \left(\frac{\sinh x}{x}\right) \]
    2. Taylor expanded in x around 0 99.8%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot {x}^{2} + -0.005555555555555556 \cdot {x}^{4}} \]
    3. Step-by-step derivation
      1. fma-def99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, {x}^{2}, -0.005555555555555556 \cdot {x}^{4}\right)} \]
      2. unpow299.8%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, \color{blue}{x \cdot x}, -0.005555555555555556 \cdot {x}^{4}\right) \]
    4. Simplified99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, x \cdot x, -0.005555555555555556 \cdot {x}^{4}\right)} \]

    if 1.0009999999999999 < (/.f64 (sinh.f64 x) x) < 1.00000000000000004e245

    1. Initial program 95.9%

      \[\log \left(\frac{\sinh x}{x}\right) \]

    if 1.00000000000000004e245 < (/.f64 (sinh.f64 x) x)

    1. Initial program 3.2%

      \[\log \left(\frac{\sinh x}{x}\right) \]
    2. Taylor expanded in x around 0 13.4%

      \[\leadsto \log \color{blue}{\left(0.16666666666666666 \cdot {x}^{2} + \left(1 + \left(0.0001984126984126984 \cdot {x}^{6} + 0.008333333333333333 \cdot {x}^{4}\right)\right)\right)} \]
    3. Taylor expanded in x around inf 6.8%

      \[\leadsto \color{blue}{-6 \cdot \log \left(\frac{1}{x}\right) + \left(\log 0.0001984126984126984 + 42 \cdot \frac{1}{{x}^{2}}\right)} \]
    4. Step-by-step derivation
      1. associate-+r+6.8%

        \[\leadsto \color{blue}{\left(-6 \cdot \log \left(\frac{1}{x}\right) + \log 0.0001984126984126984\right) + 42 \cdot \frac{1}{{x}^{2}}} \]
      2. log-rec6.8%

        \[\leadsto \left(-6 \cdot \color{blue}{\left(-\log x\right)} + \log 0.0001984126984126984\right) + 42 \cdot \frac{1}{{x}^{2}} \]
      3. distribute-rgt-neg-out6.8%

        \[\leadsto \left(\color{blue}{\left(--6 \cdot \log x\right)} + \log 0.0001984126984126984\right) + 42 \cdot \frac{1}{{x}^{2}} \]
      4. distribute-lft-neg-in6.8%

        \[\leadsto \left(\color{blue}{\left(--6\right) \cdot \log x} + \log 0.0001984126984126984\right) + 42 \cdot \frac{1}{{x}^{2}} \]
      5. metadata-eval6.8%

        \[\leadsto \left(\color{blue}{6} \cdot \log x + \log 0.0001984126984126984\right) + 42 \cdot \frac{1}{{x}^{2}} \]
      6. log-pow13.4%

        \[\leadsto \left(\color{blue}{\log \left({x}^{6}\right)} + \log 0.0001984126984126984\right) + 42 \cdot \frac{1}{{x}^{2}} \]
      7. log-prod13.4%

        \[\leadsto \color{blue}{\log \left({x}^{6} \cdot 0.0001984126984126984\right)} + 42 \cdot \frac{1}{{x}^{2}} \]
      8. associate-*r/13.4%

        \[\leadsto \log \left({x}^{6} \cdot 0.0001984126984126984\right) + \color{blue}{\frac{42 \cdot 1}{{x}^{2}}} \]
      9. metadata-eval13.4%

        \[\leadsto \log \left({x}^{6} \cdot 0.0001984126984126984\right) + \frac{\color{blue}{42}}{{x}^{2}} \]
      10. unpow213.4%

        \[\leadsto \log \left({x}^{6} \cdot 0.0001984126984126984\right) + \frac{42}{\color{blue}{x \cdot x}} \]
    5. Simplified13.4%

      \[\leadsto \color{blue}{\log \left({x}^{6} \cdot 0.0001984126984126984\right) + \frac{42}{x \cdot x}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sinh x}{x} \leq 1.001:\\ \;\;\;\;\mathsf{fma}\left(0.16666666666666666, x \cdot x, -0.005555555555555556 \cdot {x}^{4}\right)\\ \mathbf{elif}\;\frac{\sinh x}{x} \leq 10^{+245}:\\ \;\;\;\;\log \left(\frac{\sinh x}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\log \left({x}^{6} \cdot 0.0001984126984126984\right) + \frac{42}{x \cdot x}\\ \end{array} \]

Alternative 3: 98.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sinh x}{x}\\ \mathbf{if}\;t_0 \leq 1.001:\\ \;\;\;\;-0.005555555555555556 \cdot {x}^{4} + x \cdot \left(0.16666666666666666 \cdot x\right)\\ \mathbf{elif}\;t_0 \leq 10^{+245}:\\ \;\;\;\;\log t_0\\ \mathbf{else}:\\ \;\;\;\;\log \left({x}^{4} \cdot 0.008333333333333333\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (/ (sinh x) x)))
   (if (<= t_0 1.001)
     (+ (* -0.005555555555555556 (pow x 4.0)) (* x (* 0.16666666666666666 x)))
     (if (<= t_0 1e+245)
       (log t_0)
       (log (* (pow x 4.0) 0.008333333333333333))))))
double code(double x) {
	double t_0 = sinh(x) / x;
	double tmp;
	if (t_0 <= 1.001) {
		tmp = (-0.005555555555555556 * pow(x, 4.0)) + (x * (0.16666666666666666 * x));
	} else if (t_0 <= 1e+245) {
		tmp = log(t_0);
	} else {
		tmp = log((pow(x, 4.0) * 0.008333333333333333));
	}
	return tmp;
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sinh(x) / x
    if (t_0 <= 1.001d0) then
        tmp = ((-0.005555555555555556d0) * (x ** 4.0d0)) + (x * (0.16666666666666666d0 * x))
    else if (t_0 <= 1d+245) then
        tmp = log(t_0)
    else
        tmp = log(((x ** 4.0d0) * 0.008333333333333333d0))
    end if
    code = tmp
end function
public static double code(double x) {
	double t_0 = Math.sinh(x) / x;
	double tmp;
	if (t_0 <= 1.001) {
		tmp = (-0.005555555555555556 * Math.pow(x, 4.0)) + (x * (0.16666666666666666 * x));
	} else if (t_0 <= 1e+245) {
		tmp = Math.log(t_0);
	} else {
		tmp = Math.log((Math.pow(x, 4.0) * 0.008333333333333333));
	}
	return tmp;
}
def code(x):
	t_0 = math.sinh(x) / x
	tmp = 0
	if t_0 <= 1.001:
		tmp = (-0.005555555555555556 * math.pow(x, 4.0)) + (x * (0.16666666666666666 * x))
	elif t_0 <= 1e+245:
		tmp = math.log(t_0)
	else:
		tmp = math.log((math.pow(x, 4.0) * 0.008333333333333333))
	return tmp
function code(x)
	t_0 = Float64(sinh(x) / x)
	tmp = 0.0
	if (t_0 <= 1.001)
		tmp = Float64(Float64(-0.005555555555555556 * (x ^ 4.0)) + Float64(x * Float64(0.16666666666666666 * x)));
	elseif (t_0 <= 1e+245)
		tmp = log(t_0);
	else
		tmp = log(Float64((x ^ 4.0) * 0.008333333333333333));
	end
	return tmp
end
function tmp_2 = code(x)
	t_0 = sinh(x) / x;
	tmp = 0.0;
	if (t_0 <= 1.001)
		tmp = (-0.005555555555555556 * (x ^ 4.0)) + (x * (0.16666666666666666 * x));
	elseif (t_0 <= 1e+245)
		tmp = log(t_0);
	else
		tmp = log(((x ^ 4.0) * 0.008333333333333333));
	end
	tmp_2 = tmp;
end
code[x_] := Block[{t$95$0 = N[(N[Sinh[x], $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, 1.001], N[(N[(-0.005555555555555556 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] + N[(x * N[(0.16666666666666666 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+245], N[Log[t$95$0], $MachinePrecision], N[Log[N[(N[Power[x, 4.0], $MachinePrecision] * 0.008333333333333333), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sinh x}{x}\\
\mathbf{if}\;t_0 \leq 1.001:\\
\;\;\;\;-0.005555555555555556 \cdot {x}^{4} + x \cdot \left(0.16666666666666666 \cdot x\right)\\

\mathbf{elif}\;t_0 \leq 10^{+245}:\\
\;\;\;\;\log t_0\\

\mathbf{else}:\\
\;\;\;\;\log \left({x}^{4} \cdot 0.008333333333333333\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (sinh.f64 x) x) < 1.0009999999999999

    1. Initial program 58.2%

      \[\log \left(\frac{\sinh x}{x}\right) \]
    2. Taylor expanded in x around 0 58.2%

      \[\leadsto \log \color{blue}{\left(0.16666666666666666 \cdot {x}^{2} + \left(1 + 0.008333333333333333 \cdot {x}^{4}\right)\right)} \]
    3. Step-by-step derivation
      1. associate-+r+58.2%

        \[\leadsto \log \color{blue}{\left(\left(0.16666666666666666 \cdot {x}^{2} + 1\right) + 0.008333333333333333 \cdot {x}^{4}\right)} \]
      2. fma-def58.2%

        \[\leadsto \log \left(\color{blue}{\mathsf{fma}\left(0.16666666666666666, {x}^{2}, 1\right)} + 0.008333333333333333 \cdot {x}^{4}\right) \]
      3. unpow258.2%

        \[\leadsto \log \left(\mathsf{fma}\left(0.16666666666666666, \color{blue}{x \cdot x}, 1\right) + 0.008333333333333333 \cdot {x}^{4}\right) \]
      4. *-commutative58.2%

        \[\leadsto \log \left(\mathsf{fma}\left(0.16666666666666666, x \cdot x, 1\right) + \color{blue}{{x}^{4} \cdot 0.008333333333333333}\right) \]
    4. Simplified58.2%

      \[\leadsto \log \color{blue}{\left(\mathsf{fma}\left(0.16666666666666666, x \cdot x, 1\right) + {x}^{4} \cdot 0.008333333333333333\right)} \]
    5. Taylor expanded in x around 0 99.8%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot {x}^{2} + -0.005555555555555556 \cdot {x}^{4}} \]
    6. Step-by-step derivation
      1. fma-def99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, {x}^{2}, -0.005555555555555556 \cdot {x}^{4}\right)} \]
      2. unpow299.8%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, \color{blue}{x \cdot x}, -0.005555555555555556 \cdot {x}^{4}\right) \]
      3. *-commutative99.8%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, x \cdot x, \color{blue}{{x}^{4} \cdot -0.005555555555555556}\right) \]
    7. Simplified99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, x \cdot x, {x}^{4} \cdot -0.005555555555555556\right)} \]
    8. Step-by-step derivation
      1. fma-udef99.8%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(x \cdot x\right) + {x}^{4} \cdot -0.005555555555555556} \]
      2. +-commutative99.8%

        \[\leadsto \color{blue}{{x}^{4} \cdot -0.005555555555555556 + 0.16666666666666666 \cdot \left(x \cdot x\right)} \]
      3. *-commutative99.8%

        \[\leadsto {x}^{4} \cdot -0.005555555555555556 + \color{blue}{\left(x \cdot x\right) \cdot 0.16666666666666666} \]
      4. associate-*l*99.7%

        \[\leadsto {x}^{4} \cdot -0.005555555555555556 + \color{blue}{x \cdot \left(x \cdot 0.16666666666666666\right)} \]
    9. Applied egg-rr99.7%

      \[\leadsto \color{blue}{{x}^{4} \cdot -0.005555555555555556 + x \cdot \left(x \cdot 0.16666666666666666\right)} \]

    if 1.0009999999999999 < (/.f64 (sinh.f64 x) x) < 1.00000000000000004e245

    1. Initial program 95.9%

      \[\log \left(\frac{\sinh x}{x}\right) \]

    if 1.00000000000000004e245 < (/.f64 (sinh.f64 x) x)

    1. Initial program 3.2%

      \[\log \left(\frac{\sinh x}{x}\right) \]
    2. Taylor expanded in x around 0 13.3%

      \[\leadsto \log \color{blue}{\left(0.16666666666666666 \cdot {x}^{2} + \left(1 + 0.008333333333333333 \cdot {x}^{4}\right)\right)} \]
    3. Step-by-step derivation
      1. associate-+r+13.3%

        \[\leadsto \log \color{blue}{\left(\left(0.16666666666666666 \cdot {x}^{2} + 1\right) + 0.008333333333333333 \cdot {x}^{4}\right)} \]
      2. fma-def13.3%

        \[\leadsto \log \left(\color{blue}{\mathsf{fma}\left(0.16666666666666666, {x}^{2}, 1\right)} + 0.008333333333333333 \cdot {x}^{4}\right) \]
      3. unpow213.3%

        \[\leadsto \log \left(\mathsf{fma}\left(0.16666666666666666, \color{blue}{x \cdot x}, 1\right) + 0.008333333333333333 \cdot {x}^{4}\right) \]
      4. *-commutative13.3%

        \[\leadsto \log \left(\mathsf{fma}\left(0.16666666666666666, x \cdot x, 1\right) + \color{blue}{{x}^{4} \cdot 0.008333333333333333}\right) \]
    4. Simplified13.3%

      \[\leadsto \log \color{blue}{\left(\mathsf{fma}\left(0.16666666666666666, x \cdot x, 1\right) + {x}^{4} \cdot 0.008333333333333333\right)} \]
    5. Taylor expanded in x around inf 6.7%

      \[\leadsto \color{blue}{-4 \cdot \log \left(\frac{1}{x}\right) + \log 0.008333333333333333} \]
    6. Step-by-step derivation
      1. log-rec6.7%

        \[\leadsto -4 \cdot \color{blue}{\left(-\log x\right)} + \log 0.008333333333333333 \]
      2. neg-mul-16.7%

        \[\leadsto -4 \cdot \color{blue}{\left(-1 \cdot \log x\right)} + \log 0.008333333333333333 \]
      3. associate-*r*6.7%

        \[\leadsto \color{blue}{\left(-4 \cdot -1\right) \cdot \log x} + \log 0.008333333333333333 \]
      4. metadata-eval6.7%

        \[\leadsto \color{blue}{4} \cdot \log x + \log 0.008333333333333333 \]
      5. log-pow13.3%

        \[\leadsto \color{blue}{\log \left({x}^{4}\right)} + \log 0.008333333333333333 \]
      6. log-prod13.3%

        \[\leadsto \color{blue}{\log \left({x}^{4} \cdot 0.008333333333333333\right)} \]
    7. Simplified13.3%

      \[\leadsto \color{blue}{\log \left({x}^{4} \cdot 0.008333333333333333\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sinh x}{x} \leq 1.001:\\ \;\;\;\;-0.005555555555555556 \cdot {x}^{4} + x \cdot \left(0.16666666666666666 \cdot x\right)\\ \mathbf{elif}\;\frac{\sinh x}{x} \leq 10^{+245}:\\ \;\;\;\;\log \left(\frac{\sinh x}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\log \left({x}^{4} \cdot 0.008333333333333333\right)\\ \end{array} \]

Alternative 4: 98.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sinh x}{x}\\ \mathbf{if}\;t_0 \leq 1.001:\\ \;\;\;\;-0.005555555555555556 \cdot {x}^{4} + x \cdot \left(0.16666666666666666 \cdot x\right)\\ \mathbf{elif}\;t_0 \leq 10^{+245}:\\ \;\;\;\;\log t_0\\ \mathbf{else}:\\ \;\;\;\;\log \left({x}^{6} \cdot 0.0001984126984126984\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (/ (sinh x) x)))
   (if (<= t_0 1.001)
     (+ (* -0.005555555555555556 (pow x 4.0)) (* x (* 0.16666666666666666 x)))
     (if (<= t_0 1e+245)
       (log t_0)
       (log (* (pow x 6.0) 0.0001984126984126984))))))
double code(double x) {
	double t_0 = sinh(x) / x;
	double tmp;
	if (t_0 <= 1.001) {
		tmp = (-0.005555555555555556 * pow(x, 4.0)) + (x * (0.16666666666666666 * x));
	} else if (t_0 <= 1e+245) {
		tmp = log(t_0);
	} else {
		tmp = log((pow(x, 6.0) * 0.0001984126984126984));
	}
	return tmp;
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sinh(x) / x
    if (t_0 <= 1.001d0) then
        tmp = ((-0.005555555555555556d0) * (x ** 4.0d0)) + (x * (0.16666666666666666d0 * x))
    else if (t_0 <= 1d+245) then
        tmp = log(t_0)
    else
        tmp = log(((x ** 6.0d0) * 0.0001984126984126984d0))
    end if
    code = tmp
end function
public static double code(double x) {
	double t_0 = Math.sinh(x) / x;
	double tmp;
	if (t_0 <= 1.001) {
		tmp = (-0.005555555555555556 * Math.pow(x, 4.0)) + (x * (0.16666666666666666 * x));
	} else if (t_0 <= 1e+245) {
		tmp = Math.log(t_0);
	} else {
		tmp = Math.log((Math.pow(x, 6.0) * 0.0001984126984126984));
	}
	return tmp;
}
def code(x):
	t_0 = math.sinh(x) / x
	tmp = 0
	if t_0 <= 1.001:
		tmp = (-0.005555555555555556 * math.pow(x, 4.0)) + (x * (0.16666666666666666 * x))
	elif t_0 <= 1e+245:
		tmp = math.log(t_0)
	else:
		tmp = math.log((math.pow(x, 6.0) * 0.0001984126984126984))
	return tmp
function code(x)
	t_0 = Float64(sinh(x) / x)
	tmp = 0.0
	if (t_0 <= 1.001)
		tmp = Float64(Float64(-0.005555555555555556 * (x ^ 4.0)) + Float64(x * Float64(0.16666666666666666 * x)));
	elseif (t_0 <= 1e+245)
		tmp = log(t_0);
	else
		tmp = log(Float64((x ^ 6.0) * 0.0001984126984126984));
	end
	return tmp
end
function tmp_2 = code(x)
	t_0 = sinh(x) / x;
	tmp = 0.0;
	if (t_0 <= 1.001)
		tmp = (-0.005555555555555556 * (x ^ 4.0)) + (x * (0.16666666666666666 * x));
	elseif (t_0 <= 1e+245)
		tmp = log(t_0);
	else
		tmp = log(((x ^ 6.0) * 0.0001984126984126984));
	end
	tmp_2 = tmp;
end
code[x_] := Block[{t$95$0 = N[(N[Sinh[x], $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, 1.001], N[(N[(-0.005555555555555556 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] + N[(x * N[(0.16666666666666666 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+245], N[Log[t$95$0], $MachinePrecision], N[Log[N[(N[Power[x, 6.0], $MachinePrecision] * 0.0001984126984126984), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sinh x}{x}\\
\mathbf{if}\;t_0 \leq 1.001:\\
\;\;\;\;-0.005555555555555556 \cdot {x}^{4} + x \cdot \left(0.16666666666666666 \cdot x\right)\\

\mathbf{elif}\;t_0 \leq 10^{+245}:\\
\;\;\;\;\log t_0\\

\mathbf{else}:\\
\;\;\;\;\log \left({x}^{6} \cdot 0.0001984126984126984\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (sinh.f64 x) x) < 1.0009999999999999

    1. Initial program 58.2%

      \[\log \left(\frac{\sinh x}{x}\right) \]
    2. Taylor expanded in x around 0 58.2%

      \[\leadsto \log \color{blue}{\left(0.16666666666666666 \cdot {x}^{2} + \left(1 + 0.008333333333333333 \cdot {x}^{4}\right)\right)} \]
    3. Step-by-step derivation
      1. associate-+r+58.2%

        \[\leadsto \log \color{blue}{\left(\left(0.16666666666666666 \cdot {x}^{2} + 1\right) + 0.008333333333333333 \cdot {x}^{4}\right)} \]
      2. fma-def58.2%

        \[\leadsto \log \left(\color{blue}{\mathsf{fma}\left(0.16666666666666666, {x}^{2}, 1\right)} + 0.008333333333333333 \cdot {x}^{4}\right) \]
      3. unpow258.2%

        \[\leadsto \log \left(\mathsf{fma}\left(0.16666666666666666, \color{blue}{x \cdot x}, 1\right) + 0.008333333333333333 \cdot {x}^{4}\right) \]
      4. *-commutative58.2%

        \[\leadsto \log \left(\mathsf{fma}\left(0.16666666666666666, x \cdot x, 1\right) + \color{blue}{{x}^{4} \cdot 0.008333333333333333}\right) \]
    4. Simplified58.2%

      \[\leadsto \log \color{blue}{\left(\mathsf{fma}\left(0.16666666666666666, x \cdot x, 1\right) + {x}^{4} \cdot 0.008333333333333333\right)} \]
    5. Taylor expanded in x around 0 99.8%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot {x}^{2} + -0.005555555555555556 \cdot {x}^{4}} \]
    6. Step-by-step derivation
      1. fma-def99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, {x}^{2}, -0.005555555555555556 \cdot {x}^{4}\right)} \]
      2. unpow299.8%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, \color{blue}{x \cdot x}, -0.005555555555555556 \cdot {x}^{4}\right) \]
      3. *-commutative99.8%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, x \cdot x, \color{blue}{{x}^{4} \cdot -0.005555555555555556}\right) \]
    7. Simplified99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, x \cdot x, {x}^{4} \cdot -0.005555555555555556\right)} \]
    8. Step-by-step derivation
      1. fma-udef99.8%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(x \cdot x\right) + {x}^{4} \cdot -0.005555555555555556} \]
      2. +-commutative99.8%

        \[\leadsto \color{blue}{{x}^{4} \cdot -0.005555555555555556 + 0.16666666666666666 \cdot \left(x \cdot x\right)} \]
      3. *-commutative99.8%

        \[\leadsto {x}^{4} \cdot -0.005555555555555556 + \color{blue}{\left(x \cdot x\right) \cdot 0.16666666666666666} \]
      4. associate-*l*99.7%

        \[\leadsto {x}^{4} \cdot -0.005555555555555556 + \color{blue}{x \cdot \left(x \cdot 0.16666666666666666\right)} \]
    9. Applied egg-rr99.7%

      \[\leadsto \color{blue}{{x}^{4} \cdot -0.005555555555555556 + x \cdot \left(x \cdot 0.16666666666666666\right)} \]

    if 1.0009999999999999 < (/.f64 (sinh.f64 x) x) < 1.00000000000000004e245

    1. Initial program 95.9%

      \[\log \left(\frac{\sinh x}{x}\right) \]

    if 1.00000000000000004e245 < (/.f64 (sinh.f64 x) x)

    1. Initial program 3.2%

      \[\log \left(\frac{\sinh x}{x}\right) \]
    2. Taylor expanded in x around 0 13.4%

      \[\leadsto \log \color{blue}{\left(0.16666666666666666 \cdot {x}^{2} + \left(1 + \left(0.0001984126984126984 \cdot {x}^{6} + 0.008333333333333333 \cdot {x}^{4}\right)\right)\right)} \]
    3. Taylor expanded in x around inf 6.8%

      \[\leadsto \color{blue}{-6 \cdot \log \left(\frac{1}{x}\right) + \log 0.0001984126984126984} \]
    4. Step-by-step derivation
      1. log-rec6.8%

        \[\leadsto -6 \cdot \color{blue}{\left(-\log x\right)} + \log 0.0001984126984126984 \]
      2. distribute-rgt-neg-out6.8%

        \[\leadsto \color{blue}{\left(--6 \cdot \log x\right)} + \log 0.0001984126984126984 \]
      3. distribute-lft-neg-in6.8%

        \[\leadsto \color{blue}{\left(--6\right) \cdot \log x} + \log 0.0001984126984126984 \]
      4. metadata-eval6.8%

        \[\leadsto \color{blue}{6} \cdot \log x + \log 0.0001984126984126984 \]
      5. log-pow13.4%

        \[\leadsto \color{blue}{\log \left({x}^{6}\right)} + \log 0.0001984126984126984 \]
      6. log-prod13.4%

        \[\leadsto \color{blue}{\log \left({x}^{6} \cdot 0.0001984126984126984\right)} \]
    5. Simplified13.4%

      \[\leadsto \color{blue}{\log \left({x}^{6} \cdot 0.0001984126984126984\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sinh x}{x} \leq 1.001:\\ \;\;\;\;-0.005555555555555556 \cdot {x}^{4} + x \cdot \left(0.16666666666666666 \cdot x\right)\\ \mathbf{elif}\;\frac{\sinh x}{x} \leq 10^{+245}:\\ \;\;\;\;\log \left(\frac{\sinh x}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\log \left({x}^{6} \cdot 0.0001984126984126984\right)\\ \end{array} \]

Alternative 5: 97.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sinh x}{x}\\ \mathbf{if}\;t_0 \leq 1.001:\\ \;\;\;\;\mathsf{fma}\left(0.16666666666666666, x \cdot x, -0.005555555555555556 \cdot {x}^{4}\right)\\ \mathbf{elif}\;t_0 \leq 10^{+245}:\\ \;\;\;\;\log t_0\\ \mathbf{else}:\\ \;\;\;\;\log \left({x}^{6} \cdot 0.0001984126984126984\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (/ (sinh x) x)))
   (if (<= t_0 1.001)
     (fma 0.16666666666666666 (* x x) (* -0.005555555555555556 (pow x 4.0)))
     (if (<= t_0 1e+245)
       (log t_0)
       (log (* (pow x 6.0) 0.0001984126984126984))))))
double code(double x) {
	double t_0 = sinh(x) / x;
	double tmp;
	if (t_0 <= 1.001) {
		tmp = fma(0.16666666666666666, (x * x), (-0.005555555555555556 * pow(x, 4.0)));
	} else if (t_0 <= 1e+245) {
		tmp = log(t_0);
	} else {
		tmp = log((pow(x, 6.0) * 0.0001984126984126984));
	}
	return tmp;
}
function code(x)
	t_0 = Float64(sinh(x) / x)
	tmp = 0.0
	if (t_0 <= 1.001)
		tmp = fma(0.16666666666666666, Float64(x * x), Float64(-0.005555555555555556 * (x ^ 4.0)));
	elseif (t_0 <= 1e+245)
		tmp = log(t_0);
	else
		tmp = log(Float64((x ^ 6.0) * 0.0001984126984126984));
	end
	return tmp
end
code[x_] := Block[{t$95$0 = N[(N[Sinh[x], $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, 1.001], N[(0.16666666666666666 * N[(x * x), $MachinePrecision] + N[(-0.005555555555555556 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+245], N[Log[t$95$0], $MachinePrecision], N[Log[N[(N[Power[x, 6.0], $MachinePrecision] * 0.0001984126984126984), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sinh x}{x}\\
\mathbf{if}\;t_0 \leq 1.001:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, x \cdot x, -0.005555555555555556 \cdot {x}^{4}\right)\\

\mathbf{elif}\;t_0 \leq 10^{+245}:\\
\;\;\;\;\log t_0\\

\mathbf{else}:\\
\;\;\;\;\log \left({x}^{6} \cdot 0.0001984126984126984\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (sinh.f64 x) x) < 1.0009999999999999

    1. Initial program 58.2%

      \[\log \left(\frac{\sinh x}{x}\right) \]
    2. Taylor expanded in x around 0 99.8%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot {x}^{2} + -0.005555555555555556 \cdot {x}^{4}} \]
    3. Step-by-step derivation
      1. fma-def99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, {x}^{2}, -0.005555555555555556 \cdot {x}^{4}\right)} \]
      2. unpow299.8%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, \color{blue}{x \cdot x}, -0.005555555555555556 \cdot {x}^{4}\right) \]
    4. Simplified99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, x \cdot x, -0.005555555555555556 \cdot {x}^{4}\right)} \]

    if 1.0009999999999999 < (/.f64 (sinh.f64 x) x) < 1.00000000000000004e245

    1. Initial program 95.9%

      \[\log \left(\frac{\sinh x}{x}\right) \]

    if 1.00000000000000004e245 < (/.f64 (sinh.f64 x) x)

    1. Initial program 3.2%

      \[\log \left(\frac{\sinh x}{x}\right) \]
    2. Taylor expanded in x around 0 13.4%

      \[\leadsto \log \color{blue}{\left(0.16666666666666666 \cdot {x}^{2} + \left(1 + \left(0.0001984126984126984 \cdot {x}^{6} + 0.008333333333333333 \cdot {x}^{4}\right)\right)\right)} \]
    3. Taylor expanded in x around inf 6.8%

      \[\leadsto \color{blue}{-6 \cdot \log \left(\frac{1}{x}\right) + \log 0.0001984126984126984} \]
    4. Step-by-step derivation
      1. log-rec6.8%

        \[\leadsto -6 \cdot \color{blue}{\left(-\log x\right)} + \log 0.0001984126984126984 \]
      2. distribute-rgt-neg-out6.8%

        \[\leadsto \color{blue}{\left(--6 \cdot \log x\right)} + \log 0.0001984126984126984 \]
      3. distribute-lft-neg-in6.8%

        \[\leadsto \color{blue}{\left(--6\right) \cdot \log x} + \log 0.0001984126984126984 \]
      4. metadata-eval6.8%

        \[\leadsto \color{blue}{6} \cdot \log x + \log 0.0001984126984126984 \]
      5. log-pow13.4%

        \[\leadsto \color{blue}{\log \left({x}^{6}\right)} + \log 0.0001984126984126984 \]
      6. log-prod13.4%

        \[\leadsto \color{blue}{\log \left({x}^{6} \cdot 0.0001984126984126984\right)} \]
    5. Simplified13.4%

      \[\leadsto \color{blue}{\log \left({x}^{6} \cdot 0.0001984126984126984\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sinh x}{x} \leq 1.001:\\ \;\;\;\;\mathsf{fma}\left(0.16666666666666666, x \cdot x, -0.005555555555555556 \cdot {x}^{4}\right)\\ \mathbf{elif}\;\frac{\sinh x}{x} \leq 10^{+245}:\\ \;\;\;\;\log \left(\frac{\sinh x}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\log \left({x}^{6} \cdot 0.0001984126984126984\right)\\ \end{array} \]

Alternative 6: 98.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sinh x}{x}\\ \mathbf{if}\;t_0 \leq 1.001:\\ \;\;\;\;-0.005555555555555556 \cdot {x}^{4} + x \cdot \left(0.16666666666666666 \cdot x\right)\\ \mathbf{elif}\;t_0 \leq 10^{+245}:\\ \;\;\;\;\log t_0\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{log1p}\left(x \cdot \left(x \cdot 0.08333333333333333\right)\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (/ (sinh x) x)))
   (if (<= t_0 1.001)
     (+ (* -0.005555555555555556 (pow x 4.0)) (* x (* 0.16666666666666666 x)))
     (if (<= t_0 1e+245)
       (log t_0)
       (* 2.0 (log1p (* x (* x 0.08333333333333333))))))))
double code(double x) {
	double t_0 = sinh(x) / x;
	double tmp;
	if (t_0 <= 1.001) {
		tmp = (-0.005555555555555556 * pow(x, 4.0)) + (x * (0.16666666666666666 * x));
	} else if (t_0 <= 1e+245) {
		tmp = log(t_0);
	} else {
		tmp = 2.0 * log1p((x * (x * 0.08333333333333333)));
	}
	return tmp;
}
public static double code(double x) {
	double t_0 = Math.sinh(x) / x;
	double tmp;
	if (t_0 <= 1.001) {
		tmp = (-0.005555555555555556 * Math.pow(x, 4.0)) + (x * (0.16666666666666666 * x));
	} else if (t_0 <= 1e+245) {
		tmp = Math.log(t_0);
	} else {
		tmp = 2.0 * Math.log1p((x * (x * 0.08333333333333333)));
	}
	return tmp;
}
def code(x):
	t_0 = math.sinh(x) / x
	tmp = 0
	if t_0 <= 1.001:
		tmp = (-0.005555555555555556 * math.pow(x, 4.0)) + (x * (0.16666666666666666 * x))
	elif t_0 <= 1e+245:
		tmp = math.log(t_0)
	else:
		tmp = 2.0 * math.log1p((x * (x * 0.08333333333333333)))
	return tmp
function code(x)
	t_0 = Float64(sinh(x) / x)
	tmp = 0.0
	if (t_0 <= 1.001)
		tmp = Float64(Float64(-0.005555555555555556 * (x ^ 4.0)) + Float64(x * Float64(0.16666666666666666 * x)));
	elseif (t_0 <= 1e+245)
		tmp = log(t_0);
	else
		tmp = Float64(2.0 * log1p(Float64(x * Float64(x * 0.08333333333333333))));
	end
	return tmp
end
code[x_] := Block[{t$95$0 = N[(N[Sinh[x], $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, 1.001], N[(N[(-0.005555555555555556 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] + N[(x * N[(0.16666666666666666 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+245], N[Log[t$95$0], $MachinePrecision], N[(2.0 * N[Log[1 + N[(x * N[(x * 0.08333333333333333), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sinh x}{x}\\
\mathbf{if}\;t_0 \leq 1.001:\\
\;\;\;\;-0.005555555555555556 \cdot {x}^{4} + x \cdot \left(0.16666666666666666 \cdot x\right)\\

\mathbf{elif}\;t_0 \leq 10^{+245}:\\
\;\;\;\;\log t_0\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{log1p}\left(x \cdot \left(x \cdot 0.08333333333333333\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (sinh.f64 x) x) < 1.0009999999999999

    1. Initial program 58.2%

      \[\log \left(\frac{\sinh x}{x}\right) \]
    2. Taylor expanded in x around 0 58.2%

      \[\leadsto \log \color{blue}{\left(0.16666666666666666 \cdot {x}^{2} + \left(1 + 0.008333333333333333 \cdot {x}^{4}\right)\right)} \]
    3. Step-by-step derivation
      1. associate-+r+58.2%

        \[\leadsto \log \color{blue}{\left(\left(0.16666666666666666 \cdot {x}^{2} + 1\right) + 0.008333333333333333 \cdot {x}^{4}\right)} \]
      2. fma-def58.2%

        \[\leadsto \log \left(\color{blue}{\mathsf{fma}\left(0.16666666666666666, {x}^{2}, 1\right)} + 0.008333333333333333 \cdot {x}^{4}\right) \]
      3. unpow258.2%

        \[\leadsto \log \left(\mathsf{fma}\left(0.16666666666666666, \color{blue}{x \cdot x}, 1\right) + 0.008333333333333333 \cdot {x}^{4}\right) \]
      4. *-commutative58.2%

        \[\leadsto \log \left(\mathsf{fma}\left(0.16666666666666666, x \cdot x, 1\right) + \color{blue}{{x}^{4} \cdot 0.008333333333333333}\right) \]
    4. Simplified58.2%

      \[\leadsto \log \color{blue}{\left(\mathsf{fma}\left(0.16666666666666666, x \cdot x, 1\right) + {x}^{4} \cdot 0.008333333333333333\right)} \]
    5. Taylor expanded in x around 0 99.8%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot {x}^{2} + -0.005555555555555556 \cdot {x}^{4}} \]
    6. Step-by-step derivation
      1. fma-def99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, {x}^{2}, -0.005555555555555556 \cdot {x}^{4}\right)} \]
      2. unpow299.8%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, \color{blue}{x \cdot x}, -0.005555555555555556 \cdot {x}^{4}\right) \]
      3. *-commutative99.8%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, x \cdot x, \color{blue}{{x}^{4} \cdot -0.005555555555555556}\right) \]
    7. Simplified99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, x \cdot x, {x}^{4} \cdot -0.005555555555555556\right)} \]
    8. Step-by-step derivation
      1. fma-udef99.8%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(x \cdot x\right) + {x}^{4} \cdot -0.005555555555555556} \]
      2. +-commutative99.8%

        \[\leadsto \color{blue}{{x}^{4} \cdot -0.005555555555555556 + 0.16666666666666666 \cdot \left(x \cdot x\right)} \]
      3. *-commutative99.8%

        \[\leadsto {x}^{4} \cdot -0.005555555555555556 + \color{blue}{\left(x \cdot x\right) \cdot 0.16666666666666666} \]
      4. associate-*l*99.7%

        \[\leadsto {x}^{4} \cdot -0.005555555555555556 + \color{blue}{x \cdot \left(x \cdot 0.16666666666666666\right)} \]
    9. Applied egg-rr99.7%

      \[\leadsto \color{blue}{{x}^{4} \cdot -0.005555555555555556 + x \cdot \left(x \cdot 0.16666666666666666\right)} \]

    if 1.0009999999999999 < (/.f64 (sinh.f64 x) x) < 1.00000000000000004e245

    1. Initial program 95.9%

      \[\log \left(\frac{\sinh x}{x}\right) \]

    if 1.00000000000000004e245 < (/.f64 (sinh.f64 x) x)

    1. Initial program 3.2%

      \[\log \left(\frac{\sinh x}{x}\right) \]
    2. Step-by-step derivation
      1. add-cbrt-cube3.2%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\log \left(\frac{\sinh x}{x}\right) \cdot \log \left(\frac{\sinh x}{x}\right)\right) \cdot \log \left(\frac{\sinh x}{x}\right)}} \]
      2. pow1/33.2%

        \[\leadsto \color{blue}{{\left(\left(\log \left(\frac{\sinh x}{x}\right) \cdot \log \left(\frac{\sinh x}{x}\right)\right) \cdot \log \left(\frac{\sinh x}{x}\right)\right)}^{0.3333333333333333}} \]
      3. pow33.2%

        \[\leadsto {\color{blue}{\left({\log \left(\frac{\sinh x}{x}\right)}^{3}\right)}}^{0.3333333333333333} \]
    3. Applied egg-rr3.2%

      \[\leadsto \color{blue}{{\left({\log \left(\frac{\sinh x}{x}\right)}^{3}\right)}^{0.3333333333333333}} \]
    4. Step-by-step derivation
      1. unpow1/33.2%

        \[\leadsto \color{blue}{\sqrt[3]{{\log \left(\frac{\sinh x}{x}\right)}^{3}}} \]
      2. rem-cbrt-cube3.2%

        \[\leadsto \color{blue}{\log \left(\frac{\sinh x}{x}\right)} \]
      3. add-sqr-sqrt3.2%

        \[\leadsto \log \color{blue}{\left(\sqrt{\frac{\sinh x}{x}} \cdot \sqrt{\frac{\sinh x}{x}}\right)} \]
      4. log-prod3.2%

        \[\leadsto \color{blue}{\log \left(\sqrt{\frac{\sinh x}{x}}\right) + \log \left(\sqrt{\frac{\sinh x}{x}}\right)} \]
    5. Applied egg-rr3.2%

      \[\leadsto \color{blue}{\log \left(\sqrt{\frac{\sinh x}{x}}\right) + \log \left(\sqrt{\frac{\sinh x}{x}}\right)} \]
    6. Step-by-step derivation
      1. count-23.2%

        \[\leadsto \color{blue}{2 \cdot \log \left(\sqrt{\frac{\sinh x}{x}}\right)} \]
    7. Simplified3.2%

      \[\leadsto \color{blue}{2 \cdot \log \left(\sqrt{\frac{\sinh x}{x}}\right)} \]
    8. Taylor expanded in x around 0 13.3%

      \[\leadsto 2 \cdot \log \color{blue}{\left(1 + 0.08333333333333333 \cdot {x}^{2}\right)} \]
    9. Step-by-step derivation
      1. *-commutative13.3%

        \[\leadsto 2 \cdot \log \left(1 + \color{blue}{{x}^{2} \cdot 0.08333333333333333}\right) \]
      2. unpow213.3%

        \[\leadsto 2 \cdot \log \left(1 + \color{blue}{\left(x \cdot x\right)} \cdot 0.08333333333333333\right) \]
    10. Simplified13.3%

      \[\leadsto 2 \cdot \log \color{blue}{\left(1 + \left(x \cdot x\right) \cdot 0.08333333333333333\right)} \]
    11. Step-by-step derivation
      1. log1p-def13.3%

        \[\leadsto 2 \cdot \color{blue}{\mathsf{log1p}\left(\left(x \cdot x\right) \cdot 0.08333333333333333\right)} \]
      2. associate-*r*13.3%

        \[\leadsto 2 \cdot \mathsf{log1p}\left(\color{blue}{x \cdot \left(x \cdot 0.08333333333333333\right)}\right) \]
    12. Applied egg-rr13.3%

      \[\leadsto 2 \cdot \color{blue}{\mathsf{log1p}\left(x \cdot \left(x \cdot 0.08333333333333333\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sinh x}{x} \leq 1.001:\\ \;\;\;\;-0.005555555555555556 \cdot {x}^{4} + x \cdot \left(0.16666666666666666 \cdot x\right)\\ \mathbf{elif}\;\frac{\sinh x}{x} \leq 10^{+245}:\\ \;\;\;\;\log \left(\frac{\sinh x}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{log1p}\left(x \cdot \left(x \cdot 0.08333333333333333\right)\right)\\ \end{array} \]

Alternative 7: 96.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ 0.16666666666666666 \cdot \left(x \cdot x\right) + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right) \end{array} \]
(FPCore (x)
 :precision binary64
 (+
  (* 0.16666666666666666 (* x x))
  (+
   (* -0.005555555555555556 (pow x 4.0))
   (+
    (* -2.6455026455026456e-5 (pow x 8.0))
    (* 0.0003527336860670194 (pow x 6.0))))))
double code(double x) {
	return (0.16666666666666666 * (x * x)) + ((-0.005555555555555556 * pow(x, 4.0)) + ((-2.6455026455026456e-5 * pow(x, 8.0)) + (0.0003527336860670194 * pow(x, 6.0))));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = (0.16666666666666666d0 * (x * x)) + (((-0.005555555555555556d0) * (x ** 4.0d0)) + (((-2.6455026455026456d-5) * (x ** 8.0d0)) + (0.0003527336860670194d0 * (x ** 6.0d0))))
end function
public static double code(double x) {
	return (0.16666666666666666 * (x * x)) + ((-0.005555555555555556 * Math.pow(x, 4.0)) + ((-2.6455026455026456e-5 * Math.pow(x, 8.0)) + (0.0003527336860670194 * Math.pow(x, 6.0))));
}
def code(x):
	return (0.16666666666666666 * (x * x)) + ((-0.005555555555555556 * math.pow(x, 4.0)) + ((-2.6455026455026456e-5 * math.pow(x, 8.0)) + (0.0003527336860670194 * math.pow(x, 6.0))))
function code(x)
	return Float64(Float64(0.16666666666666666 * Float64(x * x)) + Float64(Float64(-0.005555555555555556 * (x ^ 4.0)) + Float64(Float64(-2.6455026455026456e-5 * (x ^ 8.0)) + Float64(0.0003527336860670194 * (x ^ 6.0)))))
end
function tmp = code(x)
	tmp = (0.16666666666666666 * (x * x)) + ((-0.005555555555555556 * (x ^ 4.0)) + ((-2.6455026455026456e-5 * (x ^ 8.0)) + (0.0003527336860670194 * (x ^ 6.0))));
end
code[x_] := N[(N[(0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(N[(-0.005555555555555556 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] + N[(N[(-2.6455026455026456e-5 * N[Power[x, 8.0], $MachinePrecision]), $MachinePrecision] + N[(0.0003527336860670194 * N[Power[x, 6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
0.16666666666666666 \cdot \left(x \cdot x\right) + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right)
\end{array}
Derivation
  1. Initial program 56.9%

    \[\log \left(\frac{\sinh x}{x}\right) \]
  2. Taylor expanded in x around 0 94.4%

    \[\leadsto \color{blue}{0.16666666666666666 \cdot {x}^{2} + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right)} \]
  3. Step-by-step derivation
    1. expm1-log1p-u94.4%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(0.16666666666666666 \cdot {x}^{2}\right)\right)} + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right) \]
    2. pow294.4%

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(0.16666666666666666 \cdot \color{blue}{\left(x \cdot x\right)}\right)\right) + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right) \]
    3. log1p-udef55.2%

      \[\leadsto \mathsf{expm1}\left(\color{blue}{\log \left(1 + 0.16666666666666666 \cdot \left(x \cdot x\right)\right)}\right) + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right) \]
    4. +-commutative55.2%

      \[\leadsto \mathsf{expm1}\left(\log \color{blue}{\left(0.16666666666666666 \cdot \left(x \cdot x\right) + 1\right)}\right) + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right) \]
    5. fma-udef55.2%

      \[\leadsto \mathsf{expm1}\left(\log \color{blue}{\left(\mathsf{fma}\left(0.16666666666666666, x \cdot x, 1\right)\right)}\right) + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right) \]
    6. expm1-udef55.2%

      \[\leadsto \color{blue}{\left(e^{\log \left(\mathsf{fma}\left(0.16666666666666666, x \cdot x, 1\right)\right)} - 1\right)} + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right) \]
    7. add-exp-log55.2%

      \[\leadsto \left(\color{blue}{\mathsf{fma}\left(0.16666666666666666, x \cdot x, 1\right)} - 1\right) + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right) \]
  4. Applied egg-rr55.2%

    \[\leadsto \color{blue}{\left(\mathsf{fma}\left(0.16666666666666666, x \cdot x, 1\right) - 1\right)} + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right) \]
  5. Step-by-step derivation
    1. unpow255.2%

      \[\leadsto \left(\mathsf{fma}\left(0.16666666666666666, \color{blue}{{x}^{2}}, 1\right) - 1\right) + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right) \]
    2. fma-def55.2%

      \[\leadsto \left(\color{blue}{\left(0.16666666666666666 \cdot {x}^{2} + 1\right)} - 1\right) + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right) \]
    3. associate--l+94.4%

      \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot {x}^{2} + \left(1 - 1\right)\right)} + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right) \]
    4. unpow294.4%

      \[\leadsto \left(0.16666666666666666 \cdot \color{blue}{\left(x \cdot x\right)} + \left(1 - 1\right)\right) + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right) \]
    5. metadata-eval94.4%

      \[\leadsto \left(0.16666666666666666 \cdot \left(x \cdot x\right) + \color{blue}{0}\right) + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right) \]
  6. Simplified94.4%

    \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \left(x \cdot x\right) + 0\right)} + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right) \]
  7. Final simplification94.4%

    \[\leadsto 0.16666666666666666 \cdot \left(x \cdot x\right) + \left(-0.005555555555555556 \cdot {x}^{4} + \left(-2.6455026455026456 \cdot 10^{-5} \cdot {x}^{8} + 0.0003527336860670194 \cdot {x}^{6}\right)\right) \]

Alternative 8: 96.5% accurate, 1.9× speedup?

\[\begin{array}{l} \\ 2 \cdot \mathsf{log1p}\left(x \cdot \left(x \cdot 0.08333333333333333\right)\right) \end{array} \]
(FPCore (x)
 :precision binary64
 (* 2.0 (log1p (* x (* x 0.08333333333333333)))))
double code(double x) {
	return 2.0 * log1p((x * (x * 0.08333333333333333)));
}
public static double code(double x) {
	return 2.0 * Math.log1p((x * (x * 0.08333333333333333)));
}
def code(x):
	return 2.0 * math.log1p((x * (x * 0.08333333333333333)))
function code(x)
	return Float64(2.0 * log1p(Float64(x * Float64(x * 0.08333333333333333))))
end
code[x_] := N[(2.0 * N[Log[1 + N[(x * N[(x * 0.08333333333333333), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot \mathsf{log1p}\left(x \cdot \left(x \cdot 0.08333333333333333\right)\right)
\end{array}
Derivation
  1. Initial program 56.9%

    \[\log \left(\frac{\sinh x}{x}\right) \]
  2. Step-by-step derivation
    1. add-cbrt-cube56.9%

      \[\leadsto \color{blue}{\sqrt[3]{\left(\log \left(\frac{\sinh x}{x}\right) \cdot \log \left(\frac{\sinh x}{x}\right)\right) \cdot \log \left(\frac{\sinh x}{x}\right)}} \]
    2. pow1/356.9%

      \[\leadsto \color{blue}{{\left(\left(\log \left(\frac{\sinh x}{x}\right) \cdot \log \left(\frac{\sinh x}{x}\right)\right) \cdot \log \left(\frac{\sinh x}{x}\right)\right)}^{0.3333333333333333}} \]
    3. pow356.9%

      \[\leadsto {\color{blue}{\left({\log \left(\frac{\sinh x}{x}\right)}^{3}\right)}}^{0.3333333333333333} \]
  3. Applied egg-rr56.9%

    \[\leadsto \color{blue}{{\left({\log \left(\frac{\sinh x}{x}\right)}^{3}\right)}^{0.3333333333333333}} \]
  4. Step-by-step derivation
    1. unpow1/356.9%

      \[\leadsto \color{blue}{\sqrt[3]{{\log \left(\frac{\sinh x}{x}\right)}^{3}}} \]
    2. rem-cbrt-cube56.9%

      \[\leadsto \color{blue}{\log \left(\frac{\sinh x}{x}\right)} \]
    3. add-sqr-sqrt56.9%

      \[\leadsto \log \color{blue}{\left(\sqrt{\frac{\sinh x}{x}} \cdot \sqrt{\frac{\sinh x}{x}}\right)} \]
    4. log-prod56.9%

      \[\leadsto \color{blue}{\log \left(\sqrt{\frac{\sinh x}{x}}\right) + \log \left(\sqrt{\frac{\sinh x}{x}}\right)} \]
  5. Applied egg-rr56.9%

    \[\leadsto \color{blue}{\log \left(\sqrt{\frac{\sinh x}{x}}\right) + \log \left(\sqrt{\frac{\sinh x}{x}}\right)} \]
  6. Step-by-step derivation
    1. count-256.9%

      \[\leadsto \color{blue}{2 \cdot \log \left(\sqrt{\frac{\sinh x}{x}}\right)} \]
  7. Simplified56.9%

    \[\leadsto \color{blue}{2 \cdot \log \left(\sqrt{\frac{\sinh x}{x}}\right)} \]
  8. Taylor expanded in x around 0 55.6%

    \[\leadsto 2 \cdot \log \color{blue}{\left(1 + 0.08333333333333333 \cdot {x}^{2}\right)} \]
  9. Step-by-step derivation
    1. *-commutative55.6%

      \[\leadsto 2 \cdot \log \left(1 + \color{blue}{{x}^{2} \cdot 0.08333333333333333}\right) \]
    2. unpow255.6%

      \[\leadsto 2 \cdot \log \left(1 + \color{blue}{\left(x \cdot x\right)} \cdot 0.08333333333333333\right) \]
  10. Simplified55.6%

    \[\leadsto 2 \cdot \log \color{blue}{\left(1 + \left(x \cdot x\right) \cdot 0.08333333333333333\right)} \]
  11. Step-by-step derivation
    1. log1p-def94.4%

      \[\leadsto 2 \cdot \color{blue}{\mathsf{log1p}\left(\left(x \cdot x\right) \cdot 0.08333333333333333\right)} \]
    2. associate-*r*94.4%

      \[\leadsto 2 \cdot \mathsf{log1p}\left(\color{blue}{x \cdot \left(x \cdot 0.08333333333333333\right)}\right) \]
  12. Applied egg-rr94.4%

    \[\leadsto 2 \cdot \color{blue}{\mathsf{log1p}\left(x \cdot \left(x \cdot 0.08333333333333333\right)\right)} \]
  13. Final simplification94.4%

    \[\leadsto 2 \cdot \mathsf{log1p}\left(x \cdot \left(x \cdot 0.08333333333333333\right)\right) \]

Alternative 9: 96.5% accurate, 40.6× speedup?

\[\begin{array}{l} \\ 0.16666666666666666 \cdot \left(x \cdot x\right) \end{array} \]
(FPCore (x) :precision binary64 (* 0.16666666666666666 (* x x)))
double code(double x) {
	return 0.16666666666666666 * (x * x);
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = 0.16666666666666666d0 * (x * x)
end function
public static double code(double x) {
	return 0.16666666666666666 * (x * x);
}
def code(x):
	return 0.16666666666666666 * (x * x)
function code(x)
	return Float64(0.16666666666666666 * Float64(x * x))
end
function tmp = code(x)
	tmp = 0.16666666666666666 * (x * x);
end
code[x_] := N[(0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
0.16666666666666666 \cdot \left(x \cdot x\right)
\end{array}
Derivation
  1. Initial program 56.9%

    \[\log \left(\frac{\sinh x}{x}\right) \]
  2. Taylor expanded in x around 0 94.3%

    \[\leadsto \color{blue}{0.16666666666666666 \cdot {x}^{2}} \]
  3. Step-by-step derivation
    1. unpow294.3%

      \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(x \cdot x\right)} \]
  4. Simplified94.3%

    \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(x \cdot x\right)} \]
  5. Final simplification94.3%

    \[\leadsto 0.16666666666666666 \cdot \left(x \cdot x\right) \]

Developer target: 98.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left|x\right| < 0.085:\\ \;\;\;\;\left(x \cdot x\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-2.6455026455026456 \cdot 10^{-5}, x \cdot x, 0.0003527336860670194\right), x \cdot x, -0.005555555555555556\right), x \cdot x, 0.16666666666666666\right)\\ \mathbf{else}:\\ \;\;\;\;\log \left(\frac{\sinh x}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (< (fabs x) 0.085)
   (*
    (* x x)
    (fma
     (fma
      (fma -2.6455026455026456e-5 (* x x) 0.0003527336860670194)
      (* x x)
      -0.005555555555555556)
     (* x x)
     0.16666666666666666))
   (log (/ (sinh x) x))))
double code(double x) {
	double tmp;
	if (fabs(x) < 0.085) {
		tmp = (x * x) * fma(fma(fma(-2.6455026455026456e-5, (x * x), 0.0003527336860670194), (x * x), -0.005555555555555556), (x * x), 0.16666666666666666);
	} else {
		tmp = log((sinh(x) / x));
	}
	return tmp;
}
function code(x)
	tmp = 0.0
	if (abs(x) < 0.085)
		tmp = Float64(Float64(x * x) * fma(fma(fma(-2.6455026455026456e-5, Float64(x * x), 0.0003527336860670194), Float64(x * x), -0.005555555555555556), Float64(x * x), 0.16666666666666666));
	else
		tmp = log(Float64(sinh(x) / x));
	end
	return tmp
end
code[x_] := If[Less[N[Abs[x], $MachinePrecision], 0.085], N[(N[(x * x), $MachinePrecision] * N[(N[(N[(-2.6455026455026456e-5 * N[(x * x), $MachinePrecision] + 0.0003527336860670194), $MachinePrecision] * N[(x * x), $MachinePrecision] + -0.005555555555555556), $MachinePrecision] * N[(x * x), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]), $MachinePrecision], N[Log[N[(N[Sinh[x], $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\left|x\right| < 0.085:\\
\;\;\;\;\left(x \cdot x\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-2.6455026455026456 \cdot 10^{-5}, x \cdot x, 0.0003527336860670194\right), x \cdot x, -0.005555555555555556\right), x \cdot x, 0.16666666666666666\right)\\

\mathbf{else}:\\
\;\;\;\;\log \left(\frac{\sinh x}{x}\right)\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023249 
(FPCore (x)
  :name "bug500, discussion (missed optimization)"
  :precision binary64

  :herbie-target
  (if (< (fabs x) 0.085) (* (* x x) (fma (fma (fma -2.6455026455026456e-5 (* x x) 0.0003527336860670194) (* x x) -0.005555555555555556) (* x x) 0.16666666666666666)) (log (/ (sinh x) x)))

  (log (/ (sinh x) x)))