Linear.Quaternion:$ccosh from linear-1.19.1.3

Percentage Accurate: 88.9% → 99.9%
Time: 8.5s
Alternatives: 9
Speedup: 1.0×

Specification

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

\\
\frac{\sin x \cdot \sinh y}{x}
\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 9 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: 88.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

Alternative 2: 74.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 12.5:\\ \;\;\;\;\sin x \cdot \frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 12.5) (* (sin x) (/ y x)) (log1p (expm1 y))))
double code(double x, double y) {
	double tmp;
	if (y <= 12.5) {
		tmp = sin(x) * (y / x);
	} else {
		tmp = log1p(expm1(y));
	}
	return tmp;
}
public static double code(double x, double y) {
	double tmp;
	if (y <= 12.5) {
		tmp = Math.sin(x) * (y / x);
	} else {
		tmp = Math.log1p(Math.expm1(y));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 12.5:
		tmp = math.sin(x) * (y / x)
	else:
		tmp = math.log1p(math.expm1(y))
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 12.5)
		tmp = Float64(sin(x) * Float64(y / x));
	else
		tmp = log1p(expm1(y));
	end
	return tmp
end
code[x_, y_] := If[LessEqual[y, 12.5], N[(N[Sin[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[Log[1 + N[(Exp[y] - 1), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 12.5:\\
\;\;\;\;\sin x \cdot \frac{y}{x}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)\\


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

    1. Initial program 87.4%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \sin x}{x}} \]
    5. Step-by-step derivation
      1. associate-/l*63.2%

        \[\leadsto \color{blue}{\frac{y}{\frac{x}{\sin x}}} \]
      2. associate-/r/70.9%

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

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

    if 12.5 < y

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
    6. Step-by-step derivation
      1. div-inv19.4%

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

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

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

        \[\leadsto y \cdot \color{blue}{1} \]
      5. *-commutative4.2%

        \[\leadsto \color{blue}{1 \cdot y} \]
      6. *-un-lft-identity4.2%

        \[\leadsto \color{blue}{y} \]
      7. log1p-expm1-u71.4%

        \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)} \]
    7. Applied egg-rr71.4%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification71.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 12.5:\\ \;\;\;\;\sin x \cdot \frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)\\ \end{array} \]

Alternative 3: 61.8% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1600000000:\\
\;\;\;\;\sin x \cdot \frac{y}{x}\\

\mathbf{elif}\;y \leq 6 \cdot 10^{+88}:\\
\;\;\;\;\frac{y \cdot \left(x + -0.16666666666666666 \cdot {x}^{3}\right)}{x}\\

\mathbf{elif}\;y \leq 2.2 \cdot 10^{+202}:\\
\;\;\;\;\frac{\frac{y}{x}}{\frac{1}{\sin x}}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \frac{1}{x \cdot y}}\\


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

    1. Initial program 87.6%

      \[\frac{\sin x \cdot \sinh y}{x} \]
    2. Step-by-step derivation
      1. *-commutative87.6%

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \sin x}{x}} \]
    5. Step-by-step derivation
      1. associate-/l*62.2%

        \[\leadsto \color{blue}{\frac{y}{\frac{x}{\sin x}}} \]
      2. associate-/r/70.4%

        \[\leadsto \color{blue}{\frac{y}{x} \cdot \sin x} \]
    6. Simplified70.4%

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

    if 1.6e9 < y < 6.00000000000000011e88

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if 6.00000000000000011e88 < y < 2.19999999999999978e202

    1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \sin x}{x}} \]
    5. Step-by-step derivation
      1. associate-/l*4.0%

        \[\leadsto \color{blue}{\frac{y}{\frac{x}{\sin x}}} \]
      2. associate-/r/45.4%

        \[\leadsto \color{blue}{\frac{y}{x} \cdot \sin x} \]
    6. Simplified45.4%

      \[\leadsto \color{blue}{\frac{y}{x} \cdot \sin x} \]
    7. Step-by-step derivation
      1. associate-/r/4.0%

        \[\leadsto \color{blue}{\frac{y}{\frac{x}{\sin x}}} \]
      2. div-inv4.0%

        \[\leadsto \frac{y}{\color{blue}{x \cdot \frac{1}{\sin x}}} \]
      3. associate-/r*45.4%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{\frac{1}{\sin x}}} \]
    8. Applied egg-rr45.4%

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

    if 2.19999999999999978e202 < y

    1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \sin x}{x}} \]
    5. Step-by-step derivation
      1. associate-/l*5.6%

        \[\leadsto \color{blue}{\frac{y}{\frac{x}{\sin x}}} \]
      2. associate-/r/30.5%

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

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

        \[\leadsto \color{blue}{\sin x \cdot \frac{y}{x}} \]
      2. associate-*r/5.6%

        \[\leadsto \color{blue}{\frac{\sin x \cdot y}{x}} \]
      3. clear-num5.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{x}{\sin x \cdot y}}} \]
      4. *-commutative5.6%

        \[\leadsto \frac{1}{\frac{x}{\color{blue}{y \cdot \sin x}}} \]
    8. Applied egg-rr5.6%

      \[\leadsto \color{blue}{\frac{1}{\frac{x}{y \cdot \sin x}}} \]
    9. Step-by-step derivation
      1. div-inv5.6%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{y \cdot \sin x} \cdot x}} \]
      3. associate-/r*5.6%

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{1}{y}}{\sin x}} \cdot x} \]
    10. Applied egg-rr5.6%

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{y \cdot x}} \cdot x} \]
    13. Simplified43.3%

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{y \cdot x}} \cdot x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification62.3%

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

Alternative 4: 61.5% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.7 \cdot 10^{+202}:\\
\;\;\;\;\sin x \cdot \frac{y}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \frac{1}{x \cdot y}}\\


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

    1. Initial program 90.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \sin x}{x}} \]
    5. Step-by-step derivation
      1. associate-/l*50.2%

        \[\leadsto \color{blue}{\frac{y}{\frac{x}{\sin x}}} \]
      2. associate-/r/62.4%

        \[\leadsto \color{blue}{\frac{y}{x} \cdot \sin x} \]
    6. Simplified62.4%

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

    if 1.7e202 < y

    1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \sin x}{x}} \]
    5. Step-by-step derivation
      1. associate-/l*5.6%

        \[\leadsto \color{blue}{\frac{y}{\frac{x}{\sin x}}} \]
      2. associate-/r/30.5%

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

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

        \[\leadsto \color{blue}{\sin x \cdot \frac{y}{x}} \]
      2. associate-*r/5.6%

        \[\leadsto \color{blue}{\frac{\sin x \cdot y}{x}} \]
      3. clear-num5.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{x}{\sin x \cdot y}}} \]
      4. *-commutative5.6%

        \[\leadsto \frac{1}{\frac{x}{\color{blue}{y \cdot \sin x}}} \]
    8. Applied egg-rr5.6%

      \[\leadsto \color{blue}{\frac{1}{\frac{x}{y \cdot \sin x}}} \]
    9. Step-by-step derivation
      1. div-inv5.6%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{y \cdot \sin x} \cdot x}} \]
      3. associate-/r*5.6%

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{1}{y}}{\sin x}} \cdot x} \]
    10. Applied egg-rr5.6%

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{y \cdot x}} \cdot x} \]
    13. Simplified43.3%

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{y \cdot x}} \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.7 \cdot 10^{+202}:\\ \;\;\;\;\sin x \cdot \frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot \frac{1}{x \cdot y}}\\ \end{array} \]

Alternative 5: 49.1% accurate, 15.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4.2 \cdot 10^{+191}:\\ \;\;\;\;\frac{\frac{y}{x}}{x \cdot 0.16666666666666666 + \frac{1}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot \frac{1}{x \cdot y}}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 4.2e+191)
   (/ (/ y x) (+ (* x 0.16666666666666666) (/ 1.0 x)))
   (/ 1.0 (* x (/ 1.0 (* x y))))))
double code(double x, double y) {
	double tmp;
	if (y <= 4.2e+191) {
		tmp = (y / x) / ((x * 0.16666666666666666) + (1.0 / x));
	} else {
		tmp = 1.0 / (x * (1.0 / (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 <= 4.2d+191) then
        tmp = (y / x) / ((x * 0.16666666666666666d0) + (1.0d0 / x))
    else
        tmp = 1.0d0 / (x * (1.0d0 / (x * y)))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 4.2e+191) {
		tmp = (y / x) / ((x * 0.16666666666666666) + (1.0 / x));
	} else {
		tmp = 1.0 / (x * (1.0 / (x * y)));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 4.2e+191:
		tmp = (y / x) / ((x * 0.16666666666666666) + (1.0 / x))
	else:
		tmp = 1.0 / (x * (1.0 / (x * y)))
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 4.2e+191)
		tmp = Float64(Float64(y / x) / Float64(Float64(x * 0.16666666666666666) + Float64(1.0 / x)));
	else
		tmp = Float64(1.0 / Float64(x * Float64(1.0 / Float64(x * y))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 4.2e+191)
		tmp = (y / x) / ((x * 0.16666666666666666) + (1.0 / x));
	else
		tmp = 1.0 / (x * (1.0 / (x * y)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 4.2e+191], N[(N[(y / x), $MachinePrecision] / N[(N[(x * 0.16666666666666666), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x * N[(1.0 / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.2 \cdot 10^{+191}:\\
\;\;\;\;\frac{\frac{y}{x}}{x \cdot 0.16666666666666666 + \frac{1}{x}}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \frac{1}{x \cdot y}}\\


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

    1. Initial program 90.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \sin x}{x}} \]
    5. Step-by-step derivation
      1. associate-/l*51.0%

        \[\leadsto \color{blue}{\frac{y}{\frac{x}{\sin x}}} \]
      2. associate-/r/63.0%

        \[\leadsto \color{blue}{\frac{y}{x} \cdot \sin x} \]
    6. Simplified63.0%

      \[\leadsto \color{blue}{\frac{y}{x} \cdot \sin x} \]
    7. Step-by-step derivation
      1. associate-/r/51.0%

        \[\leadsto \color{blue}{\frac{y}{\frac{x}{\sin x}}} \]
      2. div-inv51.0%

        \[\leadsto \frac{y}{\color{blue}{x \cdot \frac{1}{\sin x}}} \]
      3. associate-/r*62.9%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{\frac{1}{\sin x}}} \]
    8. Applied egg-rr62.9%

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

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

    if 4.2000000000000001e191 < y

    1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \sin x}{x}} \]
    5. Step-by-step derivation
      1. associate-/l*5.4%

        \[\leadsto \color{blue}{\frac{y}{\frac{x}{\sin x}}} \]
      2. associate-/r/30.0%

        \[\leadsto \color{blue}{\frac{y}{x} \cdot \sin x} \]
    6. Simplified30.0%

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

        \[\leadsto \color{blue}{\sin x \cdot \frac{y}{x}} \]
      2. associate-*r/5.4%

        \[\leadsto \color{blue}{\frac{\sin x \cdot y}{x}} \]
      3. clear-num5.4%

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

        \[\leadsto \frac{1}{\frac{x}{\color{blue}{y \cdot \sin x}}} \]
    8. Applied egg-rr5.4%

      \[\leadsto \color{blue}{\frac{1}{\frac{x}{y \cdot \sin x}}} \]
    9. Step-by-step derivation
      1. div-inv5.4%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{y \cdot \sin x} \cdot x}} \]
      3. associate-/r*5.4%

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{1}{y}}{\sin x}} \cdot x} \]
    10. Applied egg-rr5.4%

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{y \cdot x}} \cdot x} \]
    13. Simplified40.7%

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{y \cdot x}} \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.2 \cdot 10^{+191}:\\ \;\;\;\;\frac{\frac{y}{x}}{x \cdot 0.16666666666666666 + \frac{1}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot \frac{1}{x \cdot y}}\\ \end{array} \]

Alternative 6: 48.7% accurate, 18.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 6.6 \cdot 10^{+222}:\\ \;\;\;\;x \cdot \frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot \frac{1}{x \cdot y}}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 6.6e+222) (* x (/ y x)) (/ 1.0 (* x (/ 1.0 (* x y))))))
double code(double x, double y) {
	double tmp;
	if (y <= 6.6e+222) {
		tmp = x * (y / x);
	} else {
		tmp = 1.0 / (x * (1.0 / (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 <= 6.6d+222) then
        tmp = x * (y / x)
    else
        tmp = 1.0d0 / (x * (1.0d0 / (x * y)))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 6.6e+222) {
		tmp = x * (y / x);
	} else {
		tmp = 1.0 / (x * (1.0 / (x * y)));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 6.6e+222:
		tmp = x * (y / x)
	else:
		tmp = 1.0 / (x * (1.0 / (x * y)))
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 6.6e+222)
		tmp = Float64(x * Float64(y / x));
	else
		tmp = Float64(1.0 / Float64(x * Float64(1.0 / Float64(x * y))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 6.6e+222)
		tmp = x * (y / x);
	else
		tmp = 1.0 / (x * (1.0 / (x * y)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 6.6e+222], N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x * N[(1.0 / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.6 \cdot 10^{+222}:\\
\;\;\;\;x \cdot \frac{y}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \frac{1}{x \cdot y}}\\


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

    1. Initial program 90.3%

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
    5. Simplified22.5%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
    6. Step-by-step derivation
      1. associate-/l*25.8%

        \[\leadsto \color{blue}{\frac{y}{\frac{x}{x}}} \]
      2. associate-/r/48.0%

        \[\leadsto \color{blue}{\frac{y}{x} \cdot x} \]
    7. Applied egg-rr48.0%

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

    if 6.59999999999999967e222 < y

    1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \sin x}{x}} \]
    5. Step-by-step derivation
      1. associate-/l*5.9%

        \[\leadsto \color{blue}{\frac{y}{\frac{x}{\sin x}}} \]
      2. associate-/r/25.8%

        \[\leadsto \color{blue}{\frac{y}{x} \cdot \sin x} \]
    6. Simplified25.8%

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

        \[\leadsto \color{blue}{\sin x \cdot \frac{y}{x}} \]
      2. associate-*r/5.9%

        \[\leadsto \color{blue}{\frac{\sin x \cdot y}{x}} \]
      3. clear-num5.9%

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

        \[\leadsto \frac{1}{\frac{x}{\color{blue}{y \cdot \sin x}}} \]
    8. Applied egg-rr5.9%

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{y \cdot \sin x} \cdot x}} \]
      3. associate-/r*5.9%

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{1}{y}}{\sin x}} \cdot x} \]
    10. Applied egg-rr5.9%

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{y \cdot x}} \cdot x} \]
    13. Simplified46.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 6.6 \cdot 10^{+222}:\\ \;\;\;\;x \cdot \frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot \frac{1}{x \cdot y}}\\ \end{array} \]

Alternative 7: 48.7% accurate, 29.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.25 \cdot 10^{+222}:\\
\;\;\;\;x \cdot \frac{y}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{x}\\


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

    1. Initial program 90.3%

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
    5. Simplified22.5%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
    6. Step-by-step derivation
      1. associate-/l*25.8%

        \[\leadsto \color{blue}{\frac{y}{\frac{x}{x}}} \]
      2. associate-/r/48.0%

        \[\leadsto \color{blue}{\frac{y}{x} \cdot x} \]
    7. Applied egg-rr48.0%

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

    if 1.25000000000000006e222 < y

    1. Initial program 100.0%

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
    5. Simplified46.7%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification47.9%

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

Alternative 8: 49.7% accurate, 41.0× speedup?

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

\\
x \cdot \frac{y}{x}
\end{array}
Derivation
  1. Initial program 91.0%

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

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

    \[\leadsto \frac{\color{blue}{x \cdot y}}{x} \]
  4. Step-by-step derivation
    1. *-commutative24.2%

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

    \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
  6. Step-by-step derivation
    1. associate-/l*24.4%

      \[\leadsto \color{blue}{\frac{y}{\frac{x}{x}}} \]
    2. associate-/r/46.5%

      \[\leadsto \color{blue}{\frac{y}{x} \cdot x} \]
  7. Applied egg-rr46.5%

    \[\leadsto \color{blue}{\frac{y}{x} \cdot x} \]
  8. Final simplification46.5%

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

Alternative 9: 27.9% accurate, 205.0× speedup?

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

\\
y
\end{array}
Derivation
  1. Initial program 91.0%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{y \cdot \sin x}{x}} \]
  5. Step-by-step derivation
    1. associate-/l*46.4%

      \[\leadsto \color{blue}{\frac{y}{\frac{x}{\sin x}}} \]
    2. associate-/r/59.7%

      \[\leadsto \color{blue}{\frac{y}{x} \cdot \sin x} \]
  6. Simplified59.7%

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

    \[\leadsto \color{blue}{y} \]
  8. Final simplification24.4%

    \[\leadsto y \]

Developer target: 99.9% accurate, 1.0× speedup?

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

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

Reproduce

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

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

  (/ (* (sin x) (sinh y)) x))