Linear.Quaternion:$csin from linear-1.19.1.3

Percentage Accurate: 100.0% → 100.0%
Time: 7.8s
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, 0.7× speedup?

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

\\
\cos x \cdot {\left(\frac{y}{\sinh y}\right)}^{-1}
\end{array}
Derivation
  1. Initial program 100.0%

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

      \[\leadsto \cos x \cdot \color{blue}{\frac{1}{\frac{y}{\sinh y}}} \]
    2. inv-pow100.0%

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

    \[\leadsto \cos x \cdot \color{blue}{{\left(\frac{y}{\sinh y}\right)}^{-1}} \]
  4. Final simplification100.0%

    \[\leadsto \cos x \cdot {\left(\frac{y}{\sinh y}\right)}^{-1} \]

Alternative 2: 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 3: 82.8% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_0 := \left(y \cdot y\right) \cdot \left(y \cdot \left(y \cdot 0.027777777777777776\right)\right)\\
t_1 := \frac{-1 + t_0}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, -1\right)}\\
t_2 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_3 := -0.5 \cdot \left(x \cdot x\right)\\
\mathbf{if}\;y \leq 840:\\
\;\;\;\;\cos x \cdot \left(1 + t_2\right)\\

\mathbf{elif}\;y \leq 5.1 \cdot 10^{+76}:\\
\;\;\;\;\frac{1 + {t_2}^{3}}{\left(1 - t_2\right) + t_0} \cdot \left(1 + t_3\right)\\

\mathbf{elif}\;y \leq 2 \cdot 10^{+108}:\\
\;\;\;\;t_1\\

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

    if 840 < y < 5.1000000000000002e76

    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 x around 0 22.3%

      \[\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. +-commutative22.3%

        \[\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+22.3%

        \[\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. *-commutative22.3%

        \[\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*22.3%

        \[\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. +-commutative22.3%

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

        \[\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*22.3%

        \[\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. *-commutative22.3%

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

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

        \[\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*22.3%

        \[\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. *-commutative22.3%

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

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

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

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

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

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

      \[\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)} \]
    8. Step-by-step derivation
      1. fma-udef22.3%

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

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

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

        \[\leadsto \frac{{\left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)}^{3} + 1}{\color{blue}{\mathsf{fma}\left(y \cdot \left(0.16666666666666666 \cdot y\right), y \cdot \left(0.16666666666666666 \cdot y\right), 1 \cdot 1 - \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot 1\right)}} \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      5. metadata-eval47.9%

        \[\leadsto \frac{{\left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)}^{3} + 1}{\mathsf{fma}\left(y \cdot \left(0.16666666666666666 \cdot y\right), y \cdot \left(0.16666666666666666 \cdot y\right), \color{blue}{1} - \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot 1\right)} \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
    9. Applied egg-rr47.9%

      \[\leadsto \color{blue}{\frac{{\left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)}^{3} + 1}{\mathsf{fma}\left(y \cdot \left(0.16666666666666666 \cdot y\right), y \cdot \left(0.16666666666666666 \cdot y\right), 1 - \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot 1\right)}} \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
    10. Step-by-step derivation
      1. +-commutative47.9%

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

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

        \[\leadsto \frac{1 + {\color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}}^{3}}{\mathsf{fma}\left(y \cdot \left(0.16666666666666666 \cdot y\right), y \cdot \left(0.16666666666666666 \cdot y\right), 1 - \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot 1\right)} \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      4. fma-udef47.9%

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

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

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

        \[\leadsto \frac{1 + {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(1 - \color{blue}{\left(0.16666666666666666 \cdot y\right) \cdot y}\right) + \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)} \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      8. associate-*r*47.9%

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

        \[\leadsto \frac{1 + {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(1 - 0.16666666666666666 \cdot \left(y \cdot y\right)\right) + \color{blue}{\left(y \cdot y\right) \cdot \left(\left(0.16666666666666666 \cdot y\right) \cdot \left(0.16666666666666666 \cdot y\right)\right)}} \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      10. swap-sqr47.9%

        \[\leadsto \frac{1 + {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(1 - 0.16666666666666666 \cdot \left(y \cdot y\right)\right) + \left(y \cdot y\right) \cdot \color{blue}{\left(\left(0.16666666666666666 \cdot 0.16666666666666666\right) \cdot \left(y \cdot y\right)\right)}} \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      11. metadata-eval47.9%

        \[\leadsto \frac{1 + {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(1 - 0.16666666666666666 \cdot \left(y \cdot y\right)\right) + \left(y \cdot y\right) \cdot \left(\color{blue}{0.027777777777777776} \cdot \left(y \cdot y\right)\right)} \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      12. associate-*r*47.9%

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

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

        \[\leadsto \frac{1 + {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(1 - 0.16666666666666666 \cdot \left(y \cdot y\right)\right) + \left(y \cdot y\right) \cdot \color{blue}{\left(y \cdot \left(y \cdot 0.027777777777777776\right)\right)}} \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
    11. Simplified47.9%

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

    if 5.1000000000000002e76 < y < 2.0000000000000001e108 or 1.99999999999999987e146 < y < 1.35000000000000003e154

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot \left(0.16666666666666666 \cdot y\right), y \cdot \left(0.16666666666666666 \cdot y\right), \color{blue}{-1}\right)}{y \cdot \left(0.16666666666666666 \cdot y\right) - 1} \]
      6. fma-neg90.5%

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

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot \left(0.16666666666666666 \cdot y\right), y \cdot \left(0.16666666666666666 \cdot y\right), -1\right)}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, \color{blue}{-1}\right)} \]
    9. Applied egg-rr90.5%

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

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

        \[\leadsto \frac{\color{blue}{-1 + \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)}}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      3. swap-sqr90.5%

        \[\leadsto \frac{-1 + \color{blue}{\left(y \cdot y\right) \cdot \left(\left(0.16666666666666666 \cdot y\right) \cdot \left(0.16666666666666666 \cdot y\right)\right)}}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      4. swap-sqr90.5%

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

        \[\leadsto \frac{-1 + \left(y \cdot y\right) \cdot \left(\color{blue}{0.027777777777777776} \cdot \left(y \cdot y\right)\right)}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      6. associate-*r*90.5%

        \[\leadsto \frac{-1 + \left(y \cdot y\right) \cdot \color{blue}{\left(\left(0.027777777777777776 \cdot y\right) \cdot y\right)}}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      7. *-commutative90.5%

        \[\leadsto \frac{-1 + \left(y \cdot y\right) \cdot \left(\color{blue}{\left(y \cdot 0.027777777777777776\right)} \cdot y\right)}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      8. *-commutative90.5%

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

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

    if 2.0000000000000001e108 < y < 1.99999999999999987e146

    1. Initial program 100.0%

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

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

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

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

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

        \[\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+32.5%

        \[\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. *-commutative32.5%

        \[\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*32.5%

        \[\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. +-commutative32.5%

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

        \[\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*32.5%

        \[\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. *-commutative32.5%

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

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

        \[\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*32.5%

        \[\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. *-commutative32.5%

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

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

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

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

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

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

      \[\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)} \]
    8. Step-by-step derivation
      1. fma-udef4.8%

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot \left(0.16666666666666666 \cdot y\right), y \cdot \left(0.16666666666666666 \cdot y\right), -1\right)}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, \color{blue}{-1}\right)} \]
    9. Applied egg-rr85.7%

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

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

        \[\leadsto \frac{\color{blue}{-1 + \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)}}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      3. swap-sqr71.4%

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

        \[\leadsto \frac{-1 + \left(y \cdot y\right) \cdot \color{blue}{\left(\left(0.16666666666666666 \cdot 0.16666666666666666\right) \cdot \left(y \cdot y\right)\right)}}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      5. metadata-eval71.4%

        \[\leadsto \frac{-1 + \left(y \cdot y\right) \cdot \left(\color{blue}{0.027777777777777776} \cdot \left(y \cdot y\right)\right)}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      6. associate-*r*71.4%

        \[\leadsto \frac{-1 + \left(y \cdot y\right) \cdot \color{blue}{\left(\left(0.027777777777777776 \cdot y\right) \cdot y\right)}}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      7. *-commutative71.4%

        \[\leadsto \frac{-1 + \left(y \cdot y\right) \cdot \left(\color{blue}{\left(y \cdot 0.027777777777777776\right)} \cdot y\right)}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      8. *-commutative71.4%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{-1 + \left(y \cdot y\right) \cdot \left(y \cdot \left(y \cdot 0.027777777777777776\right)\right)}{-\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)}\right)} \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      3. associate-*r*85.7%

        \[\leadsto \left(-\frac{-1 + \left(y \cdot y\right) \cdot \color{blue}{\left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)}}{-\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)}\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      4. associate-*r*85.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\frac{-1 + 0.027777777777777776 \cdot {y}^{\color{blue}{4}}}{-\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)}\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      15. fma-udef85.7%

        \[\leadsto \left(-\frac{-1 + 0.027777777777777776 \cdot {y}^{4}}{-\color{blue}{\left(y \cdot \left(0.16666666666666666 \cdot y\right) + -1\right)}}\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      16. *-commutative85.7%

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

        \[\leadsto \left(-\frac{-1 + 0.027777777777777776 \cdot {y}^{4}}{-\left(\color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)} + -1\right)}\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      18. distribute-neg-in85.7%

        \[\leadsto \left(-\frac{-1 + 0.027777777777777776 \cdot {y}^{4}}{\color{blue}{\left(-0.16666666666666666 \cdot \left(y \cdot y\right)\right) + \left(--1\right)}}\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
    13. Applied egg-rr85.7%

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

    if 1.35000000000000003e154 < 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)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification85.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 840:\\ \;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 5.1 \cdot 10^{+76}:\\ \;\;\;\;\frac{1 + {\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}^{3}}{\left(1 - 0.16666666666666666 \cdot \left(y \cdot y\right)\right) + \left(y \cdot y\right) \cdot \left(y \cdot \left(y \cdot 0.027777777777777776\right)\right)} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right)\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+108}:\\ \;\;\;\;\frac{-1 + \left(y \cdot y\right) \cdot \left(y \cdot \left(y \cdot 0.027777777777777776\right)\right)}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, -1\right)}\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+146}:\\ \;\;\;\;\frac{-1 + 0.027777777777777776 \cdot {y}^{4}}{1 + \left(y \cdot y\right) \cdot -0.16666666666666666} \cdot \left(-1 - -0.5 \cdot \left(x \cdot x\right)\right)\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{-1 + \left(y \cdot y\right) \cdot \left(y \cdot \left(y \cdot 0.027777777777777776\right)\right)}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, -1\right)}\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 4: 81.8% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
t_0 := -0.5 \cdot \left(x \cdot x\right)\\
t_1 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 840:\\
\;\;\;\;\cos x \cdot \left(1 + t_1\right)\\

\mathbf{elif}\;y \leq 5.1 \cdot 10^{+76}:\\
\;\;\;\;t_1 \cdot \left(1 + t_0\right)\\

\mathbf{elif}\;y \leq 1.05 \cdot 10^{+110}:\\
\;\;\;\;\frac{-1 + \left(y \cdot y\right) \cdot \left(y \cdot \left(y \cdot 0.027777777777777776\right)\right)}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, -1\right)}\\

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

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


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

    1. Initial program 100.0%

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

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

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

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

    if 840 < y < 5.1000000000000002e76

    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 x around 0 22.3%

      \[\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. +-commutative22.3%

        \[\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+22.3%

        \[\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. *-commutative22.3%

        \[\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*22.3%

        \[\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. +-commutative22.3%

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

        \[\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*22.3%

        \[\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. *-commutative22.3%

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

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

        \[\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*22.3%

        \[\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. *-commutative22.3%

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

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

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

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

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

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

      \[\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)} \]
    8. Taylor expanded in y around inf 22.3%

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

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

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

    if 5.1000000000000002e76 < y < 1.05000000000000007e110

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot \left(0.16666666666666666 \cdot y\right), y \cdot \left(0.16666666666666666 \cdot y\right), \color{blue}{-1}\right)}{y \cdot \left(0.16666666666666666 \cdot y\right) - 1} \]
      6. fma-neg88.1%

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

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

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

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

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

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

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

        \[\leadsto \frac{-1 + \left(y \cdot y\right) \cdot \left(\color{blue}{0.027777777777777776} \cdot \left(y \cdot y\right)\right)}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      6. associate-*r*88.1%

        \[\leadsto \frac{-1 + \left(y \cdot y\right) \cdot \color{blue}{\left(\left(0.027777777777777776 \cdot y\right) \cdot y\right)}}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      7. *-commutative88.1%

        \[\leadsto \frac{-1 + \left(y \cdot y\right) \cdot \left(\color{blue}{\left(y \cdot 0.027777777777777776\right)} \cdot y\right)}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      8. *-commutative88.1%

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

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

    if 1.05000000000000007e110 < y < 1.35000000000000003e154

    1. Initial program 100.0%

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

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

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

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

      \[\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. +-commutative28.3%

        \[\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+28.3%

        \[\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. *-commutative28.3%

        \[\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*28.3%

        \[\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. +-commutative28.3%

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

        \[\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*28.3%

        \[\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. *-commutative28.3%

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

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

        \[\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*28.3%

        \[\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. *-commutative28.3%

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

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

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

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

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

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

      \[\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)} \]
    8. Step-by-step derivation
      1. fma-udef6.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y \cdot \left(0.16666666666666666 \cdot y\right), y \cdot \left(0.16666666666666666 \cdot y\right), -1\right)}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)}} \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
    10. Step-by-step derivation
      1. fma-udef77.8%

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

        \[\leadsto \frac{\color{blue}{-1 + \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)}}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      3. swap-sqr77.8%

        \[\leadsto \frac{-1 + \color{blue}{\left(y \cdot y\right) \cdot \left(\left(0.16666666666666666 \cdot y\right) \cdot \left(0.16666666666666666 \cdot y\right)\right)}}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      4. swap-sqr77.8%

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

        \[\leadsto \frac{-1 + \left(y \cdot y\right) \cdot \left(\color{blue}{0.027777777777777776} \cdot \left(y \cdot y\right)\right)}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      6. associate-*r*77.8%

        \[\leadsto \frac{-1 + \left(y \cdot y\right) \cdot \color{blue}{\left(\left(0.027777777777777776 \cdot y\right) \cdot y\right)}}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      7. *-commutative77.8%

        \[\leadsto \frac{-1 + \left(y \cdot y\right) \cdot \left(\color{blue}{\left(y \cdot 0.027777777777777776\right)} \cdot y\right)}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      8. *-commutative77.8%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{-1 + \left(y \cdot y\right) \cdot \left(y \cdot \left(y \cdot 0.027777777777777776\right)\right)}{-\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)}\right)} \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      3. associate-*r*88.9%

        \[\leadsto \left(-\frac{-1 + \left(y \cdot y\right) \cdot \color{blue}{\left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)}}{-\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)}\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      4. associate-*r*88.9%

        \[\leadsto \left(-\frac{-1 + \color{blue}{\left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot 0.027777777777777776}}{-\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)}\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      5. metadata-eval88.9%

        \[\leadsto \left(-\frac{-1 + \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \color{blue}{\left(0.16666666666666666 \cdot 0.16666666666666666\right)}}{-\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)}\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      6. swap-sqr88.9%

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

        \[\leadsto \left(-\frac{-1 + \color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)}{-\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)}\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      8. *-commutative88.9%

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

        \[\leadsto \left(-\frac{-1 + \color{blue}{\left(0.16666666666666666 \cdot 0.16666666666666666\right) \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)}}{-\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)}\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      10. metadata-eval88.9%

        \[\leadsto \left(-\frac{-1 + \color{blue}{0.027777777777777776} \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)}{-\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)}\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      11. pow288.9%

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

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

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

        \[\leadsto \left(-\frac{-1 + 0.027777777777777776 \cdot {y}^{\color{blue}{4}}}{-\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)}\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      15. fma-udef88.9%

        \[\leadsto \left(-\frac{-1 + 0.027777777777777776 \cdot {y}^{4}}{-\color{blue}{\left(y \cdot \left(0.16666666666666666 \cdot y\right) + -1\right)}}\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      16. *-commutative88.9%

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

        \[\leadsto \left(-\frac{-1 + 0.027777777777777776 \cdot {y}^{4}}{-\left(\color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)} + -1\right)}\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
      18. distribute-neg-in88.9%

        \[\leadsto \left(-\frac{-1 + 0.027777777777777776 \cdot {y}^{4}}{\color{blue}{\left(-0.16666666666666666 \cdot \left(y \cdot y\right)\right) + \left(--1\right)}}\right) \cdot \left(-0.5 \cdot \left(x \cdot x\right) + 1\right) \]
    13. Applied egg-rr88.9%

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

    if 1.35000000000000003e154 < 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)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification83.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 840:\\ \;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 5.1 \cdot 10^{+76}:\\ \;\;\;\;\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right)\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+110}:\\ \;\;\;\;\frac{-1 + \left(y \cdot y\right) \cdot \left(y \cdot \left(y \cdot 0.027777777777777776\right)\right)}{\mathsf{fma}\left(y, y \cdot 0.16666666666666666, -1\right)}\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{-1 + 0.027777777777777776 \cdot {y}^{4}}{1 + \left(y \cdot y\right) \cdot -0.16666666666666666} \cdot \left(-1 - -0.5 \cdot \left(x \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 5: 81.8% accurate, 1.7× speedup?

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

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

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

    if 840 < y < 5.1000000000000002e76

    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 x around 0 22.3%

      \[\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. +-commutative22.3%

        \[\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+22.3%

        \[\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. *-commutative22.3%

        \[\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*22.3%

        \[\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. +-commutative22.3%

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

        \[\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*22.3%

        \[\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. *-commutative22.3%

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

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

        \[\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*22.3%

        \[\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. *-commutative22.3%

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

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

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

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

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

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

      \[\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)} \]
    8. Taylor expanded in y around inf 22.3%

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

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

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

    if 5.1000000000000002e76 < y < 1.35000000000000003e154

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot \left(0.16666666666666666 \cdot y\right), y \cdot \left(0.16666666666666666 \cdot y\right), \color{blue}{-1}\right)}{y \cdot \left(0.16666666666666666 \cdot y\right) - 1} \]
      6. fma-neg82.6%

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

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot \left(0.16666666666666666 \cdot y\right), y \cdot \left(0.16666666666666666 \cdot y\right), -1\right)}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, \color{blue}{-1}\right)} \]
    9. Applied egg-rr82.6%

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

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

        \[\leadsto \frac{\color{blue}{-1 + \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(y \cdot \left(0.16666666666666666 \cdot y\right)\right)}}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      3. swap-sqr82.6%

        \[\leadsto \frac{-1 + \color{blue}{\left(y \cdot y\right) \cdot \left(\left(0.16666666666666666 \cdot y\right) \cdot \left(0.16666666666666666 \cdot y\right)\right)}}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      4. swap-sqr82.6%

        \[\leadsto \frac{-1 + \left(y \cdot y\right) \cdot \color{blue}{\left(\left(0.16666666666666666 \cdot 0.16666666666666666\right) \cdot \left(y \cdot y\right)\right)}}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      5. metadata-eval82.6%

        \[\leadsto \frac{-1 + \left(y \cdot y\right) \cdot \left(\color{blue}{0.027777777777777776} \cdot \left(y \cdot y\right)\right)}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      6. associate-*r*82.6%

        \[\leadsto \frac{-1 + \left(y \cdot y\right) \cdot \color{blue}{\left(\left(0.027777777777777776 \cdot y\right) \cdot y\right)}}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      7. *-commutative82.6%

        \[\leadsto \frac{-1 + \left(y \cdot y\right) \cdot \left(\color{blue}{\left(y \cdot 0.027777777777777776\right)} \cdot y\right)}{\mathsf{fma}\left(y, 0.16666666666666666 \cdot y, -1\right)} \]
      8. *-commutative82.6%

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

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

    if 1.35000000000000003e154 < 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)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification83.2%

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

Alternative 6: 65.6% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 840:\\
\;\;\;\;\cos x\\

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

    if 840 < y < 1.6000000000000001e149

    1. Initial program 100.0%

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

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

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

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

      \[\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. +-commutative19.3%

        \[\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+19.3%

        \[\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. *-commutative19.3%

        \[\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*19.3%

        \[\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. +-commutative19.3%

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

        \[\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*19.3%

        \[\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. *-commutative19.3%

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

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

        \[\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*19.3%

        \[\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. *-commutative19.3%

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

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

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

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

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

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

      \[\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)} \]
    8. Taylor expanded in y around inf 19.3%

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

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

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

    if 1.6000000000000001e149 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 840:\\ \;\;\;\;\cos x\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+149}:\\ \;\;\;\;\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 7: 78.6% accurate, 1.8× speedup?

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

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

    if 840 < y < 1.6000000000000001e149

    1. Initial program 100.0%

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

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

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

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

      \[\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. +-commutative19.3%

        \[\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+19.3%

        \[\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. *-commutative19.3%

        \[\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*19.3%

        \[\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. +-commutative19.3%

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

        \[\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*19.3%

        \[\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. *-commutative19.3%

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

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

        \[\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*19.3%

        \[\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. *-commutative19.3%

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

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

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

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

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

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

      \[\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)} \]
    8. Taylor expanded in y around inf 19.3%

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

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

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

    if 1.6000000000000001e149 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 840:\\ \;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+149}:\\ \;\;\;\;\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 8: 62.9% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 840:\\
\;\;\;\;\cos x\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

    if 840 < y

    1. Initial program 100.0%

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

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

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

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

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

        \[\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. *-commutative8.9%

        \[\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*8.9%

        \[\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. +-commutative8.9%

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

        \[\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*8.9%

        \[\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. *-commutative8.9%

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

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

        \[\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*8.9%

        \[\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. *-commutative8.9%

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

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

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

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

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

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

      \[\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)} \]
    8. Taylor expanded in y around inf 53.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 840:\\ \;\;\;\;\cos x\\ \mathbf{else}:\\ \;\;\;\;\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right)\\ \end{array} \]

Alternative 9: 49.2% accurate, 13.6× speedup?

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

\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq 840:\\
\;\;\;\;1 + t_0\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if 840 < y

    1. Initial program 100.0%

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

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

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

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

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

        \[\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. *-commutative8.9%

        \[\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*8.9%

        \[\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. +-commutative8.9%

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

        \[\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*8.9%

        \[\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. *-commutative8.9%

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

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

        \[\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*8.9%

        \[\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. *-commutative8.9%

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

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

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

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

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

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

      \[\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)} \]
    8. Taylor expanded in y around inf 53.0%

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

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

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

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

Alternative 10: 48.2% accurate, 18.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1700000000000:\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.7e12

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if 1.7e12 < x

    1. Initial program 100.0%

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

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

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

      \[\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. +-commutative9.3%

        \[\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+9.3%

        \[\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. *-commutative9.3%

        \[\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*9.3%

        \[\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. +-commutative9.3%

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

        \[\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*9.3%

        \[\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. *-commutative9.3%

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

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

        \[\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*9.3%

        \[\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. *-commutative9.3%

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

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

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

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

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

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

      \[\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)} \]
    8. Taylor expanded in y around inf 20.6%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 37.3% accurate, 29.0× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 46.5% 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 77.1%

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

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

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

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

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

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

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

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

Alternative 13: 28.3% 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 77.1%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto 1 \]

Reproduce

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