Linear.Quaternion:$csin from linear-1.19.1.3

Percentage Accurate: 100.0% → 100.0%
Time: 8.6s
Alternatives: 13
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 13 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: 87.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ t_1 := \sqrt[3]{{y}^{6} \cdot 0.004629629629629629}\\ \mathbf{if}\;y \leq -2.8 \cdot 10^{+197}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{+51}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-8}:\\ \;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{+51}:\\ \;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* (cos x) (* y y))))
        (t_1 (cbrt (* (pow y 6.0) 0.004629629629629629))))
   (if (<= y -2.8e+197)
     t_0
     (if (<= y -2.4e+51)
       t_1
       (if (<= y 7e-8)
         (* (cos x) (+ 1.0 (* 0.16666666666666666 (* y y))))
         (if (<= y 6.8e+51)
           (* (fma y (* y 0.16666666666666666) 1.0) (+ 1.0 (* -0.5 (* x x))))
           (if (<= y 1.4e+154) t_1 t_0)))))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (cos(x) * (y * y));
	double t_1 = cbrt((pow(y, 6.0) * 0.004629629629629629));
	double tmp;
	if (y <= -2.8e+197) {
		tmp = t_0;
	} else if (y <= -2.4e+51) {
		tmp = t_1;
	} else if (y <= 7e-8) {
		tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
	} else if (y <= 6.8e+51) {
		tmp = fma(y, (y * 0.16666666666666666), 1.0) * (1.0 + (-0.5 * (x * x)));
	} else if (y <= 1.4e+154) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(cos(x) * Float64(y * y)))
	t_1 = cbrt(Float64((y ^ 6.0) * 0.004629629629629629))
	tmp = 0.0
	if (y <= -2.8e+197)
		tmp = t_0;
	elseif (y <= -2.4e+51)
		tmp = t_1;
	elseif (y <= 7e-8)
		tmp = Float64(cos(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))));
	elseif (y <= 6.8e+51)
		tmp = Float64(fma(y, Float64(y * 0.16666666666666666), 1.0) * Float64(1.0 + Float64(-0.5 * Float64(x * x))));
	elseif (y <= 1.4e+154)
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(N[Cos[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[Power[y, 6.0], $MachinePrecision] * 0.004629629629629629), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[y, -2.8e+197], t$95$0, If[LessEqual[y, -2.4e+51], t$95$1, If[LessEqual[y, 7e-8], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+51], N[(N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+154], t$95$1, t$95$0]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\
t_1 := \sqrt[3]{{y}^{6} \cdot 0.004629629629629629}\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{+197}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq -2.4 \cdot 10^{+51}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 7 \cdot 10^{-8}:\\
\;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\

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

\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.7999999999999999e197 or 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) \]
    7. Simplified100.0%

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

    if -2.7999999999999999e197 < y < -2.3999999999999999e51 or 6.79999999999999969e51 < y < 1.4e154

    1. Initial program 100.0%

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

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

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified16.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 16.2%

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

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

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

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

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

      \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} \]
    11. Step-by-step derivation
      1. add-cbrt-cube78.6%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\right) \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}} \]
      2. pow378.6%

        \[\leadsto \sqrt[3]{\color{blue}{{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{3}}} \]
      3. *-commutative78.6%

        \[\leadsto \sqrt[3]{{\color{blue}{\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)}}^{3}} \]
      4. unpow-prod-down78.6%

        \[\leadsto \sqrt[3]{\color{blue}{{\left(y \cdot y\right)}^{3} \cdot {0.16666666666666666}^{3}}} \]
      5. pow-prod-down78.6%

        \[\leadsto \sqrt[3]{\color{blue}{\left({y}^{3} \cdot {y}^{3}\right)} \cdot {0.16666666666666666}^{3}} \]
      6. pow-prod-up78.6%

        \[\leadsto \sqrt[3]{\color{blue}{{y}^{\left(3 + 3\right)}} \cdot {0.16666666666666666}^{3}} \]
      7. metadata-eval78.6%

        \[\leadsto \sqrt[3]{{y}^{\color{blue}{6}} \cdot {0.16666666666666666}^{3}} \]
      8. metadata-eval78.6%

        \[\leadsto \sqrt[3]{{y}^{6} \cdot \color{blue}{0.004629629629629629}} \]
    12. Applied egg-rr78.6%

      \[\leadsto \color{blue}{\sqrt[3]{{y}^{6} \cdot 0.004629629629629629}} \]

    if -2.3999999999999999e51 < y < 7.00000000000000048e-8

    1. Initial program 100.0%

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

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

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

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

    if 7.00000000000000048e-8 < y < 6.79999999999999969e51

    1. Initial program 100.0%

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

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

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified14.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 67.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. +-commutative67.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. associate-+l+67.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, 1\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification88.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.8 \cdot 10^{+197}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{+51}:\\ \;\;\;\;\sqrt[3]{{y}^{6} \cdot 0.004629629629629629}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-8}:\\ \;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{+51}:\\ \;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\sqrt[3]{{y}^{6} \cdot 0.004629629629629629}\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 3: 85.5% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ t_1 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\ t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_1}\\ \mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{+67}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -90000000:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-8}:\\ \;\;\;\;\cos x \cdot \left(1 + t_1\right)\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\ \;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* (cos x) (* y y))))
        (t_1 (* 0.16666666666666666 (* y y)))
        (t_2
         (*
          (- 1.0 (* (* y y) (* (* y y) 0.027777777777777776)))
          (/ 1.0 (- 1.0 t_1)))))
   (if (<= y -1.4e+154)
     t_0
     (if (<= y -1.8e+67)
       t_2
       (if (<= y -90000000.0)
         (* (* y y) (+ 0.16666666666666666 (* x (* x -0.08333333333333333))))
         (if (<= y 7e-8)
           (* (cos x) (+ 1.0 t_1))
           (if (<= y 5.2e+52)
             (* (fma y (* y 0.16666666666666666) 1.0) (+ 1.0 (* -0.5 (* x x))))
             (if (<= y 1.4e+154) t_2 t_0))))))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (cos(x) * (y * y));
	double t_1 = 0.16666666666666666 * (y * y);
	double t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_1));
	double tmp;
	if (y <= -1.4e+154) {
		tmp = t_0;
	} else if (y <= -1.8e+67) {
		tmp = t_2;
	} else if (y <= -90000000.0) {
		tmp = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
	} else if (y <= 7e-8) {
		tmp = cos(x) * (1.0 + t_1);
	} else if (y <= 5.2e+52) {
		tmp = fma(y, (y * 0.16666666666666666), 1.0) * (1.0 + (-0.5 * (x * x)));
	} else if (y <= 1.4e+154) {
		tmp = t_2;
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(cos(x) * Float64(y * y)))
	t_1 = Float64(0.16666666666666666 * Float64(y * y))
	t_2 = Float64(Float64(1.0 - Float64(Float64(y * y) * Float64(Float64(y * y) * 0.027777777777777776))) * Float64(1.0 / Float64(1.0 - t_1)))
	tmp = 0.0
	if (y <= -1.4e+154)
		tmp = t_0;
	elseif (y <= -1.8e+67)
		tmp = t_2;
	elseif (y <= -90000000.0)
		tmp = Float64(Float64(y * y) * Float64(0.16666666666666666 + Float64(x * Float64(x * -0.08333333333333333))));
	elseif (y <= 7e-8)
		tmp = Float64(cos(x) * Float64(1.0 + t_1));
	elseif (y <= 5.2e+52)
		tmp = Float64(fma(y, Float64(y * 0.16666666666666666), 1.0) * Float64(1.0 + Float64(-0.5 * Float64(x * x))));
	elseif (y <= 1.4e+154)
		tmp = t_2;
	else
		tmp = t_0;
	end
	return tmp
end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(N[Cos[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 - N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+154], t$95$0, If[LessEqual[y, -1.8e+67], t$95$2, If[LessEqual[y, -90000000.0], N[(N[(y * y), $MachinePrecision] * N[(0.16666666666666666 + N[(x * N[(x * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-8], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e+52], N[(N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+154], t$95$2, t$95$0]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\
t_1 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_1}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq -1.8 \cdot 10^{+67}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;y \leq 7 \cdot 10^{-8}:\\
\;\;\;\;\cos x \cdot \left(1 + t_1\right)\\

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

\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.4e154 or 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) \]
    7. Simplified100.0%

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

    if -1.4e154 < y < -1.7999999999999999e67 or 5.2e52 < y < 1.4e154

    1. Initial program 100.0%

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

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

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified6.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 5.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot 1 - \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)}} \]
      4. div-inv60.8%

        \[\leadsto \color{blue}{\left(1 \cdot 1 - \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)}} \]
      5. metadata-eval60.8%

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

        \[\leadsto \left(1 - \color{blue}{{\left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)}^{2}}\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)} \]
      7. *-commutative60.8%

        \[\leadsto \left(1 - {\color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\right)}}^{2}\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)} \]
      8. associate-*l*60.8%

        \[\leadsto \left(1 - {\color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}}^{2}\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)} \]
      9. *-commutative60.8%

        \[\leadsto \left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - \color{blue}{\left(0.16666666666666666 \cdot y\right) \cdot y}} \]
      10. associate-*l*60.8%

        \[\leadsto \left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)}} \]
    9. Applied egg-rr60.8%

      \[\leadsto \color{blue}{\left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}} \]
    10. Step-by-step derivation
      1. unpow260.8%

        \[\leadsto \left(1 - \color{blue}{\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)} \]
      2. associate-*r*60.8%

        \[\leadsto \left(1 - \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\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)} \]
      3. associate-*r*60.8%

        \[\leadsto \left(1 - \left(\left(0.16666666666666666 \cdot y\right) \cdot y\right) \cdot \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\right)}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      4. swap-sqr60.8%

        \[\leadsto \left(1 - \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      5. *-commutative60.8%

        \[\leadsto \left(1 - \left(\color{blue}{\left(y \cdot 0.16666666666666666\right)} \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      6. *-commutative60.8%

        \[\leadsto \left(1 - \left(\left(y \cdot 0.16666666666666666\right) \cdot \color{blue}{\left(y \cdot 0.16666666666666666\right)}\right) \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      7. swap-sqr60.8%

        \[\leadsto \left(1 - \color{blue}{\left(\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot 0.16666666666666666\right)\right)} \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      8. metadata-eval60.8%

        \[\leadsto \left(1 - \left(\left(y \cdot y\right) \cdot \color{blue}{0.027777777777777776}\right) \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
    11. Applied egg-rr60.8%

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

    if -1.7999999999999999e67 < y < -9e7

    1. Initial program 100.0%

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

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

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified3.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 3.7%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, {y}^{2}, -0.08333333333333333 \cdot \left({y}^{2} \cdot {x}^{2}\right)\right)} \]
      2. unpow230.5%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, \color{blue}{y \cdot y}, -0.08333333333333333 \cdot \left({y}^{2} \cdot {x}^{2}\right)\right) \]
      3. unpow230.5%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot {x}^{2}\right)\right) \]
      4. *-commutative30.5%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \color{blue}{\left({x}^{2} \cdot \left(y \cdot y\right)\right)}\right) \]
      5. unpow230.5%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot \left(y \cdot y\right)\right)\right) \]
    10. Simplified30.5%

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

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

        \[\leadsto 0.16666666666666666 \cdot \left(y \cdot y\right) + \color{blue}{\left(-0.08333333333333333 \cdot \left(x \cdot x\right)\right) \cdot \left(y \cdot y\right)} \]
      3. distribute-rgt-out30.5%

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(0.16666666666666666 + \color{blue}{\left(-0.08333333333333333 \cdot x\right) \cdot x}\right) \]
    12. Applied egg-rr30.5%

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

    if -9e7 < y < 7.00000000000000048e-8

    1. Initial program 100.0%

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

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

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

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

    if 7.00000000000000048e-8 < y < 5.2e52

    1. Initial program 100.0%

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

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

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified14.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 67.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. +-commutative67.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. associate-+l+67.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, 1\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification86.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{+67}:\\ \;\;\;\;\left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\\ \mathbf{elif}\;y \leq -90000000:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-8}:\\ \;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\ \;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 4: 85.6% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ t_1 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\ t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_1}\\ \mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{+70}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -90000000:\\ \;\;\;\;\mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(y \cdot \left(y \cdot \left(x \cdot x\right)\right)\right)\right)\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-8}:\\ \;\;\;\;\cos x \cdot \left(1 + t_1\right)\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\ \;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* (cos x) (* y y))))
        (t_1 (* 0.16666666666666666 (* y y)))
        (t_2
         (*
          (- 1.0 (* (* y y) (* (* y y) 0.027777777777777776)))
          (/ 1.0 (- 1.0 t_1)))))
   (if (<= y -1.4e+154)
     t_0
     (if (<= y -7.2e+70)
       t_2
       (if (<= y -90000000.0)
         (fma
          0.16666666666666666
          (* y y)
          (* -0.08333333333333333 (* y (* y (* x x)))))
         (if (<= y 7e-8)
           (* (cos x) (+ 1.0 t_1))
           (if (<= y 5.2e+52)
             (* (fma y (* y 0.16666666666666666) 1.0) (+ 1.0 (* -0.5 (* x x))))
             (if (<= y 1.4e+154) t_2 t_0))))))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (cos(x) * (y * y));
	double t_1 = 0.16666666666666666 * (y * y);
	double t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_1));
	double tmp;
	if (y <= -1.4e+154) {
		tmp = t_0;
	} else if (y <= -7.2e+70) {
		tmp = t_2;
	} else if (y <= -90000000.0) {
		tmp = fma(0.16666666666666666, (y * y), (-0.08333333333333333 * (y * (y * (x * x)))));
	} else if (y <= 7e-8) {
		tmp = cos(x) * (1.0 + t_1);
	} else if (y <= 5.2e+52) {
		tmp = fma(y, (y * 0.16666666666666666), 1.0) * (1.0 + (-0.5 * (x * x)));
	} else if (y <= 1.4e+154) {
		tmp = t_2;
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(cos(x) * Float64(y * y)))
	t_1 = Float64(0.16666666666666666 * Float64(y * y))
	t_2 = Float64(Float64(1.0 - Float64(Float64(y * y) * Float64(Float64(y * y) * 0.027777777777777776))) * Float64(1.0 / Float64(1.0 - t_1)))
	tmp = 0.0
	if (y <= -1.4e+154)
		tmp = t_0;
	elseif (y <= -7.2e+70)
		tmp = t_2;
	elseif (y <= -90000000.0)
		tmp = fma(0.16666666666666666, Float64(y * y), Float64(-0.08333333333333333 * Float64(y * Float64(y * Float64(x * x)))));
	elseif (y <= 7e-8)
		tmp = Float64(cos(x) * Float64(1.0 + t_1));
	elseif (y <= 5.2e+52)
		tmp = Float64(fma(y, Float64(y * 0.16666666666666666), 1.0) * Float64(1.0 + Float64(-0.5 * Float64(x * x))));
	elseif (y <= 1.4e+154)
		tmp = t_2;
	else
		tmp = t_0;
	end
	return tmp
end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(N[Cos[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 - N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+154], t$95$0, If[LessEqual[y, -7.2e+70], t$95$2, If[LessEqual[y, -90000000.0], N[(0.16666666666666666 * N[(y * y), $MachinePrecision] + N[(-0.08333333333333333 * N[(y * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-8], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e+52], N[(N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+154], t$95$2, t$95$0]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\
t_1 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_1}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq -7.2 \cdot 10^{+70}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -90000000:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(y \cdot \left(y \cdot \left(x \cdot x\right)\right)\right)\right)\\

\mathbf{elif}\;y \leq 7 \cdot 10^{-8}:\\
\;\;\;\;\cos x \cdot \left(1 + t_1\right)\\

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

\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.4e154 or 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) \]
    7. Simplified100.0%

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

    if -1.4e154 < y < -7.1999999999999999e70 or 5.2e52 < y < 1.4e154

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(1 \cdot 1 - \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)}} \]
      5. metadata-eval63.4%

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

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

        \[\leadsto \left(1 - {\color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\right)}}^{2}\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)} \]
      8. associate-*l*63.4%

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

        \[\leadsto \left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - \color{blue}{\left(0.16666666666666666 \cdot y\right) \cdot y}} \]
      10. associate-*l*63.4%

        \[\leadsto \left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)}} \]
    9. Applied egg-rr63.4%

      \[\leadsto \color{blue}{\left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}} \]
    10. Step-by-step derivation
      1. unpow263.4%

        \[\leadsto \left(1 - \color{blue}{\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)} \]
      2. associate-*r*63.4%

        \[\leadsto \left(1 - \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\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)} \]
      3. associate-*r*63.4%

        \[\leadsto \left(1 - \left(\left(0.16666666666666666 \cdot y\right) \cdot y\right) \cdot \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\right)}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      4. swap-sqr63.4%

        \[\leadsto \left(1 - \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      5. *-commutative63.4%

        \[\leadsto \left(1 - \left(\color{blue}{\left(y \cdot 0.16666666666666666\right)} \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      6. *-commutative63.4%

        \[\leadsto \left(1 - \left(\left(y \cdot 0.16666666666666666\right) \cdot \color{blue}{\left(y \cdot 0.16666666666666666\right)}\right) \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      7. swap-sqr63.4%

        \[\leadsto \left(1 - \color{blue}{\left(\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot 0.16666666666666666\right)\right)} \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      8. metadata-eval63.4%

        \[\leadsto \left(1 - \left(\left(y \cdot y\right) \cdot \color{blue}{0.027777777777777776}\right) \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
    11. Applied egg-rr63.4%

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

    if -7.1999999999999999e70 < y < -9e7

    1. Initial program 100.0%

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

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

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified3.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 3.8%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, {y}^{2}, -0.08333333333333333 \cdot \left({y}^{2} \cdot {x}^{2}\right)\right)} \]
      2. unpow227.9%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, \color{blue}{y \cdot y}, -0.08333333333333333 \cdot \left({y}^{2} \cdot {x}^{2}\right)\right) \]
      3. unpow227.9%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot {x}^{2}\right)\right) \]
      4. associate-*l*27.9%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \color{blue}{\left(y \cdot \left(y \cdot {x}^{2}\right)\right)}\right) \]
      5. unpow227.9%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(y \cdot \left(y \cdot \color{blue}{\left(x \cdot x\right)}\right)\right)\right) \]
    10. Simplified27.9%

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

    if -9e7 < y < 7.00000000000000048e-8

    1. Initial program 100.0%

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

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

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

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

    if 7.00000000000000048e-8 < y < 5.2e52

    1. Initial program 100.0%

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

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

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified14.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 67.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. +-commutative67.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. associate-+l+67.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, 1\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification86.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{+70}:\\ \;\;\;\;\left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\\ \mathbf{elif}\;y \leq -90000000:\\ \;\;\;\;\mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(y \cdot \left(y \cdot \left(x \cdot x\right)\right)\right)\right)\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-8}:\\ \;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\ \;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 5: 85.5% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ t_1 := \left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\ t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\\ \mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{+67}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -165000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 25000:\\ \;\;\;\;\cos x\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* (cos x) (* y y))))
        (t_1
         (* (* y y) (+ 0.16666666666666666 (* x (* x -0.08333333333333333)))))
        (t_2
         (*
          (- 1.0 (* (* y y) (* (* y y) 0.027777777777777776)))
          (/ 1.0 (- 1.0 (* 0.16666666666666666 (* y y)))))))
   (if (<= y -1.4e+154)
     t_0
     (if (<= y -2.5e+67)
       t_2
       (if (<= y -165000000.0)
         t_1
         (if (<= y 25000.0)
           (cos x)
           (if (<= y 5.2e+52) t_1 (if (<= y 1.4e+154) t_2 t_0))))))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (cos(x) * (y * y));
	double t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
	double t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - (0.16666666666666666 * (y * y))));
	double tmp;
	if (y <= -1.4e+154) {
		tmp = t_0;
	} else if (y <= -2.5e+67) {
		tmp = t_2;
	} else if (y <= -165000000.0) {
		tmp = t_1;
	} else if (y <= 25000.0) {
		tmp = cos(x);
	} else if (y <= 5.2e+52) {
		tmp = t_1;
	} else if (y <= 1.4e+154) {
		tmp = t_2;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = 0.16666666666666666d0 * (cos(x) * (y * y))
    t_1 = (y * y) * (0.16666666666666666d0 + (x * (x * (-0.08333333333333333d0))))
    t_2 = (1.0d0 - ((y * y) * ((y * y) * 0.027777777777777776d0))) * (1.0d0 / (1.0d0 - (0.16666666666666666d0 * (y * y))))
    if (y <= (-1.4d+154)) then
        tmp = t_0
    else if (y <= (-2.5d+67)) then
        tmp = t_2
    else if (y <= (-165000000.0d0)) then
        tmp = t_1
    else if (y <= 25000.0d0) then
        tmp = cos(x)
    else if (y <= 5.2d+52) then
        tmp = t_1
    else if (y <= 1.4d+154) then
        tmp = t_2
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (Math.cos(x) * (y * y));
	double t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
	double t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - (0.16666666666666666 * (y * y))));
	double tmp;
	if (y <= -1.4e+154) {
		tmp = t_0;
	} else if (y <= -2.5e+67) {
		tmp = t_2;
	} else if (y <= -165000000.0) {
		tmp = t_1;
	} else if (y <= 25000.0) {
		tmp = Math.cos(x);
	} else if (y <= 5.2e+52) {
		tmp = t_1;
	} else if (y <= 1.4e+154) {
		tmp = t_2;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = 0.16666666666666666 * (math.cos(x) * (y * y))
	t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)))
	t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - (0.16666666666666666 * (y * y))))
	tmp = 0
	if y <= -1.4e+154:
		tmp = t_0
	elif y <= -2.5e+67:
		tmp = t_2
	elif y <= -165000000.0:
		tmp = t_1
	elif y <= 25000.0:
		tmp = math.cos(x)
	elif y <= 5.2e+52:
		tmp = t_1
	elif y <= 1.4e+154:
		tmp = t_2
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(cos(x) * Float64(y * y)))
	t_1 = Float64(Float64(y * y) * Float64(0.16666666666666666 + Float64(x * Float64(x * -0.08333333333333333))))
	t_2 = Float64(Float64(1.0 - Float64(Float64(y * y) * Float64(Float64(y * y) * 0.027777777777777776))) * Float64(1.0 / Float64(1.0 - Float64(0.16666666666666666 * Float64(y * y)))))
	tmp = 0.0
	if (y <= -1.4e+154)
		tmp = t_0;
	elseif (y <= -2.5e+67)
		tmp = t_2;
	elseif (y <= -165000000.0)
		tmp = t_1;
	elseif (y <= 25000.0)
		tmp = cos(x);
	elseif (y <= 5.2e+52)
		tmp = t_1;
	elseif (y <= 1.4e+154)
		tmp = t_2;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 0.16666666666666666 * (cos(x) * (y * y));
	t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
	t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - (0.16666666666666666 * (y * y))));
	tmp = 0.0;
	if (y <= -1.4e+154)
		tmp = t_0;
	elseif (y <= -2.5e+67)
		tmp = t_2;
	elseif (y <= -165000000.0)
		tmp = t_1;
	elseif (y <= 25000.0)
		tmp = cos(x);
	elseif (y <= 5.2e+52)
		tmp = t_1;
	elseif (y <= 1.4e+154)
		tmp = t_2;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(N[Cos[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * y), $MachinePrecision] * N[(0.16666666666666666 + N[(x * N[(x * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 - N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+154], t$95$0, If[LessEqual[y, -2.5e+67], t$95$2, If[LessEqual[y, -165000000.0], t$95$1, If[LessEqual[y, 25000.0], N[Cos[x], $MachinePrecision], If[LessEqual[y, 5.2e+52], t$95$1, If[LessEqual[y, 1.4e+154], t$95$2, t$95$0]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\
t_1 := \left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\
t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq -2.5 \cdot 10^{+67}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -165000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 25000:\\
\;\;\;\;\cos x\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.4e154 or 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) \]
    7. Simplified100.0%

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

    if -1.4e154 < y < -2.49999999999999988e67 or 5.2e52 < y < 1.4e154

    1. Initial program 100.0%

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

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

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified6.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 5.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot 1 - \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)}} \]
      4. div-inv60.8%

        \[\leadsto \color{blue}{\left(1 \cdot 1 - \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)}} \]
      5. metadata-eval60.8%

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

        \[\leadsto \left(1 - \color{blue}{{\left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)}^{2}}\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)} \]
      7. *-commutative60.8%

        \[\leadsto \left(1 - {\color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\right)}}^{2}\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)} \]
      8. associate-*l*60.8%

        \[\leadsto \left(1 - {\color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}}^{2}\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)} \]
      9. *-commutative60.8%

        \[\leadsto \left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - \color{blue}{\left(0.16666666666666666 \cdot y\right) \cdot y}} \]
      10. associate-*l*60.8%

        \[\leadsto \left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)}} \]
    9. Applied egg-rr60.8%

      \[\leadsto \color{blue}{\left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}} \]
    10. Step-by-step derivation
      1. unpow260.8%

        \[\leadsto \left(1 - \color{blue}{\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)} \]
      2. associate-*r*60.8%

        \[\leadsto \left(1 - \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\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)} \]
      3. associate-*r*60.8%

        \[\leadsto \left(1 - \left(\left(0.16666666666666666 \cdot y\right) \cdot y\right) \cdot \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\right)}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      4. swap-sqr60.8%

        \[\leadsto \left(1 - \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      5. *-commutative60.8%

        \[\leadsto \left(1 - \left(\color{blue}{\left(y \cdot 0.16666666666666666\right)} \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      6. *-commutative60.8%

        \[\leadsto \left(1 - \left(\left(y \cdot 0.16666666666666666\right) \cdot \color{blue}{\left(y \cdot 0.16666666666666666\right)}\right) \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      7. swap-sqr60.8%

        \[\leadsto \left(1 - \color{blue}{\left(\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot 0.16666666666666666\right)\right)} \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      8. metadata-eval60.8%

        \[\leadsto \left(1 - \left(\left(y \cdot y\right) \cdot \color{blue}{0.027777777777777776}\right) \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
    11. Applied egg-rr60.8%

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

    if -2.49999999999999988e67 < y < -1.65e8 or 25000 < y < 5.2e52

    1. Initial program 100.0%

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

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

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified3.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 3.7%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, {y}^{2}, -0.08333333333333333 \cdot \left({y}^{2} \cdot {x}^{2}\right)\right)} \]
      2. unpow240.5%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, \color{blue}{y \cdot y}, -0.08333333333333333 \cdot \left({y}^{2} \cdot {x}^{2}\right)\right) \]
      3. unpow240.5%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot {x}^{2}\right)\right) \]
      4. *-commutative40.5%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \color{blue}{\left({x}^{2} \cdot \left(y \cdot y\right)\right)}\right) \]
      5. unpow240.5%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot \left(y \cdot y\right)\right)\right) \]
    10. Simplified40.5%

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

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

        \[\leadsto 0.16666666666666666 \cdot \left(y \cdot y\right) + \color{blue}{\left(-0.08333333333333333 \cdot \left(x \cdot x\right)\right) \cdot \left(y \cdot y\right)} \]
      3. distribute-rgt-out40.5%

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(0.16666666666666666 + \color{blue}{\left(-0.08333333333333333 \cdot x\right) \cdot x}\right) \]
    12. Applied egg-rr40.5%

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

    if -1.65e8 < y < 25000

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto \color{blue}{\cos x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification86.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{+67}:\\ \;\;\;\;\left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\\ \mathbf{elif}\;y \leq -165000000:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\ \mathbf{elif}\;y \leq 25000:\\ \;\;\;\;\cos x\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 6: 85.8% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ t_1 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\ t_2 := \left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\ t_3 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_1}\\ \mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{+67}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -100000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 620:\\ \;\;\;\;\cos x \cdot \left(1 + t_1\right)\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* (cos x) (* y y))))
        (t_1 (* 0.16666666666666666 (* y y)))
        (t_2
         (* (* y y) (+ 0.16666666666666666 (* x (* x -0.08333333333333333)))))
        (t_3
         (*
          (- 1.0 (* (* y y) (* (* y y) 0.027777777777777776)))
          (/ 1.0 (- 1.0 t_1)))))
   (if (<= y -1.4e+154)
     t_0
     (if (<= y -2.5e+67)
       t_3
       (if (<= y -100000000.0)
         t_2
         (if (<= y 620.0)
           (* (cos x) (+ 1.0 t_1))
           (if (<= y 5.2e+52) t_2 (if (<= y 1.4e+154) t_3 t_0))))))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (cos(x) * (y * y));
	double t_1 = 0.16666666666666666 * (y * y);
	double t_2 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
	double t_3 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_1));
	double tmp;
	if (y <= -1.4e+154) {
		tmp = t_0;
	} else if (y <= -2.5e+67) {
		tmp = t_3;
	} else if (y <= -100000000.0) {
		tmp = t_2;
	} else if (y <= 620.0) {
		tmp = cos(x) * (1.0 + t_1);
	} else if (y <= 5.2e+52) {
		tmp = t_2;
	} else if (y <= 1.4e+154) {
		tmp = t_3;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = 0.16666666666666666d0 * (cos(x) * (y * y))
    t_1 = 0.16666666666666666d0 * (y * y)
    t_2 = (y * y) * (0.16666666666666666d0 + (x * (x * (-0.08333333333333333d0))))
    t_3 = (1.0d0 - ((y * y) * ((y * y) * 0.027777777777777776d0))) * (1.0d0 / (1.0d0 - t_1))
    if (y <= (-1.4d+154)) then
        tmp = t_0
    else if (y <= (-2.5d+67)) then
        tmp = t_3
    else if (y <= (-100000000.0d0)) then
        tmp = t_2
    else if (y <= 620.0d0) then
        tmp = cos(x) * (1.0d0 + t_1)
    else if (y <= 5.2d+52) then
        tmp = t_2
    else if (y <= 1.4d+154) then
        tmp = t_3
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (Math.cos(x) * (y * y));
	double t_1 = 0.16666666666666666 * (y * y);
	double t_2 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
	double t_3 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_1));
	double tmp;
	if (y <= -1.4e+154) {
		tmp = t_0;
	} else if (y <= -2.5e+67) {
		tmp = t_3;
	} else if (y <= -100000000.0) {
		tmp = t_2;
	} else if (y <= 620.0) {
		tmp = Math.cos(x) * (1.0 + t_1);
	} else if (y <= 5.2e+52) {
		tmp = t_2;
	} else if (y <= 1.4e+154) {
		tmp = t_3;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = 0.16666666666666666 * (math.cos(x) * (y * y))
	t_1 = 0.16666666666666666 * (y * y)
	t_2 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)))
	t_3 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_1))
	tmp = 0
	if y <= -1.4e+154:
		tmp = t_0
	elif y <= -2.5e+67:
		tmp = t_3
	elif y <= -100000000.0:
		tmp = t_2
	elif y <= 620.0:
		tmp = math.cos(x) * (1.0 + t_1)
	elif y <= 5.2e+52:
		tmp = t_2
	elif y <= 1.4e+154:
		tmp = t_3
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(cos(x) * Float64(y * y)))
	t_1 = Float64(0.16666666666666666 * Float64(y * y))
	t_2 = Float64(Float64(y * y) * Float64(0.16666666666666666 + Float64(x * Float64(x * -0.08333333333333333))))
	t_3 = Float64(Float64(1.0 - Float64(Float64(y * y) * Float64(Float64(y * y) * 0.027777777777777776))) * Float64(1.0 / Float64(1.0 - t_1)))
	tmp = 0.0
	if (y <= -1.4e+154)
		tmp = t_0;
	elseif (y <= -2.5e+67)
		tmp = t_3;
	elseif (y <= -100000000.0)
		tmp = t_2;
	elseif (y <= 620.0)
		tmp = Float64(cos(x) * Float64(1.0 + t_1));
	elseif (y <= 5.2e+52)
		tmp = t_2;
	elseif (y <= 1.4e+154)
		tmp = t_3;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 0.16666666666666666 * (cos(x) * (y * y));
	t_1 = 0.16666666666666666 * (y * y);
	t_2 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
	t_3 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_1));
	tmp = 0.0;
	if (y <= -1.4e+154)
		tmp = t_0;
	elseif (y <= -2.5e+67)
		tmp = t_3;
	elseif (y <= -100000000.0)
		tmp = t_2;
	elseif (y <= 620.0)
		tmp = cos(x) * (1.0 + t_1);
	elseif (y <= 5.2e+52)
		tmp = t_2;
	elseif (y <= 1.4e+154)
		tmp = t_3;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(N[Cos[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * y), $MachinePrecision] * N[(0.16666666666666666 + N[(x * N[(x * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(1.0 - N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+154], t$95$0, If[LessEqual[y, -2.5e+67], t$95$3, If[LessEqual[y, -100000000.0], t$95$2, If[LessEqual[y, 620.0], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e+52], t$95$2, If[LessEqual[y, 1.4e+154], t$95$3, t$95$0]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\
t_1 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_2 := \left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\
t_3 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_1}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq -2.5 \cdot 10^{+67}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;y \leq -100000000:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 620:\\
\;\;\;\;\cos x \cdot \left(1 + t_1\right)\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.4e154 or 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) \]
    7. Simplified100.0%

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

    if -1.4e154 < y < -2.49999999999999988e67 or 5.2e52 < y < 1.4e154

    1. Initial program 100.0%

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

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

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified6.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 5.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot 1 - \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)}} \]
      4. div-inv60.8%

        \[\leadsto \color{blue}{\left(1 \cdot 1 - \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)}} \]
      5. metadata-eval60.8%

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

        \[\leadsto \left(1 - \color{blue}{{\left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)}^{2}}\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)} \]
      7. *-commutative60.8%

        \[\leadsto \left(1 - {\color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\right)}}^{2}\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)} \]
      8. associate-*l*60.8%

        \[\leadsto \left(1 - {\color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}}^{2}\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)} \]
      9. *-commutative60.8%

        \[\leadsto \left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - \color{blue}{\left(0.16666666666666666 \cdot y\right) \cdot y}} \]
      10. associate-*l*60.8%

        \[\leadsto \left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)}} \]
    9. Applied egg-rr60.8%

      \[\leadsto \color{blue}{\left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}} \]
    10. Step-by-step derivation
      1. unpow260.8%

        \[\leadsto \left(1 - \color{blue}{\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)} \]
      2. associate-*r*60.8%

        \[\leadsto \left(1 - \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\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)} \]
      3. associate-*r*60.8%

        \[\leadsto \left(1 - \left(\left(0.16666666666666666 \cdot y\right) \cdot y\right) \cdot \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\right)}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      4. swap-sqr60.8%

        \[\leadsto \left(1 - \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      5. *-commutative60.8%

        \[\leadsto \left(1 - \left(\color{blue}{\left(y \cdot 0.16666666666666666\right)} \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      6. *-commutative60.8%

        \[\leadsto \left(1 - \left(\left(y \cdot 0.16666666666666666\right) \cdot \color{blue}{\left(y \cdot 0.16666666666666666\right)}\right) \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      7. swap-sqr60.8%

        \[\leadsto \left(1 - \color{blue}{\left(\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot 0.16666666666666666\right)\right)} \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      8. metadata-eval60.8%

        \[\leadsto \left(1 - \left(\left(y \cdot y\right) \cdot \color{blue}{0.027777777777777776}\right) \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
    11. Applied egg-rr60.8%

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

    if -2.49999999999999988e67 < y < -1e8 or 620 < y < 5.2e52

    1. Initial program 100.0%

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

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

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified3.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 3.7%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, {y}^{2}, -0.08333333333333333 \cdot \left({y}^{2} \cdot {x}^{2}\right)\right)} \]
      2. unpow240.5%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, \color{blue}{y \cdot y}, -0.08333333333333333 \cdot \left({y}^{2} \cdot {x}^{2}\right)\right) \]
      3. unpow240.5%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot {x}^{2}\right)\right) \]
      4. *-commutative40.5%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \color{blue}{\left({x}^{2} \cdot \left(y \cdot y\right)\right)}\right) \]
      5. unpow240.5%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot \left(y \cdot y\right)\right)\right) \]
    10. Simplified40.5%

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

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

        \[\leadsto 0.16666666666666666 \cdot \left(y \cdot y\right) + \color{blue}{\left(-0.08333333333333333 \cdot \left(x \cdot x\right)\right) \cdot \left(y \cdot y\right)} \]
      3. distribute-rgt-out40.5%

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(0.16666666666666666 + \color{blue}{\left(-0.08333333333333333 \cdot x\right) \cdot x}\right) \]
    12. Applied egg-rr40.5%

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

    if -1e8 < y < 620

    1. Initial program 100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{+67}:\\ \;\;\;\;\left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\\ \mathbf{elif}\;y \leq -100000000:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\ \mathbf{elif}\;y \leq 620:\\ \;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 7: 79.3% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\ t_1 := \left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\ t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_0}\\ \mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{+67}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -90000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 440:\\ \;\;\;\;\cos x\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* y y)))
        (t_1
         (* (* y y) (+ 0.16666666666666666 (* x (* x -0.08333333333333333)))))
        (t_2
         (*
          (- 1.0 (* (* y y) (* (* y y) 0.027777777777777776)))
          (/ 1.0 (- 1.0 t_0)))))
   (if (<= y -1.4e+154)
     t_0
     (if (<= y -2.5e+67)
       t_2
       (if (<= y -90000000.0)
         t_1
         (if (<= y 440.0)
           (cos x)
           (if (<= y 5.2e+52) t_1 (if (<= y 1.4e+154) t_2 t_0))))))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (y * y);
	double t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
	double t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_0));
	double tmp;
	if (y <= -1.4e+154) {
		tmp = t_0;
	} else if (y <= -2.5e+67) {
		tmp = t_2;
	} else if (y <= -90000000.0) {
		tmp = t_1;
	} else if (y <= 440.0) {
		tmp = cos(x);
	} else if (y <= 5.2e+52) {
		tmp = t_1;
	} else if (y <= 1.4e+154) {
		tmp = t_2;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = 0.16666666666666666d0 * (y * y)
    t_1 = (y * y) * (0.16666666666666666d0 + (x * (x * (-0.08333333333333333d0))))
    t_2 = (1.0d0 - ((y * y) * ((y * y) * 0.027777777777777776d0))) * (1.0d0 / (1.0d0 - t_0))
    if (y <= (-1.4d+154)) then
        tmp = t_0
    else if (y <= (-2.5d+67)) then
        tmp = t_2
    else if (y <= (-90000000.0d0)) then
        tmp = t_1
    else if (y <= 440.0d0) then
        tmp = cos(x)
    else if (y <= 5.2d+52) then
        tmp = t_1
    else if (y <= 1.4d+154) then
        tmp = t_2
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (y * y);
	double t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
	double t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_0));
	double tmp;
	if (y <= -1.4e+154) {
		tmp = t_0;
	} else if (y <= -2.5e+67) {
		tmp = t_2;
	} else if (y <= -90000000.0) {
		tmp = t_1;
	} else if (y <= 440.0) {
		tmp = Math.cos(x);
	} else if (y <= 5.2e+52) {
		tmp = t_1;
	} else if (y <= 1.4e+154) {
		tmp = t_2;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = 0.16666666666666666 * (y * y)
	t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)))
	t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_0))
	tmp = 0
	if y <= -1.4e+154:
		tmp = t_0
	elif y <= -2.5e+67:
		tmp = t_2
	elif y <= -90000000.0:
		tmp = t_1
	elif y <= 440.0:
		tmp = math.cos(x)
	elif y <= 5.2e+52:
		tmp = t_1
	elif y <= 1.4e+154:
		tmp = t_2
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(y * y))
	t_1 = Float64(Float64(y * y) * Float64(0.16666666666666666 + Float64(x * Float64(x * -0.08333333333333333))))
	t_2 = Float64(Float64(1.0 - Float64(Float64(y * y) * Float64(Float64(y * y) * 0.027777777777777776))) * Float64(1.0 / Float64(1.0 - t_0)))
	tmp = 0.0
	if (y <= -1.4e+154)
		tmp = t_0;
	elseif (y <= -2.5e+67)
		tmp = t_2;
	elseif (y <= -90000000.0)
		tmp = t_1;
	elseif (y <= 440.0)
		tmp = cos(x);
	elseif (y <= 5.2e+52)
		tmp = t_1;
	elseif (y <= 1.4e+154)
		tmp = t_2;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 0.16666666666666666 * (y * y);
	t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
	t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_0));
	tmp = 0.0;
	if (y <= -1.4e+154)
		tmp = t_0;
	elseif (y <= -2.5e+67)
		tmp = t_2;
	elseif (y <= -90000000.0)
		tmp = t_1;
	elseif (y <= 440.0)
		tmp = cos(x);
	elseif (y <= 5.2e+52)
		tmp = t_1;
	elseif (y <= 1.4e+154)
		tmp = t_2;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * y), $MachinePrecision] * N[(0.16666666666666666 + N[(x * N[(x * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 - N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+154], t$95$0, If[LessEqual[y, -2.5e+67], t$95$2, If[LessEqual[y, -90000000.0], t$95$1, If[LessEqual[y, 440.0], N[Cos[x], $MachinePrecision], If[LessEqual[y, 5.2e+52], t$95$1, If[LessEqual[y, 1.4e+154], t$95$2, t$95$0]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_1 := \left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\
t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_0}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq -2.5 \cdot 10^{+67}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -90000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 440:\\
\;\;\;\;\cos x\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.4e154 or 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) \]
    7. Simplified100.0%

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

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

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

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

    if -1.4e154 < y < -2.49999999999999988e67 or 5.2e52 < y < 1.4e154

    1. Initial program 100.0%

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

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

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified6.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 5.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot 1 - \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)}} \]
      4. div-inv60.8%

        \[\leadsto \color{blue}{\left(1 \cdot 1 - \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)}} \]
      5. metadata-eval60.8%

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

        \[\leadsto \left(1 - \color{blue}{{\left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)}^{2}}\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)} \]
      7. *-commutative60.8%

        \[\leadsto \left(1 - {\color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\right)}}^{2}\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)} \]
      8. associate-*l*60.8%

        \[\leadsto \left(1 - {\color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}}^{2}\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)} \]
      9. *-commutative60.8%

        \[\leadsto \left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - \color{blue}{\left(0.16666666666666666 \cdot y\right) \cdot y}} \]
      10. associate-*l*60.8%

        \[\leadsto \left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)}} \]
    9. Applied egg-rr60.8%

      \[\leadsto \color{blue}{\left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}} \]
    10. Step-by-step derivation
      1. unpow260.8%

        \[\leadsto \left(1 - \color{blue}{\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)} \]
      2. associate-*r*60.8%

        \[\leadsto \left(1 - \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\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)} \]
      3. associate-*r*60.8%

        \[\leadsto \left(1 - \left(\left(0.16666666666666666 \cdot y\right) \cdot y\right) \cdot \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\right)}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      4. swap-sqr60.8%

        \[\leadsto \left(1 - \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      5. *-commutative60.8%

        \[\leadsto \left(1 - \left(\color{blue}{\left(y \cdot 0.16666666666666666\right)} \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      6. *-commutative60.8%

        \[\leadsto \left(1 - \left(\left(y \cdot 0.16666666666666666\right) \cdot \color{blue}{\left(y \cdot 0.16666666666666666\right)}\right) \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      7. swap-sqr60.8%

        \[\leadsto \left(1 - \color{blue}{\left(\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot 0.16666666666666666\right)\right)} \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      8. metadata-eval60.8%

        \[\leadsto \left(1 - \left(\left(y \cdot y\right) \cdot \color{blue}{0.027777777777777776}\right) \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
    11. Applied egg-rr60.8%

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

    if -2.49999999999999988e67 < y < -9e7 or 440 < y < 5.2e52

    1. Initial program 100.0%

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

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

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified3.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 3.7%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, {y}^{2}, -0.08333333333333333 \cdot \left({y}^{2} \cdot {x}^{2}\right)\right)} \]
      2. unpow240.5%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, \color{blue}{y \cdot y}, -0.08333333333333333 \cdot \left({y}^{2} \cdot {x}^{2}\right)\right) \]
      3. unpow240.5%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot {x}^{2}\right)\right) \]
      4. *-commutative40.5%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \color{blue}{\left({x}^{2} \cdot \left(y \cdot y\right)\right)}\right) \]
      5. unpow240.5%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot \left(y \cdot y\right)\right)\right) \]
    10. Simplified40.5%

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

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

        \[\leadsto 0.16666666666666666 \cdot \left(y \cdot y\right) + \color{blue}{\left(-0.08333333333333333 \cdot \left(x \cdot x\right)\right) \cdot \left(y \cdot y\right)} \]
      3. distribute-rgt-out40.5%

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(0.16666666666666666 + \color{blue}{\left(-0.08333333333333333 \cdot x\right) \cdot x}\right) \]
    12. Applied egg-rr40.5%

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

    if -9e7 < y < 440

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto \color{blue}{\cos x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification80.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\ \;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{+67}:\\ \;\;\;\;\left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\\ \mathbf{elif}\;y \leq -90000000:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\ \mathbf{elif}\;y \leq 440:\\ \;\;\;\;\cos x\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\ \end{array} \]

Alternative 8: 56.1% accurate, 6.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\ t_1 := \left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\ t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_0}\\ \mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{+67}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{-24}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 215:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* y y)))
        (t_1
         (* (* y y) (+ 0.16666666666666666 (* x (* x -0.08333333333333333)))))
        (t_2
         (*
          (- 1.0 (* (* y y) (* (* y y) 0.027777777777777776)))
          (/ 1.0 (- 1.0 t_0)))))
   (if (<= y -1.4e+154)
     t_0
     (if (<= y -2.5e+67)
       t_2
       (if (<= y -6.8e-24)
         t_1
         (if (<= y 215.0)
           t_2
           (if (<= y 5.2e+52) t_1 (if (<= y 1.4e+154) t_2 t_0))))))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (y * y);
	double t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
	double t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_0));
	double tmp;
	if (y <= -1.4e+154) {
		tmp = t_0;
	} else if (y <= -2.5e+67) {
		tmp = t_2;
	} else if (y <= -6.8e-24) {
		tmp = t_1;
	} else if (y <= 215.0) {
		tmp = t_2;
	} else if (y <= 5.2e+52) {
		tmp = t_1;
	} else if (y <= 1.4e+154) {
		tmp = t_2;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = 0.16666666666666666d0 * (y * y)
    t_1 = (y * y) * (0.16666666666666666d0 + (x * (x * (-0.08333333333333333d0))))
    t_2 = (1.0d0 - ((y * y) * ((y * y) * 0.027777777777777776d0))) * (1.0d0 / (1.0d0 - t_0))
    if (y <= (-1.4d+154)) then
        tmp = t_0
    else if (y <= (-2.5d+67)) then
        tmp = t_2
    else if (y <= (-6.8d-24)) then
        tmp = t_1
    else if (y <= 215.0d0) then
        tmp = t_2
    else if (y <= 5.2d+52) then
        tmp = t_1
    else if (y <= 1.4d+154) then
        tmp = t_2
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (y * y);
	double t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
	double t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_0));
	double tmp;
	if (y <= -1.4e+154) {
		tmp = t_0;
	} else if (y <= -2.5e+67) {
		tmp = t_2;
	} else if (y <= -6.8e-24) {
		tmp = t_1;
	} else if (y <= 215.0) {
		tmp = t_2;
	} else if (y <= 5.2e+52) {
		tmp = t_1;
	} else if (y <= 1.4e+154) {
		tmp = t_2;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = 0.16666666666666666 * (y * y)
	t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)))
	t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_0))
	tmp = 0
	if y <= -1.4e+154:
		tmp = t_0
	elif y <= -2.5e+67:
		tmp = t_2
	elif y <= -6.8e-24:
		tmp = t_1
	elif y <= 215.0:
		tmp = t_2
	elif y <= 5.2e+52:
		tmp = t_1
	elif y <= 1.4e+154:
		tmp = t_2
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(y * y))
	t_1 = Float64(Float64(y * y) * Float64(0.16666666666666666 + Float64(x * Float64(x * -0.08333333333333333))))
	t_2 = Float64(Float64(1.0 - Float64(Float64(y * y) * Float64(Float64(y * y) * 0.027777777777777776))) * Float64(1.0 / Float64(1.0 - t_0)))
	tmp = 0.0
	if (y <= -1.4e+154)
		tmp = t_0;
	elseif (y <= -2.5e+67)
		tmp = t_2;
	elseif (y <= -6.8e-24)
		tmp = t_1;
	elseif (y <= 215.0)
		tmp = t_2;
	elseif (y <= 5.2e+52)
		tmp = t_1;
	elseif (y <= 1.4e+154)
		tmp = t_2;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 0.16666666666666666 * (y * y);
	t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
	t_2 = (1.0 - ((y * y) * ((y * y) * 0.027777777777777776))) * (1.0 / (1.0 - t_0));
	tmp = 0.0;
	if (y <= -1.4e+154)
		tmp = t_0;
	elseif (y <= -2.5e+67)
		tmp = t_2;
	elseif (y <= -6.8e-24)
		tmp = t_1;
	elseif (y <= 215.0)
		tmp = t_2;
	elseif (y <= 5.2e+52)
		tmp = t_1;
	elseif (y <= 1.4e+154)
		tmp = t_2;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * y), $MachinePrecision] * N[(0.16666666666666666 + N[(x * N[(x * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 - N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+154], t$95$0, If[LessEqual[y, -2.5e+67], t$95$2, If[LessEqual[y, -6.8e-24], t$95$1, If[LessEqual[y, 215.0], t$95$2, If[LessEqual[y, 5.2e+52], t$95$1, If[LessEqual[y, 1.4e+154], t$95$2, t$95$0]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_1 := \left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\
t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_0}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq -2.5 \cdot 10^{+67}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -6.8 \cdot 10^{-24}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 215:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.4e154 or 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) \]
    7. Simplified100.0%

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

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

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

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

    if -1.4e154 < y < -2.49999999999999988e67 or -6.79999999999999985e-24 < y < 215 or 5.2e52 < y < 1.4e154

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(1 \cdot 1 - \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)}} \]
      5. metadata-eval55.2%

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

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

        \[\leadsto \left(1 - {\color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\right)}}^{2}\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)} \]
      8. associate-*l*55.2%

        \[\leadsto \left(1 - {\color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}}^{2}\right) \cdot \frac{1}{1 - y \cdot \left(0.16666666666666666 \cdot y\right)} \]
      9. *-commutative55.2%

        \[\leadsto \left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - \color{blue}{\left(0.16666666666666666 \cdot y\right) \cdot y}} \]
      10. associate-*l*55.2%

        \[\leadsto \left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)}} \]
    9. Applied egg-rr55.2%

      \[\leadsto \color{blue}{\left(1 - {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{2}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}} \]
    10. Step-by-step derivation
      1. unpow255.2%

        \[\leadsto \left(1 - \color{blue}{\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)} \]
      2. associate-*r*55.2%

        \[\leadsto \left(1 - \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\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)} \]
      3. associate-*r*55.2%

        \[\leadsto \left(1 - \left(\left(0.16666666666666666 \cdot y\right) \cdot y\right) \cdot \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot y\right)}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      4. swap-sqr55.2%

        \[\leadsto \left(1 - \color{blue}{\left(\left(0.16666666666666666 \cdot y\right) \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot y\right)}\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
      5. *-commutative55.2%

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

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

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

        \[\leadsto \left(1 - \left(\left(y \cdot y\right) \cdot \color{blue}{0.027777777777777776}\right) \cdot \left(y \cdot y\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)} \]
    11. Applied egg-rr55.2%

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

    if -2.49999999999999988e67 < y < -6.79999999999999985e-24 or 215 < y < 5.2e52

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, \color{blue}{y \cdot y}, -0.08333333333333333 \cdot \left({y}^{2} \cdot {x}^{2}\right)\right) \]
      3. unpow234.7%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot {x}^{2}\right)\right) \]
      4. *-commutative34.7%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \color{blue}{\left({x}^{2} \cdot \left(y \cdot y\right)\right)}\right) \]
      5. unpow234.7%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot \left(y \cdot y\right)\right)\right) \]
    10. Simplified34.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(\left(x \cdot x\right) \cdot \left(y \cdot y\right)\right)\right)} \]
    11. Step-by-step derivation
      1. fma-udef34.7%

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

        \[\leadsto 0.16666666666666666 \cdot \left(y \cdot y\right) + \color{blue}{\left(-0.08333333333333333 \cdot \left(x \cdot x\right)\right) \cdot \left(y \cdot y\right)} \]
      3. distribute-rgt-out34.7%

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(0.16666666666666666 + \color{blue}{\left(-0.08333333333333333 \cdot x\right) \cdot x}\right) \]
    12. Applied egg-rr34.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+154}:\\ \;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{+67}:\\ \;\;\;\;\left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{-24}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\ \mathbf{elif}\;y \leq 215:\\ \;\;\;\;\left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+52}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\ \end{array} \]

Alternative 9: 50.5% accurate, 10.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\ t_1 := \left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\ \mathbf{if}\;y \leq -6.8 \cdot 10^{-24}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 230:\\ \;\;\;\;1 + t_0\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+168} \lor \neg \left(y \leq 2 \cdot 10^{+261}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* y y)))
        (t_1
         (* (* y y) (+ 0.16666666666666666 (* x (* x -0.08333333333333333))))))
   (if (<= y -6.8e-24)
     t_1
     (if (<= y 230.0)
       (+ 1.0 t_0)
       (if (or (<= y 1.5e+168) (not (<= y 2e+261))) t_1 t_0)))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (y * y);
	double t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
	double tmp;
	if (y <= -6.8e-24) {
		tmp = t_1;
	} else if (y <= 230.0) {
		tmp = 1.0 + t_0;
	} else if ((y <= 1.5e+168) || !(y <= 2e+261)) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 0.16666666666666666d0 * (y * y)
    t_1 = (y * y) * (0.16666666666666666d0 + (x * (x * (-0.08333333333333333d0))))
    if (y <= (-6.8d-24)) then
        tmp = t_1
    else if (y <= 230.0d0) then
        tmp = 1.0d0 + t_0
    else if ((y <= 1.5d+168) .or. (.not. (y <= 2d+261))) then
        tmp = t_1
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (y * y);
	double t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
	double tmp;
	if (y <= -6.8e-24) {
		tmp = t_1;
	} else if (y <= 230.0) {
		tmp = 1.0 + t_0;
	} else if ((y <= 1.5e+168) || !(y <= 2e+261)) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = 0.16666666666666666 * (y * y)
	t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)))
	tmp = 0
	if y <= -6.8e-24:
		tmp = t_1
	elif y <= 230.0:
		tmp = 1.0 + t_0
	elif (y <= 1.5e+168) or not (y <= 2e+261):
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(y * y))
	t_1 = Float64(Float64(y * y) * Float64(0.16666666666666666 + Float64(x * Float64(x * -0.08333333333333333))))
	tmp = 0.0
	if (y <= -6.8e-24)
		tmp = t_1;
	elseif (y <= 230.0)
		tmp = Float64(1.0 + t_0);
	elseif ((y <= 1.5e+168) || !(y <= 2e+261))
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 0.16666666666666666 * (y * y);
	t_1 = (y * y) * (0.16666666666666666 + (x * (x * -0.08333333333333333)));
	tmp = 0.0;
	if (y <= -6.8e-24)
		tmp = t_1;
	elseif (y <= 230.0)
		tmp = 1.0 + t_0;
	elseif ((y <= 1.5e+168) || ~((y <= 2e+261)))
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * y), $MachinePrecision] * N[(0.16666666666666666 + N[(x * N[(x * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.8e-24], t$95$1, If[LessEqual[y, 230.0], N[(1.0 + t$95$0), $MachinePrecision], If[Or[LessEqual[y, 1.5e+168], N[Not[LessEqual[y, 2e+261]], $MachinePrecision]], t$95$1, t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_1 := \left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\
\mathbf{if}\;y \leq -6.8 \cdot 10^{-24}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 230:\\
\;\;\;\;1 + t_0\\

\mathbf{elif}\;y \leq 1.5 \cdot 10^{+168} \lor \neg \left(y \leq 2 \cdot 10^{+261}\right):\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -6.79999999999999985e-24 or 230 < y < 1.4999999999999999e168 or 1.9999999999999999e261 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, \color{blue}{y \cdot y}, -0.08333333333333333 \cdot \left({y}^{2} \cdot {x}^{2}\right)\right) \]
      3. unpow217.4%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot {x}^{2}\right)\right) \]
      4. *-commutative17.4%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \color{blue}{\left({x}^{2} \cdot \left(y \cdot y\right)\right)}\right) \]
      5. unpow217.4%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot \left(y \cdot y\right)\right)\right) \]
    10. Simplified17.4%

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

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

        \[\leadsto 0.16666666666666666 \cdot \left(y \cdot y\right) + \color{blue}{\left(-0.08333333333333333 \cdot \left(x \cdot x\right)\right) \cdot \left(y \cdot y\right)} \]
      3. distribute-rgt-out38.1%

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

        \[\leadsto \left(y \cdot y\right) \cdot \left(0.16666666666666666 + \color{blue}{\left(-0.08333333333333333 \cdot x\right) \cdot x}\right) \]
    12. Applied egg-rr38.1%

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

    if -6.79999999999999985e-24 < y < 230

    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 53.1%

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

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

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

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

    if 1.4999999999999999e168 < y < 1.9999999999999999e261

    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) \]
    7. Simplified100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.8 \cdot 10^{-24}:\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\ \mathbf{elif}\;y \leq 230:\\ \;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+168} \lor \neg \left(y \leq 2 \cdot 10^{+261}\right):\\ \;\;\;\;\left(y \cdot y\right) \cdot \left(0.16666666666666666 + x \cdot \left(x \cdot -0.08333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\ \end{array} \]

Alternative 10: 48.9% accurate, 11.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\ t_1 := -0.08333333333333333 \cdot \left(\left(y \cdot y\right) \cdot \left(x \cdot x\right)\right)\\ \mathbf{if}\;y \leq -2 \cdot 10^{+131}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{-24}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 650:\\ \;\;\;\;1 + t_0\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+168}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* y y)))
        (t_1 (* -0.08333333333333333 (* (* y y) (* x x)))))
   (if (<= y -2e+131)
     t_0
     (if (<= y -6.8e-24)
       t_1
       (if (<= y 650.0) (+ 1.0 t_0) (if (<= y 1.3e+168) t_1 t_0))))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (y * y);
	double t_1 = -0.08333333333333333 * ((y * y) * (x * x));
	double tmp;
	if (y <= -2e+131) {
		tmp = t_0;
	} else if (y <= -6.8e-24) {
		tmp = t_1;
	} else if (y <= 650.0) {
		tmp = 1.0 + t_0;
	} else if (y <= 1.3e+168) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 0.16666666666666666d0 * (y * y)
    t_1 = (-0.08333333333333333d0) * ((y * y) * (x * x))
    if (y <= (-2d+131)) then
        tmp = t_0
    else if (y <= (-6.8d-24)) then
        tmp = t_1
    else if (y <= 650.0d0) then
        tmp = 1.0d0 + t_0
    else if (y <= 1.3d+168) then
        tmp = t_1
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (y * y);
	double t_1 = -0.08333333333333333 * ((y * y) * (x * x));
	double tmp;
	if (y <= -2e+131) {
		tmp = t_0;
	} else if (y <= -6.8e-24) {
		tmp = t_1;
	} else if (y <= 650.0) {
		tmp = 1.0 + t_0;
	} else if (y <= 1.3e+168) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = 0.16666666666666666 * (y * y)
	t_1 = -0.08333333333333333 * ((y * y) * (x * x))
	tmp = 0
	if y <= -2e+131:
		tmp = t_0
	elif y <= -6.8e-24:
		tmp = t_1
	elif y <= 650.0:
		tmp = 1.0 + t_0
	elif y <= 1.3e+168:
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(y * y))
	t_1 = Float64(-0.08333333333333333 * Float64(Float64(y * y) * Float64(x * x)))
	tmp = 0.0
	if (y <= -2e+131)
		tmp = t_0;
	elseif (y <= -6.8e-24)
		tmp = t_1;
	elseif (y <= 650.0)
		tmp = Float64(1.0 + t_0);
	elseif (y <= 1.3e+168)
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 0.16666666666666666 * (y * y);
	t_1 = -0.08333333333333333 * ((y * y) * (x * x));
	tmp = 0.0;
	if (y <= -2e+131)
		tmp = t_0;
	elseif (y <= -6.8e-24)
		tmp = t_1;
	elseif (y <= 650.0)
		tmp = 1.0 + t_0;
	elseif (y <= 1.3e+168)
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.08333333333333333 * N[(N[(y * y), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e+131], t$95$0, If[LessEqual[y, -6.8e-24], t$95$1, If[LessEqual[y, 650.0], N[(1.0 + t$95$0), $MachinePrecision], If[LessEqual[y, 1.3e+168], t$95$1, t$95$0]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_1 := -0.08333333333333333 \cdot \left(\left(y \cdot y\right) \cdot \left(x \cdot x\right)\right)\\
\mathbf{if}\;y \leq -2 \cdot 10^{+131}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq -6.8 \cdot 10^{-24}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 650:\\
\;\;\;\;1 + t_0\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{+168}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.9999999999999998e131 or 1.3e168 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999998e131 < y < -6.79999999999999985e-24 or 650 < y < 1.3e168

    1. Initial program 100.0%

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

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

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified11.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 6.5%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.16666666666666666, {y}^{2}, -0.08333333333333333 \cdot \left({y}^{2} \cdot {x}^{2}\right)\right)} \]
      2. unpow227.0%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, \color{blue}{y \cdot y}, -0.08333333333333333 \cdot \left({y}^{2} \cdot {x}^{2}\right)\right) \]
      3. unpow227.0%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot {x}^{2}\right)\right) \]
      4. *-commutative27.0%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \color{blue}{\left({x}^{2} \cdot \left(y \cdot y\right)\right)}\right) \]
      5. unpow227.0%

        \[\leadsto \mathsf{fma}\left(0.16666666666666666, y \cdot y, -0.08333333333333333 \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot \left(y \cdot y\right)\right)\right) \]
    10. Simplified27.0%

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

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

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

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

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

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

    if -6.79999999999999985e-24 < y < 650

    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 53.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{+131}:\\ \;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{-24}:\\ \;\;\;\;-0.08333333333333333 \cdot \left(\left(y \cdot y\right) \cdot \left(x \cdot x\right)\right)\\ \mathbf{elif}\;y \leq 650:\\ \;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+168}:\\ \;\;\;\;-0.08333333333333333 \cdot \left(\left(y \cdot y\right) \cdot \left(x \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\ \end{array} \]

Alternative 11: 46.2% accurate, 22.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{-24} \lor \neg \left(y \leq 62000000000000\right):\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.79999999999999985e-24 or 6.2e13 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -6.79999999999999985e-24 < y < 6.2e13

    1. Initial program 100.0%

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

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

        \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    4. Simplified98.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 52.2%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification43.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.8 \cdot 10^{-24} \lor \neg \left(y \leq 62000000000000\right):\\ \;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternative 12: 47.1% accurate, 29.3× speedup?

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

\\
1 + 0.16666666666666666 \cdot \left(y \cdot y\right)
\end{array}
Derivation
  1. Initial program 100.0%

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

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

      \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
  4. Simplified73.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 43.2%

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

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

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

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

    \[\leadsto 1 + 0.16666666666666666 \cdot \left(y \cdot y\right) \]

Alternative 13: 28.1% 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. Taylor expanded in y around 0 73.4%

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

      \[\leadsto \cos x \cdot \left(1 + 0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
  4. Simplified73.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 43.2%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{1} \]
  9. Final simplification26.1%

    \[\leadsto 1 \]

Reproduce

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