bug500, discussion (missed optimization)

Percentage Accurate: 53.1% → 97.7%
Time: 18.8s
Alternatives: 7
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 7 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: 53.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.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sinh x}{x}\\ \mathbf{if}\;t_0 \leq 1.00005:\\ \;\;\;\;{x}^{4} \cdot -0.005555555555555556 + x \cdot \left(x \cdot 0.16666666666666666\right)\\ \mathbf{elif}\;t_0 \leq 4 \cdot 10^{+49}:\\ \;\;\;\;\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.00005)
     (+ (* (pow x 4.0) -0.005555555555555556) (* x (* x 0.16666666666666666)))
     (if (<= t_0 4e+49)
       (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.00005) {
		tmp = (pow(x, 4.0) * -0.005555555555555556) + (x * (x * 0.16666666666666666));
	} else if (t_0 <= 4e+49) {
		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.00005d0) then
        tmp = ((x ** 4.0d0) * (-0.005555555555555556d0)) + (x * (x * 0.16666666666666666d0))
    else if (t_0 <= 4d+49) 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.00005) {
		tmp = (Math.pow(x, 4.0) * -0.005555555555555556) + (x * (x * 0.16666666666666666));
	} else if (t_0 <= 4e+49) {
		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.00005:
		tmp = (math.pow(x, 4.0) * -0.005555555555555556) + (x * (x * 0.16666666666666666))
	elif t_0 <= 4e+49:
		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.00005)
		tmp = Float64(Float64((x ^ 4.0) * -0.005555555555555556) + Float64(x * Float64(x * 0.16666666666666666)));
	elseif (t_0 <= 4e+49)
		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.00005)
		tmp = ((x ^ 4.0) * -0.005555555555555556) + (x * (x * 0.16666666666666666));
	elseif (t_0 <= 4e+49)
		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.00005], N[(N[(N[Power[x, 4.0], $MachinePrecision] * -0.005555555555555556), $MachinePrecision] + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+49], 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.00005:\\
\;\;\;\;{x}^{4} \cdot -0.005555555555555556 + x \cdot \left(x \cdot 0.16666666666666666\right)\\

\mathbf{elif}\;t_0 \leq 4 \cdot 10^{+49}:\\
\;\;\;\;\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.00005000000000011

    1. Initial program 46.5%

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

      \[\leadsto \color{blue}{-0.005555555555555556 \cdot {x}^{4} + 0.16666666666666666 \cdot {x}^{2}} \]
    3. Step-by-step derivation
      1. add-cbrt-cube66.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{\sqrt[3]{\left(\left(0.16666666666666666 \cdot {x}^{2}\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)}} \]
      2. pow1/365.0%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{{\left(\left(\left(0.16666666666666666 \cdot {x}^{2}\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)\right)}^{0.3333333333333333}} \]
      3. pow365.0%

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

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left({\color{blue}{\left({x}^{2} \cdot 0.16666666666666666\right)}}^{3}\right)}^{0.3333333333333333} \]
      5. unpow-prod-down65.1%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\color{blue}{\left({\left({x}^{2}\right)}^{3} \cdot {0.16666666666666666}^{3}\right)}}^{0.3333333333333333} \]
      6. unpow265.1%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left({\color{blue}{\left(x \cdot x\right)}}^{3} \cdot {0.16666666666666666}^{3}\right)}^{0.3333333333333333} \]
      7. pow-prod-down65.0%

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

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left(\color{blue}{{x}^{\left(2 \cdot 3\right)}} \cdot {0.16666666666666666}^{3}\right)}^{0.3333333333333333} \]
      9. metadata-eval65.1%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left({x}^{\color{blue}{6}} \cdot {0.16666666666666666}^{3}\right)}^{0.3333333333333333} \]
      10. metadata-eval65.0%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left({x}^{6} \cdot \color{blue}{0.004629629629629629}\right)}^{0.3333333333333333} \]
    4. Applied egg-rr65.0%

      \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{{\left({x}^{6} \cdot 0.004629629629629629\right)}^{0.3333333333333333}} \]
    5. Step-by-step derivation
      1. unpow1/366.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{\sqrt[3]{{x}^{6} \cdot 0.004629629629629629}} \]
    6. Simplified66.6%

      \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{\sqrt[3]{{x}^{6} \cdot 0.004629629629629629}} \]
    7. Step-by-step derivation
      1. metadata-eval66.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{{x}^{\color{blue}{\left(2 \cdot 3\right)}} \cdot 0.004629629629629629} \]
      2. pow-sqr66.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{\color{blue}{\left({x}^{3} \cdot {x}^{3}\right)} \cdot 0.004629629629629629} \]
      3. pow-prod-down66.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{\color{blue}{{\left(x \cdot x\right)}^{3}} \cdot 0.004629629629629629} \]
      4. unpow266.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{{\color{blue}{\left({x}^{2}\right)}}^{3} \cdot 0.004629629629629629} \]
      5. metadata-eval66.5%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{{\left({x}^{2}\right)}^{3} \cdot \color{blue}{{0.16666666666666666}^{3}}} \]
      6. unpow-prod-down66.5%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{\color{blue}{{\left({x}^{2} \cdot 0.16666666666666666\right)}^{3}}} \]
      7. *-commutative66.5%

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

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{\color{blue}{\left(\left(0.16666666666666666 \cdot {x}^{2}\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)}} \]
      9. add-cbrt-cube99.7%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{0.16666666666666666 \cdot {x}^{2}} \]
      10. unpow299.7%

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

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

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

    if 1.00005000000000011 < (/.f64 (sinh.f64 x) x) < 3.99999999999999979e49

    1. Initial program 95.5%

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

    if 3.99999999999999979e49 < (/.f64 (sinh.f64 x) x)

    1. Initial program 3.2%

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

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

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

        \[\leadsto \log 0.0001984126984126984 + -6 \cdot \color{blue}{\left(-\log x\right)} \]
      2. neg-mul-18.0%

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

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

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

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

        \[\leadsto \color{blue}{\log \left(0.0001984126984126984 \cdot {x}^{6}\right)} \]
      7. *-commutative12.6%

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

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

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

Alternative 2: 97.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{fma}\left({x}^{6}, 0.0001984126984126984, \mathsf{fma}\left({x}^{2}, 0.16666666666666666, {x}^{4} \cdot 0.008333333333333333\right)\right)\right)\right)\right) \end{array} \]
(FPCore (x)
 :precision binary64
 (expm1
  (log1p
   (log1p
    (fma
     (pow x 6.0)
     0.0001984126984126984
     (fma
      (pow x 2.0)
      0.16666666666666666
      (* (pow x 4.0) 0.008333333333333333)))))))
double code(double x) {
	return expm1(log1p(log1p(fma(pow(x, 6.0), 0.0001984126984126984, fma(pow(x, 2.0), 0.16666666666666666, (pow(x, 4.0) * 0.008333333333333333))))));
}
function code(x)
	return expm1(log1p(log1p(fma((x ^ 6.0), 0.0001984126984126984, fma((x ^ 2.0), 0.16666666666666666, Float64((x ^ 4.0) * 0.008333333333333333))))))
end
code[x_] := N[(Exp[N[Log[1 + N[Log[1 + N[(N[Power[x, 6.0], $MachinePrecision] * 0.0001984126984126984 + N[(N[Power[x, 2.0], $MachinePrecision] * 0.16666666666666666 + N[(N[Power[x, 4.0], $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{fma}\left({x}^{6}, 0.0001984126984126984, \mathsf{fma}\left({x}^{2}, 0.16666666666666666, {x}^{4} \cdot 0.008333333333333333\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 46.3%

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

    \[\leadsto \log \color{blue}{\left(1 + \left(0.0001984126984126984 \cdot {x}^{6} + \left(0.008333333333333333 \cdot {x}^{4} + 0.16666666666666666 \cdot {x}^{2}\right)\right)\right)} \]
  3. Step-by-step derivation
    1. expm1-log1p-u45.4%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\log \left(1 + \left(0.0001984126984126984 \cdot {x}^{6} + \left(0.008333333333333333 \cdot {x}^{4} + 0.16666666666666666 \cdot {x}^{2}\right)\right)\right)\right)\right)} \]
    2. log1p-def95.7%

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\mathsf{log1p}\left(0.0001984126984126984 \cdot {x}^{6} + \left(0.008333333333333333 \cdot {x}^{4} + 0.16666666666666666 \cdot {x}^{2}\right)\right)}\right)\right) \]
    3. *-commutative95.7%

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\color{blue}{{x}^{6} \cdot 0.0001984126984126984} + \left(0.008333333333333333 \cdot {x}^{4} + 0.16666666666666666 \cdot {x}^{2}\right)\right)\right)\right) \]
    4. fma-def95.7%

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left({x}^{6}, 0.0001984126984126984, 0.008333333333333333 \cdot {x}^{4} + 0.16666666666666666 \cdot {x}^{2}\right)}\right)\right)\right) \]
    5. +-commutative95.7%

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{fma}\left({x}^{6}, 0.0001984126984126984, \color{blue}{0.16666666666666666 \cdot {x}^{2} + 0.008333333333333333 \cdot {x}^{4}}\right)\right)\right)\right) \]
    6. *-commutative95.7%

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{fma}\left({x}^{6}, 0.0001984126984126984, \color{blue}{{x}^{2} \cdot 0.16666666666666666} + 0.008333333333333333 \cdot {x}^{4}\right)\right)\right)\right) \]
    7. fma-def95.7%

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{fma}\left({x}^{6}, 0.0001984126984126984, \color{blue}{\mathsf{fma}\left({x}^{2}, 0.16666666666666666, 0.008333333333333333 \cdot {x}^{4}\right)}\right)\right)\right)\right) \]
    8. *-commutative95.7%

      \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{fma}\left({x}^{6}, 0.0001984126984126984, \mathsf{fma}\left({x}^{2}, 0.16666666666666666, \color{blue}{{x}^{4} \cdot 0.008333333333333333}\right)\right)\right)\right)\right) \]
  4. Applied egg-rr95.7%

    \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{fma}\left({x}^{6}, 0.0001984126984126984, \mathsf{fma}\left({x}^{2}, 0.16666666666666666, {x}^{4} \cdot 0.008333333333333333\right)\right)\right)\right)\right)} \]
  5. Final simplification95.7%

    \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{fma}\left({x}^{6}, 0.0001984126984126984, \mathsf{fma}\left({x}^{2}, 0.16666666666666666, {x}^{4} \cdot 0.008333333333333333\right)\right)\right)\right)\right) \]

Alternative 3: 96.8% accurate, 0.5× speedup?

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

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

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

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

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

Alternative 4: 97.7% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t_0 \leq 4 \cdot 10^{+49}:\\
\;\;\;\;\log t_0\\

\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{x}^{6} \cdot 0.004629629629629629}\\


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

    1. Initial program 46.5%

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

      \[\leadsto \color{blue}{-0.005555555555555556 \cdot {x}^{4} + 0.16666666666666666 \cdot {x}^{2}} \]
    3. Step-by-step derivation
      1. add-cbrt-cube66.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{\sqrt[3]{\left(\left(0.16666666666666666 \cdot {x}^{2}\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)}} \]
      2. pow1/365.0%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{{\left(\left(\left(0.16666666666666666 \cdot {x}^{2}\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)\right)}^{0.3333333333333333}} \]
      3. pow365.0%

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

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left({\color{blue}{\left({x}^{2} \cdot 0.16666666666666666\right)}}^{3}\right)}^{0.3333333333333333} \]
      5. unpow-prod-down65.1%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\color{blue}{\left({\left({x}^{2}\right)}^{3} \cdot {0.16666666666666666}^{3}\right)}}^{0.3333333333333333} \]
      6. unpow265.1%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left({\color{blue}{\left(x \cdot x\right)}}^{3} \cdot {0.16666666666666666}^{3}\right)}^{0.3333333333333333} \]
      7. pow-prod-down65.0%

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

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left(\color{blue}{{x}^{\left(2 \cdot 3\right)}} \cdot {0.16666666666666666}^{3}\right)}^{0.3333333333333333} \]
      9. metadata-eval65.1%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left({x}^{\color{blue}{6}} \cdot {0.16666666666666666}^{3}\right)}^{0.3333333333333333} \]
      10. metadata-eval65.0%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left({x}^{6} \cdot \color{blue}{0.004629629629629629}\right)}^{0.3333333333333333} \]
    4. Applied egg-rr65.0%

      \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{{\left({x}^{6} \cdot 0.004629629629629629\right)}^{0.3333333333333333}} \]
    5. Step-by-step derivation
      1. unpow1/366.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{\sqrt[3]{{x}^{6} \cdot 0.004629629629629629}} \]
    6. Simplified66.6%

      \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{\sqrt[3]{{x}^{6} \cdot 0.004629629629629629}} \]
    7. Step-by-step derivation
      1. metadata-eval66.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{{x}^{\color{blue}{\left(2 \cdot 3\right)}} \cdot 0.004629629629629629} \]
      2. pow-sqr66.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{\color{blue}{\left({x}^{3} \cdot {x}^{3}\right)} \cdot 0.004629629629629629} \]
      3. pow-prod-down66.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{\color{blue}{{\left(x \cdot x\right)}^{3}} \cdot 0.004629629629629629} \]
      4. unpow266.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{{\color{blue}{\left({x}^{2}\right)}}^{3} \cdot 0.004629629629629629} \]
      5. metadata-eval66.5%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{{\left({x}^{2}\right)}^{3} \cdot \color{blue}{{0.16666666666666666}^{3}}} \]
      6. unpow-prod-down66.5%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{\color{blue}{{\left({x}^{2} \cdot 0.16666666666666666\right)}^{3}}} \]
      7. *-commutative66.5%

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

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{\color{blue}{\left(\left(0.16666666666666666 \cdot {x}^{2}\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)}} \]
      9. add-cbrt-cube99.7%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{0.16666666666666666 \cdot {x}^{2}} \]
      10. unpow299.7%

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

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

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

    if 1.00005000000000011 < (/.f64 (sinh.f64 x) x) < 3.99999999999999979e49

    1. Initial program 95.5%

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

    if 3.99999999999999979e49 < (/.f64 (sinh.f64 x) x)

    1. Initial program 3.2%

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

      \[\leadsto \color{blue}{-0.005555555555555556 \cdot {x}^{4} + 0.16666666666666666 \cdot {x}^{2}} \]
    3. Taylor expanded in x around 0 12.1%

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

        \[\leadsto \color{blue}{{x}^{2} \cdot 0.16666666666666666} \]
    5. Simplified12.1%

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

        \[\leadsto \color{blue}{0.16666666666666666 \cdot {x}^{2}} \]
      2. add-cbrt-cube12.1%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(0.16666666666666666 \cdot {x}^{2}\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)}} \]
      3. pow312.1%

        \[\leadsto \sqrt[3]{\color{blue}{{\left(0.16666666666666666 \cdot {x}^{2}\right)}^{3}}} \]
      4. *-commutative12.1%

        \[\leadsto \sqrt[3]{{\color{blue}{\left({x}^{2} \cdot 0.16666666666666666\right)}}^{3}} \]
      5. unpow-prod-down12.1%

        \[\leadsto \sqrt[3]{\color{blue}{{\left({x}^{2}\right)}^{3} \cdot {0.16666666666666666}^{3}}} \]
      6. unpow212.1%

        \[\leadsto \sqrt[3]{{\color{blue}{\left(x \cdot x\right)}}^{3} \cdot {0.16666666666666666}^{3}} \]
      7. pow-prod-down12.1%

        \[\leadsto \sqrt[3]{\color{blue}{\left({x}^{3} \cdot {x}^{3}\right)} \cdot {0.16666666666666666}^{3}} \]
      8. pow-prod-up12.1%

        \[\leadsto \sqrt[3]{\color{blue}{{x}^{\left(3 + 3\right)}} \cdot {0.16666666666666666}^{3}} \]
      9. metadata-eval12.1%

        \[\leadsto \sqrt[3]{{x}^{\color{blue}{6}} \cdot {0.16666666666666666}^{3}} \]
      10. metadata-eval12.1%

        \[\leadsto \sqrt[3]{{x}^{6} \cdot \color{blue}{0.004629629629629629}} \]
    7. Applied egg-rr12.1%

      \[\leadsto \color{blue}{\sqrt[3]{{x}^{6} \cdot 0.004629629629629629}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.9%

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

Alternative 5: 97.7% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t_0 \leq 4 \cdot 10^{+49}:\\
\;\;\;\;\log t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 46.5%

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

      \[\leadsto \color{blue}{-0.005555555555555556 \cdot {x}^{4} + 0.16666666666666666 \cdot {x}^{2}} \]
    3. Step-by-step derivation
      1. add-cbrt-cube66.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{\sqrt[3]{\left(\left(0.16666666666666666 \cdot {x}^{2}\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)}} \]
      2. pow1/365.0%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{{\left(\left(\left(0.16666666666666666 \cdot {x}^{2}\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)\right)}^{0.3333333333333333}} \]
      3. pow365.0%

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

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left({\color{blue}{\left({x}^{2} \cdot 0.16666666666666666\right)}}^{3}\right)}^{0.3333333333333333} \]
      5. unpow-prod-down65.1%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\color{blue}{\left({\left({x}^{2}\right)}^{3} \cdot {0.16666666666666666}^{3}\right)}}^{0.3333333333333333} \]
      6. unpow265.1%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left({\color{blue}{\left(x \cdot x\right)}}^{3} \cdot {0.16666666666666666}^{3}\right)}^{0.3333333333333333} \]
      7. pow-prod-down65.0%

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

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left(\color{blue}{{x}^{\left(2 \cdot 3\right)}} \cdot {0.16666666666666666}^{3}\right)}^{0.3333333333333333} \]
      9. metadata-eval65.1%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left({x}^{\color{blue}{6}} \cdot {0.16666666666666666}^{3}\right)}^{0.3333333333333333} \]
      10. metadata-eval65.0%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left({x}^{6} \cdot \color{blue}{0.004629629629629629}\right)}^{0.3333333333333333} \]
    4. Applied egg-rr65.0%

      \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{{\left({x}^{6} \cdot 0.004629629629629629\right)}^{0.3333333333333333}} \]
    5. Step-by-step derivation
      1. unpow1/366.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{\sqrt[3]{{x}^{6} \cdot 0.004629629629629629}} \]
    6. Simplified66.6%

      \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{\sqrt[3]{{x}^{6} \cdot 0.004629629629629629}} \]
    7. Step-by-step derivation
      1. metadata-eval66.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{{x}^{\color{blue}{\left(2 \cdot 3\right)}} \cdot 0.004629629629629629} \]
      2. pow-sqr66.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{\color{blue}{\left({x}^{3} \cdot {x}^{3}\right)} \cdot 0.004629629629629629} \]
      3. pow-prod-down66.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{\color{blue}{{\left(x \cdot x\right)}^{3}} \cdot 0.004629629629629629} \]
      4. unpow266.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{{\color{blue}{\left({x}^{2}\right)}}^{3} \cdot 0.004629629629629629} \]
      5. metadata-eval66.5%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{{\left({x}^{2}\right)}^{3} \cdot \color{blue}{{0.16666666666666666}^{3}}} \]
      6. unpow-prod-down66.5%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{\color{blue}{{\left({x}^{2} \cdot 0.16666666666666666\right)}^{3}}} \]
      7. *-commutative66.5%

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

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{\color{blue}{\left(\left(0.16666666666666666 \cdot {x}^{2}\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)}} \]
      9. add-cbrt-cube99.7%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{0.16666666666666666 \cdot {x}^{2}} \]
      10. unpow299.7%

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

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

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

    if 1.00005000000000011 < (/.f64 (sinh.f64 x) x) < 3.99999999999999979e49

    1. Initial program 95.5%

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

    if 3.99999999999999979e49 < (/.f64 (sinh.f64 x) x)

    1. Initial program 3.2%

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

      \[\leadsto \color{blue}{-0.005555555555555556 \cdot {x}^{4} + 0.16666666666666666 \cdot {x}^{2}} \]
    3. Taylor expanded in x around 0 12.1%

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

        \[\leadsto \color{blue}{{x}^{2} \cdot 0.16666666666666666} \]
    5. Simplified12.1%

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

        \[\leadsto \color{blue}{0.16666666666666666 \cdot {x}^{2}} \]
      2. add-sqr-sqrt12.1%

        \[\leadsto \color{blue}{\sqrt{0.16666666666666666 \cdot {x}^{2}} \cdot \sqrt{0.16666666666666666 \cdot {x}^{2}}} \]
      3. sqrt-unprod12.1%

        \[\leadsto \color{blue}{\sqrt{\left(0.16666666666666666 \cdot {x}^{2}\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)}} \]
      4. *-commutative12.1%

        \[\leadsto \sqrt{\color{blue}{\left({x}^{2} \cdot 0.16666666666666666\right)} \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)} \]
      5. *-commutative12.1%

        \[\leadsto \sqrt{\left({x}^{2} \cdot 0.16666666666666666\right) \cdot \color{blue}{\left({x}^{2} \cdot 0.16666666666666666\right)}} \]
      6. swap-sqr12.1%

        \[\leadsto \sqrt{\color{blue}{\left({x}^{2} \cdot {x}^{2}\right) \cdot \left(0.16666666666666666 \cdot 0.16666666666666666\right)}} \]
      7. pow-prod-up12.1%

        \[\leadsto \sqrt{\color{blue}{{x}^{\left(2 + 2\right)}} \cdot \left(0.16666666666666666 \cdot 0.16666666666666666\right)} \]
      8. metadata-eval12.1%

        \[\leadsto \sqrt{{x}^{\color{blue}{4}} \cdot \left(0.16666666666666666 \cdot 0.16666666666666666\right)} \]
      9. metadata-eval12.1%

        \[\leadsto \sqrt{{x}^{4} \cdot \color{blue}{0.027777777777777776}} \]
    7. Applied egg-rr12.1%

      \[\leadsto \color{blue}{\sqrt{{x}^{4} \cdot 0.027777777777777776}} \]
    8. Step-by-step derivation
      1. *-commutative12.1%

        \[\leadsto \sqrt{\color{blue}{0.027777777777777776 \cdot {x}^{4}}} \]
      2. sqrt-prod12.1%

        \[\leadsto \color{blue}{\sqrt{0.027777777777777776} \cdot \sqrt{{x}^{4}}} \]
      3. metadata-eval12.1%

        \[\leadsto \color{blue}{0.16666666666666666} \cdot \sqrt{{x}^{4}} \]
      4. sqrt-pow112.1%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{{x}^{\left(\frac{4}{2}\right)}} \]
      5. metadata-eval12.1%

        \[\leadsto 0.16666666666666666 \cdot {x}^{\color{blue}{2}} \]
      6. unpow212.1%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(x \cdot x\right)} \]
      7. associate-*l*12.1%

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot x\right) \cdot x} \]
      8. *-commutative12.1%

        \[\leadsto \color{blue}{\left(x \cdot 0.16666666666666666\right)} \cdot x \]
    9. Applied egg-rr12.1%

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

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

Alternative 6: 97.8% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 46.5%

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

      \[\leadsto \color{blue}{-0.005555555555555556 \cdot {x}^{4} + 0.16666666666666666 \cdot {x}^{2}} \]
    3. Step-by-step derivation
      1. add-cbrt-cube66.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{\sqrt[3]{\left(\left(0.16666666666666666 \cdot {x}^{2}\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)}} \]
      2. pow1/365.0%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{{\left(\left(\left(0.16666666666666666 \cdot {x}^{2}\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)\right)}^{0.3333333333333333}} \]
      3. pow365.0%

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

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left({\color{blue}{\left({x}^{2} \cdot 0.16666666666666666\right)}}^{3}\right)}^{0.3333333333333333} \]
      5. unpow-prod-down65.1%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\color{blue}{\left({\left({x}^{2}\right)}^{3} \cdot {0.16666666666666666}^{3}\right)}}^{0.3333333333333333} \]
      6. unpow265.1%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left({\color{blue}{\left(x \cdot x\right)}}^{3} \cdot {0.16666666666666666}^{3}\right)}^{0.3333333333333333} \]
      7. pow-prod-down65.0%

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

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left(\color{blue}{{x}^{\left(2 \cdot 3\right)}} \cdot {0.16666666666666666}^{3}\right)}^{0.3333333333333333} \]
      9. metadata-eval65.1%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left({x}^{\color{blue}{6}} \cdot {0.16666666666666666}^{3}\right)}^{0.3333333333333333} \]
      10. metadata-eval65.0%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + {\left({x}^{6} \cdot \color{blue}{0.004629629629629629}\right)}^{0.3333333333333333} \]
    4. Applied egg-rr65.0%

      \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{{\left({x}^{6} \cdot 0.004629629629629629\right)}^{0.3333333333333333}} \]
    5. Step-by-step derivation
      1. unpow1/366.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{\sqrt[3]{{x}^{6} \cdot 0.004629629629629629}} \]
    6. Simplified66.6%

      \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{\sqrt[3]{{x}^{6} \cdot 0.004629629629629629}} \]
    7. Step-by-step derivation
      1. metadata-eval66.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{{x}^{\color{blue}{\left(2 \cdot 3\right)}} \cdot 0.004629629629629629} \]
      2. pow-sqr66.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{\color{blue}{\left({x}^{3} \cdot {x}^{3}\right)} \cdot 0.004629629629629629} \]
      3. pow-prod-down66.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{\color{blue}{{\left(x \cdot x\right)}^{3}} \cdot 0.004629629629629629} \]
      4. unpow266.6%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{{\color{blue}{\left({x}^{2}\right)}}^{3} \cdot 0.004629629629629629} \]
      5. metadata-eval66.5%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{{\left({x}^{2}\right)}^{3} \cdot \color{blue}{{0.16666666666666666}^{3}}} \]
      6. unpow-prod-down66.5%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{\color{blue}{{\left({x}^{2} \cdot 0.16666666666666666\right)}^{3}}} \]
      7. *-commutative66.5%

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

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \sqrt[3]{\color{blue}{\left(\left(0.16666666666666666 \cdot {x}^{2}\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)}} \]
      9. add-cbrt-cube99.7%

        \[\leadsto -0.005555555555555556 \cdot {x}^{4} + \color{blue}{0.16666666666666666 \cdot {x}^{2}} \]
      10. unpow299.7%

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

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

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

    if 1.00005000000000011 < (/.f64 (sinh.f64 x) x)

    1. Initial program 42.7%

      \[\log \left(\frac{\sinh x}{x}\right) \]
    2. Step-by-step derivation
      1. clear-num42.7%

        \[\leadsto \log \color{blue}{\left(\frac{1}{\frac{x}{\sinh x}}\right)} \]
      2. neg-log43.1%

        \[\leadsto \color{blue}{-\log \left(\frac{x}{\sinh x}\right)} \]
    3. Applied egg-rr43.1%

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

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

Alternative 7: 96.3% accurate, 40.6× speedup?

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

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

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

    \[\leadsto \color{blue}{-0.005555555555555556 \cdot {x}^{4} + 0.16666666666666666 \cdot {x}^{2}} \]
  3. Taylor expanded in x around 0 95.0%

    \[\leadsto \color{blue}{0.16666666666666666 \cdot {x}^{2}} \]
  4. Step-by-step derivation
    1. *-commutative95.0%

      \[\leadsto \color{blue}{{x}^{2} \cdot 0.16666666666666666} \]
  5. Simplified95.0%

    \[\leadsto \color{blue}{{x}^{2} \cdot 0.16666666666666666} \]
  6. Step-by-step derivation
    1. *-commutative95.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot {x}^{2}} \]
    2. add-sqr-sqrt94.8%

      \[\leadsto \color{blue}{\sqrt{0.16666666666666666 \cdot {x}^{2}} \cdot \sqrt{0.16666666666666666 \cdot {x}^{2}}} \]
    3. sqrt-unprod71.7%

      \[\leadsto \color{blue}{\sqrt{\left(0.16666666666666666 \cdot {x}^{2}\right) \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)}} \]
    4. *-commutative71.7%

      \[\leadsto \sqrt{\color{blue}{\left({x}^{2} \cdot 0.16666666666666666\right)} \cdot \left(0.16666666666666666 \cdot {x}^{2}\right)} \]
    5. *-commutative71.7%

      \[\leadsto \sqrt{\left({x}^{2} \cdot 0.16666666666666666\right) \cdot \color{blue}{\left({x}^{2} \cdot 0.16666666666666666\right)}} \]
    6. swap-sqr71.7%

      \[\leadsto \sqrt{\color{blue}{\left({x}^{2} \cdot {x}^{2}\right) \cdot \left(0.16666666666666666 \cdot 0.16666666666666666\right)}} \]
    7. pow-prod-up71.7%

      \[\leadsto \sqrt{\color{blue}{{x}^{\left(2 + 2\right)}} \cdot \left(0.16666666666666666 \cdot 0.16666666666666666\right)} \]
    8. metadata-eval71.7%

      \[\leadsto \sqrt{{x}^{\color{blue}{4}} \cdot \left(0.16666666666666666 \cdot 0.16666666666666666\right)} \]
    9. metadata-eval71.7%

      \[\leadsto \sqrt{{x}^{4} \cdot \color{blue}{0.027777777777777776}} \]
  7. Applied egg-rr71.7%

    \[\leadsto \color{blue}{\sqrt{{x}^{4} \cdot 0.027777777777777776}} \]
  8. Step-by-step derivation
    1. *-commutative71.7%

      \[\leadsto \sqrt{\color{blue}{0.027777777777777776 \cdot {x}^{4}}} \]
    2. sqrt-prod71.8%

      \[\leadsto \color{blue}{\sqrt{0.027777777777777776} \cdot \sqrt{{x}^{4}}} \]
    3. metadata-eval71.8%

      \[\leadsto \color{blue}{0.16666666666666666} \cdot \sqrt{{x}^{4}} \]
    4. sqrt-pow195.0%

      \[\leadsto 0.16666666666666666 \cdot \color{blue}{{x}^{\left(\frac{4}{2}\right)}} \]
    5. metadata-eval95.0%

      \[\leadsto 0.16666666666666666 \cdot {x}^{\color{blue}{2}} \]
    6. unpow295.0%

      \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(x \cdot x\right)} \]
    7. associate-*l*95.1%

      \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot x\right) \cdot x} \]
    8. *-commutative95.1%

      \[\leadsto \color{blue}{\left(x \cdot 0.16666666666666666\right)} \cdot x \]
  9. Applied egg-rr95.1%

    \[\leadsto \color{blue}{\left(x \cdot 0.16666666666666666\right) \cdot x} \]
  10. Final simplification95.1%

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

Developer target: 97.9% 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 2023318 
(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)))