Linear.Quaternion:$csin from linear-1.19.1.3

Percentage Accurate: 100.0% → 100.0%
Time: 14.8s
Alternatives: 15
Speedup: 1.0×

Specification

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

\\
\cos x \cdot \frac{\sinh y}{y}
\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 15 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: 100.0% accurate, 1.0× speedup?

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

\\
\cos x \cdot \frac{\sinh y}{y}
\end{array}

Alternative 1: 100.0% accurate, 1.0× speedup?

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

\\
\cos x \cdot \frac{\sinh y}{y}
\end{array}
Derivation
  1. Initial program 100.0%

    \[\cos x \cdot \frac{\sinh y}{y} \]
  2. Final simplification100.0%

    \[\leadsto \cos x \cdot \frac{\sinh y}{y} \]

Alternative 2: 80.9% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{if}\;y \leq 10^{+26}:\\ \;\;\;\;\cos x \cdot \left(1 + t_0\right)\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+77}:\\ \;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + \left(x \cdot x\right) \cdot -0.5\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;1 + \left(-1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 + y \cdot \left(y \cdot -0.16666666666666666\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos x \cdot t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* y y))))
   (if (<= y 1e+26)
     (* (cos x) (+ 1.0 t_0))
     (if (<= y 1.15e+77)
       (* (fma y (* y 0.16666666666666666) 1.0) (+ 1.0 (* (* x x) -0.5)))
       (if (<= y 1.4e+154)
         (+
          1.0
          (+
           -1.0
           (/
            (+ 1.0 (* (pow y 4.0) -0.027777777777777776))
            (+ 1.0 (* y (* y -0.16666666666666666))))))
         (* (cos x) t_0))))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (y * y);
	double tmp;
	if (y <= 1e+26) {
		tmp = cos(x) * (1.0 + t_0);
	} else if (y <= 1.15e+77) {
		tmp = fma(y, (y * 0.16666666666666666), 1.0) * (1.0 + ((x * x) * -0.5));
	} else if (y <= 1.4e+154) {
		tmp = 1.0 + (-1.0 + ((1.0 + (pow(y, 4.0) * -0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666)))));
	} else {
		tmp = cos(x) * t_0;
	}
	return tmp;
}
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(y * y))
	tmp = 0.0
	if (y <= 1e+26)
		tmp = Float64(cos(x) * Float64(1.0 + t_0));
	elseif (y <= 1.15e+77)
		tmp = Float64(fma(y, Float64(y * 0.16666666666666666), 1.0) * Float64(1.0 + Float64(Float64(x * x) * -0.5)));
	elseif (y <= 1.4e+154)
		tmp = Float64(1.0 + Float64(-1.0 + Float64(Float64(1.0 + Float64((y ^ 4.0) * -0.027777777777777776)) / Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666))))));
	else
		tmp = Float64(cos(x) * t_0);
	end
	return tmp
end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1e+26], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+77], N[(N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+154], N[(1.0 + N[(-1.0 + N[(N[(1.0 + N[(N[Power[y, 4.0], $MachinePrecision] * -0.027777777777777776), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[x], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 10^{+26}:\\
\;\;\;\;\cos x \cdot \left(1 + t_0\right)\\

\mathbf{elif}\;y \leq 1.15 \cdot 10^{+77}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + \left(x \cdot x\right) \cdot -0.5\right)\\

\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;1 + \left(-1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 + y \cdot \left(y \cdot -0.16666666666666666\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\cos x \cdot t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 1.00000000000000005e26

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 82.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow282.0%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified82.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]

    if 1.00000000000000005e26 < y < 1.14999999999999997e77

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 4.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow24.0%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified4.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in x around 0 64.1%

      \[\leadsto \color{blue}{1 + \left(-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    6. Step-by-step derivation
      1. +-commutative64.1%

        \[\leadsto \color{blue}{\left(-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + 0.16666666666666666 \cdot {y}^{2}\right) + 1} \]
      2. unpow264.1%

        \[\leadsto \left(-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) + 1 \]
      3. *-commutative64.1%

        \[\leadsto \left(-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666}\right) + 1 \]
      4. associate-*r*64.1%

        \[\leadsto \left(-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right)}\right) + 1 \]
      5. associate-+l+64.1%

        \[\leadsto \color{blue}{-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right)} \]
      6. *-commutative64.1%

        \[\leadsto \color{blue}{\left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) \cdot -0.5} + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      7. +-commutative64.1%

        \[\leadsto \left(\color{blue}{\left(0.16666666666666666 \cdot {y}^{2} + 1\right)} \cdot {x}^{2}\right) \cdot -0.5 + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      8. unpow264.1%

        \[\leadsto \left(\left(0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1\right) \cdot {x}^{2}\right) \cdot -0.5 + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      9. *-commutative64.1%

        \[\leadsto \left(\left(\color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1\right) \cdot {x}^{2}\right) \cdot -0.5 + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      10. associate-*r*64.1%

        \[\leadsto \left(\left(\color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right)} + 1\right) \cdot {x}^{2}\right) \cdot -0.5 + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      11. fma-udef64.1%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \cdot {x}^{2}\right) \cdot -0.5 + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      12. associate-*l*64.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left({x}^{2} \cdot -0.5\right)} + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      13. fma-udef64.1%

        \[\leadsto \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left({x}^{2} \cdot -0.5\right) + \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
      14. *-rgt-identity64.1%

        \[\leadsto \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left({x}^{2} \cdot -0.5\right) + \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot 1} \]
      15. distribute-lft-out64.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left({x}^{2} \cdot -0.5 + 1\right)} \]
    7. Simplified64.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(\left(x \cdot x\right) \cdot -0.5 + 1\right)} \]

    if 1.14999999999999997e77 < y < 1.4e154

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 6.6%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow26.6%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified6.6%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in x around 0 5.5%

      \[\leadsto \color{blue}{1 + 0.16666666666666666 \cdot {y}^{2}} \]
    6. Step-by-step derivation
      1. +-commutative5.5%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2} + 1} \]
      2. unpow25.5%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1 \]
      3. *-commutative5.5%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1 \]
      4. associate-*r*5.5%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right)} + 1 \]
      5. fma-udef5.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
    7. Simplified5.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
    8. Step-by-step derivation
      1. fma-udef5.5%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right) + 1} \]
      2. associate-*r*5.5%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1 \]
      3. unpow25.5%

        \[\leadsto \color{blue}{{y}^{2}} \cdot 0.16666666666666666 + 1 \]
      4. *-commutative5.5%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2}} + 1 \]
      5. unpow25.5%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1 \]
    9. Applied egg-rr5.5%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right) + 1} \]
    10. Step-by-step derivation
      1. expm1-log1p-u5.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\right)} \]
      2. expm1-udef5.5%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)} - 1} \]
      3. log1p-udef5.5%

        \[\leadsto e^{\color{blue}{\log \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)}} - 1 \]
      4. add-exp-log5.5%

        \[\leadsto \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} - 1 \]
      5. flip-+84.2%

        \[\leadsto \color{blue}{\frac{1 \cdot 1 - \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}} - 1 \]
      6. div-inv84.2%

        \[\leadsto \color{blue}{\left(1 \cdot 1 - \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}} - 1 \]
      7. fma-neg84.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1 \cdot 1 - \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right), \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right)} \]
      8. metadata-eval84.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{1} - \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right), \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right) \]
      9. swap-sqr84.2%

        \[\leadsto \mathsf{fma}\left(1 - \color{blue}{\left(0.16666666666666666 \cdot 0.16666666666666666\right) \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)}, \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right) \]
      10. metadata-eval84.2%

        \[\leadsto \mathsf{fma}\left(1 - \color{blue}{0.027777777777777776} \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right), \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right) \]
      11. pow284.2%

        \[\leadsto \mathsf{fma}\left(1 - 0.027777777777777776 \cdot \left(\color{blue}{{y}^{2}} \cdot \left(y \cdot y\right)\right), \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right) \]
      12. pow284.2%

        \[\leadsto \mathsf{fma}\left(1 - 0.027777777777777776 \cdot \left({y}^{2} \cdot \color{blue}{{y}^{2}}\right), \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right) \]
      13. pow-prod-up84.2%

        \[\leadsto \mathsf{fma}\left(1 - 0.027777777777777776 \cdot \color{blue}{{y}^{\left(2 + 2\right)}}, \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right) \]
      14. metadata-eval84.2%

        \[\leadsto \mathsf{fma}\left(1 - 0.027777777777777776 \cdot {y}^{\color{blue}{4}}, \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right) \]
      15. *-commutative84.2%

        \[\leadsto \mathsf{fma}\left(1 - 0.027777777777777776 \cdot {y}^{4}, \frac{1}{1 - \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666}}, -1\right) \]
      16. associate-*l*84.2%

        \[\leadsto \mathsf{fma}\left(1 - 0.027777777777777776 \cdot {y}^{4}, \frac{1}{1 - \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right)}}, -1\right) \]
      17. metadata-eval84.2%

        \[\leadsto \mathsf{fma}\left(1 - 0.027777777777777776 \cdot {y}^{4}, \frac{1}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)}, \color{blue}{-1}\right) \]
    11. Applied egg-rr84.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(1 - 0.027777777777777776 \cdot {y}^{4}, \frac{1}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)}, -1\right)} + 1 \]
    12. Step-by-step derivation
      1. fma-udef84.2%

        \[\leadsto \color{blue}{\left(1 - 0.027777777777777776 \cdot {y}^{4}\right) \cdot \frac{1}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)} + -1} \]
      2. +-commutative84.2%

        \[\leadsto \color{blue}{-1 + \left(1 - 0.027777777777777776 \cdot {y}^{4}\right) \cdot \frac{1}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)}} \]
      3. associate-*r/84.2%

        \[\leadsto -1 + \color{blue}{\frac{\left(1 - 0.027777777777777776 \cdot {y}^{4}\right) \cdot 1}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)}} \]
      4. *-rgt-identity84.2%

        \[\leadsto -1 + \frac{\color{blue}{1 - 0.027777777777777776 \cdot {y}^{4}}}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)} \]
      5. sub-neg84.2%

        \[\leadsto -1 + \frac{\color{blue}{1 + \left(-0.027777777777777776 \cdot {y}^{4}\right)}}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)} \]
      6. *-commutative84.2%

        \[\leadsto -1 + \frac{1 + \left(-\color{blue}{{y}^{4} \cdot 0.027777777777777776}\right)}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)} \]
      7. distribute-rgt-neg-in84.2%

        \[\leadsto -1 + \frac{1 + \color{blue}{{y}^{4} \cdot \left(-0.027777777777777776\right)}}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)} \]
      8. metadata-eval84.2%

        \[\leadsto -1 + \frac{1 + {y}^{4} \cdot \color{blue}{-0.027777777777777776}}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)} \]
      9. associate-*r*84.2%

        \[\leadsto -1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 - \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666}} \]
      10. *-commutative84.2%

        \[\leadsto -1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 - \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)}} \]
      11. cancel-sign-sub-inv84.2%

        \[\leadsto -1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{\color{blue}{1 + \left(-0.16666666666666666\right) \cdot \left(y \cdot y\right)}} \]
      12. metadata-eval84.2%

        \[\leadsto -1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 + \color{blue}{-0.16666666666666666} \cdot \left(y \cdot y\right)} \]
      13. *-commutative84.2%

        \[\leadsto -1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 + \color{blue}{\left(y \cdot y\right) \cdot -0.16666666666666666}} \]
      14. associate-*l*84.2%

        \[\leadsto -1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 + \color{blue}{y \cdot \left(y \cdot -0.16666666666666666\right)}} \]
    13. Simplified84.2%

      \[\leadsto \color{blue}{\left(-1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 + y \cdot \left(y \cdot -0.16666666666666666\right)}\right)} + 1 \]

    if 1.4e154 < y

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 100.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow2100.0%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified100.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in y around inf 100.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(\cos x \cdot {y}^{2}\right)} \]
    6. Step-by-step derivation
      1. unpow2100.0%

        \[\leadsto 0.16666666666666666 \cdot \left(\cos x \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
      2. associate-*r*100.0%

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \cos x\right) \cdot \left(y \cdot y\right)} \]
      3. *-commutative100.0%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot \cos x\right)} \]
      4. associate-*l*96.7%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \cos x\right)\right)} \]
      5. *-commutative96.7%

        \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(\cos x \cdot 0.16666666666666666\right)}\right) \]
    7. Simplified96.7%

      \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(\cos x \cdot 0.16666666666666666\right)\right)} \]
    8. Taylor expanded in y around 0 100.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(\cos x \cdot {y}^{2}\right)} \]
    9. Step-by-step derivation
      1. associate-*r*100.0%

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \cos x\right) \cdot {y}^{2}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{\left(\cos x \cdot 0.16666666666666666\right)} \cdot {y}^{2} \]
      3. associate-*r*100.0%

        \[\leadsto \color{blue}{\cos x \cdot \left(0.16666666666666666 \cdot {y}^{2}\right)} \]
      4. unpow2100.0%

        \[\leadsto \cos x \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    10. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 10^{+26}:\\ \;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+77}:\\ \;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + \left(x \cdot x\right) \cdot -0.5\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;1 + \left(-1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 + y \cdot \left(y \cdot -0.16666666666666666\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 3: 80.9% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{if}\;y \leq 8.5 \cdot 10^{+25}:\\ \;\;\;\;\cos x \cdot \left(1 + t_0\right)\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+77}:\\ \;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + \left(x \cdot x\right) \cdot -0.5\right)\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+154}:\\ \;\;\;\;-1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 + y \cdot \left(y \cdot -0.16666666666666666\right)}\\ \mathbf{else}:\\ \;\;\;\;\cos x \cdot t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* y y))))
   (if (<= y 8.5e+25)
     (* (cos x) (+ 1.0 t_0))
     (if (<= y 1.15e+77)
       (* (fma y (* y 0.16666666666666666) 1.0) (+ 1.0 (* (* x x) -0.5)))
       (if (<= y 1.5e+154)
         (+
          -1.0
          (/
           (+ 1.0 (* (pow y 4.0) -0.027777777777777776))
           (+ 1.0 (* y (* y -0.16666666666666666)))))
         (* (cos x) t_0))))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (y * y);
	double tmp;
	if (y <= 8.5e+25) {
		tmp = cos(x) * (1.0 + t_0);
	} else if (y <= 1.15e+77) {
		tmp = fma(y, (y * 0.16666666666666666), 1.0) * (1.0 + ((x * x) * -0.5));
	} else if (y <= 1.5e+154) {
		tmp = -1.0 + ((1.0 + (pow(y, 4.0) * -0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666))));
	} else {
		tmp = cos(x) * t_0;
	}
	return tmp;
}
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(y * y))
	tmp = 0.0
	if (y <= 8.5e+25)
		tmp = Float64(cos(x) * Float64(1.0 + t_0));
	elseif (y <= 1.15e+77)
		tmp = Float64(fma(y, Float64(y * 0.16666666666666666), 1.0) * Float64(1.0 + Float64(Float64(x * x) * -0.5)));
	elseif (y <= 1.5e+154)
		tmp = Float64(-1.0 + Float64(Float64(1.0 + Float64((y ^ 4.0) * -0.027777777777777776)) / Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666)))));
	else
		tmp = Float64(cos(x) * t_0);
	end
	return tmp
end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 8.5e+25], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+77], N[(N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e+154], N[(-1.0 + N[(N[(1.0 + N[(N[Power[y, 4.0], $MachinePrecision] * -0.027777777777777776), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[x], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 8.5 \cdot 10^{+25}:\\
\;\;\;\;\cos x \cdot \left(1 + t_0\right)\\

\mathbf{elif}\;y \leq 1.15 \cdot 10^{+77}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + \left(x \cdot x\right) \cdot -0.5\right)\\

\mathbf{elif}\;y \leq 1.5 \cdot 10^{+154}:\\
\;\;\;\;-1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 + y \cdot \left(y \cdot -0.16666666666666666\right)}\\

\mathbf{else}:\\
\;\;\;\;\cos x \cdot t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 8.5000000000000007e25

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 82.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow282.0%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified82.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]

    if 8.5000000000000007e25 < y < 1.14999999999999997e77

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 4.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow24.0%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified4.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in x around 0 64.1%

      \[\leadsto \color{blue}{1 + \left(-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    6. Step-by-step derivation
      1. +-commutative64.1%

        \[\leadsto \color{blue}{\left(-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + 0.16666666666666666 \cdot {y}^{2}\right) + 1} \]
      2. unpow264.1%

        \[\leadsto \left(-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) + 1 \]
      3. *-commutative64.1%

        \[\leadsto \left(-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666}\right) + 1 \]
      4. associate-*r*64.1%

        \[\leadsto \left(-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right)}\right) + 1 \]
      5. associate-+l+64.1%

        \[\leadsto \color{blue}{-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right)} \]
      6. *-commutative64.1%

        \[\leadsto \color{blue}{\left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) \cdot -0.5} + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      7. +-commutative64.1%

        \[\leadsto \left(\color{blue}{\left(0.16666666666666666 \cdot {y}^{2} + 1\right)} \cdot {x}^{2}\right) \cdot -0.5 + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      8. unpow264.1%

        \[\leadsto \left(\left(0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1\right) \cdot {x}^{2}\right) \cdot -0.5 + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      9. *-commutative64.1%

        \[\leadsto \left(\left(\color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1\right) \cdot {x}^{2}\right) \cdot -0.5 + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      10. associate-*r*64.1%

        \[\leadsto \left(\left(\color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right)} + 1\right) \cdot {x}^{2}\right) \cdot -0.5 + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      11. fma-udef64.1%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \cdot {x}^{2}\right) \cdot -0.5 + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      12. associate-*l*64.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left({x}^{2} \cdot -0.5\right)} + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      13. fma-udef64.1%

        \[\leadsto \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left({x}^{2} \cdot -0.5\right) + \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
      14. *-rgt-identity64.1%

        \[\leadsto \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left({x}^{2} \cdot -0.5\right) + \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot 1} \]
      15. distribute-lft-out64.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left({x}^{2} \cdot -0.5 + 1\right)} \]
    7. Simplified64.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(\left(x \cdot x\right) \cdot -0.5 + 1\right)} \]

    if 1.14999999999999997e77 < y < 1.50000000000000013e154

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 6.6%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow26.6%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified6.6%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in x around 0 5.5%

      \[\leadsto \color{blue}{1 + 0.16666666666666666 \cdot {y}^{2}} \]
    6. Step-by-step derivation
      1. +-commutative5.5%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2} + 1} \]
      2. unpow25.5%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1 \]
      3. *-commutative5.5%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1 \]
      4. associate-*r*5.5%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right)} + 1 \]
      5. fma-udef5.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
    7. Simplified5.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
    8. Taylor expanded in y around inf 5.5%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2}} \]
    9. Step-by-step derivation
      1. unpow25.5%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} \]
    10. Simplified5.5%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)} \]
    11. Step-by-step derivation
      1. expm1-log1p-u5.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\right)} \]
      2. expm1-udef5.5%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)} - 1} \]
      3. log1p-udef5.5%

        \[\leadsto e^{\color{blue}{\log \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)}} - 1 \]
      4. add-exp-log5.5%

        \[\leadsto \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} - 1 \]
      5. flip-+84.2%

        \[\leadsto \color{blue}{\frac{1 \cdot 1 - \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}} - 1 \]
      6. div-inv84.2%

        \[\leadsto \color{blue}{\left(1 \cdot 1 - \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}} - 1 \]
      7. fma-neg84.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1 \cdot 1 - \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right), \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right)} \]
      8. metadata-eval84.2%

        \[\leadsto \mathsf{fma}\left(\color{blue}{1} - \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right), \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right) \]
      9. swap-sqr84.2%

        \[\leadsto \mathsf{fma}\left(1 - \color{blue}{\left(0.16666666666666666 \cdot 0.16666666666666666\right) \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)}, \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right) \]
      10. metadata-eval84.2%

        \[\leadsto \mathsf{fma}\left(1 - \color{blue}{0.027777777777777776} \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right), \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right) \]
      11. pow284.2%

        \[\leadsto \mathsf{fma}\left(1 - 0.027777777777777776 \cdot \left(\color{blue}{{y}^{2}} \cdot \left(y \cdot y\right)\right), \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right) \]
      12. pow284.2%

        \[\leadsto \mathsf{fma}\left(1 - 0.027777777777777776 \cdot \left({y}^{2} \cdot \color{blue}{{y}^{2}}\right), \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right) \]
      13. pow-prod-up84.2%

        \[\leadsto \mathsf{fma}\left(1 - 0.027777777777777776 \cdot \color{blue}{{y}^{\left(2 + 2\right)}}, \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right) \]
      14. metadata-eval84.2%

        \[\leadsto \mathsf{fma}\left(1 - 0.027777777777777776 \cdot {y}^{\color{blue}{4}}, \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right) \]
      15. *-commutative84.2%

        \[\leadsto \mathsf{fma}\left(1 - 0.027777777777777776 \cdot {y}^{4}, \frac{1}{1 - \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666}}, -1\right) \]
      16. associate-*l*84.2%

        \[\leadsto \mathsf{fma}\left(1 - 0.027777777777777776 \cdot {y}^{4}, \frac{1}{1 - \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right)}}, -1\right) \]
      17. metadata-eval84.2%

        \[\leadsto \mathsf{fma}\left(1 - 0.027777777777777776 \cdot {y}^{4}, \frac{1}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)}, \color{blue}{-1}\right) \]
    12. Applied egg-rr84.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(1 - 0.027777777777777776 \cdot {y}^{4}, \frac{1}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)}, -1\right)} \]
    13. Step-by-step derivation
      1. fma-udef84.2%

        \[\leadsto \color{blue}{\left(1 - 0.027777777777777776 \cdot {y}^{4}\right) \cdot \frac{1}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)} + -1} \]
      2. +-commutative84.2%

        \[\leadsto \color{blue}{-1 + \left(1 - 0.027777777777777776 \cdot {y}^{4}\right) \cdot \frac{1}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)}} \]
      3. associate-*r/84.2%

        \[\leadsto -1 + \color{blue}{\frac{\left(1 - 0.027777777777777776 \cdot {y}^{4}\right) \cdot 1}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)}} \]
      4. *-rgt-identity84.2%

        \[\leadsto -1 + \frac{\color{blue}{1 - 0.027777777777777776 \cdot {y}^{4}}}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)} \]
      5. sub-neg84.2%

        \[\leadsto -1 + \frac{\color{blue}{1 + \left(-0.027777777777777776 \cdot {y}^{4}\right)}}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)} \]
      6. *-commutative84.2%

        \[\leadsto -1 + \frac{1 + \left(-\color{blue}{{y}^{4} \cdot 0.027777777777777776}\right)}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)} \]
      7. distribute-rgt-neg-in84.2%

        \[\leadsto -1 + \frac{1 + \color{blue}{{y}^{4} \cdot \left(-0.027777777777777776\right)}}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)} \]
      8. metadata-eval84.2%

        \[\leadsto -1 + \frac{1 + {y}^{4} \cdot \color{blue}{-0.027777777777777776}}{1 - y \cdot \left(y \cdot 0.16666666666666666\right)} \]
      9. associate-*r*84.2%

        \[\leadsto -1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 - \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666}} \]
      10. *-commutative84.2%

        \[\leadsto -1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 - \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)}} \]
      11. cancel-sign-sub-inv84.2%

        \[\leadsto -1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{\color{blue}{1 + \left(-0.16666666666666666\right) \cdot \left(y \cdot y\right)}} \]
      12. metadata-eval84.2%

        \[\leadsto -1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 + \color{blue}{-0.16666666666666666} \cdot \left(y \cdot y\right)} \]
      13. *-commutative84.2%

        \[\leadsto -1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 + \color{blue}{\left(y \cdot y\right) \cdot -0.16666666666666666}} \]
      14. associate-*l*84.2%

        \[\leadsto -1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 + \color{blue}{y \cdot \left(y \cdot -0.16666666666666666\right)}} \]
    14. Simplified84.2%

      \[\leadsto \color{blue}{-1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 + y \cdot \left(y \cdot -0.16666666666666666\right)}} \]

    if 1.50000000000000013e154 < y

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 100.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow2100.0%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified100.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in y around inf 100.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(\cos x \cdot {y}^{2}\right)} \]
    6. Step-by-step derivation
      1. unpow2100.0%

        \[\leadsto 0.16666666666666666 \cdot \left(\cos x \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
      2. associate-*r*100.0%

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \cos x\right) \cdot \left(y \cdot y\right)} \]
      3. *-commutative100.0%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot \cos x\right)} \]
      4. associate-*l*96.7%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \cos x\right)\right)} \]
      5. *-commutative96.7%

        \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(\cos x \cdot 0.16666666666666666\right)}\right) \]
    7. Simplified96.7%

      \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(\cos x \cdot 0.16666666666666666\right)\right)} \]
    8. Taylor expanded in y around 0 100.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(\cos x \cdot {y}^{2}\right)} \]
    9. Step-by-step derivation
      1. associate-*r*100.0%

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \cos x\right) \cdot {y}^{2}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{\left(\cos x \cdot 0.16666666666666666\right)} \cdot {y}^{2} \]
      3. associate-*r*100.0%

        \[\leadsto \color{blue}{\cos x \cdot \left(0.16666666666666666 \cdot {y}^{2}\right)} \]
      4. unpow2100.0%

        \[\leadsto \cos x \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    10. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 8.5 \cdot 10^{+25}:\\ \;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+77}:\\ \;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + \left(x \cdot x\right) \cdot -0.5\right)\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+154}:\\ \;\;\;\;-1 + \frac{1 + {y}^{4} \cdot -0.027777777777777776}{1 + y \cdot \left(y \cdot -0.16666666666666666\right)}\\ \mathbf{else}:\\ \;\;\;\;\cos x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 4: 77.7% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{if}\;y \leq 9.5 \cdot 10^{+25}:\\ \;\;\;\;\cos x \cdot \left(1 + t_0\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + \left(x \cdot x\right) \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\cos x \cdot t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* y y))))
   (if (<= y 9.5e+25)
     (* (cos x) (+ 1.0 t_0))
     (if (<= y 1.4e+154)
       (* (fma y (* y 0.16666666666666666) 1.0) (+ 1.0 (* (* x x) -0.5)))
       (* (cos x) t_0)))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (y * y);
	double tmp;
	if (y <= 9.5e+25) {
		tmp = cos(x) * (1.0 + t_0);
	} else if (y <= 1.4e+154) {
		tmp = fma(y, (y * 0.16666666666666666), 1.0) * (1.0 + ((x * x) * -0.5));
	} else {
		tmp = cos(x) * t_0;
	}
	return tmp;
}
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(y * y))
	tmp = 0.0
	if (y <= 9.5e+25)
		tmp = Float64(cos(x) * Float64(1.0 + t_0));
	elseif (y <= 1.4e+154)
		tmp = Float64(fma(y, Float64(y * 0.16666666666666666), 1.0) * Float64(1.0 + Float64(Float64(x * x) * -0.5)));
	else
		tmp = Float64(cos(x) * t_0);
	end
	return tmp
end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 9.5e+25], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+154], N[(N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[x], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 9.5 \cdot 10^{+25}:\\
\;\;\;\;\cos x \cdot \left(1 + t_0\right)\\

\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + \left(x \cdot x\right) \cdot -0.5\right)\\

\mathbf{else}:\\
\;\;\;\;\cos x \cdot t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 9.5000000000000005e25

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 82.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow282.0%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified82.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]

    if 9.5000000000000005e25 < y < 1.4e154

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 5.8%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow25.8%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified5.8%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in x around 0 32.9%

      \[\leadsto \color{blue}{1 + \left(-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    6. Step-by-step derivation
      1. +-commutative32.9%

        \[\leadsto \color{blue}{\left(-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + 0.16666666666666666 \cdot {y}^{2}\right) + 1} \]
      2. unpow232.9%

        \[\leadsto \left(-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) + 1 \]
      3. *-commutative32.9%

        \[\leadsto \left(-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666}\right) + 1 \]
      4. associate-*r*32.9%

        \[\leadsto \left(-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right)}\right) + 1 \]
      5. associate-+l+32.9%

        \[\leadsto \color{blue}{-0.5 \cdot \left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right)} \]
      6. *-commutative32.9%

        \[\leadsto \color{blue}{\left(\left(1 + 0.16666666666666666 \cdot {y}^{2}\right) \cdot {x}^{2}\right) \cdot -0.5} + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      7. +-commutative32.9%

        \[\leadsto \left(\color{blue}{\left(0.16666666666666666 \cdot {y}^{2} + 1\right)} \cdot {x}^{2}\right) \cdot -0.5 + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      8. unpow232.9%

        \[\leadsto \left(\left(0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1\right) \cdot {x}^{2}\right) \cdot -0.5 + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      9. *-commutative32.9%

        \[\leadsto \left(\left(\color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1\right) \cdot {x}^{2}\right) \cdot -0.5 + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      10. associate-*r*32.9%

        \[\leadsto \left(\left(\color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right)} + 1\right) \cdot {x}^{2}\right) \cdot -0.5 + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      11. fma-udef32.9%

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \cdot {x}^{2}\right) \cdot -0.5 + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      12. associate-*l*32.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left({x}^{2} \cdot -0.5\right)} + \left(y \cdot \left(y \cdot 0.16666666666666666\right) + 1\right) \]
      13. fma-udef32.9%

        \[\leadsto \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left({x}^{2} \cdot -0.5\right) + \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
      14. *-rgt-identity32.9%

        \[\leadsto \mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left({x}^{2} \cdot -0.5\right) + \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot 1} \]
      15. distribute-lft-out32.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left({x}^{2} \cdot -0.5 + 1\right)} \]
    7. Simplified32.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(\left(x \cdot x\right) \cdot -0.5 + 1\right)} \]

    if 1.4e154 < y

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 100.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow2100.0%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified100.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in y around inf 100.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(\cos x \cdot {y}^{2}\right)} \]
    6. Step-by-step derivation
      1. unpow2100.0%

        \[\leadsto 0.16666666666666666 \cdot \left(\cos x \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
      2. associate-*r*100.0%

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \cos x\right) \cdot \left(y \cdot y\right)} \]
      3. *-commutative100.0%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot \cos x\right)} \]
      4. associate-*l*96.7%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \cos x\right)\right)} \]
      5. *-commutative96.7%

        \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(\cos x \cdot 0.16666666666666666\right)}\right) \]
    7. Simplified96.7%

      \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(\cos x \cdot 0.16666666666666666\right)\right)} \]
    8. Taylor expanded in y around 0 100.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(\cos x \cdot {y}^{2}\right)} \]
    9. Step-by-step derivation
      1. associate-*r*100.0%

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \cos x\right) \cdot {y}^{2}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{\left(\cos x \cdot 0.16666666666666666\right)} \cdot {y}^{2} \]
      3. associate-*r*100.0%

        \[\leadsto \color{blue}{\cos x \cdot \left(0.16666666666666666 \cdot {y}^{2}\right)} \]
      4. unpow2100.0%

        \[\leadsto \cos x \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    10. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 9.5 \cdot 10^{+25}:\\ \;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + \left(x \cdot x\right) \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\cos x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 5: 77.6% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 8.5 \cdot 10^{+25} \lor \neg \left(y \leq 1.35 \cdot 10^{+147}\right):\\ \;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= y 8.5e+25) (not (<= y 1.35e+147)))
   (* (cos x) (+ 1.0 (* 0.16666666666666666 (* y y))))
   (* y (* y (+ 0.16666666666666666 (* (* x x) -0.08333333333333333))))))
double code(double x, double y) {
	double tmp;
	if ((y <= 8.5e+25) || !(y <= 1.35e+147)) {
		tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
	} else {
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((y <= 8.5d+25) .or. (.not. (y <= 1.35d+147))) then
        tmp = cos(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
    else
        tmp = y * (y * (0.16666666666666666d0 + ((x * x) * (-0.08333333333333333d0))))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((y <= 8.5e+25) || !(y <= 1.35e+147)) {
		tmp = Math.cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
	} else {
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (y <= 8.5e+25) or not (y <= 1.35e+147):
		tmp = math.cos(x) * (1.0 + (0.16666666666666666 * (y * y)))
	else:
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)))
	return tmp
function code(x, y)
	tmp = 0.0
	if ((y <= 8.5e+25) || !(y <= 1.35e+147))
		tmp = Float64(cos(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))));
	else
		tmp = Float64(y * Float64(y * Float64(0.16666666666666666 + Float64(Float64(x * x) * -0.08333333333333333))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((y <= 8.5e+25) || ~((y <= 1.35e+147)))
		tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
	else
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[y, 8.5e+25], N[Not[LessEqual[y, 1.35e+147]], $MachinePrecision]], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(y * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{+25} \lor \neg \left(y \leq 1.35 \cdot 10^{+147}\right):\\
\;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 8.5000000000000007e25 or 1.34999999999999999e147 < y

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 83.6%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow283.6%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified83.6%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]

    if 8.5000000000000007e25 < y < 1.34999999999999999e147

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 5.7%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow25.7%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified5.7%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in y around inf 5.7%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(\cos x \cdot {y}^{2}\right)} \]
    6. Step-by-step derivation
      1. unpow25.7%

        \[\leadsto 0.16666666666666666 \cdot \left(\cos x \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
      2. associate-*r*5.7%

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \cos x\right) \cdot \left(y \cdot y\right)} \]
      3. *-commutative5.7%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot \cos x\right)} \]
      4. associate-*l*5.7%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \cos x\right)\right)} \]
      5. *-commutative5.7%

        \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(\cos x \cdot 0.16666666666666666\right)}\right) \]
    7. Simplified5.7%

      \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(\cos x \cdot 0.16666666666666666\right)\right)} \]
    8. Taylor expanded in x around 0 33.8%

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

        \[\leadsto y \cdot \left(y \cdot \left(0.16666666666666666 + \color{blue}{{x}^{2} \cdot -0.08333333333333333}\right)\right) \]
      2. unpow233.8%

        \[\leadsto y \cdot \left(y \cdot \left(0.16666666666666666 + \color{blue}{\left(x \cdot x\right)} \cdot -0.08333333333333333\right)\right) \]
    10. Simplified33.8%

      \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 8.5 \cdot 10^{+25} \lor \neg \left(y \leq 1.35 \cdot 10^{+147}\right):\\ \;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\ \end{array} \]

Alternative 6: 65.5% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 8.5 \cdot 10^{+25}:\\ \;\;\;\;\cos x\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+147}:\\ \;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(y \cdot \left(\cos x \cdot 0.16666666666666666\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 8.5e+25)
   (cos x)
   (if (<= y 1.35e+147)
     (* y (* y (+ 0.16666666666666666 (* (* x x) -0.08333333333333333))))
     (* y (* y (* (cos x) 0.16666666666666666))))))
double code(double x, double y) {
	double tmp;
	if (y <= 8.5e+25) {
		tmp = cos(x);
	} else if (y <= 1.35e+147) {
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
	} else {
		tmp = y * (y * (cos(x) * 0.16666666666666666));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 8.5d+25) then
        tmp = cos(x)
    else if (y <= 1.35d+147) then
        tmp = y * (y * (0.16666666666666666d0 + ((x * x) * (-0.08333333333333333d0))))
    else
        tmp = y * (y * (cos(x) * 0.16666666666666666d0))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 8.5e+25) {
		tmp = Math.cos(x);
	} else if (y <= 1.35e+147) {
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
	} else {
		tmp = y * (y * (Math.cos(x) * 0.16666666666666666));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 8.5e+25:
		tmp = math.cos(x)
	elif y <= 1.35e+147:
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)))
	else:
		tmp = y * (y * (math.cos(x) * 0.16666666666666666))
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 8.5e+25)
		tmp = cos(x);
	elseif (y <= 1.35e+147)
		tmp = Float64(y * Float64(y * Float64(0.16666666666666666 + Float64(Float64(x * x) * -0.08333333333333333))));
	else
		tmp = Float64(y * Float64(y * Float64(cos(x) * 0.16666666666666666)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 8.5e+25)
		tmp = cos(x);
	elseif (y <= 1.35e+147)
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
	else
		tmp = y * (y * (cos(x) * 0.16666666666666666));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 8.5e+25], N[Cos[x], $MachinePrecision], If[LessEqual[y, 1.35e+147], N[(y * N[(y * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(y * N[(N[Cos[x], $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{+25}:\\
\;\;\;\;\cos x\\

\mathbf{elif}\;y \leq 1.35 \cdot 10^{+147}:\\
\;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot \left(y \cdot \left(\cos x \cdot 0.16666666666666666\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 8.5000000000000007e25

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 64.4%

      \[\leadsto \color{blue}{\cos x} \]

    if 8.5000000000000007e25 < y < 1.34999999999999999e147

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 5.7%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow25.7%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified5.7%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in y around inf 5.7%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(\cos x \cdot {y}^{2}\right)} \]
    6. Step-by-step derivation
      1. unpow25.7%

        \[\leadsto 0.16666666666666666 \cdot \left(\cos x \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
      2. associate-*r*5.7%

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \cos x\right) \cdot \left(y \cdot y\right)} \]
      3. *-commutative5.7%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot \cos x\right)} \]
      4. associate-*l*5.7%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \cos x\right)\right)} \]
      5. *-commutative5.7%

        \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(\cos x \cdot 0.16666666666666666\right)}\right) \]
    7. Simplified5.7%

      \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(\cos x \cdot 0.16666666666666666\right)\right)} \]
    8. Taylor expanded in x around 0 33.8%

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

        \[\leadsto y \cdot \left(y \cdot \left(0.16666666666666666 + \color{blue}{{x}^{2} \cdot -0.08333333333333333}\right)\right) \]
      2. unpow233.8%

        \[\leadsto y \cdot \left(y \cdot \left(0.16666666666666666 + \color{blue}{\left(x \cdot x\right)} \cdot -0.08333333333333333\right)\right) \]
    10. Simplified33.8%

      \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)}\right) \]

    if 1.34999999999999999e147 < y

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 96.5%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow296.5%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified96.5%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in y around inf 96.5%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(\cos x \cdot {y}^{2}\right)} \]
    6. Step-by-step derivation
      1. unpow296.5%

        \[\leadsto 0.16666666666666666 \cdot \left(\cos x \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
      2. associate-*r*96.5%

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \cos x\right) \cdot \left(y \cdot y\right)} \]
      3. *-commutative96.5%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot \cos x\right)} \]
      4. associate-*l*93.4%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \cos x\right)\right)} \]
      5. *-commutative93.4%

        \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(\cos x \cdot 0.16666666666666666\right)}\right) \]
    7. Simplified93.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 8.5 \cdot 10^{+25}:\\ \;\;\;\;\cos x\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+147}:\\ \;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(y \cdot \left(\cos x \cdot 0.16666666666666666\right)\right)\\ \end{array} \]

Alternative 7: 65.5% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 8.5 \cdot 10^{+25}:\\ \;\;\;\;\cos x\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+147}:\\ \;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 8.5e+25)
   (cos x)
   (if (<= y 1.35e+147)
     (* y (* y (+ 0.16666666666666666 (* (* x x) -0.08333333333333333))))
     (* (cos x) (* 0.16666666666666666 (* y y))))))
double code(double x, double y) {
	double tmp;
	if (y <= 8.5e+25) {
		tmp = cos(x);
	} else if (y <= 1.35e+147) {
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
	} else {
		tmp = cos(x) * (0.16666666666666666 * (y * y));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 8.5d+25) then
        tmp = cos(x)
    else if (y <= 1.35d+147) then
        tmp = y * (y * (0.16666666666666666d0 + ((x * x) * (-0.08333333333333333d0))))
    else
        tmp = cos(x) * (0.16666666666666666d0 * (y * y))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 8.5e+25) {
		tmp = Math.cos(x);
	} else if (y <= 1.35e+147) {
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
	} else {
		tmp = Math.cos(x) * (0.16666666666666666 * (y * y));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 8.5e+25:
		tmp = math.cos(x)
	elif y <= 1.35e+147:
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)))
	else:
		tmp = math.cos(x) * (0.16666666666666666 * (y * y))
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 8.5e+25)
		tmp = cos(x);
	elseif (y <= 1.35e+147)
		tmp = Float64(y * Float64(y * Float64(0.16666666666666666 + Float64(Float64(x * x) * -0.08333333333333333))));
	else
		tmp = Float64(cos(x) * Float64(0.16666666666666666 * Float64(y * y)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 8.5e+25)
		tmp = cos(x);
	elseif (y <= 1.35e+147)
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
	else
		tmp = cos(x) * (0.16666666666666666 * (y * y));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 8.5e+25], N[Cos[x], $MachinePrecision], If[LessEqual[y, 1.35e+147], N[(y * N[(y * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[x], $MachinePrecision] * N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{+25}:\\
\;\;\;\;\cos x\\

\mathbf{elif}\;y \leq 1.35 \cdot 10^{+147}:\\
\;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\cos x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 8.5000000000000007e25

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 64.4%

      \[\leadsto \color{blue}{\cos x} \]

    if 8.5000000000000007e25 < y < 1.34999999999999999e147

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 5.7%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow25.7%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified5.7%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in y around inf 5.7%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(\cos x \cdot {y}^{2}\right)} \]
    6. Step-by-step derivation
      1. unpow25.7%

        \[\leadsto 0.16666666666666666 \cdot \left(\cos x \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
      2. associate-*r*5.7%

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \cos x\right) \cdot \left(y \cdot y\right)} \]
      3. *-commutative5.7%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot \cos x\right)} \]
      4. associate-*l*5.7%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \cos x\right)\right)} \]
      5. *-commutative5.7%

        \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(\cos x \cdot 0.16666666666666666\right)}\right) \]
    7. Simplified5.7%

      \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(\cos x \cdot 0.16666666666666666\right)\right)} \]
    8. Taylor expanded in x around 0 33.8%

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

        \[\leadsto y \cdot \left(y \cdot \left(0.16666666666666666 + \color{blue}{{x}^{2} \cdot -0.08333333333333333}\right)\right) \]
      2. unpow233.8%

        \[\leadsto y \cdot \left(y \cdot \left(0.16666666666666666 + \color{blue}{\left(x \cdot x\right)} \cdot -0.08333333333333333\right)\right) \]
    10. Simplified33.8%

      \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)}\right) \]

    if 1.34999999999999999e147 < y

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 96.5%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow296.5%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified96.5%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in y around inf 96.5%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(\cos x \cdot {y}^{2}\right)} \]
    6. Step-by-step derivation
      1. unpow296.5%

        \[\leadsto 0.16666666666666666 \cdot \left(\cos x \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
      2. associate-*r*96.5%

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \cos x\right) \cdot \left(y \cdot y\right)} \]
      3. *-commutative96.5%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot \cos x\right)} \]
      4. associate-*l*93.4%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \cos x\right)\right)} \]
      5. *-commutative93.4%

        \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(\cos x \cdot 0.16666666666666666\right)}\right) \]
    7. Simplified93.4%

      \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(\cos x \cdot 0.16666666666666666\right)\right)} \]
    8. Taylor expanded in y around 0 96.5%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(\cos x \cdot {y}^{2}\right)} \]
    9. Step-by-step derivation
      1. associate-*r*96.5%

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \cos x\right) \cdot {y}^{2}} \]
      2. *-commutative96.5%

        \[\leadsto \color{blue}{\left(\cos x \cdot 0.16666666666666666\right)} \cdot {y}^{2} \]
      3. associate-*r*96.5%

        \[\leadsto \color{blue}{\cos x \cdot \left(0.16666666666666666 \cdot {y}^{2}\right)} \]
      4. unpow296.5%

        \[\leadsto \cos x \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    10. Simplified96.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 8.5 \cdot 10^{+25}:\\ \;\;\;\;\cos x\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+147}:\\ \;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 8: 62.3% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 8.5 \cdot 10^{+25}:\\ \;\;\;\;\cos x\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+215} \lor \neg \left(y \leq 1.1 \cdot 10^{+268}\right):\\ \;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 8.5e+25)
   (cos x)
   (if (or (<= y 2e+215) (not (<= y 1.1e+268)))
     (* y (* y (+ 0.16666666666666666 (* (* x x) -0.08333333333333333))))
     (+ 1.0 (* 0.16666666666666666 (* y y))))))
double code(double x, double y) {
	double tmp;
	if (y <= 8.5e+25) {
		tmp = cos(x);
	} else if ((y <= 2e+215) || !(y <= 1.1e+268)) {
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
	} else {
		tmp = 1.0 + (0.16666666666666666 * (y * y));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 8.5d+25) then
        tmp = cos(x)
    else if ((y <= 2d+215) .or. (.not. (y <= 1.1d+268))) then
        tmp = y * (y * (0.16666666666666666d0 + ((x * x) * (-0.08333333333333333d0))))
    else
        tmp = 1.0d0 + (0.16666666666666666d0 * (y * y))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 8.5e+25) {
		tmp = Math.cos(x);
	} else if ((y <= 2e+215) || !(y <= 1.1e+268)) {
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
	} else {
		tmp = 1.0 + (0.16666666666666666 * (y * y));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 8.5e+25:
		tmp = math.cos(x)
	elif (y <= 2e+215) or not (y <= 1.1e+268):
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)))
	else:
		tmp = 1.0 + (0.16666666666666666 * (y * y))
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 8.5e+25)
		tmp = cos(x);
	elseif ((y <= 2e+215) || !(y <= 1.1e+268))
		tmp = Float64(y * Float64(y * Float64(0.16666666666666666 + Float64(Float64(x * x) * -0.08333333333333333))));
	else
		tmp = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 8.5e+25)
		tmp = cos(x);
	elseif ((y <= 2e+215) || ~((y <= 1.1e+268)))
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
	else
		tmp = 1.0 + (0.16666666666666666 * (y * y));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 8.5e+25], N[Cos[x], $MachinePrecision], If[Or[LessEqual[y, 2e+215], N[Not[LessEqual[y, 1.1e+268]], $MachinePrecision]], N[(y * N[(y * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{+25}:\\
\;\;\;\;\cos x\\

\mathbf{elif}\;y \leq 2 \cdot 10^{+215} \lor \neg \left(y \leq 1.1 \cdot 10^{+268}\right):\\
\;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\

\mathbf{else}:\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 8.5000000000000007e25

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 64.4%

      \[\leadsto \color{blue}{\cos x} \]

    if 8.5000000000000007e25 < y < 1.99999999999999981e215 or 1.09999999999999997e268 < y

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 43.5%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow243.5%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified43.5%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in y around inf 43.5%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(\cos x \cdot {y}^{2}\right)} \]
    6. Step-by-step derivation
      1. unpow243.5%

        \[\leadsto 0.16666666666666666 \cdot \left(\cos x \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
      2. associate-*r*43.5%

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \cos x\right) \cdot \left(y \cdot y\right)} \]
      3. *-commutative43.5%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot \cos x\right)} \]
      4. associate-*l*41.7%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \cos x\right)\right)} \]
      5. *-commutative41.7%

        \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(\cos x \cdot 0.16666666666666666\right)}\right) \]
    7. Simplified41.7%

      \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(\cos x \cdot 0.16666666666666666\right)\right)} \]
    8. Taylor expanded in x around 0 55.3%

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

        \[\leadsto y \cdot \left(y \cdot \left(0.16666666666666666 + \color{blue}{{x}^{2} \cdot -0.08333333333333333}\right)\right) \]
      2. unpow255.3%

        \[\leadsto y \cdot \left(y \cdot \left(0.16666666666666666 + \color{blue}{\left(x \cdot x\right)} \cdot -0.08333333333333333\right)\right) \]
    10. Simplified55.3%

      \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)}\right) \]

    if 1.99999999999999981e215 < y < 1.09999999999999997e268

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 100.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow2100.0%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified100.0%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in x around 0 71.4%

      \[\leadsto \color{blue}{1 + 0.16666666666666666 \cdot {y}^{2}} \]
    6. Step-by-step derivation
      1. +-commutative71.4%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2} + 1} \]
      2. unpow271.4%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1 \]
      3. *-commutative71.4%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1 \]
      4. associate-*r*71.4%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right)} + 1 \]
      5. fma-udef71.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
    7. Simplified71.4%

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

        \[\leadsto \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right) + 1} \]
      2. associate-*r*71.4%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1 \]
      3. unpow271.4%

        \[\leadsto \color{blue}{{y}^{2}} \cdot 0.16666666666666666 + 1 \]
      4. *-commutative71.4%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2}} + 1 \]
      5. unpow271.4%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1 \]
    9. Applied egg-rr71.4%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right) + 1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 8.5 \cdot 10^{+25}:\\ \;\;\;\;\cos x\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+215} \lor \neg \left(y \leq 1.1 \cdot 10^{+268}\right):\\ \;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \end{array} \]

Alternative 9: 48.6% accurate, 11.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 8.5 \cdot 10^{+25} \lor \neg \left(y \leq 3 \cdot 10^{+216}\right) \land y \leq 1.3 \cdot 10^{+268}:\\ \;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= y 8.5e+25) (and (not (<= y 3e+216)) (<= y 1.3e+268)))
   (+ 1.0 (* 0.16666666666666666 (* y y)))
   (* y (* y (+ 0.16666666666666666 (* (* x x) -0.08333333333333333))))))
double code(double x, double y) {
	double tmp;
	if ((y <= 8.5e+25) || (!(y <= 3e+216) && (y <= 1.3e+268))) {
		tmp = 1.0 + (0.16666666666666666 * (y * y));
	} else {
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((y <= 8.5d+25) .or. (.not. (y <= 3d+216)) .and. (y <= 1.3d+268)) then
        tmp = 1.0d0 + (0.16666666666666666d0 * (y * y))
    else
        tmp = y * (y * (0.16666666666666666d0 + ((x * x) * (-0.08333333333333333d0))))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((y <= 8.5e+25) || (!(y <= 3e+216) && (y <= 1.3e+268))) {
		tmp = 1.0 + (0.16666666666666666 * (y * y));
	} else {
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (y <= 8.5e+25) or (not (y <= 3e+216) and (y <= 1.3e+268)):
		tmp = 1.0 + (0.16666666666666666 * (y * y))
	else:
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)))
	return tmp
function code(x, y)
	tmp = 0.0
	if ((y <= 8.5e+25) || (!(y <= 3e+216) && (y <= 1.3e+268)))
		tmp = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)));
	else
		tmp = Float64(y * Float64(y * Float64(0.16666666666666666 + Float64(Float64(x * x) * -0.08333333333333333))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((y <= 8.5e+25) || (~((y <= 3e+216)) && (y <= 1.3e+268)))
		tmp = 1.0 + (0.16666666666666666 * (y * y));
	else
		tmp = y * (y * (0.16666666666666666 + ((x * x) * -0.08333333333333333)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[y, 8.5e+25], And[N[Not[LessEqual[y, 3e+216]], $MachinePrecision], LessEqual[y, 1.3e+268]]], N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(y * N[(0.16666666666666666 + N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{+25} \lor \neg \left(y \leq 3 \cdot 10^{+216}\right) \land y \leq 1.3 \cdot 10^{+268}:\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 8.5000000000000007e25 or 2.9999999999999998e216 < y < 1.29999999999999997e268

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 82.6%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow282.6%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified82.6%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in x around 0 49.5%

      \[\leadsto \color{blue}{1 + 0.16666666666666666 \cdot {y}^{2}} \]
    6. Step-by-step derivation
      1. +-commutative49.5%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2} + 1} \]
      2. unpow249.5%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1 \]
      3. *-commutative49.5%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1 \]
      4. associate-*r*49.5%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right)} + 1 \]
      5. fma-udef49.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
    7. Simplified49.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
    8. Step-by-step derivation
      1. fma-udef49.5%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right) + 1} \]
      2. associate-*r*49.5%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1 \]
      3. unpow249.5%

        \[\leadsto \color{blue}{{y}^{2}} \cdot 0.16666666666666666 + 1 \]
      4. *-commutative49.5%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2}} + 1 \]
      5. unpow249.5%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1 \]
    9. Applied egg-rr49.5%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right) + 1} \]

    if 8.5000000000000007e25 < y < 2.9999999999999998e216 or 1.29999999999999997e268 < y

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 43.5%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow243.5%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified43.5%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in y around inf 43.5%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(\cos x \cdot {y}^{2}\right)} \]
    6. Step-by-step derivation
      1. unpow243.5%

        \[\leadsto 0.16666666666666666 \cdot \left(\cos x \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
      2. associate-*r*43.5%

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \cos x\right) \cdot \left(y \cdot y\right)} \]
      3. *-commutative43.5%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot \cos x\right)} \]
      4. associate-*l*41.7%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \cos x\right)\right)} \]
      5. *-commutative41.7%

        \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(\cos x \cdot 0.16666666666666666\right)}\right) \]
    7. Simplified41.7%

      \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(\cos x \cdot 0.16666666666666666\right)\right)} \]
    8. Taylor expanded in x around 0 55.3%

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

        \[\leadsto y \cdot \left(y \cdot \left(0.16666666666666666 + \color{blue}{{x}^{2} \cdot -0.08333333333333333}\right)\right) \]
      2. unpow255.3%

        \[\leadsto y \cdot \left(y \cdot \left(0.16666666666666666 + \color{blue}{\left(x \cdot x\right)} \cdot -0.08333333333333333\right)\right) \]
    10. Simplified55.3%

      \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification50.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 8.5 \cdot 10^{+25} \lor \neg \left(y \leq 3 \cdot 10^{+216}\right) \land y \leq 1.3 \cdot 10^{+268}:\\ \;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(y \cdot \left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)\right)\\ \end{array} \]

Alternative 10: 48.1% accurate, 13.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.7 \cdot 10^{+77} \lor \neg \left(x \leq 4.8 \cdot 10^{+246}\right) \land x \leq 1.85 \cdot 10^{+283}:\\ \;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot \left(y \cdot \left(x \cdot -0.08333333333333333\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= x 2.7e+77) (and (not (<= x 4.8e+246)) (<= x 1.85e+283)))
   (+ 1.0 (* 0.16666666666666666 (* y y)))
   (* y (* x (* y (* x -0.08333333333333333))))))
double code(double x, double y) {
	double tmp;
	if ((x <= 2.7e+77) || (!(x <= 4.8e+246) && (x <= 1.85e+283))) {
		tmp = 1.0 + (0.16666666666666666 * (y * y));
	} else {
		tmp = y * (x * (y * (x * -0.08333333333333333)));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((x <= 2.7d+77) .or. (.not. (x <= 4.8d+246)) .and. (x <= 1.85d+283)) then
        tmp = 1.0d0 + (0.16666666666666666d0 * (y * y))
    else
        tmp = y * (x * (y * (x * (-0.08333333333333333d0))))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((x <= 2.7e+77) || (!(x <= 4.8e+246) && (x <= 1.85e+283))) {
		tmp = 1.0 + (0.16666666666666666 * (y * y));
	} else {
		tmp = y * (x * (y * (x * -0.08333333333333333)));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (x <= 2.7e+77) or (not (x <= 4.8e+246) and (x <= 1.85e+283)):
		tmp = 1.0 + (0.16666666666666666 * (y * y))
	else:
		tmp = y * (x * (y * (x * -0.08333333333333333)))
	return tmp
function code(x, y)
	tmp = 0.0
	if ((x <= 2.7e+77) || (!(x <= 4.8e+246) && (x <= 1.85e+283)))
		tmp = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)));
	else
		tmp = Float64(y * Float64(x * Float64(y * Float64(x * -0.08333333333333333))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((x <= 2.7e+77) || (~((x <= 4.8e+246)) && (x <= 1.85e+283)))
		tmp = 1.0 + (0.16666666666666666 * (y * y));
	else
		tmp = y * (x * (y * (x * -0.08333333333333333)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[x, 2.7e+77], And[N[Not[LessEqual[x, 4.8e+246]], $MachinePrecision], LessEqual[x, 1.85e+283]]], N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x * N[(y * N[(x * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.7 \cdot 10^{+77} \lor \neg \left(x \leq 4.8 \cdot 10^{+246}\right) \land x \leq 1.85 \cdot 10^{+283}:\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \left(y \cdot \left(x \cdot -0.08333333333333333\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.6999999999999998e77 or 4.8e246 < x < 1.85e283

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 75.4%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow275.4%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified75.4%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in x around 0 50.8%

      \[\leadsto \color{blue}{1 + 0.16666666666666666 \cdot {y}^{2}} \]
    6. Step-by-step derivation
      1. +-commutative50.8%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2} + 1} \]
      2. unpow250.8%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1 \]
      3. *-commutative50.8%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1 \]
      4. associate-*r*50.5%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right)} + 1 \]
      5. fma-udef50.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
    7. Simplified50.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
    8. Step-by-step derivation
      1. fma-udef50.5%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right) + 1} \]
      2. associate-*r*50.8%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1 \]
      3. unpow250.8%

        \[\leadsto \color{blue}{{y}^{2}} \cdot 0.16666666666666666 + 1 \]
      4. *-commutative50.8%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2}} + 1 \]
      5. unpow250.8%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1 \]
    9. Applied egg-rr50.8%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right) + 1} \]

    if 2.6999999999999998e77 < x < 4.8e246 or 1.85e283 < x

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 78.2%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow278.2%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified78.2%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in y around inf 29.5%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(\cos x \cdot {y}^{2}\right)} \]
    6. Step-by-step derivation
      1. unpow229.5%

        \[\leadsto 0.16666666666666666 \cdot \left(\cos x \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
      2. associate-*r*29.5%

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \cos x\right) \cdot \left(y \cdot y\right)} \]
      3. *-commutative29.5%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot \cos x\right)} \]
      4. associate-*l*29.5%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \cos x\right)\right)} \]
      5. *-commutative29.5%

        \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(\cos x \cdot 0.16666666666666666\right)}\right) \]
    7. Simplified29.5%

      \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(\cos x \cdot 0.16666666666666666\right)\right)} \]
    8. Taylor expanded in x around 0 27.1%

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

        \[\leadsto y \cdot \left(y \cdot \left(0.16666666666666666 + \color{blue}{{x}^{2} \cdot -0.08333333333333333}\right)\right) \]
      2. unpow227.1%

        \[\leadsto y \cdot \left(y \cdot \left(0.16666666666666666 + \color{blue}{\left(x \cdot x\right)} \cdot -0.08333333333333333\right)\right) \]
    10. Simplified27.1%

      \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)}\right) \]
    11. Taylor expanded in x around inf 27.1%

      \[\leadsto y \cdot \color{blue}{\left(-0.08333333333333333 \cdot \left(y \cdot {x}^{2}\right)\right)} \]
    12. Step-by-step derivation
      1. unpow227.1%

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

        \[\leadsto y \cdot \color{blue}{\left(\left(-0.08333333333333333 \cdot y\right) \cdot \left(x \cdot x\right)\right)} \]
      3. *-commutative27.1%

        \[\leadsto y \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot \left(-0.08333333333333333 \cdot y\right)\right)} \]
      4. associate-*l*27.4%

        \[\leadsto y \cdot \color{blue}{\left(x \cdot \left(x \cdot \left(-0.08333333333333333 \cdot y\right)\right)\right)} \]
      5. associate-*l*27.4%

        \[\leadsto y \cdot \left(x \cdot \color{blue}{\left(\left(x \cdot -0.08333333333333333\right) \cdot y\right)}\right) \]
      6. *-commutative27.4%

        \[\leadsto y \cdot \left(x \cdot \color{blue}{\left(y \cdot \left(x \cdot -0.08333333333333333\right)\right)}\right) \]
    13. Simplified27.4%

      \[\leadsto y \cdot \color{blue}{\left(x \cdot \left(y \cdot \left(x \cdot -0.08333333333333333\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.7 \cdot 10^{+77} \lor \neg \left(x \leq 4.8 \cdot 10^{+246}\right) \land x \leq 1.85 \cdot 10^{+283}:\\ \;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot \left(y \cdot \left(x \cdot -0.08333333333333333\right)\right)\right)\\ \end{array} \]

Alternative 11: 48.0% accurate, 15.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.7 \cdot 10^{+77} \lor \neg \left(x \leq 4.8 \cdot 10^{+246}\right):\\ \;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(x \cdot y\right) \cdot \left(y \cdot -0.08333333333333333\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= x 2.7e+77) (not (<= x 4.8e+246)))
   (+ 1.0 (* 0.16666666666666666 (* y y)))
   (* x (* (* x y) (* y -0.08333333333333333)))))
double code(double x, double y) {
	double tmp;
	if ((x <= 2.7e+77) || !(x <= 4.8e+246)) {
		tmp = 1.0 + (0.16666666666666666 * (y * y));
	} else {
		tmp = x * ((x * y) * (y * -0.08333333333333333));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((x <= 2.7d+77) .or. (.not. (x <= 4.8d+246))) then
        tmp = 1.0d0 + (0.16666666666666666d0 * (y * y))
    else
        tmp = x * ((x * y) * (y * (-0.08333333333333333d0)))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((x <= 2.7e+77) || !(x <= 4.8e+246)) {
		tmp = 1.0 + (0.16666666666666666 * (y * y));
	} else {
		tmp = x * ((x * y) * (y * -0.08333333333333333));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (x <= 2.7e+77) or not (x <= 4.8e+246):
		tmp = 1.0 + (0.16666666666666666 * (y * y))
	else:
		tmp = x * ((x * y) * (y * -0.08333333333333333))
	return tmp
function code(x, y)
	tmp = 0.0
	if ((x <= 2.7e+77) || !(x <= 4.8e+246))
		tmp = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)));
	else
		tmp = Float64(x * Float64(Float64(x * y) * Float64(y * -0.08333333333333333)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((x <= 2.7e+77) || ~((x <= 4.8e+246)))
		tmp = 1.0 + (0.16666666666666666 * (y * y));
	else
		tmp = x * ((x * y) * (y * -0.08333333333333333));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[x, 2.7e+77], N[Not[LessEqual[x, 4.8e+246]], $MachinePrecision]], N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(x * y), $MachinePrecision] * N[(y * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.7 \cdot 10^{+77} \lor \neg \left(x \leq 4.8 \cdot 10^{+246}\right):\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(x \cdot y\right) \cdot \left(y \cdot -0.08333333333333333\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.6999999999999998e77 or 4.8e246 < x

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 75.7%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow275.7%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified75.7%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in x around 0 50.7%

      \[\leadsto \color{blue}{1 + 0.16666666666666666 \cdot {y}^{2}} \]
    6. Step-by-step derivation
      1. +-commutative50.7%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2} + 1} \]
      2. unpow250.7%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1 \]
      3. *-commutative50.7%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1 \]
      4. associate-*r*50.3%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right)} + 1 \]
      5. fma-udef50.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
    7. Simplified50.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
    8. Step-by-step derivation
      1. fma-udef50.3%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right) + 1} \]
      2. associate-*r*50.7%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1 \]
      3. unpow250.7%

        \[\leadsto \color{blue}{{y}^{2}} \cdot 0.16666666666666666 + 1 \]
      4. *-commutative50.7%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2}} + 1 \]
      5. unpow250.7%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1 \]
    9. Applied egg-rr50.7%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right) + 1} \]

    if 2.6999999999999998e77 < x < 4.8e246

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 75.8%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow275.8%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified75.8%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in y around inf 28.7%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(\cos x \cdot {y}^{2}\right)} \]
    6. Step-by-step derivation
      1. unpow228.7%

        \[\leadsto 0.16666666666666666 \cdot \left(\cos x \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
      2. associate-*r*28.7%

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \cos x\right) \cdot \left(y \cdot y\right)} \]
      3. *-commutative28.7%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot \cos x\right)} \]
      4. associate-*l*28.7%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \cos x\right)\right)} \]
      5. *-commutative28.7%

        \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(\cos x \cdot 0.16666666666666666\right)}\right) \]
    7. Simplified28.7%

      \[\leadsto \color{blue}{y \cdot \left(y \cdot \left(\cos x \cdot 0.16666666666666666\right)\right)} \]
    8. Taylor expanded in x around 0 29.9%

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

        \[\leadsto y \cdot \left(y \cdot \left(0.16666666666666666 + \color{blue}{{x}^{2} \cdot -0.08333333333333333}\right)\right) \]
      2. unpow229.9%

        \[\leadsto y \cdot \left(y \cdot \left(0.16666666666666666 + \color{blue}{\left(x \cdot x\right)} \cdot -0.08333333333333333\right)\right) \]
    10. Simplified29.9%

      \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(0.16666666666666666 + \left(x \cdot x\right) \cdot -0.08333333333333333\right)}\right) \]
    11. Taylor expanded in x around inf 29.6%

      \[\leadsto \color{blue}{-0.08333333333333333 \cdot \left({y}^{2} \cdot {x}^{2}\right)} \]
    12. Step-by-step derivation
      1. unpow229.6%

        \[\leadsto -0.08333333333333333 \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot {x}^{2}\right) \]
      2. unpow229.6%

        \[\leadsto -0.08333333333333333 \cdot \left(\left(y \cdot y\right) \cdot \color{blue}{\left(x \cdot x\right)}\right) \]
      3. associate-*r*29.6%

        \[\leadsto \color{blue}{\left(-0.08333333333333333 \cdot \left(y \cdot y\right)\right) \cdot \left(x \cdot x\right)} \]
      4. *-commutative29.6%

        \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot \left(-0.08333333333333333 \cdot \left(y \cdot y\right)\right)} \]
      5. associate-*r*29.6%

        \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{\left(\left(-0.08333333333333333 \cdot y\right) \cdot y\right)} \]
      6. *-commutative29.6%

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

        \[\leadsto \color{blue}{\left(\left(x \cdot x\right) \cdot y\right) \cdot \left(-0.08333333333333333 \cdot y\right)} \]
      8. associate-*l*30.2%

        \[\leadsto \color{blue}{\left(x \cdot \left(x \cdot y\right)\right)} \cdot \left(-0.08333333333333333 \cdot y\right) \]
      9. *-commutative30.2%

        \[\leadsto \left(x \cdot \color{blue}{\left(y \cdot x\right)}\right) \cdot \left(-0.08333333333333333 \cdot y\right) \]
      10. associate-*l*30.2%

        \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot x\right) \cdot \left(-0.08333333333333333 \cdot y\right)\right)} \]
      11. *-commutative30.2%

        \[\leadsto x \cdot \left(\left(y \cdot x\right) \cdot \color{blue}{\left(y \cdot -0.08333333333333333\right)}\right) \]
    13. Simplified30.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.7 \cdot 10^{+77} \lor \neg \left(x \leq 4.8 \cdot 10^{+246}\right):\\ \;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(x \cdot y\right) \cdot \left(y \cdot -0.08333333333333333\right)\right)\\ \end{array} \]

Alternative 12: 47.6% accurate, 18.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 8.8 \cdot 10^{+163} \lor \neg \left(x \leq 4.8 \cdot 10^{+246}\right):\\ \;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;1 + \left(x \cdot x\right) \cdot -0.5\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= x 8.8e+163) (not (<= x 4.8e+246)))
   (+ 1.0 (* 0.16666666666666666 (* y y)))
   (+ 1.0 (* (* x x) -0.5))))
double code(double x, double y) {
	double tmp;
	if ((x <= 8.8e+163) || !(x <= 4.8e+246)) {
		tmp = 1.0 + (0.16666666666666666 * (y * y));
	} else {
		tmp = 1.0 + ((x * x) * -0.5);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((x <= 8.8d+163) .or. (.not. (x <= 4.8d+246))) then
        tmp = 1.0d0 + (0.16666666666666666d0 * (y * y))
    else
        tmp = 1.0d0 + ((x * x) * (-0.5d0))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((x <= 8.8e+163) || !(x <= 4.8e+246)) {
		tmp = 1.0 + (0.16666666666666666 * (y * y));
	} else {
		tmp = 1.0 + ((x * x) * -0.5);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (x <= 8.8e+163) or not (x <= 4.8e+246):
		tmp = 1.0 + (0.16666666666666666 * (y * y))
	else:
		tmp = 1.0 + ((x * x) * -0.5)
	return tmp
function code(x, y)
	tmp = 0.0
	if ((x <= 8.8e+163) || !(x <= 4.8e+246))
		tmp = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)));
	else
		tmp = Float64(1.0 + Float64(Float64(x * x) * -0.5));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((x <= 8.8e+163) || ~((x <= 4.8e+246)))
		tmp = 1.0 + (0.16666666666666666 * (y * y));
	else
		tmp = 1.0 + ((x * x) * -0.5);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[x, 8.8e+163], N[Not[LessEqual[x, 4.8e+246]], $MachinePrecision]], N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.8 \cdot 10^{+163} \lor \neg \left(x \leq 4.8 \cdot 10^{+246}\right):\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot -0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 8.79999999999999945e163 or 4.8e246 < x

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 75.7%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow275.7%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified75.7%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in x around 0 49.4%

      \[\leadsto \color{blue}{1 + 0.16666666666666666 \cdot {y}^{2}} \]
    6. Step-by-step derivation
      1. +-commutative49.4%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2} + 1} \]
      2. unpow249.4%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1 \]
      3. *-commutative49.4%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1 \]
      4. associate-*r*49.0%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right)} + 1 \]
      5. fma-udef49.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
    7. Simplified49.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
    8. Step-by-step derivation
      1. fma-udef49.0%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right) + 1} \]
      2. associate-*r*49.4%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1 \]
      3. unpow249.4%

        \[\leadsto \color{blue}{{y}^{2}} \cdot 0.16666666666666666 + 1 \]
      4. *-commutative49.4%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2}} + 1 \]
      5. unpow249.4%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1 \]
    9. Applied egg-rr49.4%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right) + 1} \]

    if 8.79999999999999945e163 < x < 4.8e246

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Step-by-step derivation
      1. log1p-expm1-u99.9%

        \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos x \cdot \frac{\sinh y}{y}\right)\right)} \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos x \cdot \frac{\sinh y}{y}\right)\right)} \]
    4. Taylor expanded in y around 0 43.4%

      \[\leadsto \mathsf{log1p}\left(\color{blue}{e^{\cos x} - 1}\right) \]
    5. Step-by-step derivation
      1. expm1-def43.8%

        \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(\cos x\right)}\right) \]
    6. Simplified43.8%

      \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(\cos x\right)}\right) \]
    7. Taylor expanded in x around 0 35.8%

      \[\leadsto \color{blue}{1 + -0.5 \cdot {x}^{2}} \]
    8. Step-by-step derivation
      1. unpow235.8%

        \[\leadsto 1 + -0.5 \cdot \color{blue}{\left(x \cdot x\right)} \]
    9. Simplified35.8%

      \[\leadsto \color{blue}{1 + -0.5 \cdot \left(x \cdot x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 8.8 \cdot 10^{+163} \lor \neg \left(x \leq 4.8 \cdot 10^{+246}\right):\\ \;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;1 + \left(x \cdot x\right) \cdot -0.5\\ \end{array} \]

Alternative 13: 39.1% accurate, 18.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.15 \cdot 10^{+26}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{+120}:\\ \;\;\;\;1 + \left(x \cdot x\right) \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 1.15e+26)
   1.0
   (if (<= y 1.65e+120)
     (+ 1.0 (* (* x x) -0.5))
     (* 0.16666666666666666 (* y y)))))
double code(double x, double y) {
	double tmp;
	if (y <= 1.15e+26) {
		tmp = 1.0;
	} else if (y <= 1.65e+120) {
		tmp = 1.0 + ((x * x) * -0.5);
	} else {
		tmp = 0.16666666666666666 * (y * y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 1.15d+26) then
        tmp = 1.0d0
    else if (y <= 1.65d+120) then
        tmp = 1.0d0 + ((x * x) * (-0.5d0))
    else
        tmp = 0.16666666666666666d0 * (y * y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 1.15e+26) {
		tmp = 1.0;
	} else if (y <= 1.65e+120) {
		tmp = 1.0 + ((x * x) * -0.5);
	} else {
		tmp = 0.16666666666666666 * (y * y);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 1.15e+26:
		tmp = 1.0
	elif y <= 1.65e+120:
		tmp = 1.0 + ((x * x) * -0.5)
	else:
		tmp = 0.16666666666666666 * (y * y)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 1.15e+26)
		tmp = 1.0;
	elseif (y <= 1.65e+120)
		tmp = Float64(1.0 + Float64(Float64(x * x) * -0.5));
	else
		tmp = Float64(0.16666666666666666 * Float64(y * y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 1.15e+26)
		tmp = 1.0;
	elseif (y <= 1.65e+120)
		tmp = 1.0 + ((x * x) * -0.5);
	else
		tmp = 0.16666666666666666 * (y * y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 1.15e+26], 1.0, If[LessEqual[y, 1.65e+120], N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.15 \cdot 10^{+26}:\\
\;\;\;\;1\\

\mathbf{elif}\;y \leq 1.65 \cdot 10^{+120}:\\
\;\;\;\;1 + \left(x \cdot x\right) \cdot -0.5\\

\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 1.15e26

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Step-by-step derivation
      1. log1p-expm1-u99.4%

        \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos x \cdot \frac{\sinh y}{y}\right)\right)} \]
    3. Applied egg-rr99.4%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos x \cdot \frac{\sinh y}{y}\right)\right)} \]
    4. Taylor expanded in y around 0 64.1%

      \[\leadsto \mathsf{log1p}\left(\color{blue}{e^{\cos x} - 1}\right) \]
    5. Step-by-step derivation
      1. expm1-def64.3%

        \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(\cos x\right)}\right) \]
    6. Simplified64.3%

      \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(\cos x\right)}\right) \]
    7. Taylor expanded in x around 0 37.2%

      \[\leadsto \color{blue}{1} \]

    if 1.15e26 < y < 1.64999999999999995e120

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Step-by-step derivation
      1. log1p-expm1-u100.0%

        \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos x \cdot \frac{\sinh y}{y}\right)\right)} \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos x \cdot \frac{\sinh y}{y}\right)\right)} \]
    4. Taylor expanded in y around 0 3.1%

      \[\leadsto \mathsf{log1p}\left(\color{blue}{e^{\cos x} - 1}\right) \]
    5. Step-by-step derivation
      1. expm1-def3.1%

        \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(\cos x\right)}\right) \]
    6. Simplified3.1%

      \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(\cos x\right)}\right) \]
    7. Taylor expanded in x around 0 33.2%

      \[\leadsto \color{blue}{1 + -0.5 \cdot {x}^{2}} \]
    8. Step-by-step derivation
      1. unpow233.2%

        \[\leadsto 1 + -0.5 \cdot \color{blue}{\left(x \cdot x\right)} \]
    9. Simplified33.2%

      \[\leadsto \color{blue}{1 + -0.5 \cdot \left(x \cdot x\right)} \]

    if 1.64999999999999995e120 < y

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 77.7%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow277.7%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified77.7%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in x around 0 59.2%

      \[\leadsto \color{blue}{1 + 0.16666666666666666 \cdot {y}^{2}} \]
    6. Step-by-step derivation
      1. +-commutative59.2%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2} + 1} \]
      2. unpow259.2%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1 \]
      3. *-commutative59.2%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1 \]
      4. associate-*r*56.8%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right)} + 1 \]
      5. fma-udef56.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
    7. Simplified56.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
    8. Taylor expanded in y around inf 59.2%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2}} \]
    9. Step-by-step derivation
      1. unpow259.2%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} \]
    10. Simplified59.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.15 \cdot 10^{+26}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{+120}:\\ \;\;\;\;1 + \left(x \cdot x\right) \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\ \end{array} \]

Alternative 14: 38.2% accurate, 29.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 13:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 13.0) 1.0 (* 0.16666666666666666 (* y y))))
double code(double x, double y) {
	double tmp;
	if (y <= 13.0) {
		tmp = 1.0;
	} else {
		tmp = 0.16666666666666666 * (y * y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 13.0d0) then
        tmp = 1.0d0
    else
        tmp = 0.16666666666666666d0 * (y * y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 13.0) {
		tmp = 1.0;
	} else {
		tmp = 0.16666666666666666 * (y * y);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 13.0:
		tmp = 1.0
	else:
		tmp = 0.16666666666666666 * (y * y)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 13.0)
		tmp = 1.0;
	else
		tmp = Float64(0.16666666666666666 * Float64(y * y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 13.0)
		tmp = 1.0;
	else
		tmp = 0.16666666666666666 * (y * y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 13.0], 1.0, N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 13:\\
\;\;\;\;1\\

\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 13

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Step-by-step derivation
      1. log1p-expm1-u99.4%

        \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos x \cdot \frac{\sinh y}{y}\right)\right)} \]
    3. Applied egg-rr99.4%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos x \cdot \frac{\sinh y}{y}\right)\right)} \]
    4. Taylor expanded in y around 0 64.7%

      \[\leadsto \mathsf{log1p}\left(\color{blue}{e^{\cos x} - 1}\right) \]
    5. Step-by-step derivation
      1. expm1-def64.9%

        \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(\cos x\right)}\right) \]
    6. Simplified64.9%

      \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(\cos x\right)}\right) \]
    7. Taylor expanded in x around 0 37.6%

      \[\leadsto \color{blue}{1} \]

    if 13 < y

    1. Initial program 100.0%

      \[\cos x \cdot \frac{\sinh y}{y} \]
    2. Taylor expanded in y around 0 49.3%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. unpow249.3%

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified49.3%

      \[\leadsto \cos x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    5. Taylor expanded in x around 0 37.4%

      \[\leadsto \color{blue}{1 + 0.16666666666666666 \cdot {y}^{2}} \]
    6. Step-by-step derivation
      1. +-commutative37.4%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2} + 1} \]
      2. unpow237.4%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} + 1 \]
      3. *-commutative37.4%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot 0.16666666666666666} + 1 \]
      4. associate-*r*35.9%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot 0.16666666666666666\right)} + 1 \]
      5. fma-udef35.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
    7. Simplified35.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right)} \]
    8. Taylor expanded in y around inf 37.4%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot {y}^{2}} \]
    9. Step-by-step derivation
      1. unpow237.4%

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} \]
    10. Simplified37.4%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification37.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 13:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\ \end{array} \]

Alternative 15: 29.0% accurate, 205.0× speedup?

\[\begin{array}{l} \\ 1 \end{array} \]
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
	return 1.0;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 1.0d0
end function
public static double code(double x, double y) {
	return 1.0;
}
def code(x, y):
	return 1.0
function code(x, y)
	return 1.0
end
function tmp = code(x, y)
	tmp = 1.0;
end
code[x_, y_] := 1.0
\begin{array}{l}

\\
1
\end{array}
Derivation
  1. Initial program 100.0%

    \[\cos x \cdot \frac{\sinh y}{y} \]
  2. Step-by-step derivation
    1. log1p-expm1-u99.5%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos x \cdot \frac{\sinh y}{y}\right)\right)} \]
  3. Applied egg-rr99.5%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\cos x \cdot \frac{\sinh y}{y}\right)\right)} \]
  4. Taylor expanded in y around 0 51.7%

    \[\leadsto \mathsf{log1p}\left(\color{blue}{e^{\cos x} - 1}\right) \]
  5. Step-by-step derivation
    1. expm1-def51.9%

      \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(\cos x\right)}\right) \]
  6. Simplified51.9%

    \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(\cos x\right)}\right) \]
  7. Taylor expanded in x around 0 30.2%

    \[\leadsto \color{blue}{1} \]
  8. Final simplification30.2%

    \[\leadsto 1 \]

Reproduce

?
herbie shell --seed 2023279 
(FPCore (x y)
  :name "Linear.Quaternion:$csin from linear-1.19.1.3"
  :precision binary64
  (* (cos x) (/ (sinh y) y)))