Linear.Quaternion:$csinh from linear-1.19.1.3

Percentage Accurate: 99.9% → 99.9%
Time: 8.8s
Alternatives: 13
Speedup: 1.0×

Specification

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

\\
\cosh x \cdot \frac{\sin y}{y}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

\\
\cosh x \cdot \frac{\sin y}{y}
\end{array}

Alternative 1: 99.9% accurate, 1.0× speedup?

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

\\
\frac{\sin y \cdot \cosh x}{y}
\end{array}
Derivation
  1. Initial program 99.9%

    \[\cosh x \cdot \frac{\sin y}{y} \]
  2. Step-by-step derivation
    1. add-cbrt-cube64.6%

      \[\leadsto \cosh x \cdot \frac{\color{blue}{\sqrt[3]{\left(\sin y \cdot \sin y\right) \cdot \sin y}}}{y} \]
    2. pow364.6%

      \[\leadsto \cosh x \cdot \frac{\sqrt[3]{\color{blue}{{\sin y}^{3}}}}{y} \]
  3. Applied egg-rr64.6%

    \[\leadsto \cosh x \cdot \frac{\color{blue}{\sqrt[3]{{\sin y}^{3}}}}{y} \]
  4. Step-by-step derivation
    1. *-commutative64.6%

      \[\leadsto \color{blue}{\frac{\sqrt[3]{{\sin y}^{3}}}{y} \cdot \cosh x} \]
    2. rem-cbrt-cube99.9%

      \[\leadsto \frac{\color{blue}{\sin y}}{y} \cdot \cosh x \]
    3. associate-*l/99.9%

      \[\leadsto \color{blue}{\frac{\sin y \cdot \cosh x}{y}} \]
  5. Applied egg-rr99.9%

    \[\leadsto \color{blue}{\frac{\sin y \cdot \cosh x}{y}} \]
  6. Final simplification99.9%

    \[\leadsto \frac{\sin y \cdot \cosh x}{y} \]

Alternative 2: 86.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\cosh x \leq 2:\\ \;\;\;\;\frac{\sin y}{y}\\ \mathbf{else}:\\ \;\;\;\;\cosh x\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= (cosh x) 2.0) (/ (sin y) y) (cosh x)))
double code(double x, double y) {
	double tmp;
	if (cosh(x) <= 2.0) {
		tmp = sin(y) / y;
	} else {
		tmp = cosh(x);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (cosh(x) <= 2.0d0) then
        tmp = sin(y) / y
    else
        tmp = cosh(x)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (Math.cosh(x) <= 2.0) {
		tmp = Math.sin(y) / y;
	} else {
		tmp = Math.cosh(x);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if math.cosh(x) <= 2.0:
		tmp = math.sin(y) / y
	else:
		tmp = math.cosh(x)
	return tmp
function code(x, y)
	tmp = 0.0
	if (cosh(x) <= 2.0)
		tmp = Float64(sin(y) / y);
	else
		tmp = cosh(x);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (cosh(x) <= 2.0)
		tmp = sin(y) / y;
	else
		tmp = cosh(x);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[N[Cosh[x], $MachinePrecision], 2.0], N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision], N[Cosh[x], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\cosh x \leq 2:\\
\;\;\;\;\frac{\sin y}{y}\\

\mathbf{else}:\\
\;\;\;\;\cosh x\\


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

    1. Initial program 99.8%

      \[\cosh x \cdot \frac{\sin y}{y} \]
    2. Taylor expanded in x around 0 99.3%

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

    if 2 < (cosh.f64 x)

    1. Initial program 100.0%

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

      \[\leadsto \cosh x \cdot \color{blue}{1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification87.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\cosh x \leq 2:\\ \;\;\;\;\frac{\sin y}{y}\\ \mathbf{else}:\\ \;\;\;\;\cosh x\\ \end{array} \]

Alternative 3: 99.9% accurate, 1.0× speedup?

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

\\
\frac{\sin y}{y} \cdot \cosh x
\end{array}
Derivation
  1. Initial program 99.9%

    \[\cosh x \cdot \frac{\sin y}{y} \]
  2. Final simplification99.9%

    \[\leadsto \frac{\sin y}{y} \cdot \cosh x \]

Alternative 4: 92.3% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{+137} \lor \neg \left(x \leq -0.054\right) \land \left(x \leq 0.0132 \lor \neg \left(x \leq 1.9 \cdot 10^{+154}\right)\right):\\ \;\;\;\;\frac{1 + x \cdot \left(x \cdot 0.5\right)}{\frac{y}{\sin y}}\\ \mathbf{else}:\\ \;\;\;\;\cosh x\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= x -4.2e+137)
         (and (not (<= x -0.054)) (or (<= x 0.0132) (not (<= x 1.9e+154)))))
   (/ (+ 1.0 (* x (* x 0.5))) (/ y (sin y)))
   (cosh x)))
double code(double x, double y) {
	double tmp;
	if ((x <= -4.2e+137) || (!(x <= -0.054) && ((x <= 0.0132) || !(x <= 1.9e+154)))) {
		tmp = (1.0 + (x * (x * 0.5))) / (y / sin(y));
	} else {
		tmp = cosh(x);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((x <= (-4.2d+137)) .or. (.not. (x <= (-0.054d0))) .and. (x <= 0.0132d0) .or. (.not. (x <= 1.9d+154))) then
        tmp = (1.0d0 + (x * (x * 0.5d0))) / (y / sin(y))
    else
        tmp = cosh(x)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((x <= -4.2e+137) || (!(x <= -0.054) && ((x <= 0.0132) || !(x <= 1.9e+154)))) {
		tmp = (1.0 + (x * (x * 0.5))) / (y / Math.sin(y));
	} else {
		tmp = Math.cosh(x);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (x <= -4.2e+137) or (not (x <= -0.054) and ((x <= 0.0132) or not (x <= 1.9e+154))):
		tmp = (1.0 + (x * (x * 0.5))) / (y / math.sin(y))
	else:
		tmp = math.cosh(x)
	return tmp
function code(x, y)
	tmp = 0.0
	if ((x <= -4.2e+137) || (!(x <= -0.054) && ((x <= 0.0132) || !(x <= 1.9e+154))))
		tmp = Float64(Float64(1.0 + Float64(x * Float64(x * 0.5))) / Float64(y / sin(y)));
	else
		tmp = cosh(x);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((x <= -4.2e+137) || (~((x <= -0.054)) && ((x <= 0.0132) || ~((x <= 1.9e+154)))))
		tmp = (1.0 + (x * (x * 0.5))) / (y / sin(y));
	else
		tmp = cosh(x);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[x, -4.2e+137], And[N[Not[LessEqual[x, -0.054]], $MachinePrecision], Or[LessEqual[x, 0.0132], N[Not[LessEqual[x, 1.9e+154]], $MachinePrecision]]]], N[(N[(1.0 + N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y / N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Cosh[x], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+137} \lor \neg \left(x \leq -0.054\right) \land \left(x \leq 0.0132 \lor \neg \left(x \leq 1.9 \cdot 10^{+154}\right)\right):\\
\;\;\;\;\frac{1 + x \cdot \left(x \cdot 0.5\right)}{\frac{y}{\sin y}}\\

\mathbf{else}:\\
\;\;\;\;\cosh x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.1999999999999998e137 or -0.0539999999999999994 < x < 0.0132 or 1.8999999999999999e154 < x

    1. Initial program 99.9%

      \[\cosh x \cdot \frac{\sin y}{y} \]
    2. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto \cosh x \cdot \color{blue}{\frac{1}{\frac{y}{\sin y}}} \]
      2. un-div-inv99.8%

        \[\leadsto \color{blue}{\frac{\cosh x}{\frac{y}{\sin y}}} \]
    3. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\cosh x}{\frac{y}{\sin y}}} \]
    4. Taylor expanded in x around 0 98.8%

      \[\leadsto \color{blue}{\frac{\sin y}{y} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y}} \]
    5. Step-by-step derivation
      1. *-rgt-identity98.8%

        \[\leadsto \frac{\color{blue}{\sin y \cdot 1}}{y} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y} \]
      2. associate-*r/98.6%

        \[\leadsto \color{blue}{\sin y \cdot \frac{1}{y}} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y} \]
      3. *-commutative98.6%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y \cdot {x}^{2}}{y} \cdot 0.5} \]
      4. associate-/l*98.6%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y}{\frac{y}{{x}^{2}}}} \cdot 0.5 \]
      5. unpow298.6%

        \[\leadsto \sin y \cdot \frac{1}{y} + \frac{\sin y}{\frac{y}{\color{blue}{x \cdot x}}} \cdot 0.5 \]
      6. associate-/r*92.2%

        \[\leadsto \sin y \cdot \frac{1}{y} + \frac{\sin y}{\color{blue}{\frac{\frac{y}{x}}{x}}} \cdot 0.5 \]
      7. associate-/l*92.2%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y \cdot x}{\frac{y}{x}}} \cdot 0.5 \]
      8. associate-*r/92.2%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\left(\sin y \cdot \frac{x}{\frac{y}{x}}\right)} \cdot 0.5 \]
      9. associate-*r*92.2%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\sin y \cdot \left(\frac{x}{\frac{y}{x}} \cdot 0.5\right)} \]
      10. distribute-lft-out92.2%

        \[\leadsto \color{blue}{\sin y \cdot \left(\frac{1}{y} + \frac{x}{\frac{y}{x}} \cdot 0.5\right)} \]
      11. *-commutative92.2%

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + \color{blue}{0.5 \cdot \frac{x}{\frac{y}{x}}}\right) \]
      12. associate-/r/92.2%

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \color{blue}{\left(\frac{x}{y} \cdot x\right)}\right) \]
      13. *-commutative92.2%

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \color{blue}{\left(x \cdot \frac{x}{y}\right)}\right) \]
    6. Simplified92.2%

      \[\leadsto \color{blue}{\sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \left(x \cdot \frac{x}{y}\right)\right)} \]
    7. Taylor expanded in y around inf 98.8%

      \[\leadsto \color{blue}{\frac{\left(1 + 0.5 \cdot {x}^{2}\right) \cdot \sin y}{y}} \]
    8. Step-by-step derivation
      1. associate-/l*98.7%

        \[\leadsto \color{blue}{\frac{1 + 0.5 \cdot {x}^{2}}{\frac{y}{\sin y}}} \]
      2. unpow298.7%

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

        \[\leadsto \frac{1 + \color{blue}{\left(0.5 \cdot x\right) \cdot x}}{\frac{y}{\sin y}} \]
      4. *-commutative98.7%

        \[\leadsto \frac{1 + \color{blue}{\left(x \cdot 0.5\right)} \cdot x}{\frac{y}{\sin y}} \]
      5. associate-*l*98.7%

        \[\leadsto \frac{1 + \color{blue}{x \cdot \left(0.5 \cdot x\right)}}{\frac{y}{\sin y}} \]
    9. Simplified98.7%

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

    if -4.1999999999999998e137 < x < -0.0539999999999999994 or 0.0132 < x < 1.8999999999999999e154

    1. Initial program 100.0%

      \[\cosh x \cdot \frac{\sin y}{y} \]
    2. Taylor expanded in y around 0 80.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{+137} \lor \neg \left(x \leq -0.054\right) \land \left(x \leq 0.0132 \lor \neg \left(x \leq 1.9 \cdot 10^{+154}\right)\right):\\ \;\;\;\;\frac{1 + x \cdot \left(x \cdot 0.5\right)}{\frac{y}{\sin y}}\\ \mathbf{else}:\\ \;\;\;\;\cosh x\\ \end{array} \]

Alternative 5: 87.1% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;x \leq 7 \cdot 10^{-5}:\\
\;\;\;\;\frac{\sin y}{y}\\

\mathbf{else}:\\
\;\;\;\;\cosh x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -0.0529999999999999985

    1. Initial program 100.0%

      \[\cosh x \cdot \frac{\sin y}{y} \]
    2. Taylor expanded in y around 0 74.0%

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

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

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

    if -0.0529999999999999985 < x < 6.9999999999999994e-5

    1. Initial program 99.8%

      \[\cosh x \cdot \frac{\sin y}{y} \]
    2. Taylor expanded in x around 0 99.3%

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

    if 6.9999999999999994e-5 < x

    1. Initial program 100.0%

      \[\cosh x \cdot \frac{\sin y}{y} \]
    2. Taylor expanded in y around 0 83.8%

      \[\leadsto \cosh x \cdot \color{blue}{1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification89.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.053:\\ \;\;\;\;\cosh x \cdot \left(1 + -0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;x \leq 7 \cdot 10^{-5}:\\ \;\;\;\;\frac{\sin y}{y}\\ \mathbf{else}:\\ \;\;\;\;\cosh x\\ \end{array} \]

Alternative 6: 62.9% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \cosh x \end{array} \]
(FPCore (x y) :precision binary64 (cosh x))
double code(double x, double y) {
	return cosh(x);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = cosh(x)
end function
public static double code(double x, double y) {
	return Math.cosh(x);
}
def code(x, y):
	return math.cosh(x)
function code(x, y)
	return cosh(x)
end
function tmp = code(x, y)
	tmp = cosh(x);
end
code[x_, y_] := N[Cosh[x], $MachinePrecision]
\begin{array}{l}

\\
\cosh x
\end{array}
Derivation
  1. Initial program 99.9%

    \[\cosh x \cdot \frac{\sin y}{y} \]
  2. Taylor expanded in y around 0 66.3%

    \[\leadsto \cosh x \cdot \color{blue}{1} \]
  3. Final simplification66.3%

    \[\leadsto \cosh x \]

Alternative 7: 53.7% accurate, 13.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{+148} \lor \neg \left(y \leq 9.2 \cdot 10^{+178}\right):\\
\;\;\;\;-0.16666666666666666 \cdot \left(y \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.4999999999999996e148 or 9.2000000000000003e178 < y

    1. Initial program 99.8%

      \[\cosh x \cdot \frac{\sin y}{y} \]
    2. Taylor expanded in x around 0 45.2%

      \[\leadsto \color{blue}{\frac{\sin y}{y}} \]
    3. Taylor expanded in y around 0 32.3%

      \[\leadsto \frac{\color{blue}{-0.16666666666666666 \cdot {y}^{3} + y}}{y} \]
    4. Taylor expanded in y around inf 30.7%

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

        \[\leadsto -0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} \]
    6. Simplified30.7%

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

    if -8.4999999999999996e148 < y < 9.2000000000000003e178

    1. Initial program 99.9%

      \[\cosh x \cdot \frac{\sin y}{y} \]
    2. Step-by-step derivation
      1. clear-num99.9%

        \[\leadsto \cosh x \cdot \color{blue}{\frac{1}{\frac{y}{\sin y}}} \]
      2. un-div-inv99.9%

        \[\leadsto \color{blue}{\frac{\cosh x}{\frac{y}{\sin y}}} \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\cosh x}{\frac{y}{\sin y}}} \]
    4. Taylor expanded in x around 0 82.4%

      \[\leadsto \color{blue}{\frac{\sin y}{y} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y}} \]
    5. Step-by-step derivation
      1. *-rgt-identity82.4%

        \[\leadsto \frac{\color{blue}{\sin y \cdot 1}}{y} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y} \]
      2. associate-*r/82.3%

        \[\leadsto \color{blue}{\sin y \cdot \frac{1}{y}} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y} \]
      3. *-commutative82.3%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y \cdot {x}^{2}}{y} \cdot 0.5} \]
      4. associate-/l*88.8%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y}{\frac{y}{{x}^{2}}}} \cdot 0.5 \]
      5. unpow288.8%

        \[\leadsto \sin y \cdot \frac{1}{y} + \frac{\sin y}{\frac{y}{\color{blue}{x \cdot x}}} \cdot 0.5 \]
      6. associate-/r*86.5%

        \[\leadsto \sin y \cdot \frac{1}{y} + \frac{\sin y}{\color{blue}{\frac{\frac{y}{x}}{x}}} \cdot 0.5 \]
      7. associate-/l*84.6%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y \cdot x}{\frac{y}{x}}} \cdot 0.5 \]
      8. associate-*r/87.0%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\left(\sin y \cdot \frac{x}{\frac{y}{x}}\right)} \cdot 0.5 \]
      9. associate-*r*87.0%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\sin y \cdot \left(\frac{x}{\frac{y}{x}} \cdot 0.5\right)} \]
      10. distribute-lft-out87.0%

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

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + \color{blue}{0.5 \cdot \frac{x}{\frac{y}{x}}}\right) \]
      12. associate-/r/87.0%

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \color{blue}{\left(\frac{x}{y} \cdot x\right)}\right) \]
      13. *-commutative87.0%

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \color{blue}{\left(x \cdot \frac{x}{y}\right)}\right) \]
    6. Simplified87.0%

      \[\leadsto \color{blue}{\sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \left(x \cdot \frac{x}{y}\right)\right)} \]
    7. Taylor expanded in y around 0 68.8%

      \[\leadsto \color{blue}{y} \cdot \left(\frac{1}{y} + 0.5 \cdot \left(x \cdot \frac{x}{y}\right)\right) \]
    8. Taylor expanded in y around 0 68.8%

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

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

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

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

        \[\leadsto y \cdot \frac{1 + \color{blue}{x \cdot \left(0.5 \cdot x\right)}}{y} \]
    10. Simplified68.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.5 \cdot 10^{+148} \lor \neg \left(y \leq 9.2 \cdot 10^{+178}\right):\\ \;\;\;\;-0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{1 + x \cdot \left(x \cdot 0.5\right)}{y}\\ \end{array} \]

Alternative 8: 45.6% accurate, 18.3× speedup?

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

\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(x \cdot x\right)\\
\mathbf{if}\;x \leq -6.1 \cdot 10^{+172}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;x \leq 3.3 \cdot 10^{-9}:\\
\;\;\;\;1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.0999999999999998e172 or 3.30000000000000018e-9 < x

    1. Initial program 100.0%

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

        \[\leadsto \cosh x \cdot \color{blue}{\frac{1}{\frac{y}{\sin y}}} \]
      2. un-div-inv100.0%

        \[\leadsto \color{blue}{\frac{\cosh x}{\frac{y}{\sin y}}} \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{\cosh x}{\frac{y}{\sin y}}} \]
    4. Taylor expanded in x around 0 70.2%

      \[\leadsto \color{blue}{\frac{\sin y}{y} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y}} \]
    5. Step-by-step derivation
      1. *-rgt-identity70.2%

        \[\leadsto \frac{\color{blue}{\sin y \cdot 1}}{y} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y} \]
      2. associate-*r/70.2%

        \[\leadsto \color{blue}{\sin y \cdot \frac{1}{y}} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y} \]
      3. *-commutative70.2%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y \cdot {x}^{2}}{y} \cdot 0.5} \]
      4. associate-/l*80.2%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y}{\frac{y}{{x}^{2}}}} \cdot 0.5 \]
      5. unpow280.2%

        \[\leadsto \sin y \cdot \frac{1}{y} + \frac{\sin y}{\frac{y}{\color{blue}{x \cdot x}}} \cdot 0.5 \]
      6. associate-/r*68.2%

        \[\leadsto \sin y \cdot \frac{1}{y} + \frac{\sin y}{\color{blue}{\frac{\frac{y}{x}}{x}}} \cdot 0.5 \]
      7. associate-/l*64.6%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y \cdot x}{\frac{y}{x}}} \cdot 0.5 \]
      8. associate-*r/69.2%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\left(\sin y \cdot \frac{x}{\frac{y}{x}}\right)} \cdot 0.5 \]
      9. associate-*r*69.2%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\sin y \cdot \left(\frac{x}{\frac{y}{x}} \cdot 0.5\right)} \]
      10. distribute-lft-out69.2%

        \[\leadsto \color{blue}{\sin y \cdot \left(\frac{1}{y} + \frac{x}{\frac{y}{x}} \cdot 0.5\right)} \]
      11. *-commutative69.2%

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + \color{blue}{0.5 \cdot \frac{x}{\frac{y}{x}}}\right) \]
      12. associate-/r/69.2%

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \color{blue}{\left(\frac{x}{y} \cdot x\right)}\right) \]
      13. *-commutative69.2%

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \color{blue}{\left(x \cdot \frac{x}{y}\right)}\right) \]
    6. Simplified69.2%

      \[\leadsto \color{blue}{\sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \left(x \cdot \frac{x}{y}\right)\right)} \]
    7. Taylor expanded in y around 0 63.6%

      \[\leadsto \color{blue}{y} \cdot \left(\frac{1}{y} + 0.5 \cdot \left(x \cdot \frac{x}{y}\right)\right) \]
    8. Taylor expanded in x around inf 52.7%

      \[\leadsto \color{blue}{0.5 \cdot {x}^{2}} \]
    9. Step-by-step derivation
      1. unpow252.7%

        \[\leadsto 0.5 \cdot \color{blue}{\left(x \cdot x\right)} \]
    10. Simplified52.7%

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

    if -6.0999999999999998e172 < x < -1200

    1. Initial program 100.0%

      \[\cosh x \cdot \frac{\sin y}{y} \]
    2. Taylor expanded in x around 0 2.3%

      \[\leadsto \color{blue}{\frac{\sin y}{y}} \]
    3. Taylor expanded in y around 0 38.9%

      \[\leadsto \frac{\color{blue}{-0.16666666666666666 \cdot {y}^{3} + y}}{y} \]
    4. Taylor expanded in y around inf 34.1%

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

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

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

    if -1200 < x < 3.30000000000000018e-9

    1. Initial program 99.8%

      \[\cosh x \cdot \frac{\sin y}{y} \]
    2. Taylor expanded in x around 0 98.0%

      \[\leadsto \color{blue}{\frac{\sin y}{y}} \]
    3. Taylor expanded in y around 0 57.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.1 \cdot 10^{+172}:\\ \;\;\;\;0.5 \cdot \left(x \cdot x\right)\\ \mathbf{elif}\;x \leq -1200:\\ \;\;\;\;-0.16666666666666666 \cdot \left(y \cdot y\right)\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(x \cdot x\right)\\ \end{array} \]

Alternative 9: 45.6% accurate, 18.3× speedup?

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

\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(x \cdot x\right)\\
\mathbf{if}\;x \leq -6.1 \cdot 10^{+172}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;x \leq 3.3 \cdot 10^{-9}:\\
\;\;\;\;1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.0999999999999998e172 or 3.30000000000000018e-9 < x

    1. Initial program 100.0%

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

        \[\leadsto \cosh x \cdot \color{blue}{\frac{1}{\frac{y}{\sin y}}} \]
      2. un-div-inv100.0%

        \[\leadsto \color{blue}{\frac{\cosh x}{\frac{y}{\sin y}}} \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{\cosh x}{\frac{y}{\sin y}}} \]
    4. Taylor expanded in x around 0 70.2%

      \[\leadsto \color{blue}{\frac{\sin y}{y} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y}} \]
    5. Step-by-step derivation
      1. *-rgt-identity70.2%

        \[\leadsto \frac{\color{blue}{\sin y \cdot 1}}{y} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y} \]
      2. associate-*r/70.2%

        \[\leadsto \color{blue}{\sin y \cdot \frac{1}{y}} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y} \]
      3. *-commutative70.2%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y \cdot {x}^{2}}{y} \cdot 0.5} \]
      4. associate-/l*80.2%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y}{\frac{y}{{x}^{2}}}} \cdot 0.5 \]
      5. unpow280.2%

        \[\leadsto \sin y \cdot \frac{1}{y} + \frac{\sin y}{\frac{y}{\color{blue}{x \cdot x}}} \cdot 0.5 \]
      6. associate-/r*68.2%

        \[\leadsto \sin y \cdot \frac{1}{y} + \frac{\sin y}{\color{blue}{\frac{\frac{y}{x}}{x}}} \cdot 0.5 \]
      7. associate-/l*64.6%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y \cdot x}{\frac{y}{x}}} \cdot 0.5 \]
      8. associate-*r/69.2%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\left(\sin y \cdot \frac{x}{\frac{y}{x}}\right)} \cdot 0.5 \]
      9. associate-*r*69.2%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\sin y \cdot \left(\frac{x}{\frac{y}{x}} \cdot 0.5\right)} \]
      10. distribute-lft-out69.2%

        \[\leadsto \color{blue}{\sin y \cdot \left(\frac{1}{y} + \frac{x}{\frac{y}{x}} \cdot 0.5\right)} \]
      11. *-commutative69.2%

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + \color{blue}{0.5 \cdot \frac{x}{\frac{y}{x}}}\right) \]
      12. associate-/r/69.2%

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \color{blue}{\left(\frac{x}{y} \cdot x\right)}\right) \]
      13. *-commutative69.2%

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \color{blue}{\left(x \cdot \frac{x}{y}\right)}\right) \]
    6. Simplified69.2%

      \[\leadsto \color{blue}{\sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \left(x \cdot \frac{x}{y}\right)\right)} \]
    7. Taylor expanded in y around 0 63.6%

      \[\leadsto \color{blue}{y} \cdot \left(\frac{1}{y} + 0.5 \cdot \left(x \cdot \frac{x}{y}\right)\right) \]
    8. Taylor expanded in x around inf 52.7%

      \[\leadsto \color{blue}{0.5 \cdot {x}^{2}} \]
    9. Step-by-step derivation
      1. unpow252.7%

        \[\leadsto 0.5 \cdot \color{blue}{\left(x \cdot x\right)} \]
    10. Simplified52.7%

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

    if -6.0999999999999998e172 < x < -520

    1. Initial program 100.0%

      \[\cosh x \cdot \frac{\sin y}{y} \]
    2. Taylor expanded in x around 0 2.3%

      \[\leadsto \color{blue}{\frac{\sin y}{y}} \]
    3. Taylor expanded in y around 0 38.9%

      \[\leadsto \frac{\color{blue}{-0.16666666666666666 \cdot {y}^{3} + y}}{y} \]
    4. Taylor expanded in y around inf 34.1%

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

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

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

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

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

    if -520 < x < 3.30000000000000018e-9

    1. Initial program 99.8%

      \[\cosh x \cdot \frac{\sin y}{y} \]
    2. Taylor expanded in x around 0 98.0%

      \[\leadsto \color{blue}{\frac{\sin y}{y}} \]
    3. Taylor expanded in y around 0 57.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.1 \cdot 10^{+172}:\\ \;\;\;\;0.5 \cdot \left(x \cdot x\right)\\ \mathbf{elif}\;x \leq -520:\\ \;\;\;\;y \cdot \left(y \cdot -0.16666666666666666\right)\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(x \cdot x\right)\\ \end{array} \]

Alternative 10: 46.8% accurate, 18.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.1 \cdot 10^{+172} \lor \neg \left(x \leq 2.8 \cdot 10^{+149}\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.0999999999999998e172 or 2.7999999999999999e149 < x

    1. Initial program 100.0%

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

        \[\leadsto \cosh x \cdot \color{blue}{\frac{1}{\frac{y}{\sin y}}} \]
      2. un-div-inv100.0%

        \[\leadsto \color{blue}{\frac{\cosh x}{\frac{y}{\sin y}}} \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{\cosh x}{\frac{y}{\sin y}}} \]
    4. Taylor expanded in x around 0 97.4%

      \[\leadsto \color{blue}{\frac{\sin y}{y} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y}} \]
    5. Step-by-step derivation
      1. *-rgt-identity97.4%

        \[\leadsto \frac{\color{blue}{\sin y \cdot 1}}{y} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y} \]
      2. associate-*r/97.4%

        \[\leadsto \color{blue}{\sin y \cdot \frac{1}{y}} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y} \]
      3. *-commutative97.4%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y \cdot {x}^{2}}{y} \cdot 0.5} \]
      4. associate-/l*98.7%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y}{\frac{y}{{x}^{2}}}} \cdot 0.5 \]
      5. unpow298.7%

        \[\leadsto \sin y \cdot \frac{1}{y} + \frac{\sin y}{\frac{y}{\color{blue}{x \cdot x}}} \cdot 0.5 \]
      6. associate-/r*81.5%

        \[\leadsto \sin y \cdot \frac{1}{y} + \frac{\sin y}{\color{blue}{\frac{\frac{y}{x}}{x}}} \cdot 0.5 \]
      7. associate-/l*80.3%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y \cdot x}{\frac{y}{x}}} \cdot 0.5 \]
      8. associate-*r/81.5%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\left(\sin y \cdot \frac{x}{\frac{y}{x}}\right)} \cdot 0.5 \]
      9. associate-*r*81.5%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\sin y \cdot \left(\frac{x}{\frac{y}{x}} \cdot 0.5\right)} \]
      10. distribute-lft-out81.5%

        \[\leadsto \color{blue}{\sin y \cdot \left(\frac{1}{y} + \frac{x}{\frac{y}{x}} \cdot 0.5\right)} \]
      11. *-commutative81.5%

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + \color{blue}{0.5 \cdot \frac{x}{\frac{y}{x}}}\right) \]
      12. associate-/r/81.5%

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \color{blue}{\left(\frac{x}{y} \cdot x\right)}\right) \]
      13. *-commutative81.5%

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \color{blue}{\left(x \cdot \frac{x}{y}\right)}\right) \]
    6. Simplified81.5%

      \[\leadsto \color{blue}{\sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \left(x \cdot \frac{x}{y}\right)\right)} \]
    7. Taylor expanded in y around 0 74.8%

      \[\leadsto \color{blue}{y} \cdot \left(\frac{1}{y} + 0.5 \cdot \left(x \cdot \frac{x}{y}\right)\right) \]
    8. Taylor expanded in x around inf 73.6%

      \[\leadsto \color{blue}{0.5 \cdot {x}^{2}} \]
    9. Step-by-step derivation
      1. unpow273.6%

        \[\leadsto 0.5 \cdot \color{blue}{\left(x \cdot x\right)} \]
    10. Simplified73.6%

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

    if -6.0999999999999998e172 < x < 2.7999999999999999e149

    1. Initial program 99.9%

      \[\cosh x \cdot \frac{\sin y}{y} \]
    2. Taylor expanded in x around 0 71.7%

      \[\leadsto \color{blue}{\frac{\sin y}{y}} \]
    3. Taylor expanded in y around 0 47.1%

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

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

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

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

Alternative 11: 47.8% accurate, 18.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{+148} \lor \neg \left(y \leq 9.2 \cdot 10^{+178}\right):\\
\;\;\;\;-0.16666666666666666 \cdot \left(y \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.4999999999999996e148 or 9.2000000000000003e178 < y

    1. Initial program 99.8%

      \[\cosh x \cdot \frac{\sin y}{y} \]
    2. Taylor expanded in x around 0 45.2%

      \[\leadsto \color{blue}{\frac{\sin y}{y}} \]
    3. Taylor expanded in y around 0 32.3%

      \[\leadsto \frac{\color{blue}{-0.16666666666666666 \cdot {y}^{3} + y}}{y} \]
    4. Taylor expanded in y around inf 30.7%

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

        \[\leadsto -0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)} \]
    6. Simplified30.7%

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

    if -8.4999999999999996e148 < y < 9.2000000000000003e178

    1. Initial program 99.9%

      \[\cosh x \cdot \frac{\sin y}{y} \]
    2. Step-by-step derivation
      1. clear-num99.9%

        \[\leadsto \cosh x \cdot \color{blue}{\frac{1}{\frac{y}{\sin y}}} \]
      2. un-div-inv99.9%

        \[\leadsto \color{blue}{\frac{\cosh x}{\frac{y}{\sin y}}} \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\cosh x}{\frac{y}{\sin y}}} \]
    4. Taylor expanded in x around 0 82.4%

      \[\leadsto \color{blue}{\frac{\sin y}{y} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y}} \]
    5. Step-by-step derivation
      1. *-rgt-identity82.4%

        \[\leadsto \frac{\color{blue}{\sin y \cdot 1}}{y} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y} \]
      2. associate-*r/82.3%

        \[\leadsto \color{blue}{\sin y \cdot \frac{1}{y}} + 0.5 \cdot \frac{\sin y \cdot {x}^{2}}{y} \]
      3. *-commutative82.3%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y \cdot {x}^{2}}{y} \cdot 0.5} \]
      4. associate-/l*88.8%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y}{\frac{y}{{x}^{2}}}} \cdot 0.5 \]
      5. unpow288.8%

        \[\leadsto \sin y \cdot \frac{1}{y} + \frac{\sin y}{\frac{y}{\color{blue}{x \cdot x}}} \cdot 0.5 \]
      6. associate-/r*86.5%

        \[\leadsto \sin y \cdot \frac{1}{y} + \frac{\sin y}{\color{blue}{\frac{\frac{y}{x}}{x}}} \cdot 0.5 \]
      7. associate-/l*84.6%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\frac{\sin y \cdot x}{\frac{y}{x}}} \cdot 0.5 \]
      8. associate-*r/87.0%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\left(\sin y \cdot \frac{x}{\frac{y}{x}}\right)} \cdot 0.5 \]
      9. associate-*r*87.0%

        \[\leadsto \sin y \cdot \frac{1}{y} + \color{blue}{\sin y \cdot \left(\frac{x}{\frac{y}{x}} \cdot 0.5\right)} \]
      10. distribute-lft-out87.0%

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

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + \color{blue}{0.5 \cdot \frac{x}{\frac{y}{x}}}\right) \]
      12. associate-/r/87.0%

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \color{blue}{\left(\frac{x}{y} \cdot x\right)}\right) \]
      13. *-commutative87.0%

        \[\leadsto \sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \color{blue}{\left(x \cdot \frac{x}{y}\right)}\right) \]
    6. Simplified87.0%

      \[\leadsto \color{blue}{\sin y \cdot \left(\frac{1}{y} + 0.5 \cdot \left(x \cdot \frac{x}{y}\right)\right)} \]
    7. Taylor expanded in y around 0 61.8%

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

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

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

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

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

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

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

Alternative 12: 30.4% accurate, 29.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1200:\\
\;\;\;\;-0.16666666666666666 \cdot \left(y \cdot y\right)\\

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


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

    1. Initial program 100.0%

      \[\cosh x \cdot \frac{\sin y}{y} \]
    2. Taylor expanded in x around 0 2.5%

      \[\leadsto \color{blue}{\frac{\sin y}{y}} \]
    3. Taylor expanded in y around 0 32.7%

      \[\leadsto \frac{\color{blue}{-0.16666666666666666 \cdot {y}^{3} + y}}{y} \]
    4. Taylor expanded in y around inf 30.2%

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

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

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

    if -1200 < x

    1. Initial program 99.9%

      \[\cosh x \cdot \frac{\sin y}{y} \]
    2. Taylor expanded in x around 0 64.1%

      \[\leadsto \color{blue}{\frac{\sin y}{y}} \]
    3. Taylor expanded in y around 0 37.5%

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

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

Alternative 13: 27.6% 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 99.9%

    \[\cosh x \cdot \frac{\sin y}{y} \]
  2. Taylor expanded in x around 0 52.6%

    \[\leadsto \color{blue}{\frac{\sin y}{y}} \]
  3. Taylor expanded in y around 0 30.8%

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

    \[\leadsto 1 \]

Developer target: 99.9% accurate, 1.0× speedup?

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

\\
\frac{\cosh x \cdot \sin y}{y}
\end{array}

Reproduce

?
herbie shell --seed 2023185 
(FPCore (x y)
  :name "Linear.Quaternion:$csinh from linear-1.19.1.3"
  :precision binary64

  :herbie-target
  (/ (* (cosh x) (sin y)) y)

  (* (cosh x) (/ (sin y) y)))