Linear.Quaternion:$ccos from linear-1.19.1.3

Percentage Accurate: 100.0% → 100.0%
Time: 7.4s
Alternatives: 11
Speedup: 1.0×

Specification

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

\\
\sin 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 11 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} \\ \sin x \cdot \frac{\sinh y}{y} \end{array} \]
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) y)))
double code(double x, double y) {
	return sin(x) * (sinh(y) / y);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = sin(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
	return Math.sin(x) * (Math.sinh(y) / y);
}
def code(x, y):
	return math.sin(x) * (math.sinh(y) / y)
function code(x, y)
	return Float64(sin(x) * Float64(sinh(y) / y))
end
function tmp = code(x, y)
	tmp = sin(x) * (sinh(y) / y);
end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 92.1% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ t_1 := \frac{x \cdot \sinh y}{y}\\ \mathbf{if}\;y \leq -1.65 \cdot 10^{+202}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -9.6:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{-5}:\\ \;\;\;\;\sin x\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (sin x) (* 0.16666666666666666 (* y y))))
        (t_1 (/ (* x (sinh y)) y)))
   (if (<= y -1.65e+202)
     t_0
     (if (<= y -9.6)
       t_1
       (if (<= y 1.45e-5) (sin x) (if (<= y 1.35e+154) t_1 t_0))))))
double code(double x, double y) {
	double t_0 = sin(x) * (0.16666666666666666 * (y * y));
	double t_1 = (x * sinh(y)) / y;
	double tmp;
	if (y <= -1.65e+202) {
		tmp = t_0;
	} else if (y <= -9.6) {
		tmp = t_1;
	} else if (y <= 1.45e-5) {
		tmp = sin(x);
	} else if (y <= 1.35e+154) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = sin(x) * (0.16666666666666666d0 * (y * y))
    t_1 = (x * sinh(y)) / y
    if (y <= (-1.65d+202)) then
        tmp = t_0
    else if (y <= (-9.6d0)) then
        tmp = t_1
    else if (y <= 1.45d-5) then
        tmp = sin(x)
    else if (y <= 1.35d+154) then
        tmp = t_1
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = Math.sin(x) * (0.16666666666666666 * (y * y));
	double t_1 = (x * Math.sinh(y)) / y;
	double tmp;
	if (y <= -1.65e+202) {
		tmp = t_0;
	} else if (y <= -9.6) {
		tmp = t_1;
	} else if (y <= 1.45e-5) {
		tmp = Math.sin(x);
	} else if (y <= 1.35e+154) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = math.sin(x) * (0.16666666666666666 * (y * y))
	t_1 = (x * math.sinh(y)) / y
	tmp = 0
	if y <= -1.65e+202:
		tmp = t_0
	elif y <= -9.6:
		tmp = t_1
	elif y <= 1.45e-5:
		tmp = math.sin(x)
	elif y <= 1.35e+154:
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(sin(x) * Float64(0.16666666666666666 * Float64(y * y)))
	t_1 = Float64(Float64(x * sinh(y)) / y)
	tmp = 0.0
	if (y <= -1.65e+202)
		tmp = t_0;
	elseif (y <= -9.6)
		tmp = t_1;
	elseif (y <= 1.45e-5)
		tmp = sin(x);
	elseif (y <= 1.35e+154)
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = sin(x) * (0.16666666666666666 * (y * y));
	t_1 = (x * sinh(y)) / y;
	tmp = 0.0;
	if (y <= -1.65e+202)
		tmp = t_0;
	elseif (y <= -9.6)
		tmp = t_1;
	elseif (y <= 1.45e-5)
		tmp = sin(x);
	elseif (y <= 1.35e+154)
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[Sin[x], $MachinePrecision] * N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -1.65e+202], t$95$0, If[LessEqual[y, -9.6], t$95$1, If[LessEqual[y, 1.45e-5], N[Sin[x], $MachinePrecision], If[LessEqual[y, 1.35e+154], t$95$1, t$95$0]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sin x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
t_1 := \frac{x \cdot \sinh y}{y}\\
\mathbf{if}\;y \leq -1.65 \cdot 10^{+202}:\\
\;\;\;\;t_0\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.6499999999999999e202 or 1.35000000000000003e154 < y

    1. Initial program 100.0%

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

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

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

      \[\leadsto \sin 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 \sin x\right)} \]
    6. Step-by-step derivation
      1. unpow2100.0%

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

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

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

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

    if -1.6499999999999999e202 < y < -9.59999999999999964 or 1.45e-5 < y < 1.35000000000000003e154

    1. Initial program 100.0%

      \[\sin x \cdot \frac{\sinh y}{y} \]
    2. Step-by-step derivation
      1. add-log-exp98.8%

        \[\leadsto \color{blue}{\log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      2. *-un-lft-identity98.8%

        \[\leadsto \log \color{blue}{\left(1 \cdot e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      3. log-prod98.8%

        \[\leadsto \color{blue}{\log 1 + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      4. metadata-eval98.8%

        \[\leadsto \color{blue}{0} + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right) \]
      5. add-log-exp100.0%

        \[\leadsto 0 + \color{blue}{\sin x \cdot \frac{\sinh y}{y}} \]
      6. *-commutative100.0%

        \[\leadsto 0 + \color{blue}{\frac{\sinh y}{y} \cdot \sin x} \]
      7. associate-*l/100.0%

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

      \[\leadsto \color{blue}{0 + \frac{\sinh y \cdot \sin x}{y}} \]
    4. Step-by-step derivation
      1. +-lft-identity100.0%

        \[\leadsto \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
      2. *-commutative100.0%

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

        \[\leadsto \color{blue}{\frac{\sin x}{y} \cdot \sinh y} \]
      4. *-commutative93.2%

        \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    5. Simplified93.2%

      \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    6. Taylor expanded in x around 0 76.7%

      \[\leadsto \sinh y \cdot \color{blue}{\frac{x}{y}} \]
    7. Step-by-step derivation
      1. *-commutative76.7%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \sinh y} \]
      2. associate-*l/83.5%

        \[\leadsto \color{blue}{\frac{x \cdot \sinh y}{y}} \]
    8. Applied egg-rr83.5%

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

    if -9.59999999999999964 < y < 1.45e-5

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{\sin x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification95.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{+202}:\\ \;\;\;\;\sin x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq -9.6:\\ \;\;\;\;\frac{x \cdot \sinh y}{y}\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{-5}:\\ \;\;\;\;\sin x\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{x \cdot \sinh y}{y}\\ \mathbf{else}:\\ \;\;\;\;\sin x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 3: 92.0% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\ t_1 := \sin x \cdot t_0\\ t_2 := \frac{x \cdot \sinh y}{y}\\ \mathbf{if}\;y \leq -1.65 \cdot 10^{+202}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -9.6:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 29000000:\\ \;\;\;\;\sin x \cdot \left(t_0 + 1\right)\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+153}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* y y)))
        (t_1 (* (sin x) t_0))
        (t_2 (/ (* x (sinh y)) y)))
   (if (<= y -1.65e+202)
     t_1
     (if (<= y -9.6)
       t_2
       (if (<= y 29000000.0)
         (* (sin x) (+ t_0 1.0))
         (if (<= y 5e+153) t_2 t_1))))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (y * y);
	double t_1 = sin(x) * t_0;
	double t_2 = (x * sinh(y)) / y;
	double tmp;
	if (y <= -1.65e+202) {
		tmp = t_1;
	} else if (y <= -9.6) {
		tmp = t_2;
	} else if (y <= 29000000.0) {
		tmp = sin(x) * (t_0 + 1.0);
	} else if (y <= 5e+153) {
		tmp = t_2;
	} else {
		tmp = 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 = sin(x) * t_0
    t_2 = (x * sinh(y)) / y
    if (y <= (-1.65d+202)) then
        tmp = t_1
    else if (y <= (-9.6d0)) then
        tmp = t_2
    else if (y <= 29000000.0d0) then
        tmp = sin(x) * (t_0 + 1.0d0)
    else if (y <= 5d+153) then
        tmp = t_2
    else
        tmp = 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 = Math.sin(x) * t_0;
	double t_2 = (x * Math.sinh(y)) / y;
	double tmp;
	if (y <= -1.65e+202) {
		tmp = t_1;
	} else if (y <= -9.6) {
		tmp = t_2;
	} else if (y <= 29000000.0) {
		tmp = Math.sin(x) * (t_0 + 1.0);
	} else if (y <= 5e+153) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y):
	t_0 = 0.16666666666666666 * (y * y)
	t_1 = math.sin(x) * t_0
	t_2 = (x * math.sinh(y)) / y
	tmp = 0
	if y <= -1.65e+202:
		tmp = t_1
	elif y <= -9.6:
		tmp = t_2
	elif y <= 29000000.0:
		tmp = math.sin(x) * (t_0 + 1.0)
	elif y <= 5e+153:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(y * y))
	t_1 = Float64(sin(x) * t_0)
	t_2 = Float64(Float64(x * sinh(y)) / y)
	tmp = 0.0
	if (y <= -1.65e+202)
		tmp = t_1;
	elseif (y <= -9.6)
		tmp = t_2;
	elseif (y <= 29000000.0)
		tmp = Float64(sin(x) * Float64(t_0 + 1.0));
	elseif (y <= 5e+153)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 0.16666666666666666 * (y * y);
	t_1 = sin(x) * t_0;
	t_2 = (x * sinh(y)) / y;
	tmp = 0.0;
	if (y <= -1.65e+202)
		tmp = t_1;
	elseif (y <= -9.6)
		tmp = t_2;
	elseif (y <= 29000000.0)
		tmp = sin(x) * (t_0 + 1.0);
	elseif (y <= 5e+153)
		tmp = t_2;
	else
		tmp = 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[(N[Sin[x], $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -1.65e+202], t$95$1, If[LessEqual[y, -9.6], t$95$2, If[LessEqual[y, 29000000.0], N[(N[Sin[x], $MachinePrecision] * N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+153], t$95$2, t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_1 := \sin x \cdot t_0\\
t_2 := \frac{x \cdot \sinh y}{y}\\
\mathbf{if}\;y \leq -1.65 \cdot 10^{+202}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 29000000:\\
\;\;\;\;\sin x \cdot \left(t_0 + 1\right)\\

\mathbf{elif}\;y \leq 5 \cdot 10^{+153}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.6499999999999999e202 or 5.00000000000000018e153 < y

    1. Initial program 100.0%

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

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

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

      \[\leadsto \sin 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 \sin x\right)} \]
    6. Step-by-step derivation
      1. unpow2100.0%

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

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

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

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

    if -1.6499999999999999e202 < y < -9.59999999999999964 or 2.9e7 < y < 5.00000000000000018e153

    1. Initial program 100.0%

      \[\sin x \cdot \frac{\sinh y}{y} \]
    2. Step-by-step derivation
      1. add-log-exp100.0%

        \[\leadsto \color{blue}{\log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      2. *-un-lft-identity100.0%

        \[\leadsto \log \color{blue}{\left(1 \cdot e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      3. log-prod100.0%

        \[\leadsto \color{blue}{\log 1 + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      4. metadata-eval100.0%

        \[\leadsto \color{blue}{0} + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right) \]
      5. add-log-exp100.0%

        \[\leadsto 0 + \color{blue}{\sin x \cdot \frac{\sinh y}{y}} \]
      6. *-commutative100.0%

        \[\leadsto 0 + \color{blue}{\frac{\sinh y}{y} \cdot \sin x} \]
      7. associate-*l/100.0%

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

      \[\leadsto \color{blue}{0 + \frac{\sinh y \cdot \sin x}{y}} \]
    4. Step-by-step derivation
      1. +-lft-identity100.0%

        \[\leadsto \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
      2. *-commutative100.0%

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

        \[\leadsto \color{blue}{\frac{\sin x}{y} \cdot \sinh y} \]
      4. *-commutative93.0%

        \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    5. Simplified93.0%

      \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    6. Taylor expanded in x around 0 77.5%

      \[\leadsto \sinh y \cdot \color{blue}{\frac{x}{y}} \]
    7. Step-by-step derivation
      1. *-commutative77.5%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \sinh y} \]
      2. associate-*l/84.5%

        \[\leadsto \color{blue}{\frac{x \cdot \sinh y}{y}} \]
    8. Applied egg-rr84.5%

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

    if -9.59999999999999964 < y < 2.9e7

    1. Initial program 100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{+202}:\\ \;\;\;\;\sin x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq -9.6:\\ \;\;\;\;\frac{x \cdot \sinh y}{y}\\ \mathbf{elif}\;y \leq 29000000:\\ \;\;\;\;\sin x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right) + 1\right)\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+153}:\\ \;\;\;\;\frac{x \cdot \sinh y}{y}\\ \mathbf{else}:\\ \;\;\;\;\sin x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 4: 84.8% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x \cdot \sinh y}{y}\\ \mathbf{if}\;y \leq -9.6:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.42 \cdot 10^{-5}:\\ \;\;\;\;\sin x\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{+201} \lor \neg \left(y \leq 3 \cdot 10^{+237}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;-0.16666666666666666 \cdot {x}^{3}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ (* x (sinh y)) y)))
   (if (<= y -9.6)
     t_0
     (if (<= y 1.42e-5)
       (sin x)
       (if (or (<= y 2.05e+201) (not (<= y 3e+237)))
         t_0
         (* -0.16666666666666666 (pow x 3.0)))))))
double code(double x, double y) {
	double t_0 = (x * sinh(y)) / y;
	double tmp;
	if (y <= -9.6) {
		tmp = t_0;
	} else if (y <= 1.42e-5) {
		tmp = sin(x);
	} else if ((y <= 2.05e+201) || !(y <= 3e+237)) {
		tmp = t_0;
	} else {
		tmp = -0.16666666666666666 * pow(x, 3.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 = (x * sinh(y)) / y
    if (y <= (-9.6d0)) then
        tmp = t_0
    else if (y <= 1.42d-5) then
        tmp = sin(x)
    else if ((y <= 2.05d+201) .or. (.not. (y <= 3d+237))) then
        tmp = t_0
    else
        tmp = (-0.16666666666666666d0) * (x ** 3.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = (x * Math.sinh(y)) / y;
	double tmp;
	if (y <= -9.6) {
		tmp = t_0;
	} else if (y <= 1.42e-5) {
		tmp = Math.sin(x);
	} else if ((y <= 2.05e+201) || !(y <= 3e+237)) {
		tmp = t_0;
	} else {
		tmp = -0.16666666666666666 * Math.pow(x, 3.0);
	}
	return tmp;
}
def code(x, y):
	t_0 = (x * math.sinh(y)) / y
	tmp = 0
	if y <= -9.6:
		tmp = t_0
	elif y <= 1.42e-5:
		tmp = math.sin(x)
	elif (y <= 2.05e+201) or not (y <= 3e+237):
		tmp = t_0
	else:
		tmp = -0.16666666666666666 * math.pow(x, 3.0)
	return tmp
function code(x, y)
	t_0 = Float64(Float64(x * sinh(y)) / y)
	tmp = 0.0
	if (y <= -9.6)
		tmp = t_0;
	elseif (y <= 1.42e-5)
		tmp = sin(x);
	elseif ((y <= 2.05e+201) || !(y <= 3e+237))
		tmp = t_0;
	else
		tmp = Float64(-0.16666666666666666 * (x ^ 3.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (x * sinh(y)) / y;
	tmp = 0.0;
	if (y <= -9.6)
		tmp = t_0;
	elseif (y <= 1.42e-5)
		tmp = sin(x);
	elseif ((y <= 2.05e+201) || ~((y <= 3e+237)))
		tmp = t_0;
	else
		tmp = -0.16666666666666666 * (x ^ 3.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(x * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -9.6], t$95$0, If[LessEqual[y, 1.42e-5], N[Sin[x], $MachinePrecision], If[Or[LessEqual[y, 2.05e+201], N[Not[LessEqual[y, 3e+237]], $MachinePrecision]], t$95$0, N[(-0.16666666666666666 * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x \cdot \sinh y}{y}\\
\mathbf{if}\;y \leq -9.6:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;y \leq 2.05 \cdot 10^{+201} \lor \neg \left(y \leq 3 \cdot 10^{+237}\right):\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;-0.16666666666666666 \cdot {x}^{3}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9.59999999999999964 or 1.42e-5 < y < 2.0500000000000001e201 or 3e237 < y

    1. Initial program 100.0%

      \[\sin x \cdot \frac{\sinh y}{y} \]
    2. Step-by-step derivation
      1. add-log-exp99.3%

        \[\leadsto \color{blue}{\log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      2. *-un-lft-identity99.3%

        \[\leadsto \log \color{blue}{\left(1 \cdot e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      3. log-prod99.3%

        \[\leadsto \color{blue}{\log 1 + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      4. metadata-eval99.3%

        \[\leadsto \color{blue}{0} + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right) \]
      5. add-log-exp100.0%

        \[\leadsto 0 + \color{blue}{\sin x \cdot \frac{\sinh y}{y}} \]
      6. *-commutative100.0%

        \[\leadsto 0 + \color{blue}{\frac{\sinh y}{y} \cdot \sin x} \]
      7. associate-*l/100.0%

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

      \[\leadsto \color{blue}{0 + \frac{\sinh y \cdot \sin x}{y}} \]
    4. Step-by-step derivation
      1. +-lft-identity100.0%

        \[\leadsto \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
      2. *-commutative100.0%

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

        \[\leadsto \color{blue}{\frac{\sin x}{y} \cdot \sinh y} \]
      4. *-commutative81.5%

        \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    5. Simplified81.5%

      \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    6. Taylor expanded in x around 0 57.3%

      \[\leadsto \sinh y \cdot \color{blue}{\frac{x}{y}} \]
    7. Step-by-step derivation
      1. *-commutative57.3%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \sinh y} \]
      2. associate-*l/75.8%

        \[\leadsto \color{blue}{\frac{x \cdot \sinh y}{y}} \]
    8. Applied egg-rr75.8%

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

    if -9.59999999999999964 < y < 1.42e-5

    1. Initial program 100.0%

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

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

    if 2.0500000000000001e201 < y < 3e237

    1. Initial program 100.0%

      \[\sin x \cdot \frac{\sinh y}{y} \]
    2. Step-by-step derivation
      1. add-log-exp100.0%

        \[\leadsto \color{blue}{\log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      2. *-un-lft-identity100.0%

        \[\leadsto \log \color{blue}{\left(1 \cdot e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      3. log-prod100.0%

        \[\leadsto \color{blue}{\log 1 + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      4. metadata-eval100.0%

        \[\leadsto \color{blue}{0} + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right) \]
      5. add-log-exp100.0%

        \[\leadsto 0 + \color{blue}{\sin x \cdot \frac{\sinh y}{y}} \]
      6. *-commutative100.0%

        \[\leadsto 0 + \color{blue}{\frac{\sinh y}{y} \cdot \sin x} \]
      7. associate-*l/100.0%

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

      \[\leadsto \color{blue}{0 + \frac{\sinh y \cdot \sin x}{y}} \]
    4. Step-by-step derivation
      1. +-lft-identity100.0%

        \[\leadsto \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
      2. *-commutative100.0%

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

        \[\leadsto \color{blue}{\frac{\sin x}{y} \cdot \sinh y} \]
      4. *-commutative100.0%

        \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    5. Simplified100.0%

      \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    6. Taylor expanded in y around 0 3.1%

      \[\leadsto \color{blue}{y} \cdot \frac{\sin x}{y} \]
    7. Taylor expanded in x around 0 100.0%

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot {x}^{3} + x} \]
    8. Taylor expanded in x around inf 100.0%

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot {x}^{3}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.6:\\ \;\;\;\;\frac{x \cdot \sinh y}{y}\\ \mathbf{elif}\;y \leq 1.42 \cdot 10^{-5}:\\ \;\;\;\;\sin x\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{+201} \lor \neg \left(y \leq 3 \cdot 10^{+237}\right):\\ \;\;\;\;\frac{x \cdot \sinh y}{y}\\ \mathbf{else}:\\ \;\;\;\;-0.16666666666666666 \cdot {x}^{3}\\ \end{array} \]

Alternative 5: 83.5% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\ t_1 := \sinh y \cdot \frac{x}{y}\\ \mathbf{if}\;y \leq -1.42 \cdot 10^{+190}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -9.6:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{-5}:\\ \;\;\;\;\sin x\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* x (* y y)))) (t_1 (* (sinh y) (/ x y))))
   (if (<= y -1.42e+190)
     t_0
     (if (<= y -9.6)
       t_1
       (if (<= y 1.45e-5) (sin x) (if (<= y 1.35e+154) t_1 t_0))))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (x * (y * y));
	double t_1 = sinh(y) * (x / y);
	double tmp;
	if (y <= -1.42e+190) {
		tmp = t_0;
	} else if (y <= -9.6) {
		tmp = t_1;
	} else if (y <= 1.45e-5) {
		tmp = sin(x);
	} else if (y <= 1.35e+154) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 0.16666666666666666d0 * (x * (y * y))
    t_1 = sinh(y) * (x / y)
    if (y <= (-1.42d+190)) then
        tmp = t_0
    else if (y <= (-9.6d0)) then
        tmp = t_1
    else if (y <= 1.45d-5) then
        tmp = sin(x)
    else if (y <= 1.35d+154) then
        tmp = t_1
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (x * (y * y));
	double t_1 = Math.sinh(y) * (x / y);
	double tmp;
	if (y <= -1.42e+190) {
		tmp = t_0;
	} else if (y <= -9.6) {
		tmp = t_1;
	} else if (y <= 1.45e-5) {
		tmp = Math.sin(x);
	} else if (y <= 1.35e+154) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = 0.16666666666666666 * (x * (y * y))
	t_1 = math.sinh(y) * (x / y)
	tmp = 0
	if y <= -1.42e+190:
		tmp = t_0
	elif y <= -9.6:
		tmp = t_1
	elif y <= 1.45e-5:
		tmp = math.sin(x)
	elif y <= 1.35e+154:
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(x * Float64(y * y)))
	t_1 = Float64(sinh(y) * Float64(x / y))
	tmp = 0.0
	if (y <= -1.42e+190)
		tmp = t_0;
	elseif (y <= -9.6)
		tmp = t_1;
	elseif (y <= 1.45e-5)
		tmp = sin(x);
	elseif (y <= 1.35e+154)
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 0.16666666666666666 * (x * (y * y));
	t_1 = sinh(y) * (x / y);
	tmp = 0.0;
	if (y <= -1.42e+190)
		tmp = t_0;
	elseif (y <= -9.6)
		tmp = t_1;
	elseif (y <= 1.45e-5)
		tmp = sin(x);
	elseif (y <= 1.35e+154)
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sinh[y], $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.42e+190], t$95$0, If[LessEqual[y, -9.6], t$95$1, If[LessEqual[y, 1.45e-5], N[Sin[x], $MachinePrecision], If[LessEqual[y, 1.35e+154], t$95$1, t$95$0]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
t_1 := \sinh y \cdot \frac{x}{y}\\
\mathbf{if}\;y \leq -1.42 \cdot 10^{+190}:\\
\;\;\;\;t_0\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.42e190 or 1.35000000000000003e154 < y

    1. Initial program 100.0%

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

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

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

      \[\leadsto \sin 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 \sin x\right)} \]
    6. Step-by-step derivation
      1. unpow2100.0%

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

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

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

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

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

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

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

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

    if -1.42e190 < y < -9.59999999999999964 or 1.45e-5 < y < 1.35000000000000003e154

    1. Initial program 100.0%

      \[\sin x \cdot \frac{\sinh y}{y} \]
    2. Step-by-step derivation
      1. add-log-exp98.8%

        \[\leadsto \color{blue}{\log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      2. *-un-lft-identity98.8%

        \[\leadsto \log \color{blue}{\left(1 \cdot e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      3. log-prod98.8%

        \[\leadsto \color{blue}{\log 1 + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      4. metadata-eval98.8%

        \[\leadsto \color{blue}{0} + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right) \]
      5. add-log-exp100.0%

        \[\leadsto 0 + \color{blue}{\sin x \cdot \frac{\sinh y}{y}} \]
      6. *-commutative100.0%

        \[\leadsto 0 + \color{blue}{\frac{\sinh y}{y} \cdot \sin x} \]
      7. associate-*l/100.0%

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

      \[\leadsto \color{blue}{0 + \frac{\sinh y \cdot \sin x}{y}} \]
    4. Step-by-step derivation
      1. +-lft-identity100.0%

        \[\leadsto \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
      2. *-commutative100.0%

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

        \[\leadsto \color{blue}{\frac{\sin x}{y} \cdot \sinh y} \]
      4. *-commutative94.4%

        \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    5. Simplified94.4%

      \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    6. Taylor expanded in x around 0 77.8%

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

    if -9.59999999999999964 < y < 1.45e-5

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.42 \cdot 10^{+190}:\\ \;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq -9.6:\\ \;\;\;\;\sinh y \cdot \frac{x}{y}\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{-5}:\\ \;\;\;\;\sin x\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\sinh y \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 6: 67.5% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\ \mathbf{if}\;y \leq -3000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+31}:\\ \;\;\;\;\sin x\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+237}:\\ \;\;\;\;-0.16666666666666666 \cdot {x}^{3}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* x (* y y)))))
   (if (<= y -3000.0)
     t_0
     (if (<= y 1.25e+31)
       (sin x)
       (if (<= y 3e+237) (* -0.16666666666666666 (pow x 3.0)) t_0)))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (x * (y * y));
	double tmp;
	if (y <= -3000.0) {
		tmp = t_0;
	} else if (y <= 1.25e+31) {
		tmp = sin(x);
	} else if (y <= 3e+237) {
		tmp = -0.16666666666666666 * pow(x, 3.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.16666666666666666d0 * (x * (y * y))
    if (y <= (-3000.0d0)) then
        tmp = t_0
    else if (y <= 1.25d+31) then
        tmp = sin(x)
    else if (y <= 3d+237) then
        tmp = (-0.16666666666666666d0) * (x ** 3.0d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (x * (y * y));
	double tmp;
	if (y <= -3000.0) {
		tmp = t_0;
	} else if (y <= 1.25e+31) {
		tmp = Math.sin(x);
	} else if (y <= 3e+237) {
		tmp = -0.16666666666666666 * Math.pow(x, 3.0);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = 0.16666666666666666 * (x * (y * y))
	tmp = 0
	if y <= -3000.0:
		tmp = t_0
	elif y <= 1.25e+31:
		tmp = math.sin(x)
	elif y <= 3e+237:
		tmp = -0.16666666666666666 * math.pow(x, 3.0)
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(x * Float64(y * y)))
	tmp = 0.0
	if (y <= -3000.0)
		tmp = t_0;
	elseif (y <= 1.25e+31)
		tmp = sin(x);
	elseif (y <= 3e+237)
		tmp = Float64(-0.16666666666666666 * (x ^ 3.0));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 0.16666666666666666 * (x * (y * y));
	tmp = 0.0;
	if (y <= -3000.0)
		tmp = t_0;
	elseif (y <= 1.25e+31)
		tmp = sin(x);
	elseif (y <= 3e+237)
		tmp = -0.16666666666666666 * (x ^ 3.0);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3000.0], t$95$0, If[LessEqual[y, 1.25e+31], N[Sin[x], $MachinePrecision], If[LessEqual[y, 3e+237], N[(-0.16666666666666666 * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 1.25 \cdot 10^{+31}:\\
\;\;\;\;\sin x\\

\mathbf{elif}\;y \leq 3 \cdot 10^{+237}:\\
\;\;\;\;-0.16666666666666666 \cdot {x}^{3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3e3 or 3e237 < y

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \sin x} \]
      3. *-commutative62.8%

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

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

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

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

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

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

    if -3e3 < y < 1.25000000000000007e31

    1. Initial program 100.0%

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

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

    if 1.25000000000000007e31 < y < 3e237

    1. Initial program 100.0%

      \[\sin x \cdot \frac{\sinh y}{y} \]
    2. Step-by-step derivation
      1. add-log-exp100.0%

        \[\leadsto \color{blue}{\log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      2. *-un-lft-identity100.0%

        \[\leadsto \log \color{blue}{\left(1 \cdot e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      3. log-prod100.0%

        \[\leadsto \color{blue}{\log 1 + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      4. metadata-eval100.0%

        \[\leadsto \color{blue}{0} + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right) \]
      5. add-log-exp100.0%

        \[\leadsto 0 + \color{blue}{\sin x \cdot \frac{\sinh y}{y}} \]
      6. *-commutative100.0%

        \[\leadsto 0 + \color{blue}{\frac{\sinh y}{y} \cdot \sin x} \]
      7. associate-*l/100.0%

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

      \[\leadsto \color{blue}{0 + \frac{\sinh y \cdot \sin x}{y}} \]
    4. Step-by-step derivation
      1. +-lft-identity100.0%

        \[\leadsto \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
      2. *-commutative100.0%

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

        \[\leadsto \color{blue}{\frac{\sin x}{y} \cdot \sinh y} \]
      4. *-commutative87.9%

        \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    5. Simplified87.9%

      \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    6. Taylor expanded in y around 0 2.7%

      \[\leadsto \color{blue}{y} \cdot \frac{\sin x}{y} \]
    7. Taylor expanded in x around 0 31.7%

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot {x}^{3} + x} \]
    8. Taylor expanded in x around inf 31.3%

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot {x}^{3}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification69.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3000:\\ \;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+31}:\\ \;\;\;\;\sin x\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+237}:\\ \;\;\;\;-0.16666666666666666 \cdot {x}^{3}\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 7: 71.8% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3100 \lor \neg \left(y \leq 17200000000000\right):\\ \;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin x\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= y -3100.0) (not (<= y 17200000000000.0)))
   (* 0.16666666666666666 (* x (* y y)))
   (sin x)))
double code(double x, double y) {
	double tmp;
	if ((y <= -3100.0) || !(y <= 17200000000000.0)) {
		tmp = 0.16666666666666666 * (x * (y * y));
	} else {
		tmp = sin(x);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((y <= (-3100.0d0)) .or. (.not. (y <= 17200000000000.0d0))) then
        tmp = 0.16666666666666666d0 * (x * (y * y))
    else
        tmp = sin(x)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((y <= -3100.0) || !(y <= 17200000000000.0)) {
		tmp = 0.16666666666666666 * (x * (y * y));
	} else {
		tmp = Math.sin(x);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (y <= -3100.0) or not (y <= 17200000000000.0):
		tmp = 0.16666666666666666 * (x * (y * y))
	else:
		tmp = math.sin(x)
	return tmp
function code(x, y)
	tmp = 0.0
	if ((y <= -3100.0) || !(y <= 17200000000000.0))
		tmp = Float64(0.16666666666666666 * Float64(x * Float64(y * y)));
	else
		tmp = sin(x);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((y <= -3100.0) || ~((y <= 17200000000000.0)))
		tmp = 0.16666666666666666 * (x * (y * y));
	else
		tmp = sin(x);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[y, -3100.0], N[Not[LessEqual[y, 17200000000000.0]], $MachinePrecision]], N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[x], $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3100 or 1.72e13 < y

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \sin x} \]
      3. *-commutative50.9%

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

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

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

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

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

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

    if -3100 < y < 1.72e13

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{\sin x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification67.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3100 \lor \neg \left(y \leq 17200000000000\right):\\ \;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin x\\ \end{array} \]

Alternative 8: 48.1% accurate, 13.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -54 or 8.5e7 < y

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot \sin x} \]
      3. *-commutative50.9%

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

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

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

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

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

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

    if -54 < y < 8.5e7

    1. Initial program 100.0%

      \[\sin x \cdot \frac{\sinh y}{y} \]
    2. Step-by-step derivation
      1. add-log-exp58.7%

        \[\leadsto \color{blue}{\log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      2. *-un-lft-identity58.7%

        \[\leadsto \log \color{blue}{\left(1 \cdot e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      3. log-prod58.7%

        \[\leadsto \color{blue}{\log 1 + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      4. metadata-eval58.7%

        \[\leadsto \color{blue}{0} + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right) \]
      5. add-log-exp100.0%

        \[\leadsto 0 + \color{blue}{\sin x \cdot \frac{\sinh y}{y}} \]
      6. *-commutative100.0%

        \[\leadsto 0 + \color{blue}{\frac{\sinh y}{y} \cdot \sin x} \]
      7. associate-*l/85.8%

        \[\leadsto 0 + \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
    3. Applied egg-rr85.8%

      \[\leadsto \color{blue}{0 + \frac{\sinh y \cdot \sin x}{y}} \]
    4. Step-by-step derivation
      1. +-lft-identity85.8%

        \[\leadsto \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
      2. *-commutative85.8%

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

        \[\leadsto \color{blue}{\frac{\sin x}{y} \cdot \sinh y} \]
      4. *-commutative99.8%

        \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    5. Simplified99.8%

      \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    6. Taylor expanded in y around 0 98.2%

      \[\leadsto \color{blue}{y} \cdot \frac{\sin x}{y} \]
    7. Step-by-step derivation
      1. clear-num97.9%

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

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

      \[\leadsto \color{blue}{\frac{y}{\frac{y}{\sin x}}} \]
    9. Taylor expanded in x around 0 47.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -54 \lor \neg \left(y \leq 85000000\right):\\ \;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{y}{x} + 0.16666666666666666 \cdot \left(x \cdot y\right)}\\ \end{array} \]

Alternative 9: 47.7% accurate, 18.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{-8} \lor \neg \left(y \leq 29000000\right):\\
\;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.11999999999999994e-8 or 2.9e7 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.11999999999999994e-8 < y < 2.9e7

    1. Initial program 100.0%

      \[\sin x \cdot \frac{\sinh y}{y} \]
    2. Step-by-step derivation
      1. add-log-exp58.1%

        \[\leadsto \color{blue}{\log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      2. *-un-lft-identity58.1%

        \[\leadsto \log \color{blue}{\left(1 \cdot e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      3. log-prod58.1%

        \[\leadsto \color{blue}{\log 1 + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      4. metadata-eval58.1%

        \[\leadsto \color{blue}{0} + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right) \]
      5. add-log-exp100.0%

        \[\leadsto 0 + \color{blue}{\sin x \cdot \frac{\sinh y}{y}} \]
      6. *-commutative100.0%

        \[\leadsto 0 + \color{blue}{\frac{\sinh y}{y} \cdot \sin x} \]
      7. associate-*l/85.5%

        \[\leadsto 0 + \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
    3. Applied egg-rr85.5%

      \[\leadsto \color{blue}{0 + \frac{\sinh y \cdot \sin x}{y}} \]
    4. Step-by-step derivation
      1. +-lft-identity85.5%

        \[\leadsto \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
      2. *-commutative85.5%

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

        \[\leadsto \color{blue}{\frac{\sin x}{y} \cdot \sinh y} \]
      4. *-commutative99.8%

        \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    5. Simplified99.8%

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

      \[\leadsto \color{blue}{y} \cdot \frac{\sin x}{y} \]
    7. Taylor expanded in x around 0 47.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.12 \cdot 10^{-8} \lor \neg \left(y \leq 29000000\right):\\ \;\;\;\;0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 10: 28.9% accurate, 29.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{+61}:\\
\;\;\;\;\frac{x \cdot y}{y}\\

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


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

    1. Initial program 100.0%

      \[\sin x \cdot \frac{\sinh y}{y} \]
    2. Step-by-step derivation
      1. add-log-exp99.4%

        \[\leadsto \color{blue}{\log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      2. *-un-lft-identity99.4%

        \[\leadsto \log \color{blue}{\left(1 \cdot e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      3. log-prod99.4%

        \[\leadsto \color{blue}{\log 1 + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      4. metadata-eval99.4%

        \[\leadsto \color{blue}{0} + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right) \]
      5. add-log-exp100.0%

        \[\leadsto 0 + \color{blue}{\sin x \cdot \frac{\sinh y}{y}} \]
      6. *-commutative100.0%

        \[\leadsto 0 + \color{blue}{\frac{\sinh y}{y} \cdot \sin x} \]
      7. associate-*l/99.9%

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

      \[\leadsto \color{blue}{0 + \frac{\sinh y \cdot \sin x}{y}} \]
    4. Step-by-step derivation
      1. +-lft-identity99.9%

        \[\leadsto \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
      2. *-commutative99.9%

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

        \[\leadsto \color{blue}{\frac{\sin x}{y} \cdot \sinh y} \]
      4. *-commutative99.9%

        \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    5. Simplified99.9%

      \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    6. Taylor expanded in y around 0 56.9%

      \[\leadsto \color{blue}{y} \cdot \frac{\sin x}{y} \]
    7. Taylor expanded in x around 0 2.8%

      \[\leadsto y \cdot \color{blue}{\frac{x}{y}} \]
    8. Step-by-step derivation
      1. associate-*r/14.6%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} \]
      2. *-commutative14.6%

        \[\leadsto \frac{\color{blue}{x \cdot y}}{y} \]
    9. Applied egg-rr14.6%

      \[\leadsto \color{blue}{\frac{x \cdot y}{y}} \]

    if -7.20000000000000021e61 < x

    1. Initial program 100.0%

      \[\sin x \cdot \frac{\sinh y}{y} \]
    2. Step-by-step derivation
      1. add-log-exp72.4%

        \[\leadsto \color{blue}{\log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      2. *-un-lft-identity72.4%

        \[\leadsto \log \color{blue}{\left(1 \cdot e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      3. log-prod72.4%

        \[\leadsto \color{blue}{\log 1 + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
      4. metadata-eval72.4%

        \[\leadsto \color{blue}{0} + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right) \]
      5. add-log-exp100.0%

        \[\leadsto 0 + \color{blue}{\sin x \cdot \frac{\sinh y}{y}} \]
      6. *-commutative100.0%

        \[\leadsto 0 + \color{blue}{\frac{\sinh y}{y} \cdot \sin x} \]
      7. associate-*l/90.4%

        \[\leadsto 0 + \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
    3. Applied egg-rr90.4%

      \[\leadsto \color{blue}{0 + \frac{\sinh y \cdot \sin x}{y}} \]
    4. Step-by-step derivation
      1. +-lft-identity90.4%

        \[\leadsto \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
      2. *-commutative90.4%

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

        \[\leadsto \color{blue}{\frac{\sin x}{y} \cdot \sinh y} \]
      4. *-commutative87.8%

        \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    5. Simplified87.8%

      \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
    6. Taylor expanded in y around 0 48.7%

      \[\leadsto \color{blue}{y} \cdot \frac{\sin x}{y} \]
    7. Taylor expanded in x around 0 31.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{+61}:\\ \;\;\;\;\frac{x \cdot y}{y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 11: 26.1% accurate, 205.0× speedup?

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

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

    \[\sin x \cdot \frac{\sinh y}{y} \]
  2. Step-by-step derivation
    1. add-log-exp79.2%

      \[\leadsto \color{blue}{\log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
    2. *-un-lft-identity79.2%

      \[\leadsto \log \color{blue}{\left(1 \cdot e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
    3. log-prod79.2%

      \[\leadsto \color{blue}{\log 1 + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right)} \]
    4. metadata-eval79.2%

      \[\leadsto \color{blue}{0} + \log \left(e^{\sin x \cdot \frac{\sinh y}{y}}\right) \]
    5. add-log-exp100.0%

      \[\leadsto 0 + \color{blue}{\sin x \cdot \frac{\sinh y}{y}} \]
    6. *-commutative100.0%

      \[\leadsto 0 + \color{blue}{\frac{\sinh y}{y} \cdot \sin x} \]
    7. associate-*l/92.8%

      \[\leadsto 0 + \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
  3. Applied egg-rr92.8%

    \[\leadsto \color{blue}{0 + \frac{\sinh y \cdot \sin x}{y}} \]
  4. Step-by-step derivation
    1. +-lft-identity92.8%

      \[\leadsto \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
    2. *-commutative92.8%

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

      \[\leadsto \color{blue}{\frac{\sin x}{y} \cdot \sinh y} \]
    4. *-commutative90.9%

      \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
  5. Simplified90.9%

    \[\leadsto \color{blue}{\sinh y \cdot \frac{\sin x}{y}} \]
  6. Taylor expanded in y around 0 50.8%

    \[\leadsto \color{blue}{y} \cdot \frac{\sin x}{y} \]
  7. Taylor expanded in x around 0 24.5%

    \[\leadsto \color{blue}{x} \]
  8. Final simplification24.5%

    \[\leadsto x \]

Reproduce

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