Linear.Quaternion:$ccos from linear-1.19.1.3

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\sin x}{\frac{y}{\sinh y}}} \]
  4. Final simplification100.0%

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

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

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\ t_1 := x \cdot \left(-1 + \frac{1 - {y}^{4} \cdot 0.027777777777777776}{1 + y \cdot \left(y \cdot -0.16666666666666666\right)}\right)\\ \mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -1 \cdot 10^{+40}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+66}:\\ \;\;\;\;\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 2.25 \cdot 10^{+150}:\\ \;\;\;\;x + t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* (sin x) (* y y))))
        (t_1
         (*
          x
          (+
           -1.0
           (/
            (- 1.0 (* (pow y 4.0) 0.027777777777777776))
            (+ 1.0 (* y (* y -0.16666666666666666))))))))
   (if (<= y -1.35e+154)
     t_0
     (if (<= y -1e+40)
       t_1
       (if (<= y 2.2e+66)
         (* (sin x) (+ 1.0 (* 0.16666666666666666 (* y y))))
         (if (<= y 2.25e+150) (+ x t_1) t_0))))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (sin(x) * (y * y));
	double t_1 = x * (-1.0 + ((1.0 - (pow(y, 4.0) * 0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666)))));
	double tmp;
	if (y <= -1.35e+154) {
		tmp = t_0;
	} else if (y <= -1e+40) {
		tmp = t_1;
	} else if (y <= 2.2e+66) {
		tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
	} else if (y <= 2.25e+150) {
		tmp = x + 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 * (sin(x) * (y * y))
    t_1 = x * ((-1.0d0) + ((1.0d0 - ((y ** 4.0d0) * 0.027777777777777776d0)) / (1.0d0 + (y * (y * (-0.16666666666666666d0))))))
    if (y <= (-1.35d+154)) then
        tmp = t_0
    else if (y <= (-1d+40)) then
        tmp = t_1
    else if (y <= 2.2d+66) then
        tmp = sin(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
    else if (y <= 2.25d+150) then
        tmp = x + 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 * (Math.sin(x) * (y * y));
	double t_1 = x * (-1.0 + ((1.0 - (Math.pow(y, 4.0) * 0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666)))));
	double tmp;
	if (y <= -1.35e+154) {
		tmp = t_0;
	} else if (y <= -1e+40) {
		tmp = t_1;
	} else if (y <= 2.2e+66) {
		tmp = Math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
	} else if (y <= 2.25e+150) {
		tmp = x + t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = 0.16666666666666666 * (math.sin(x) * (y * y))
	t_1 = x * (-1.0 + ((1.0 - (math.pow(y, 4.0) * 0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666)))))
	tmp = 0
	if y <= -1.35e+154:
		tmp = t_0
	elif y <= -1e+40:
		tmp = t_1
	elif y <= 2.2e+66:
		tmp = math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)))
	elif y <= 2.25e+150:
		tmp = x + t_1
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(sin(x) * Float64(y * y)))
	t_1 = Float64(x * Float64(-1.0 + Float64(Float64(1.0 - Float64((y ^ 4.0) * 0.027777777777777776)) / Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666))))))
	tmp = 0.0
	if (y <= -1.35e+154)
		tmp = t_0;
	elseif (y <= -1e+40)
		tmp = t_1;
	elseif (y <= 2.2e+66)
		tmp = Float64(sin(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))));
	elseif (y <= 2.25e+150)
		tmp = Float64(x + t_1);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 0.16666666666666666 * (sin(x) * (y * y));
	t_1 = x * (-1.0 + ((1.0 - ((y ^ 4.0) * 0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666)))));
	tmp = 0.0;
	if (y <= -1.35e+154)
		tmp = t_0;
	elseif (y <= -1e+40)
		tmp = t_1;
	elseif (y <= 2.2e+66)
		tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
	elseif (y <= 2.25e+150)
		tmp = x + t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(N[Sin[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(-1.0 + N[(N[(1.0 - N[(N[Power[y, 4.0], $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.35e+154], t$95$0, If[LessEqual[y, -1e+40], t$95$1, If[LessEqual[y, 2.2e+66], N[(N[Sin[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.25e+150], N[(x + t$95$1), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1 \cdot 10^{+40}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.2 \cdot 10^{+66}:\\
\;\;\;\;\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\

\mathbf{elif}\;y \leq 2.25 \cdot 10^{+150}:\\
\;\;\;\;x + t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.35000000000000003e154 or 2.25e150 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -1.35000000000000003e154 < y < -1.00000000000000003e40

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    11. Step-by-step derivation
      1. expm1-log1p-u17.5%

        \[\leadsto x \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\right)} \]
      2. expm1-udef17.5%

        \[\leadsto x \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)} - 1\right)} \]
      3. log1p-udef17.5%

        \[\leadsto x \cdot \left(e^{\color{blue}{\log \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)}} - 1\right) \]
      4. add-exp-log17.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(1 - 0.027777777777777776 \cdot {y}^{4}, \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, \color{blue}{-1}\right) \]
    12. Applied egg-rr54.6%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(1 - 0.027777777777777776 \cdot {y}^{4}, \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right)} \]
    13. Step-by-step derivation
      1. fma-udef54.6%

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

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

        \[\leadsto x \cdot \left(-1 + \color{blue}{\frac{\left(1 - 0.027777777777777776 \cdot {y}^{4}\right) \cdot 1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}}\right) \]
      4. *-rgt-identity54.6%

        \[\leadsto x \cdot \left(-1 + \frac{\color{blue}{1 - 0.027777777777777776 \cdot {y}^{4}}}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\right) \]
      5. *-commutative54.6%

        \[\leadsto x \cdot \left(-1 + \frac{1 - \color{blue}{{y}^{4} \cdot 0.027777777777777776}}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\right) \]
      6. cancel-sign-sub-inv54.6%

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

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

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

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

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

    if -1.00000000000000003e40 < y < 2.1999999999999998e66

    1. Initial program 100.0%

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

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

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

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

    if 2.1999999999999998e66 < y < 2.25e150

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot x + x} \]
    10. Step-by-step derivation
      1. expm1-log1p-u9.5%

        \[\leadsto x \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\right)} \]
      2. expm1-udef9.5%

        \[\leadsto x \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)} - 1\right)} \]
      3. log1p-udef9.5%

        \[\leadsto x \cdot \left(e^{\color{blue}{\log \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)}} - 1\right) \]
      4. add-exp-log9.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(1 - 0.027777777777777776 \cdot {y}^{4}, \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, \color{blue}{-1}\right) \]
    11. Applied egg-rr65.4%

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

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

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

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

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

        \[\leadsto x \cdot \left(-1 + \frac{1 - \color{blue}{{y}^{4} \cdot 0.027777777777777776}}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\right) \]
      6. cancel-sign-sub-inv65.4%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq -1 \cdot 10^{+40}:\\ \;\;\;\;x \cdot \left(-1 + \frac{1 - {y}^{4} \cdot 0.027777777777777776}{1 + y \cdot \left(y \cdot -0.16666666666666666\right)}\right)\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+66}:\\ \;\;\;\;\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 2.25 \cdot 10^{+150}:\\ \;\;\;\;x + x \cdot \left(-1 + \frac{1 - {y}^{4} \cdot 0.027777777777777776}{1 + y \cdot \left(y \cdot -0.16666666666666666\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 4: 83.9% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\ t_1 := y \cdot \left(y \cdot -0.16666666666666666\right)\\ \mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -1.35 \cdot 10^{+40}:\\ \;\;\;\;x \cdot \left(-1 + \frac{1 - {y}^{4} \cdot 0.027777777777777776}{1 + t_1}\right)\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{+22}:\\ \;\;\;\;\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 2.25 \cdot 10^{+150}:\\ \;\;\;\;\frac{x \cdot \left(x - {y}^{4} \cdot \left(x \cdot 0.027777777777777776\right)\right)}{x + x \cdot t_1}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* (sin x) (* y y))))
        (t_1 (* y (* y -0.16666666666666666))))
   (if (<= y -1.35e+154)
     t_0
     (if (<= y -1.35e+40)
       (*
        x
        (+ -1.0 (/ (- 1.0 (* (pow y 4.0) 0.027777777777777776)) (+ 1.0 t_1))))
       (if (<= y 2.7e+22)
         (* (sin x) (+ 1.0 (* 0.16666666666666666 (* y y))))
         (if (<= y 2.25e+150)
           (/
            (* x (- x (* (pow y 4.0) (* x 0.027777777777777776))))
            (+ x (* x t_1)))
           t_0))))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (sin(x) * (y * y));
	double t_1 = y * (y * -0.16666666666666666);
	double tmp;
	if (y <= -1.35e+154) {
		tmp = t_0;
	} else if (y <= -1.35e+40) {
		tmp = x * (-1.0 + ((1.0 - (pow(y, 4.0) * 0.027777777777777776)) / (1.0 + t_1)));
	} else if (y <= 2.7e+22) {
		tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
	} else if (y <= 2.25e+150) {
		tmp = (x * (x - (pow(y, 4.0) * (x * 0.027777777777777776)))) / (x + (x * 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 * (sin(x) * (y * y))
    t_1 = y * (y * (-0.16666666666666666d0))
    if (y <= (-1.35d+154)) then
        tmp = t_0
    else if (y <= (-1.35d+40)) then
        tmp = x * ((-1.0d0) + ((1.0d0 - ((y ** 4.0d0) * 0.027777777777777776d0)) / (1.0d0 + t_1)))
    else if (y <= 2.7d+22) then
        tmp = sin(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
    else if (y <= 2.25d+150) then
        tmp = (x * (x - ((y ** 4.0d0) * (x * 0.027777777777777776d0)))) / (x + (x * 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 * (Math.sin(x) * (y * y));
	double t_1 = y * (y * -0.16666666666666666);
	double tmp;
	if (y <= -1.35e+154) {
		tmp = t_0;
	} else if (y <= -1.35e+40) {
		tmp = x * (-1.0 + ((1.0 - (Math.pow(y, 4.0) * 0.027777777777777776)) / (1.0 + t_1)));
	} else if (y <= 2.7e+22) {
		tmp = Math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
	} else if (y <= 2.25e+150) {
		tmp = (x * (x - (Math.pow(y, 4.0) * (x * 0.027777777777777776)))) / (x + (x * t_1));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = 0.16666666666666666 * (math.sin(x) * (y * y))
	t_1 = y * (y * -0.16666666666666666)
	tmp = 0
	if y <= -1.35e+154:
		tmp = t_0
	elif y <= -1.35e+40:
		tmp = x * (-1.0 + ((1.0 - (math.pow(y, 4.0) * 0.027777777777777776)) / (1.0 + t_1)))
	elif y <= 2.7e+22:
		tmp = math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)))
	elif y <= 2.25e+150:
		tmp = (x * (x - (math.pow(y, 4.0) * (x * 0.027777777777777776)))) / (x + (x * t_1))
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(sin(x) * Float64(y * y)))
	t_1 = Float64(y * Float64(y * -0.16666666666666666))
	tmp = 0.0
	if (y <= -1.35e+154)
		tmp = t_0;
	elseif (y <= -1.35e+40)
		tmp = Float64(x * Float64(-1.0 + Float64(Float64(1.0 - Float64((y ^ 4.0) * 0.027777777777777776)) / Float64(1.0 + t_1))));
	elseif (y <= 2.7e+22)
		tmp = Float64(sin(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))));
	elseif (y <= 2.25e+150)
		tmp = Float64(Float64(x * Float64(x - Float64((y ^ 4.0) * Float64(x * 0.027777777777777776)))) / Float64(x + Float64(x * t_1)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 0.16666666666666666 * (sin(x) * (y * y));
	t_1 = y * (y * -0.16666666666666666);
	tmp = 0.0;
	if (y <= -1.35e+154)
		tmp = t_0;
	elseif (y <= -1.35e+40)
		tmp = x * (-1.0 + ((1.0 - ((y ^ 4.0) * 0.027777777777777776)) / (1.0 + t_1)));
	elseif (y <= 2.7e+22)
		tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
	elseif (y <= 2.25e+150)
		tmp = (x * (x - ((y ^ 4.0) * (x * 0.027777777777777776)))) / (x + (x * t_1));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(N[Sin[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.35e+154], t$95$0, If[LessEqual[y, -1.35e+40], N[(x * N[(-1.0 + N[(N[(1.0 - N[(N[Power[y, 4.0], $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision] / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e+22], N[(N[Sin[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.25e+150], N[(N[(x * N[(x - N[(N[Power[y, 4.0], $MachinePrecision] * N[(x * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.35 \cdot 10^{+40}:\\
\;\;\;\;x \cdot \left(-1 + \frac{1 - {y}^{4} \cdot 0.027777777777777776}{1 + t_1}\right)\\

\mathbf{elif}\;y \leq 2.7 \cdot 10^{+22}:\\
\;\;\;\;\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\

\mathbf{elif}\;y \leq 2.25 \cdot 10^{+150}:\\
\;\;\;\;\frac{x \cdot \left(x - {y}^{4} \cdot \left(x \cdot 0.027777777777777776\right)\right)}{x + x \cdot t_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.35000000000000003e154 or 2.25e150 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -1.35000000000000003e154 < y < -1.35000000000000005e40

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    11. Step-by-step derivation
      1. expm1-log1p-u17.5%

        \[\leadsto x \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\right)} \]
      2. expm1-udef17.5%

        \[\leadsto x \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)} - 1\right)} \]
      3. log1p-udef17.5%

        \[\leadsto x \cdot \left(e^{\color{blue}{\log \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)}} - 1\right) \]
      4. add-exp-log17.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(1 - 0.027777777777777776 \cdot {y}^{4}, \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, \color{blue}{-1}\right) \]
    12. Applied egg-rr54.6%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(1 - 0.027777777777777776 \cdot {y}^{4}, \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right)} \]
    13. Step-by-step derivation
      1. fma-udef54.6%

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

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

        \[\leadsto x \cdot \left(-1 + \color{blue}{\frac{\left(1 - 0.027777777777777776 \cdot {y}^{4}\right) \cdot 1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}}\right) \]
      4. *-rgt-identity54.6%

        \[\leadsto x \cdot \left(-1 + \frac{\color{blue}{1 - 0.027777777777777776 \cdot {y}^{4}}}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\right) \]
      5. *-commutative54.6%

        \[\leadsto x \cdot \left(-1 + \frac{1 - \color{blue}{{y}^{4} \cdot 0.027777777777777776}}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\right) \]
      6. cancel-sign-sub-inv54.6%

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

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

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

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

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

    if -1.35000000000000005e40 < y < 2.7000000000000002e22

    1. Initial program 100.0%

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

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

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

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

    if 2.7000000000000002e22 < y < 2.25e150

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot x + \color{blue}{x} \]
    9. Applied egg-rr7.4%

      \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot x + x} \]
    10. Step-by-step derivation
      1. +-commutative7.4%

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

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot x\right) \cdot \left(\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot x\right)}{x - \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot x}} \]
      3. swap-sqr33.9%

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

        \[\leadsto \frac{x \cdot x - \color{blue}{\left(\left(0.16666666666666666 \cdot 0.16666666666666666\right) \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)\right)} \cdot \left(x \cdot x\right)}{x - \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot x} \]
      5. metadata-eval33.9%

        \[\leadsto \frac{x \cdot x - \left(\color{blue}{0.027777777777777776} \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)\right) \cdot \left(x \cdot x\right)}{x - \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot x} \]
      6. pow233.9%

        \[\leadsto \frac{x \cdot x - \left(0.027777777777777776 \cdot \left(\color{blue}{{y}^{2}} \cdot \left(y \cdot y\right)\right)\right) \cdot \left(x \cdot x\right)}{x - \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot x} \]
      7. pow233.9%

        \[\leadsto \frac{x \cdot x - \left(0.027777777777777776 \cdot \left({y}^{2} \cdot \color{blue}{{y}^{2}}\right)\right) \cdot \left(x \cdot x\right)}{x - \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot x} \]
      8. pow-prod-up33.9%

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

        \[\leadsto \frac{x \cdot x - \left(0.027777777777777776 \cdot {y}^{\color{blue}{4}}\right) \cdot \left(x \cdot x\right)}{x - \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot x} \]
      10. associate-*l*33.9%

        \[\leadsto \frac{x \cdot x - \left(0.027777777777777776 \cdot {y}^{4}\right) \cdot \left(x \cdot x\right)}{x - \color{blue}{0.16666666666666666 \cdot \left(\left(y \cdot y\right) \cdot x\right)}} \]
      11. associate-*r*33.9%

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

      \[\leadsto \color{blue}{\frac{x \cdot x - \left(0.027777777777777776 \cdot {y}^{4}\right) \cdot \left(x \cdot x\right)}{x - 0.16666666666666666 \cdot \left(y \cdot \left(y \cdot x\right)\right)}} \]
    12. Step-by-step derivation
      1. associate-*r*46.5%

        \[\leadsto \frac{x \cdot x - \color{blue}{\left(\left(0.027777777777777776 \cdot {y}^{4}\right) \cdot x\right) \cdot x}}{x - 0.16666666666666666 \cdot \left(y \cdot \left(y \cdot x\right)\right)} \]
      2. distribute-rgt-out--50.6%

        \[\leadsto \frac{\color{blue}{x \cdot \left(x - \left(0.027777777777777776 \cdot {y}^{4}\right) \cdot x\right)}}{x - 0.16666666666666666 \cdot \left(y \cdot \left(y \cdot x\right)\right)} \]
      3. *-commutative50.6%

        \[\leadsto \frac{x \cdot \left(x - \color{blue}{\left({y}^{4} \cdot 0.027777777777777776\right)} \cdot x\right)}{x - 0.16666666666666666 \cdot \left(y \cdot \left(y \cdot x\right)\right)} \]
      4. associate-*l*50.6%

        \[\leadsto \frac{x \cdot \left(x - \color{blue}{{y}^{4} \cdot \left(0.027777777777777776 \cdot x\right)}\right)}{x - 0.16666666666666666 \cdot \left(y \cdot \left(y \cdot x\right)\right)} \]
      5. *-commutative50.6%

        \[\leadsto \frac{x \cdot \left(x - {y}^{4} \cdot \color{blue}{\left(x \cdot 0.027777777777777776\right)}\right)}{x - 0.16666666666666666 \cdot \left(y \cdot \left(y \cdot x\right)\right)} \]
      6. associate-*r*50.6%

        \[\leadsto \frac{x \cdot \left(x - {y}^{4} \cdot \left(x \cdot 0.027777777777777776\right)\right)}{x - 0.16666666666666666 \cdot \color{blue}{\left(\left(y \cdot y\right) \cdot x\right)}} \]
      7. associate-*r*50.6%

        \[\leadsto \frac{x \cdot \left(x - {y}^{4} \cdot \left(x \cdot 0.027777777777777776\right)\right)}{x - \color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot x}} \]
      8. cancel-sign-sub-inv50.6%

        \[\leadsto \frac{x \cdot \left(x - {y}^{4} \cdot \left(x \cdot 0.027777777777777776\right)\right)}{\color{blue}{x + \left(-0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot x}} \]
      9. distribute-lft-neg-in50.6%

        \[\leadsto \frac{x \cdot \left(x - {y}^{4} \cdot \left(x \cdot 0.027777777777777776\right)\right)}{x + \color{blue}{\left(\left(-0.16666666666666666\right) \cdot \left(y \cdot y\right)\right)} \cdot x} \]
      10. metadata-eval50.6%

        \[\leadsto \frac{x \cdot \left(x - {y}^{4} \cdot \left(x \cdot 0.027777777777777776\right)\right)}{x + \left(\color{blue}{-0.16666666666666666} \cdot \left(y \cdot y\right)\right) \cdot x} \]
      11. *-commutative50.6%

        \[\leadsto \frac{x \cdot \left(x - {y}^{4} \cdot \left(x \cdot 0.027777777777777776\right)\right)}{x + \color{blue}{\left(\left(y \cdot y\right) \cdot -0.16666666666666666\right)} \cdot x} \]
      12. associate-*l*50.6%

        \[\leadsto \frac{x \cdot \left(x - {y}^{4} \cdot \left(x \cdot 0.027777777777777776\right)\right)}{x + \color{blue}{\left(y \cdot \left(y \cdot -0.16666666666666666\right)\right)} \cdot x} \]
    13. Simplified50.6%

      \[\leadsto \color{blue}{\frac{x \cdot \left(x - {y}^{4} \cdot \left(x \cdot 0.027777777777777776\right)\right)}{x + \left(y \cdot \left(y \cdot -0.16666666666666666\right)\right) \cdot x}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification85.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq -1.35 \cdot 10^{+40}:\\ \;\;\;\;x \cdot \left(-1 + \frac{1 - {y}^{4} \cdot 0.027777777777777776}{1 + y \cdot \left(y \cdot -0.16666666666666666\right)}\right)\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{+22}:\\ \;\;\;\;\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 2.25 \cdot 10^{+150}:\\ \;\;\;\;\frac{x \cdot \left(x - {y}^{4} \cdot \left(x \cdot 0.027777777777777776\right)\right)}{x + x \cdot \left(y \cdot \left(y \cdot -0.16666666666666666\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 5: 84.5% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\ t_1 := x \cdot \left(-1 + \frac{1 - {y}^{4} \cdot 0.027777777777777776}{1 + y \cdot \left(y \cdot -0.16666666666666666\right)}\right)\\ \mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{+40}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+69}:\\ \;\;\;\;\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 2.25 \cdot 10^{+150}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* (sin x) (* y y))))
        (t_1
         (*
          x
          (+
           -1.0
           (/
            (- 1.0 (* (pow y 4.0) 0.027777777777777776))
            (+ 1.0 (* y (* y -0.16666666666666666))))))))
   (if (<= y -1.35e+154)
     t_0
     (if (<= y -1.1e+40)
       t_1
       (if (<= y 1.25e+69)
         (* (sin x) (+ 1.0 (* 0.16666666666666666 (* y y))))
         (if (<= y 2.25e+150) t_1 t_0))))))
double code(double x, double y) {
	double t_0 = 0.16666666666666666 * (sin(x) * (y * y));
	double t_1 = x * (-1.0 + ((1.0 - (pow(y, 4.0) * 0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666)))));
	double tmp;
	if (y <= -1.35e+154) {
		tmp = t_0;
	} else if (y <= -1.1e+40) {
		tmp = t_1;
	} else if (y <= 1.25e+69) {
		tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
	} else if (y <= 2.25e+150) {
		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 * (sin(x) * (y * y))
    t_1 = x * ((-1.0d0) + ((1.0d0 - ((y ** 4.0d0) * 0.027777777777777776d0)) / (1.0d0 + (y * (y * (-0.16666666666666666d0))))))
    if (y <= (-1.35d+154)) then
        tmp = t_0
    else if (y <= (-1.1d+40)) then
        tmp = t_1
    else if (y <= 1.25d+69) then
        tmp = sin(x) * (1.0d0 + (0.16666666666666666d0 * (y * y)))
    else if (y <= 2.25d+150) 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 * (Math.sin(x) * (y * y));
	double t_1 = x * (-1.0 + ((1.0 - (Math.pow(y, 4.0) * 0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666)))));
	double tmp;
	if (y <= -1.35e+154) {
		tmp = t_0;
	} else if (y <= -1.1e+40) {
		tmp = t_1;
	} else if (y <= 1.25e+69) {
		tmp = Math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
	} else if (y <= 2.25e+150) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = 0.16666666666666666 * (math.sin(x) * (y * y))
	t_1 = x * (-1.0 + ((1.0 - (math.pow(y, 4.0) * 0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666)))))
	tmp = 0
	if y <= -1.35e+154:
		tmp = t_0
	elif y <= -1.1e+40:
		tmp = t_1
	elif y <= 1.25e+69:
		tmp = math.sin(x) * (1.0 + (0.16666666666666666 * (y * y)))
	elif y <= 2.25e+150:
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(0.16666666666666666 * Float64(sin(x) * Float64(y * y)))
	t_1 = Float64(x * Float64(-1.0 + Float64(Float64(1.0 - Float64((y ^ 4.0) * 0.027777777777777776)) / Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666))))))
	tmp = 0.0
	if (y <= -1.35e+154)
		tmp = t_0;
	elseif (y <= -1.1e+40)
		tmp = t_1;
	elseif (y <= 1.25e+69)
		tmp = Float64(sin(x) * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))));
	elseif (y <= 2.25e+150)
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 0.16666666666666666 * (sin(x) * (y * y));
	t_1 = x * (-1.0 + ((1.0 - ((y ^ 4.0) * 0.027777777777777776)) / (1.0 + (y * (y * -0.16666666666666666)))));
	tmp = 0.0;
	if (y <= -1.35e+154)
		tmp = t_0;
	elseif (y <= -1.1e+40)
		tmp = t_1;
	elseif (y <= 1.25e+69)
		tmp = sin(x) * (1.0 + (0.16666666666666666 * (y * y)));
	elseif (y <= 2.25e+150)
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(N[Sin[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(-1.0 + N[(N[(1.0 - N[(N[Power[y, 4.0], $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.35e+154], t$95$0, If[LessEqual[y, -1.1e+40], t$95$1, If[LessEqual[y, 1.25e+69], N[(N[Sin[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.25e+150], t$95$1, t$95$0]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.1 \cdot 10^{+40}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.25 \cdot 10^{+69}:\\
\;\;\;\;\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\

\mathbf{elif}\;y \leq 2.25 \cdot 10^{+150}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -1.35000000000000003e154 < y < -1.0999999999999999e40 or 1.25000000000000009e69 < y < 2.25e150

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
    11. Step-by-step derivation
      1. expm1-log1p-u14.6%

        \[\leadsto x \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\right)} \]
      2. expm1-udef14.6%

        \[\leadsto x \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)} - 1\right)} \]
      3. log1p-udef14.6%

        \[\leadsto x \cdot \left(e^{\color{blue}{\log \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)}} - 1\right) \]
      4. add-exp-log14.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \mathsf{fma}\left(1 - 0.027777777777777776 \cdot {y}^{4}, \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, \color{blue}{-1}\right) \]
    12. Applied egg-rr60.2%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(1 - 0.027777777777777776 \cdot {y}^{4}, \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}, -1\right)} \]
    13. Step-by-step derivation
      1. fma-udef60.2%

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

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

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

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

        \[\leadsto x \cdot \left(-1 + \frac{1 - \color{blue}{{y}^{4} \cdot 0.027777777777777776}}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\right) \]
      6. cancel-sign-sub-inv60.2%

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

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

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

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

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

    if -1.0999999999999999e40 < y < 1.25000000000000009e69

    1. Initial program 100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{+40}:\\ \;\;\;\;x \cdot \left(-1 + \frac{1 - {y}^{4} \cdot 0.027777777777777776}{1 + y \cdot \left(y \cdot -0.16666666666666666\right)}\right)\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+69}:\\ \;\;\;\;\sin x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 2.25 \cdot 10^{+150}:\\ \;\;\;\;x \cdot \left(-1 + \frac{1 - {y}^{4} \cdot 0.027777777777777776}{1 + y \cdot \left(y \cdot -0.16666666666666666\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 6: 79.2% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\
t_1 := y \cdot \left(y \cdot \left(-0.027777777777777776 \cdot {x}^{3}\right)\right)\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{+152}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;y \leq 1.7 \cdot 10^{+47}:\\
\;\;\;\;\sin x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.25e152 or 1.31999999999999998e154 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -1.25e152 < y < -10500 or 1.6999999999999999e47 < y < 1.31999999999999998e154

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left({y}^{2} \cdot x\right) \cdot 0.16666666666666666} + -0.027777777777777776 \cdot \left({y}^{2} \cdot {x}^{3}\right) \]
      2. associate-*l*7.5%

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

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

        \[\leadsto {y}^{2} \cdot \left(x \cdot 0.16666666666666666\right) + \color{blue}{{y}^{2} \cdot \left({x}^{3} \cdot -0.027777777777777776\right)} \]
      5. distribute-lft-out35.5%

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

        \[\leadsto \color{blue}{\left(y \cdot y\right)} \cdot \left(x \cdot 0.16666666666666666 + {x}^{3} \cdot -0.027777777777777776\right) \]
      7. *-commutative35.5%

        \[\leadsto \left(y \cdot y\right) \cdot \left(\color{blue}{0.16666666666666666 \cdot x} + {x}^{3} \cdot -0.027777777777777776\right) \]
    10. Simplified35.5%

      \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot \left(0.16666666666666666 \cdot x + {x}^{3} \cdot -0.027777777777777776\right)} \]
    11. Taylor expanded in x around inf 34.6%

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

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

        \[\leadsto \left(\color{blue}{\left(y \cdot y\right)} \cdot {x}^{3}\right) \cdot -0.027777777777777776 \]
      3. associate-*r*34.6%

        \[\leadsto \color{blue}{\left(y \cdot y\right) \cdot \left({x}^{3} \cdot -0.027777777777777776\right)} \]
      4. associate-*l*34.6%

        \[\leadsto \color{blue}{y \cdot \left(y \cdot \left({x}^{3} \cdot -0.027777777777777776\right)\right)} \]
      5. *-commutative34.6%

        \[\leadsto y \cdot \left(y \cdot \color{blue}{\left(-0.027777777777777776 \cdot {x}^{3}\right)}\right) \]
    13. Simplified34.6%

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

    if -10500 < y < 1.6999999999999999e47

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+152}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq -10500:\\ \;\;\;\;y \cdot \left(y \cdot \left(-0.027777777777777776 \cdot {x}^{3}\right)\right)\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+47}:\\ \;\;\;\;\sin x\\ \mathbf{elif}\;y \leq 1.32 \cdot 10^{+154}:\\ \;\;\;\;y \cdot \left(y \cdot \left(-0.027777777777777776 \cdot {x}^{3}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 7: 75.3% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.5 \lor \neg \left(y \leq 2.45\right):\\ \;\;\;\;0.16666666666666666 \cdot \left(\sin x \cdot \left(y \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin x\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= y -2.5) (not (<= y 2.45)))
   (* 0.16666666666666666 (* (sin x) (* y y)))
   (sin x)))
double code(double x, double y) {
	double tmp;
	if ((y <= -2.5) || !(y <= 2.45)) {
		tmp = 0.16666666666666666 * (sin(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 <= (-2.5d0)) .or. (.not. (y <= 2.45d0))) then
        tmp = 0.16666666666666666d0 * (sin(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 <= -2.5) || !(y <= 2.45)) {
		tmp = 0.16666666666666666 * (Math.sin(x) * (y * y));
	} else {
		tmp = Math.sin(x);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (y <= -2.5) or not (y <= 2.45):
		tmp = 0.16666666666666666 * (math.sin(x) * (y * y))
	else:
		tmp = math.sin(x)
	return tmp
function code(x, y)
	tmp = 0.0
	if ((y <= -2.5) || !(y <= 2.45))
		tmp = Float64(0.16666666666666666 * Float64(sin(x) * Float64(y * y)));
	else
		tmp = sin(x);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((y <= -2.5) || ~((y <= 2.45)))
		tmp = 0.16666666666666666 * (sin(x) * (y * y));
	else
		tmp = sin(x);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[y, -2.5], N[Not[LessEqual[y, 2.45]], $MachinePrecision]], N[(0.16666666666666666 * N[(N[Sin[x], $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[x], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \lor \neg \left(y \leq 2.45\right):\\
\;\;\;\;0.16666666666666666 \cdot \left(\sin 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 < -2.5 or 2.4500000000000002 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -2.5 < y < 2.4500000000000002

    1. Initial program 100.0%

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

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

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

Alternative 8: 70.8% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{-6}:\\ \;\;\;\;x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 2.45:\\ \;\;\;\;\sin x\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(\sin x \cdot y\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y -9e-6)
   (* x (+ 1.0 (* 0.16666666666666666 (* y y))))
   (if (<= y 2.45) (sin x) (* 0.16666666666666666 (* y (* (sin x) y))))))
double code(double x, double y) {
	double tmp;
	if (y <= -9e-6) {
		tmp = x * (1.0 + (0.16666666666666666 * (y * y)));
	} else if (y <= 2.45) {
		tmp = sin(x);
	} else {
		tmp = 0.16666666666666666 * (y * (sin(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 <= (-9d-6)) then
        tmp = x * (1.0d0 + (0.16666666666666666d0 * (y * y)))
    else if (y <= 2.45d0) then
        tmp = sin(x)
    else
        tmp = 0.16666666666666666d0 * (y * (sin(x) * y))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= -9e-6) {
		tmp = x * (1.0 + (0.16666666666666666 * (y * y)));
	} else if (y <= 2.45) {
		tmp = Math.sin(x);
	} else {
		tmp = 0.16666666666666666 * (y * (Math.sin(x) * y));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= -9e-6:
		tmp = x * (1.0 + (0.16666666666666666 * (y * y)))
	elif y <= 2.45:
		tmp = math.sin(x)
	else:
		tmp = 0.16666666666666666 * (y * (math.sin(x) * y))
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= -9e-6)
		tmp = Float64(x * Float64(1.0 + Float64(0.16666666666666666 * Float64(y * y))));
	elseif (y <= 2.45)
		tmp = sin(x);
	else
		tmp = Float64(0.16666666666666666 * Float64(y * Float64(sin(x) * y)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= -9e-6)
		tmp = x * (1.0 + (0.16666666666666666 * (y * y)));
	elseif (y <= 2.45)
		tmp = sin(x);
	else
		tmp = 0.16666666666666666 * (y * (sin(x) * y));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, -9e-6], N[(x * N[(1.0 + N[(0.16666666666666666 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.45], N[Sin[x], $MachinePrecision], N[(0.16666666666666666 * N[(y * N[(N[Sin[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\

\mathbf{elif}\;y \leq 2.45:\\
\;\;\;\;\sin x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9.00000000000000023e-6

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.00000000000000023e-6 < y < 2.4500000000000002

    1. Initial program 100.0%

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

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

    if 2.4500000000000002 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{-6}:\\ \;\;\;\;x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 2.45:\\ \;\;\;\;\sin x\\ \mathbf{else}:\\ \;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(\sin x \cdot y\right)\right)\\ \end{array} \]

Alternative 9: 75.6% accurate, 1.9× speedup?

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

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

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

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

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

    \[\leadsto \sin x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)} \]
  5. Final simplification76.2%

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

Alternative 10: 70.9% accurate, 2.0× speedup?

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

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

\mathbf{elif}\;y \leq 5.6 \cdot 10^{-24}:\\
\;\;\;\;\sin x\\

\mathbf{else}:\\
\;\;\;\;x + x \cdot t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9.00000000000000023e-6

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.00000000000000023e-6 < y < 5.6000000000000003e-24

    1. Initial program 100.0%

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

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

    if 5.6000000000000003e-24 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot y\right)\right) \cdot x + 1 \cdot x} \]
      3. *-un-lft-identity39.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{-6}:\\ \;\;\;\;x \cdot \left(1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-24}:\\ \;\;\;\;\sin x\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot \left(0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\ \end{array} \]

Alternative 11: 42.8% accurate, 18.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+16} \lor \neg \left(y \leq 2.45\right):\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(x \cdot y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9e16 or 2.4500000000000002 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -9e16 < y < 2.4500000000000002

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 48.3% accurate, 18.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+16} \lor \neg \left(y \leq 2.45\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 -9e+16) (not (<= y 2.45)))
   (* 0.16666666666666666 (* x (* y y)))
   x))
double code(double x, double y) {
	double tmp;
	if ((y <= -9e+16) || !(y <= 2.45)) {
		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 <= (-9d+16)) .or. (.not. (y <= 2.45d0))) 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 <= -9e+16) || !(y <= 2.45)) {
		tmp = 0.16666666666666666 * (x * (y * y));
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (y <= -9e+16) or not (y <= 2.45):
		tmp = 0.16666666666666666 * (x * (y * y))
	else:
		tmp = x
	return tmp
function code(x, y)
	tmp = 0.0
	if ((y <= -9e+16) || !(y <= 2.45))
		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 <= -9e+16) || ~((y <= 2.45)))
		tmp = 0.16666666666666666 * (x * (y * y));
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[y, -9e+16], N[Not[LessEqual[y, 2.45]], $MachinePrecision]], N[(0.16666666666666666 * N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+16} \lor \neg \left(y \leq 2.45\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 < -9e16 or 2.4500000000000002 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

    if -9e16 < y < 2.4500000000000002

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 48.4% accurate, 22.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 48.4% accurate, 22.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 27.4% 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. Taylor expanded in y around 0 76.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  9. Final simplification30.7%

    \[\leadsto x \]

Reproduce

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