Linear.Quaternion:$csin from linear-1.19.1.3

Percentage Accurate: 100.0% → 100.0%
Time: 10.4s
Alternatives: 14
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 14 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 84.2% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 0.15:\\ \;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 10^{+77}:\\ \;\;\;\;\frac{\sinh y}{y}\\ \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} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 0.15)
   (* (cos x) (+ 1.0 (* 0.16666666666666666 (* y y))))
   (if (<= y 1e+77)
     (/ (sinh y) y)
     (if (<= y 1.35e+154)
       (*
        (/
         (- 1.0 (* 0.027777777777777776 (pow y 4.0)))
         (+ 1.0 (* (* y y) -0.16666666666666666)))
        (+ 1.0 (* -0.5 (* x x))))
       (* 0.16666666666666666 (* (cos x) (* y y)))))))
double code(double x, double y) {
	double tmp;
	if (y <= 0.15) {
		tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
	} else if (y <= 1e+77) {
		tmp = sinh(y) / y;
	} else if (y <= 1.35e+154) {
		tmp = ((1.0 - (0.027777777777777776 * pow(y, 4.0))) / (1.0 + ((y * y) * -0.16666666666666666))) * (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 <= 0.15d0) then
        tmp = cos(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
    else if (y <= 1d+77) then
        tmp = sinh(y) / y
    else if (y <= 1.35d+154) then
        tmp = ((1.0d0 - (0.027777777777777776d0 * (y ** 4.0d0))) / (1.0d0 + ((y * y) * (-0.16666666666666666d0)))) * (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 <= 0.15) {
		tmp = Math.cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
	} else if (y <= 1e+77) {
		tmp = Math.sinh(y) / y;
	} else if (y <= 1.35e+154) {
		tmp = ((1.0 - (0.027777777777777776 * Math.pow(y, 4.0))) / (1.0 + ((y * y) * -0.16666666666666666))) * (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 <= 0.15:
		tmp = math.cos(x) * (1.0 + (0.16666666666666666 * (y * y)))
	elif y <= 1e+77:
		tmp = math.sinh(y) / y
	elif y <= 1.35e+154:
		tmp = ((1.0 - (0.027777777777777776 * math.pow(y, 4.0))) / (1.0 + ((y * y) * -0.16666666666666666))) * (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 <= 0.15)
		tmp = Float64(cos(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))));
	elseif (y <= 1e+77)
		tmp = Float64(sinh(y) / y);
	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 + 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 <= 0.15)
		tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
	elseif (y <= 1e+77)
		tmp = sinh(y) / y;
	elseif (y <= 1.35e+154)
		tmp = ((1.0 - (0.027777777777777776 * (y ^ 4.0))) / (1.0 + ((y * y) * -0.16666666666666666))) * (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, 0.15], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+77], N[(N[Sinh[y], $MachinePrecision] / y), $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 + 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 0.15:\\
\;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\

\mathbf{elif}\;y \leq 10^{+77}:\\
\;\;\;\;\frac{\sinh y}{y}\\

\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}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 0.149999999999999994

    1. Initial program 100.0%

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

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

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

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

    if 0.149999999999999994 < y < 9.99999999999999983e76

    1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\frac{\sinh y}{y} \cdot \cos x} \]
      2. associate-/r/100.0%

        \[\leadsto \color{blue}{\frac{\sinh y}{\frac{y}{\cos x}}} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\sinh y}{\frac{y}{\cos x}}} \]
    4. Taylor expanded in x around 0 78.9%

      \[\leadsto \frac{\sinh y}{\color{blue}{y}} \]

    if 9.99999999999999983e76 < y < 1.35000000000000003e154

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{y \cdot \left(0.16666666666666666 \cdot y\right)} + 1\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      4. +-lft-identity21.6%

        \[\leadsto \left(\color{blue}{\left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)} + 1\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      5. +-commutative21.6%

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

        \[\leadsto \color{blue}{\frac{1 \cdot 1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      7. metadata-eval77.8%

        \[\leadsto \frac{\color{blue}{1} - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      8. div-sub77.8%

        \[\leadsto \color{blue}{\left(\frac{1}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)} - \frac{\left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}\right)} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      9. +-lft-identity77.8%

        \[\leadsto \left(\frac{1}{1 - \color{blue}{y \cdot \left(0.16666666666666666 \cdot y\right)}} - \frac{\left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      10. *-commutative77.8%

        \[\leadsto \left(\frac{1}{1 - \color{blue}{\left(0.16666666666666666 \cdot y\right) \cdot y}} - \frac{\left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      11. associate-*r*77.8%

        \[\leadsto \left(\frac{1}{1 - \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)}} - \frac{\left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      12. pow277.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\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) \]

    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({y}^{2} \cdot \cos x\right)} \]
    6. Step-by-step derivation
      1. unpow2100.0%

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

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(\cos x \cdot \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 simplification82.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 0.15:\\ \;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 10^{+77}:\\ \;\;\;\;\frac{\sinh y}{y}\\ \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 3: 71.7% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 0.085:\\ \;\;\;\;\cos x\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{\sinh y}{y}\\ \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 0.085)
   (cos x)
   (if (<= y 1.35e+154)
     (/ (sinh y) y)
     (* 0.16666666666666666 (* (cos x) (* y y))))))
double code(double x, double y) {
	double tmp;
	if (y <= 0.085) {
		tmp = cos(x);
	} else if (y <= 1.35e+154) {
		tmp = sinh(y) / y;
	} 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 <= 0.085d0) then
        tmp = cos(x)
    else if (y <= 1.35d+154) then
        tmp = sinh(y) / y
    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 <= 0.085) {
		tmp = Math.cos(x);
	} else if (y <= 1.35e+154) {
		tmp = Math.sinh(y) / y;
	} else {
		tmp = 0.16666666666666666 * (Math.cos(x) * (y * y));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 0.085:
		tmp = math.cos(x)
	elif y <= 1.35e+154:
		tmp = math.sinh(y) / y
	else:
		tmp = 0.16666666666666666 * (math.cos(x) * (y * y))
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 0.085)
		tmp = cos(x);
	elseif (y <= 1.35e+154)
		tmp = Float64(sinh(y) / y);
	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 <= 0.085)
		tmp = cos(x);
	elseif (y <= 1.35e+154)
		tmp = sinh(y) / y;
	else
		tmp = 0.16666666666666666 * (cos(x) * (y * y));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 0.085], N[Cos[x], $MachinePrecision], If[LessEqual[y, 1.35e+154], N[(N[Sinh[y], $MachinePrecision] / y), $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 0.085:\\
\;\;\;\;\cos x\\

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

\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 < 0.0850000000000000061

    1. Initial program 100.0%

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

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

    if 0.0850000000000000061 < y < 1.35000000000000003e154

    1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\frac{\sinh y}{y} \cdot \cos x} \]
      2. associate-/r/100.0%

        \[\leadsto \color{blue}{\frac{\sinh y}{\frac{y}{\cos x}}} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\sinh y}{\frac{y}{\cos x}}} \]
    4. Taylor expanded in x around 0 78.4%

      \[\leadsto \frac{\sinh y}{\color{blue}{y}} \]

    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({y}^{2} \cdot \cos x\right)} \]
    6. Step-by-step derivation
      1. unpow2100.0%

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

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(\cos x \cdot \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 3 regimes into one program.
  4. Final simplification67.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 0.085:\\ \;\;\;\;\cos x\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{\sinh y}{y}\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 4: 84.6% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 0.185:\\ \;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{\sinh y}{y}\\ \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 0.185)
   (* (cos x) (+ 1.0 (* 0.16666666666666666 (* y y))))
   (if (<= y 1.35e+154)
     (/ (sinh y) y)
     (* 0.16666666666666666 (* (cos x) (* y y))))))
double code(double x, double y) {
	double tmp;
	if (y <= 0.185) {
		tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
	} else if (y <= 1.35e+154) {
		tmp = sinh(y) / y;
	} 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 <= 0.185d0) then
        tmp = cos(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
    else if (y <= 1.35d+154) then
        tmp = sinh(y) / y
    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 <= 0.185) {
		tmp = Math.cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
	} else if (y <= 1.35e+154) {
		tmp = Math.sinh(y) / y;
	} else {
		tmp = 0.16666666666666666 * (Math.cos(x) * (y * y));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 0.185:
		tmp = math.cos(x) * (1.0 + (0.16666666666666666 * (y * y)))
	elif y <= 1.35e+154:
		tmp = math.sinh(y) / y
	else:
		tmp = 0.16666666666666666 * (math.cos(x) * (y * y))
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 0.185)
		tmp = Float64(cos(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))));
	elseif (y <= 1.35e+154)
		tmp = Float64(sinh(y) / y);
	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 <= 0.185)
		tmp = cos(x) * (1.0 + (0.16666666666666666 * (y * y)));
	elseif (y <= 1.35e+154)
		tmp = sinh(y) / y;
	else
		tmp = 0.16666666666666666 * (cos(x) * (y * y));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 0.185], N[(N[Cos[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+154], N[(N[Sinh[y], $MachinePrecision] / y), $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 0.185:\\
\;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\

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

\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 < 0.185

    1. Initial program 100.0%

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

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

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

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

    if 0.185 < y < 1.35000000000000003e154

    1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\frac{\sinh y}{y} \cdot \cos x} \]
      2. associate-/r/100.0%

        \[\leadsto \color{blue}{\frac{\sinh y}{\frac{y}{\cos x}}} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\sinh y}{\frac{y}{\cos x}}} \]
    4. Taylor expanded in x around 0 78.4%

      \[\leadsto \frac{\sinh y}{\color{blue}{y}} \]

    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({y}^{2} \cdot \cos x\right)} \]
    6. Step-by-step derivation
      1. unpow2100.0%

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

        \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(\cos x \cdot \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 3 regimes into one program.
  4. Final simplification82.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 0.185:\\ \;\;\;\;\cos x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{\sinh y}{y}\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\cos x \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 5: 68.7% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;y \leq 1.9 \cdot 10^{+179}:\\
\;\;\;\;\frac{\sinh y}{y}\\

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


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

    1. Initial program 100.0%

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

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

    if 0.0850000000000000061 < y < 1.9e179

    1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\frac{\sinh y}{y} \cdot \cos x} \]
      2. associate-/r/100.0%

        \[\leadsto \color{blue}{\frac{\sinh y}{\frac{y}{\cos x}}} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\sinh y}{\frac{y}{\cos x}}} \]
    4. Taylor expanded in x around 0 76.6%

      \[\leadsto \frac{\sinh y}{\color{blue}{y}} \]

    if 1.9e179 < 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 x around 0 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 61.6% accurate, 2.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(1 + t_0\right)\\


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

    1. Initial program 100.0%

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

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

    if 11000 < y < 5.3999999999999998e76

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{y \cdot \left(0.16666666666666666 \cdot y\right)} + 1\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      4. +-lft-identity8.8%

        \[\leadsto \left(\color{blue}{\left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)} + 1\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      5. +-commutative8.8%

        \[\leadsto \color{blue}{\left(1 + \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)\right)} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      6. flip-+8.8%

        \[\leadsto \color{blue}{\frac{1 \cdot 1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      7. metadata-eval8.8%

        \[\leadsto \frac{\color{blue}{1} - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      8. div-sub8.8%

        \[\leadsto \color{blue}{\left(\frac{1}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)} - \frac{\left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}\right)} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      9. +-lft-identity8.8%

        \[\leadsto \left(\frac{1}{1 - \color{blue}{y \cdot \left(0.16666666666666666 \cdot y\right)}} - \frac{\left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      10. *-commutative8.8%

        \[\leadsto \left(\frac{1}{1 - \color{blue}{\left(0.16666666666666666 \cdot y\right) \cdot y}} - \frac{\left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      11. associate-*r*8.8%

        \[\leadsto \left(\frac{1}{1 - \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)}} - \frac{\left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      12. pow28.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\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) \]
    12. Step-by-step derivation
      1. metadata-eval8.8%

        \[\leadsto \frac{\color{blue}{1 \cdot 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) \]
      2. *-commutative8.8%

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

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

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

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

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

        \[\leadsto \frac{1 \cdot 1 - \left(\left(y \cdot y\right) \cdot \color{blue}{\left(y \cdot y\right)}\right) \cdot 0.027777777777777776}{1 + \left(y \cdot y\right) \cdot -0.16666666666666666} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      8. metadata-eval8.8%

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

        \[\leadsto \frac{1 \cdot 1 - \color{blue}{\left(\left(y \cdot y\right) \cdot -0.16666666666666666\right) \cdot \left(\left(y \cdot y\right) \cdot -0.16666666666666666\right)}}{1 + \left(y \cdot y\right) \cdot -0.16666666666666666} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      10. flip--8.8%

        \[\leadsto \color{blue}{\left(1 - \left(y \cdot y\right) \cdot -0.16666666666666666\right)} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      11. add-sqr-sqrt0.0%

        \[\leadsto \left(1 - \color{blue}{\sqrt{\left(y \cdot y\right) \cdot -0.16666666666666666} \cdot \sqrt{\left(y \cdot y\right) \cdot -0.16666666666666666}}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      12. sqrt-unprod12.8%

        \[\leadsto \left(1 - \color{blue}{\sqrt{\left(\left(y \cdot y\right) \cdot -0.16666666666666666\right) \cdot \left(\left(y \cdot y\right) \cdot -0.16666666666666666\right)}}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      13. swap-sqr12.8%

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

        \[\leadsto \left(1 - \sqrt{\left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \color{blue}{0.027777777777777776}}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      15. metadata-eval12.8%

        \[\leadsto \left(1 - \sqrt{\left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \color{blue}{\left(0.16666666666666666 \cdot 0.16666666666666666\right)}}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      16. swap-sqr12.8%

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

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

        \[\leadsto \left(1 - \sqrt{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
    13. Applied egg-rr12.8%

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

    if 5.3999999999999998e76 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 48.1% accurate, 10.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{+99} \lor \neg \left(x \leq 4 \cdot 10^{+123}\right) \land \left(x \leq 2 \cdot 10^{+162} \lor \neg \left(x \leq 1.3 \cdot 10^{+244}\right) \land x \leq 1.85 \cdot 10^{+273}\right):\\ \;\;\;\;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 (or (<= x 5e+99)
         (and (not (<= x 4e+123))
              (or (<= x 2e+162) (and (not (<= x 1.3e+244)) (<= x 1.85e+273)))))
   (+ 1.0 (* 0.16666666666666666 (* y y)))
   (* -0.08333333333333333 (* (* x y) (* x y)))))
double code(double x, double y) {
	double tmp;
	if ((x <= 5e+99) || (!(x <= 4e+123) && ((x <= 2e+162) || (!(x <= 1.3e+244) && (x <= 1.85e+273))))) {
		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 <= 5d+99) .or. (.not. (x <= 4d+123)) .and. (x <= 2d+162) .or. (.not. (x <= 1.3d+244)) .and. (x <= 1.85d+273)) 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 <= 5e+99) || (!(x <= 4e+123) && ((x <= 2e+162) || (!(x <= 1.3e+244) && (x <= 1.85e+273))))) {
		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 <= 5e+99) or (not (x <= 4e+123) and ((x <= 2e+162) or (not (x <= 1.3e+244) and (x <= 1.85e+273)))):
		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 <= 5e+99) || (!(x <= 4e+123) && ((x <= 2e+162) || (!(x <= 1.3e+244) && (x <= 1.85e+273)))))
		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 <= 5e+99) || (~((x <= 4e+123)) && ((x <= 2e+162) || (~((x <= 1.3e+244)) && (x <= 1.85e+273)))))
		tmp = 1.0 + (0.16666666666666666 * (y * y));
	else
		tmp = -0.08333333333333333 * ((x * y) * (x * y));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[x, 5e+99], And[N[Not[LessEqual[x, 4e+123]], $MachinePrecision], Or[LessEqual[x, 2e+162], And[N[Not[LessEqual[x, 1.3e+244]], $MachinePrecision], LessEqual[x, 1.85e+273]]]]], 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 5 \cdot 10^{+99} \lor \neg \left(x \leq 4 \cdot 10^{+123}\right) \land \left(x \leq 2 \cdot 10^{+162} \lor \neg \left(x \leq 1.3 \cdot 10^{+244}\right) \land x \leq 1.85 \cdot 10^{+273}\right):\\
\;\;\;\;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 < 5.00000000000000008e99 or 3.99999999999999991e123 < x < 1.9999999999999999e162 or 1.3e244 < x < 1.8499999999999999e273

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if 5.00000000000000008e99 < x < 3.99999999999999991e123 or 1.9999999999999999e162 < x < 1.3e244 or 1.8499999999999999e273 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-0.08333333333333333 \cdot {x}^{2}\right) \cdot {y}^{2}} + 0.16666666666666666 \cdot {y}^{2} \]
      2. distribute-rgt-out35.4%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{+99} \lor \neg \left(x \leq 4 \cdot 10^{+123}\right) \land \left(x \leq 2 \cdot 10^{+162} \lor \neg \left(x \leq 1.3 \cdot 10^{+244}\right) \land x \leq 1.85 \cdot 10^{+273}\right):\\ \;\;\;\;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 8: 48.0% accurate, 10.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{if}\;x \leq 5 \cdot 10^{+99}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 4 \cdot 10^{+123}:\\ \;\;\;\;-0.08333333333333333 \cdot \left(\left(x \cdot y\right) \cdot \left(x \cdot y\right)\right)\\ \mathbf{elif}\;x \leq 2 \cdot 10^{+162} \lor \neg \left(x \leq 1.3 \cdot 10^{+244}\right) \land x \leq 1.85 \cdot 10^{+273}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(x \cdot -0.08333333333333333\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (+ 1.0 (* 0.16666666666666666 (* y y)))))
   (if (<= x 5e+99)
     t_0
     (if (<= x 4e+123)
       (* -0.08333333333333333 (* (* x y) (* x y)))
       (if (or (<= x 2e+162) (and (not (<= x 1.3e+244)) (<= x 1.85e+273)))
         t_0
         (* (* x (* y y)) (* x -0.08333333333333333)))))))
double code(double x, double y) {
	double t_0 = 1.0 + (0.16666666666666666 * (y * y));
	double tmp;
	if (x <= 5e+99) {
		tmp = t_0;
	} else if (x <= 4e+123) {
		tmp = -0.08333333333333333 * ((x * y) * (x * y));
	} else if ((x <= 2e+162) || (!(x <= 1.3e+244) && (x <= 1.85e+273))) {
		tmp = t_0;
	} else {
		tmp = (x * (y * y)) * (x * -0.08333333333333333);
	}
	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 = 1.0d0 + (0.16666666666666666d0 * (y * y))
    if (x <= 5d+99) then
        tmp = t_0
    else if (x <= 4d+123) then
        tmp = (-0.08333333333333333d0) * ((x * y) * (x * y))
    else if ((x <= 2d+162) .or. (.not. (x <= 1.3d+244)) .and. (x <= 1.85d+273)) then
        tmp = t_0
    else
        tmp = (x * (y * y)) * (x * (-0.08333333333333333d0))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 1.0 + (0.16666666666666666 * (y * y));
	double tmp;
	if (x <= 5e+99) {
		tmp = t_0;
	} else if (x <= 4e+123) {
		tmp = -0.08333333333333333 * ((x * y) * (x * y));
	} else if ((x <= 2e+162) || (!(x <= 1.3e+244) && (x <= 1.85e+273))) {
		tmp = t_0;
	} else {
		tmp = (x * (y * y)) * (x * -0.08333333333333333);
	}
	return tmp;
}
def code(x, y):
	t_0 = 1.0 + (0.16666666666666666 * (y * y))
	tmp = 0
	if x <= 5e+99:
		tmp = t_0
	elif x <= 4e+123:
		tmp = -0.08333333333333333 * ((x * y) * (x * y))
	elif (x <= 2e+162) or (not (x <= 1.3e+244) and (x <= 1.85e+273)):
		tmp = t_0
	else:
		tmp = (x * (y * y)) * (x * -0.08333333333333333)
	return tmp
function code(x, y)
	t_0 = Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y)))
	tmp = 0.0
	if (x <= 5e+99)
		tmp = t_0;
	elseif (x <= 4e+123)
		tmp = Float64(-0.08333333333333333 * Float64(Float64(x * y) * Float64(x * y)));
	elseif ((x <= 2e+162) || (!(x <= 1.3e+244) && (x <= 1.85e+273)))
		tmp = t_0;
	else
		tmp = Float64(Float64(x * Float64(y * y)) * Float64(x * -0.08333333333333333));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 1.0 + (0.16666666666666666 * (y * y));
	tmp = 0.0;
	if (x <= 5e+99)
		tmp = t_0;
	elseif (x <= 4e+123)
		tmp = -0.08333333333333333 * ((x * y) * (x * y));
	elseif ((x <= 2e+162) || (~((x <= 1.3e+244)) && (x <= 1.85e+273)))
		tmp = t_0;
	else
		tmp = (x * (y * y)) * (x * -0.08333333333333333);
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 5e+99], t$95$0, If[LessEqual[x, 4e+123], N[(-0.08333333333333333 * N[(N[(x * y), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 2e+162], And[N[Not[LessEqual[x, 1.3e+244]], $MachinePrecision], LessEqual[x, 1.85e+273]]], t$95$0, N[(N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(x * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \leq 2 \cdot 10^{+162} \lor \neg \left(x \leq 1.3 \cdot 10^{+244}\right) \land x \leq 1.85 \cdot 10^{+273}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 5.00000000000000008e99 or 3.99999999999999991e123 < x < 1.9999999999999999e162 or 1.3e244 < x < 1.8499999999999999e273

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if 5.00000000000000008e99 < x < 3.99999999999999991e123

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e162 < x < 1.3e244 or 1.8499999999999999e273 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{+99}:\\ \;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{elif}\;x \leq 4 \cdot 10^{+123}:\\ \;\;\;\;-0.08333333333333333 \cdot \left(\left(x \cdot y\right) \cdot \left(x \cdot y\right)\right)\\ \mathbf{elif}\;x \leq 2 \cdot 10^{+162} \lor \neg \left(x \leq 1.3 \cdot 10^{+244}\right) \land x \leq 1.85 \cdot 10^{+273}:\\ \;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(x \cdot -0.08333333333333333\right)\\ \end{array} \]

Alternative 9: 49.0% accurate, 10.7× speedup?

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

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if 8500 < y < 5.30000000000000015e76

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{y \cdot \left(0.16666666666666666 \cdot y\right)} + 1\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      4. +-lft-identity8.8%

        \[\leadsto \left(\color{blue}{\left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)} + 1\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      5. +-commutative8.8%

        \[\leadsto \color{blue}{\left(1 + \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)\right)} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      6. flip-+8.8%

        \[\leadsto \color{blue}{\frac{1 \cdot 1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      7. metadata-eval8.8%

        \[\leadsto \frac{\color{blue}{1} - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      8. div-sub8.8%

        \[\leadsto \color{blue}{\left(\frac{1}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)} - \frac{\left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}\right)} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      9. +-lft-identity8.8%

        \[\leadsto \left(\frac{1}{1 - \color{blue}{y \cdot \left(0.16666666666666666 \cdot y\right)}} - \frac{\left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      10. *-commutative8.8%

        \[\leadsto \left(\frac{1}{1 - \color{blue}{\left(0.16666666666666666 \cdot y\right) \cdot y}} - \frac{\left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      11. associate-*r*8.8%

        \[\leadsto \left(\frac{1}{1 - \color{blue}{0.16666666666666666 \cdot \left(y \cdot y\right)}} - \frac{\left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right) \cdot \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}{1 - \left(0 + y \cdot \left(0.16666666666666666 \cdot y\right)\right)}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      12. pow28.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\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) \]
    12. Step-by-step derivation
      1. metadata-eval8.8%

        \[\leadsto \frac{\color{blue}{1 \cdot 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) \]
      2. *-commutative8.8%

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

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

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

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

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

        \[\leadsto \frac{1 \cdot 1 - \left(\left(y \cdot y\right) \cdot \color{blue}{\left(y \cdot y\right)}\right) \cdot 0.027777777777777776}{1 + \left(y \cdot y\right) \cdot -0.16666666666666666} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      8. metadata-eval8.8%

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

        \[\leadsto \frac{1 \cdot 1 - \color{blue}{\left(\left(y \cdot y\right) \cdot -0.16666666666666666\right) \cdot \left(\left(y \cdot y\right) \cdot -0.16666666666666666\right)}}{1 + \left(y \cdot y\right) \cdot -0.16666666666666666} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      10. flip--8.8%

        \[\leadsto \color{blue}{\left(1 - \left(y \cdot y\right) \cdot -0.16666666666666666\right)} \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      11. add-sqr-sqrt0.0%

        \[\leadsto \left(1 - \color{blue}{\sqrt{\left(y \cdot y\right) \cdot -0.16666666666666666} \cdot \sqrt{\left(y \cdot y\right) \cdot -0.16666666666666666}}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      12. sqrt-unprod12.8%

        \[\leadsto \left(1 - \color{blue}{\sqrt{\left(\left(y \cdot y\right) \cdot -0.16666666666666666\right) \cdot \left(\left(y \cdot y\right) \cdot -0.16666666666666666\right)}}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      13. swap-sqr12.8%

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

        \[\leadsto \left(1 - \sqrt{\left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \color{blue}{0.027777777777777776}}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      15. metadata-eval12.8%

        \[\leadsto \left(1 - \sqrt{\left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \color{blue}{\left(0.16666666666666666 \cdot 0.16666666666666666\right)}}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
      16. swap-sqr12.8%

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

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

        \[\leadsto \left(1 - \sqrt{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)}}\right) \cdot \left(1 + -0.5 \cdot \left(x \cdot x\right)\right) \]
    13. Applied egg-rr12.8%

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

    if 5.30000000000000015e76 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 48.9% accurate, 12.0× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if 4.3e20 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 48.9% accurate, 15.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.3 \cdot 10^{+20}:\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if 4.3e20 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 37.4% accurate, 29.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 8500:\\
\;\;\;\;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 < 8500

    1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\frac{\sinh y}{y} \cdot \cos x} \]
      2. associate-/r/99.9%

        \[\leadsto \color{blue}{\frac{\sinh y}{\frac{y}{\cos x}}} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{\sinh y}{\frac{y}{\cos x}}} \]
    4. Taylor expanded in x around 0 57.9%

      \[\leadsto \frac{\sinh y}{\color{blue}{y}} \]
    5. Taylor expanded in y around 0 33.9%

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

    if 8500 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 46.9% 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 72.2%

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

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

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

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

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

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

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

Alternative 14: 28.1% accurate, 205.0× speedup?

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

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

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

      \[\leadsto \color{blue}{\frac{\sinh y}{y} \cdot \cos x} \]
    2. associate-/r/100.0%

      \[\leadsto \color{blue}{\frac{\sinh y}{\frac{y}{\cos x}}} \]
  3. Simplified100.0%

    \[\leadsto \color{blue}{\frac{\sinh y}{\frac{y}{\cos x}}} \]
  4. Taylor expanded in x around 0 63.6%

    \[\leadsto \frac{\sinh y}{\color{blue}{y}} \]
  5. Taylor expanded in y around 0 25.6%

    \[\leadsto \color{blue}{1} \]
  6. Final simplification25.6%

    \[\leadsto 1 \]

Reproduce

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