Linear.Quaternion:$ccosh from linear-1.19.1.3

Percentage Accurate: 88.9% → 99.9%
Time: 6.8s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 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 87.5%

    \[\frac{\sin x \cdot \sinh y}{x} \]
  2. Step-by-step derivation
    1. associate-*r/99.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: 87.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -7 \cdot 10^{-5}:\\
\;\;\;\;\sinh y\\

\mathbf{elif}\;\sinh y \leq 40000000:\\
\;\;\;\;\sin x \cdot \frac{y}{x}\\

\mathbf{else}:\\
\;\;\;\;\sinh y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (sinh.f64 y) < -6.9999999999999994e-5 or 4e7 < (sinh.f64 y)

    1. Initial program 100.0%

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

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

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

      \[\leadsto \color{blue}{1} \cdot \sinh y \]

    if -6.9999999999999994e-5 < (sinh.f64 y) < 4e7

    1. Initial program 73.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sinh y \leq -7 \cdot 10^{-5}:\\ \;\;\;\;\sinh y\\ \mathbf{elif}\;\sinh y \leq 40000000:\\ \;\;\;\;\sin x \cdot \frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\sinh y\\ \end{array} \]

Alternative 3: 87.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -7 \cdot 10^{-5}:\\
\;\;\;\;\sinh y\\

\mathbf{elif}\;\sinh y \leq 40000000:\\
\;\;\;\;\frac{y}{\frac{x}{\sin x}}\\

\mathbf{else}:\\
\;\;\;\;\sinh y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (sinh.f64 y) < -6.9999999999999994e-5 or 4e7 < (sinh.f64 y)

    1. Initial program 100.0%

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

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

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

      \[\leadsto \color{blue}{1} \cdot \sinh y \]

    if -6.9999999999999994e-5 < (sinh.f64 y) < 4e7

    1. Initial program 73.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sinh y \leq -7 \cdot 10^{-5}:\\ \;\;\;\;\sinh y\\ \mathbf{elif}\;\sinh y \leq 40000000:\\ \;\;\;\;\frac{y}{\frac{x}{\sin x}}\\ \mathbf{else}:\\ \;\;\;\;\sinh y\\ \end{array} \]

Alternative 4: 76.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -1 \cdot 10^{-17}:\\
\;\;\;\;\sinh y\\

\mathbf{elif}\;\sinh y \leq 40000000:\\
\;\;\;\;\frac{1}{\frac{1 + x \cdot \left(x \cdot 0.16666666666666666\right)}{y}}\\

\mathbf{else}:\\
\;\;\;\;\sinh y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (sinh.f64 y) < -1.00000000000000007e-17 or 4e7 < (sinh.f64 y)

    1. Initial program 100.0%

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

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

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

      \[\leadsto \color{blue}{1} \cdot \sinh y \]

    if -1.00000000000000007e-17 < (sinh.f64 y) < 4e7

    1. Initial program 73.4%

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

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

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

        \[\leadsto \color{blue}{\frac{\sin x \cdot \sinh y}{x}} \]
      2. clear-num72.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{x}{\sin x \cdot \sinh y}}} \]
    5. Applied egg-rr72.2%

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{x}{y}}{\sin x}}} \]
    8. Simplified96.3%

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

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{y} + 0.16666666666666666 \cdot \frac{{x}^{2}}{y}}} \]
    10. Step-by-step derivation
      1. associate-*r/78.3%

        \[\leadsto \frac{1}{\frac{1}{y} + \color{blue}{\frac{0.16666666666666666 \cdot {x}^{2}}{y}}} \]
      2. metadata-eval78.3%

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

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

        \[\leadsto \frac{1}{\frac{1}{y} + \frac{-\color{blue}{{x}^{2} \cdot -0.16666666666666666}}{y}} \]
      5. unpow278.3%

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

        \[\leadsto \frac{1}{\frac{1}{y} + \frac{-\color{blue}{x \cdot \left(x \cdot -0.16666666666666666\right)}}{y}} \]
      7. distribute-frac-neg78.3%

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{1 - x \cdot \left(x \cdot -0.16666666666666666\right)}{y}}} \]
      10. associate-*r*78.3%

        \[\leadsto \frac{1}{\frac{1 - \color{blue}{\left(x \cdot x\right) \cdot -0.16666666666666666}}{y}} \]
      11. unpow278.3%

        \[\leadsto \frac{1}{\frac{1 - \color{blue}{{x}^{2}} \cdot -0.16666666666666666}{y}} \]
      12. *-commutative78.3%

        \[\leadsto \frac{1}{\frac{1 - \color{blue}{-0.16666666666666666 \cdot {x}^{2}}}{y}} \]
      13. cancel-sign-sub-inv78.3%

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

        \[\leadsto \frac{1}{\frac{1 + \color{blue}{0.16666666666666666} \cdot {x}^{2}}{y}} \]
      15. *-commutative78.3%

        \[\leadsto \frac{1}{\frac{1 + \color{blue}{{x}^{2} \cdot 0.16666666666666666}}{y}} \]
      16. unpow278.3%

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

        \[\leadsto \frac{1}{\frac{1 + \color{blue}{x \cdot \left(x \cdot 0.16666666666666666\right)}}{y}} \]
    11. Simplified78.3%

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

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

Alternative 5: 87.4% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{-5}:\\
\;\;\;\;\sinh y\\

\mathbf{elif}\;y \leq 18:\\
\;\;\;\;\frac{y}{\frac{x}{\sin x}}\\

\mathbf{elif}\;y \leq 5 \cdot 10^{+226}:\\
\;\;\;\;\sinh y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.20000000000000018e-5 or 18 < y < 5.0000000000000005e226

    1. Initial program 100.0%

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

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

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

      \[\leadsto \color{blue}{1} \cdot \sinh y \]

    if -7.20000000000000018e-5 < y < 18

    1. Initial program 73.9%

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

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

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

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

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

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

    if 5.0000000000000005e226 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

Alternative 6: 62.6% accurate, 8.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\frac{\frac{x}{y}}{x}}\\ \mathbf{if}\;y \leq -2.2 \cdot 10^{+163}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq -5.8 \cdot 10^{+135}:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{+107}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq -41000:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq 540:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+226}:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq 10^{+262}:\\ \;\;\;\;y \cdot \left(1 + \left(x \cdot x\right) \cdot -0.16666666666666666\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{0}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ 1.0 (/ (/ x y) x))))
   (if (<= y -2.2e+163)
     t_0
     (if (<= y -5.8e+135)
       (/ 1.0 0.0)
       (if (<= y -1.9e+107)
         t_0
         (if (<= y -41000.0)
           (/ 1.0 0.0)
           (if (<= y 540.0)
             t_0
             (if (<= y 5.2e+226)
               (/ 1.0 0.0)
               (if (<= y 1e+262)
                 (* y (+ 1.0 (* (* x x) -0.16666666666666666)))
                 (/ 1.0 0.0))))))))))
double code(double x, double y) {
	double t_0 = 1.0 / ((x / y) / x);
	double tmp;
	if (y <= -2.2e+163) {
		tmp = t_0;
	} else if (y <= -5.8e+135) {
		tmp = 1.0 / 0.0;
	} else if (y <= -1.9e+107) {
		tmp = t_0;
	} else if (y <= -41000.0) {
		tmp = 1.0 / 0.0;
	} else if (y <= 540.0) {
		tmp = t_0;
	} else if (y <= 5.2e+226) {
		tmp = 1.0 / 0.0;
	} else if (y <= 1e+262) {
		tmp = y * (1.0 + ((x * x) * -0.16666666666666666));
	} else {
		tmp = 1.0 / 0.0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 1.0d0 / ((x / y) / x)
    if (y <= (-2.2d+163)) then
        tmp = t_0
    else if (y <= (-5.8d+135)) then
        tmp = 1.0d0 / 0.0d0
    else if (y <= (-1.9d+107)) then
        tmp = t_0
    else if (y <= (-41000.0d0)) then
        tmp = 1.0d0 / 0.0d0
    else if (y <= 540.0d0) then
        tmp = t_0
    else if (y <= 5.2d+226) then
        tmp = 1.0d0 / 0.0d0
    else if (y <= 1d+262) then
        tmp = y * (1.0d0 + ((x * x) * (-0.16666666666666666d0)))
    else
        tmp = 1.0d0 / 0.0d0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 1.0 / ((x / y) / x);
	double tmp;
	if (y <= -2.2e+163) {
		tmp = t_0;
	} else if (y <= -5.8e+135) {
		tmp = 1.0 / 0.0;
	} else if (y <= -1.9e+107) {
		tmp = t_0;
	} else if (y <= -41000.0) {
		tmp = 1.0 / 0.0;
	} else if (y <= 540.0) {
		tmp = t_0;
	} else if (y <= 5.2e+226) {
		tmp = 1.0 / 0.0;
	} else if (y <= 1e+262) {
		tmp = y * (1.0 + ((x * x) * -0.16666666666666666));
	} else {
		tmp = 1.0 / 0.0;
	}
	return tmp;
}
def code(x, y):
	t_0 = 1.0 / ((x / y) / x)
	tmp = 0
	if y <= -2.2e+163:
		tmp = t_0
	elif y <= -5.8e+135:
		tmp = 1.0 / 0.0
	elif y <= -1.9e+107:
		tmp = t_0
	elif y <= -41000.0:
		tmp = 1.0 / 0.0
	elif y <= 540.0:
		tmp = t_0
	elif y <= 5.2e+226:
		tmp = 1.0 / 0.0
	elif y <= 1e+262:
		tmp = y * (1.0 + ((x * x) * -0.16666666666666666))
	else:
		tmp = 1.0 / 0.0
	return tmp
function code(x, y)
	t_0 = Float64(1.0 / Float64(Float64(x / y) / x))
	tmp = 0.0
	if (y <= -2.2e+163)
		tmp = t_0;
	elseif (y <= -5.8e+135)
		tmp = Float64(1.0 / 0.0);
	elseif (y <= -1.9e+107)
		tmp = t_0;
	elseif (y <= -41000.0)
		tmp = Float64(1.0 / 0.0);
	elseif (y <= 540.0)
		tmp = t_0;
	elseif (y <= 5.2e+226)
		tmp = Float64(1.0 / 0.0);
	elseif (y <= 1e+262)
		tmp = Float64(y * Float64(1.0 + Float64(Float64(x * x) * -0.16666666666666666)));
	else
		tmp = Float64(1.0 / 0.0);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 1.0 / ((x / y) / x);
	tmp = 0.0;
	if (y <= -2.2e+163)
		tmp = t_0;
	elseif (y <= -5.8e+135)
		tmp = 1.0 / 0.0;
	elseif (y <= -1.9e+107)
		tmp = t_0;
	elseif (y <= -41000.0)
		tmp = 1.0 / 0.0;
	elseif (y <= 540.0)
		tmp = t_0;
	elseif (y <= 5.2e+226)
		tmp = 1.0 / 0.0;
	elseif (y <= 1e+262)
		tmp = y * (1.0 + ((x * x) * -0.16666666666666666));
	else
		tmp = 1.0 / 0.0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(N[(x / y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e+163], t$95$0, If[LessEqual[y, -5.8e+135], N[(1.0 / 0.0), $MachinePrecision], If[LessEqual[y, -1.9e+107], t$95$0, If[LessEqual[y, -41000.0], N[(1.0 / 0.0), $MachinePrecision], If[LessEqual[y, 540.0], t$95$0, If[LessEqual[y, 5.2e+226], N[(1.0 / 0.0), $MachinePrecision], If[LessEqual[y, 1e+262], N[(y * N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / 0.0), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1}{\frac{\frac{x}{y}}{x}}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+163}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq -5.8 \cdot 10^{+135}:\\
\;\;\;\;\frac{1}{0}\\

\mathbf{elif}\;y \leq -1.9 \cdot 10^{+107}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq -41000:\\
\;\;\;\;\frac{1}{0}\\

\mathbf{elif}\;y \leq 540:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{+226}:\\
\;\;\;\;\frac{1}{0}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.19999999999999986e163 or -5.7999999999999997e135 < y < -1.8999999999999999e107 or -41000 < y < 540

    1. Initial program 80.3%

      \[\frac{\sin x \cdot \sinh y}{x} \]
    2. Step-by-step derivation
      1. associate-*r/99.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. Step-by-step derivation
      1. associate-*r/80.3%

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

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

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

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

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

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

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

    if -2.19999999999999986e163 < y < -5.7999999999999997e135 or -1.8999999999999999e107 < y < -41000 or 540 < y < 5.2000000000000005e226 or 1e262 < y

    1. Initial program 100.0%

      \[\frac{\sin x \cdot \sinh y}{x} \]
    2. Step-by-step derivation
      1. associate-*r/100.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. Step-by-step derivation
      1. associate-*r/100.0%

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

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

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

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

    if 5.2000000000000005e226 < y < 1e262

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+163}:\\ \;\;\;\;\frac{1}{\frac{\frac{x}{y}}{x}}\\ \mathbf{elif}\;y \leq -5.8 \cdot 10^{+135}:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{+107}:\\ \;\;\;\;\frac{1}{\frac{\frac{x}{y}}{x}}\\ \mathbf{elif}\;y \leq -41000:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq 540:\\ \;\;\;\;\frac{1}{\frac{\frac{x}{y}}{x}}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+226}:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq 10^{+262}:\\ \;\;\;\;y \cdot \left(1 + \left(x \cdot x\right) \cdot -0.16666666666666666\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{0}\\ \end{array} \]

Alternative 7: 62.9% accurate, 8.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\frac{\frac{x}{y}}{x}}\\ \mathbf{if}\;y \leq -7 \cdot 10^{+160}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{+134}:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{+107}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq -45000:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq 410:\\ \;\;\;\;\frac{1}{\frac{1 + x \cdot \left(x \cdot 0.16666666666666666\right)}{y}}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+226}:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq 10^{+262}:\\ \;\;\;\;y \cdot \left(1 + \left(x \cdot x\right) \cdot -0.16666666666666666\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{0}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ 1.0 (/ (/ x y) x))))
   (if (<= y -7e+160)
     t_0
     (if (<= y -7.2e+134)
       (/ 1.0 0.0)
       (if (<= y -1.75e+107)
         t_0
         (if (<= y -45000.0)
           (/ 1.0 0.0)
           (if (<= y 410.0)
             (/ 1.0 (/ (+ 1.0 (* x (* x 0.16666666666666666))) y))
             (if (<= y 5.2e+226)
               (/ 1.0 0.0)
               (if (<= y 1e+262)
                 (* y (+ 1.0 (* (* x x) -0.16666666666666666)))
                 (/ 1.0 0.0))))))))))
double code(double x, double y) {
	double t_0 = 1.0 / ((x / y) / x);
	double tmp;
	if (y <= -7e+160) {
		tmp = t_0;
	} else if (y <= -7.2e+134) {
		tmp = 1.0 / 0.0;
	} else if (y <= -1.75e+107) {
		tmp = t_0;
	} else if (y <= -45000.0) {
		tmp = 1.0 / 0.0;
	} else if (y <= 410.0) {
		tmp = 1.0 / ((1.0 + (x * (x * 0.16666666666666666))) / y);
	} else if (y <= 5.2e+226) {
		tmp = 1.0 / 0.0;
	} else if (y <= 1e+262) {
		tmp = y * (1.0 + ((x * x) * -0.16666666666666666));
	} else {
		tmp = 1.0 / 0.0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 1.0d0 / ((x / y) / x)
    if (y <= (-7d+160)) then
        tmp = t_0
    else if (y <= (-7.2d+134)) then
        tmp = 1.0d0 / 0.0d0
    else if (y <= (-1.75d+107)) then
        tmp = t_0
    else if (y <= (-45000.0d0)) then
        tmp = 1.0d0 / 0.0d0
    else if (y <= 410.0d0) then
        tmp = 1.0d0 / ((1.0d0 + (x * (x * 0.16666666666666666d0))) / y)
    else if (y <= 5.2d+226) then
        tmp = 1.0d0 / 0.0d0
    else if (y <= 1d+262) then
        tmp = y * (1.0d0 + ((x * x) * (-0.16666666666666666d0)))
    else
        tmp = 1.0d0 / 0.0d0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 1.0 / ((x / y) / x);
	double tmp;
	if (y <= -7e+160) {
		tmp = t_0;
	} else if (y <= -7.2e+134) {
		tmp = 1.0 / 0.0;
	} else if (y <= -1.75e+107) {
		tmp = t_0;
	} else if (y <= -45000.0) {
		tmp = 1.0 / 0.0;
	} else if (y <= 410.0) {
		tmp = 1.0 / ((1.0 + (x * (x * 0.16666666666666666))) / y);
	} else if (y <= 5.2e+226) {
		tmp = 1.0 / 0.0;
	} else if (y <= 1e+262) {
		tmp = y * (1.0 + ((x * x) * -0.16666666666666666));
	} else {
		tmp = 1.0 / 0.0;
	}
	return tmp;
}
def code(x, y):
	t_0 = 1.0 / ((x / y) / x)
	tmp = 0
	if y <= -7e+160:
		tmp = t_0
	elif y <= -7.2e+134:
		tmp = 1.0 / 0.0
	elif y <= -1.75e+107:
		tmp = t_0
	elif y <= -45000.0:
		tmp = 1.0 / 0.0
	elif y <= 410.0:
		tmp = 1.0 / ((1.0 + (x * (x * 0.16666666666666666))) / y)
	elif y <= 5.2e+226:
		tmp = 1.0 / 0.0
	elif y <= 1e+262:
		tmp = y * (1.0 + ((x * x) * -0.16666666666666666))
	else:
		tmp = 1.0 / 0.0
	return tmp
function code(x, y)
	t_0 = Float64(1.0 / Float64(Float64(x / y) / x))
	tmp = 0.0
	if (y <= -7e+160)
		tmp = t_0;
	elseif (y <= -7.2e+134)
		tmp = Float64(1.0 / 0.0);
	elseif (y <= -1.75e+107)
		tmp = t_0;
	elseif (y <= -45000.0)
		tmp = Float64(1.0 / 0.0);
	elseif (y <= 410.0)
		tmp = Float64(1.0 / Float64(Float64(1.0 + Float64(x * Float64(x * 0.16666666666666666))) / y));
	elseif (y <= 5.2e+226)
		tmp = Float64(1.0 / 0.0);
	elseif (y <= 1e+262)
		tmp = Float64(y * Float64(1.0 + Float64(Float64(x * x) * -0.16666666666666666)));
	else
		tmp = Float64(1.0 / 0.0);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 1.0 / ((x / y) / x);
	tmp = 0.0;
	if (y <= -7e+160)
		tmp = t_0;
	elseif (y <= -7.2e+134)
		tmp = 1.0 / 0.0;
	elseif (y <= -1.75e+107)
		tmp = t_0;
	elseif (y <= -45000.0)
		tmp = 1.0 / 0.0;
	elseif (y <= 410.0)
		tmp = 1.0 / ((1.0 + (x * (x * 0.16666666666666666))) / y);
	elseif (y <= 5.2e+226)
		tmp = 1.0 / 0.0;
	elseif (y <= 1e+262)
		tmp = y * (1.0 + ((x * x) * -0.16666666666666666));
	else
		tmp = 1.0 / 0.0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(N[(x / y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7e+160], t$95$0, If[LessEqual[y, -7.2e+134], N[(1.0 / 0.0), $MachinePrecision], If[LessEqual[y, -1.75e+107], t$95$0, If[LessEqual[y, -45000.0], N[(1.0 / 0.0), $MachinePrecision], If[LessEqual[y, 410.0], N[(1.0 / N[(N[(1.0 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e+226], N[(1.0 / 0.0), $MachinePrecision], If[LessEqual[y, 1e+262], N[(y * N[(1.0 + N[(N[(x * x), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / 0.0), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1}{\frac{\frac{x}{y}}{x}}\\
\mathbf{if}\;y \leq -7 \cdot 10^{+160}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq -7.2 \cdot 10^{+134}:\\
\;\;\;\;\frac{1}{0}\\

\mathbf{elif}\;y \leq -1.75 \cdot 10^{+107}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq -45000:\\
\;\;\;\;\frac{1}{0}\\

\mathbf{elif}\;y \leq 410:\\
\;\;\;\;\frac{1}{\frac{1 + x \cdot \left(x \cdot 0.16666666666666666\right)}{y}}\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{+226}:\\
\;\;\;\;\frac{1}{0}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -7.00000000000000051e160 or -7.19999999999999976e134 < y < -1.7499999999999999e107

    1. Initial program 100.0%

      \[\frac{\sin x \cdot \sinh y}{x} \]
    2. Step-by-step derivation
      1. associate-*r/100.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. Step-by-step derivation
      1. associate-*r/100.0%

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{x}{y}}{\sin x}}} \]
    8. Simplified57.3%

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

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

    if -7.00000000000000051e160 < y < -7.19999999999999976e134 or -1.7499999999999999e107 < y < -45000 or 410 < y < 5.2000000000000005e226 or 1e262 < y

    1. Initial program 100.0%

      \[\frac{\sin x \cdot \sinh y}{x} \]
    2. Step-by-step derivation
      1. associate-*r/100.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. Step-by-step derivation
      1. associate-*r/100.0%

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

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

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

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

    if -45000 < y < 410

    1. Initial program 74.7%

      \[\frac{\sin x \cdot \sinh y}{x} \]
    2. Step-by-step derivation
      1. associate-*r/99.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. Step-by-step derivation
      1. associate-*r/74.7%

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

        \[\leadsto \color{blue}{\frac{1}{\frac{x}{\sin x \cdot \sinh y}}} \]
    5. Applied egg-rr73.5%

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

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{y} + 0.16666666666666666 \cdot \frac{{x}^{2}}{y}}} \]
    10. Step-by-step derivation
      1. associate-*r/75.9%

        \[\leadsto \frac{1}{\frac{1}{y} + \color{blue}{\frac{0.16666666666666666 \cdot {x}^{2}}{y}}} \]
      2. metadata-eval75.9%

        \[\leadsto \frac{1}{\frac{1}{y} + \frac{\color{blue}{\left(--0.16666666666666666\right)} \cdot {x}^{2}}{y}} \]
      3. distribute-lft-neg-in75.9%

        \[\leadsto \frac{1}{\frac{1}{y} + \frac{\color{blue}{--0.16666666666666666 \cdot {x}^{2}}}{y}} \]
      4. *-commutative75.9%

        \[\leadsto \frac{1}{\frac{1}{y} + \frac{-\color{blue}{{x}^{2} \cdot -0.16666666666666666}}{y}} \]
      5. unpow275.9%

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

        \[\leadsto \frac{1}{\frac{1}{y} + \frac{-\color{blue}{x \cdot \left(x \cdot -0.16666666666666666\right)}}{y}} \]
      7. distribute-frac-neg75.9%

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{1 - x \cdot \left(x \cdot -0.16666666666666666\right)}{y}}} \]
      10. associate-*r*75.9%

        \[\leadsto \frac{1}{\frac{1 - \color{blue}{\left(x \cdot x\right) \cdot -0.16666666666666666}}{y}} \]
      11. unpow275.9%

        \[\leadsto \frac{1}{\frac{1 - \color{blue}{{x}^{2}} \cdot -0.16666666666666666}{y}} \]
      12. *-commutative75.9%

        \[\leadsto \frac{1}{\frac{1 - \color{blue}{-0.16666666666666666 \cdot {x}^{2}}}{y}} \]
      13. cancel-sign-sub-inv75.9%

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

        \[\leadsto \frac{1}{\frac{1 + \color{blue}{0.16666666666666666} \cdot {x}^{2}}{y}} \]
      15. *-commutative75.9%

        \[\leadsto \frac{1}{\frac{1 + \color{blue}{{x}^{2} \cdot 0.16666666666666666}}{y}} \]
      16. unpow275.9%

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

        \[\leadsto \frac{1}{\frac{1 + \color{blue}{x \cdot \left(x \cdot 0.16666666666666666\right)}}{y}} \]
    11. Simplified75.9%

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

    if 5.2000000000000005e226 < y < 1e262

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7 \cdot 10^{+160}:\\ \;\;\;\;\frac{1}{\frac{\frac{x}{y}}{x}}\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{+134}:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{+107}:\\ \;\;\;\;\frac{1}{\frac{\frac{x}{y}}{x}}\\ \mathbf{elif}\;y \leq -45000:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq 410:\\ \;\;\;\;\frac{1}{\frac{1 + x \cdot \left(x \cdot 0.16666666666666666\right)}{y}}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+226}:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq 10^{+262}:\\ \;\;\;\;y \cdot \left(1 + \left(x \cdot x\right) \cdot -0.16666666666666666\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{0}\\ \end{array} \]

Alternative 8: 62.4% accurate, 9.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{\frac{\frac{x}{y}}{x}}\\ \mathbf{if}\;y \leq -6 \cdot 10^{+161}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq -4 \cdot 10^{+135}:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq -8.8 \cdot 10^{+111}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq -42000:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq 520:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+226}:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{+262}:\\ \;\;\;\;y \cdot \left(x \cdot \left(x \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{0}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ 1.0 (/ (/ x y) x))))
   (if (<= y -6e+161)
     t_0
     (if (<= y -4e+135)
       (/ 1.0 0.0)
       (if (<= y -8.8e+111)
         t_0
         (if (<= y -42000.0)
           (/ 1.0 0.0)
           (if (<= y 520.0)
             t_0
             (if (<= y 5.2e+226)
               (/ 1.0 0.0)
               (if (<= y 1.1e+262)
                 (* y (* x (* x -0.16666666666666666)))
                 (/ 1.0 0.0))))))))))
double code(double x, double y) {
	double t_0 = 1.0 / ((x / y) / x);
	double tmp;
	if (y <= -6e+161) {
		tmp = t_0;
	} else if (y <= -4e+135) {
		tmp = 1.0 / 0.0;
	} else if (y <= -8.8e+111) {
		tmp = t_0;
	} else if (y <= -42000.0) {
		tmp = 1.0 / 0.0;
	} else if (y <= 520.0) {
		tmp = t_0;
	} else if (y <= 5.2e+226) {
		tmp = 1.0 / 0.0;
	} else if (y <= 1.1e+262) {
		tmp = y * (x * (x * -0.16666666666666666));
	} else {
		tmp = 1.0 / 0.0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 1.0d0 / ((x / y) / x)
    if (y <= (-6d+161)) then
        tmp = t_0
    else if (y <= (-4d+135)) then
        tmp = 1.0d0 / 0.0d0
    else if (y <= (-8.8d+111)) then
        tmp = t_0
    else if (y <= (-42000.0d0)) then
        tmp = 1.0d0 / 0.0d0
    else if (y <= 520.0d0) then
        tmp = t_0
    else if (y <= 5.2d+226) then
        tmp = 1.0d0 / 0.0d0
    else if (y <= 1.1d+262) then
        tmp = y * (x * (x * (-0.16666666666666666d0)))
    else
        tmp = 1.0d0 / 0.0d0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 1.0 / ((x / y) / x);
	double tmp;
	if (y <= -6e+161) {
		tmp = t_0;
	} else if (y <= -4e+135) {
		tmp = 1.0 / 0.0;
	} else if (y <= -8.8e+111) {
		tmp = t_0;
	} else if (y <= -42000.0) {
		tmp = 1.0 / 0.0;
	} else if (y <= 520.0) {
		tmp = t_0;
	} else if (y <= 5.2e+226) {
		tmp = 1.0 / 0.0;
	} else if (y <= 1.1e+262) {
		tmp = y * (x * (x * -0.16666666666666666));
	} else {
		tmp = 1.0 / 0.0;
	}
	return tmp;
}
def code(x, y):
	t_0 = 1.0 / ((x / y) / x)
	tmp = 0
	if y <= -6e+161:
		tmp = t_0
	elif y <= -4e+135:
		tmp = 1.0 / 0.0
	elif y <= -8.8e+111:
		tmp = t_0
	elif y <= -42000.0:
		tmp = 1.0 / 0.0
	elif y <= 520.0:
		tmp = t_0
	elif y <= 5.2e+226:
		tmp = 1.0 / 0.0
	elif y <= 1.1e+262:
		tmp = y * (x * (x * -0.16666666666666666))
	else:
		tmp = 1.0 / 0.0
	return tmp
function code(x, y)
	t_0 = Float64(1.0 / Float64(Float64(x / y) / x))
	tmp = 0.0
	if (y <= -6e+161)
		tmp = t_0;
	elseif (y <= -4e+135)
		tmp = Float64(1.0 / 0.0);
	elseif (y <= -8.8e+111)
		tmp = t_0;
	elseif (y <= -42000.0)
		tmp = Float64(1.0 / 0.0);
	elseif (y <= 520.0)
		tmp = t_0;
	elseif (y <= 5.2e+226)
		tmp = Float64(1.0 / 0.0);
	elseif (y <= 1.1e+262)
		tmp = Float64(y * Float64(x * Float64(x * -0.16666666666666666)));
	else
		tmp = Float64(1.0 / 0.0);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 1.0 / ((x / y) / x);
	tmp = 0.0;
	if (y <= -6e+161)
		tmp = t_0;
	elseif (y <= -4e+135)
		tmp = 1.0 / 0.0;
	elseif (y <= -8.8e+111)
		tmp = t_0;
	elseif (y <= -42000.0)
		tmp = 1.0 / 0.0;
	elseif (y <= 520.0)
		tmp = t_0;
	elseif (y <= 5.2e+226)
		tmp = 1.0 / 0.0;
	elseif (y <= 1.1e+262)
		tmp = y * (x * (x * -0.16666666666666666));
	else
		tmp = 1.0 / 0.0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(N[(x / y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6e+161], t$95$0, If[LessEqual[y, -4e+135], N[(1.0 / 0.0), $MachinePrecision], If[LessEqual[y, -8.8e+111], t$95$0, If[LessEqual[y, -42000.0], N[(1.0 / 0.0), $MachinePrecision], If[LessEqual[y, 520.0], t$95$0, If[LessEqual[y, 5.2e+226], N[(1.0 / 0.0), $MachinePrecision], If[LessEqual[y, 1.1e+262], N[(y * N[(x * N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / 0.0), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1}{\frac{\frac{x}{y}}{x}}\\
\mathbf{if}\;y \leq -6 \cdot 10^{+161}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq -4 \cdot 10^{+135}:\\
\;\;\;\;\frac{1}{0}\\

\mathbf{elif}\;y \leq -8.8 \cdot 10^{+111}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq -42000:\\
\;\;\;\;\frac{1}{0}\\

\mathbf{elif}\;y \leq 520:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{+226}:\\
\;\;\;\;\frac{1}{0}\\

\mathbf{elif}\;y \leq 1.1 \cdot 10^{+262}:\\
\;\;\;\;y \cdot \left(x \cdot \left(x \cdot -0.16666666666666666\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -6.00000000000000023e161 or -3.99999999999999985e135 < y < -8.79999999999999994e111 or -42000 < y < 520

    1. Initial program 80.3%

      \[\frac{\sin x \cdot \sinh y}{x} \]
    2. Step-by-step derivation
      1. associate-*r/99.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. Step-by-step derivation
      1. associate-*r/80.3%

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

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

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

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

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

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

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

    if -6.00000000000000023e161 < y < -3.99999999999999985e135 or -8.79999999999999994e111 < y < -42000 or 520 < y < 5.2000000000000005e226 or 1.10000000000000005e262 < y

    1. Initial program 100.0%

      \[\frac{\sin x \cdot \sinh y}{x} \]
    2. Step-by-step derivation
      1. associate-*r/100.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. Step-by-step derivation
      1. associate-*r/100.0%

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

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

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

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

    if 5.2000000000000005e226 < y < 1.10000000000000005e262

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6 \cdot 10^{+161}:\\ \;\;\;\;\frac{1}{\frac{\frac{x}{y}}{x}}\\ \mathbf{elif}\;y \leq -4 \cdot 10^{+135}:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq -8.8 \cdot 10^{+111}:\\ \;\;\;\;\frac{1}{\frac{\frac{x}{y}}{x}}\\ \mathbf{elif}\;y \leq -42000:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq 520:\\ \;\;\;\;\frac{1}{\frac{\frac{x}{y}}{x}}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+226}:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{+262}:\\ \;\;\;\;y \cdot \left(x \cdot \left(x \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{0}\\ \end{array} \]

Alternative 9: 48.8% accurate, 13.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -41000:\\
\;\;\;\;\frac{1}{0}\\

\mathbf{elif}\;y \leq 430:\\
\;\;\;\;y\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{+226} \lor \neg \left(y \leq 8.2 \cdot 10^{+264}\right):\\
\;\;\;\;\frac{1}{0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -41000 or 430 < y < 5.2000000000000005e226 or 8.1999999999999999e264 < y

    1. Initial program 100.0%

      \[\frac{\sin x \cdot \sinh y}{x} \]
    2. Step-by-step derivation
      1. associate-*r/100.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. Step-by-step derivation
      1. associate-*r/100.0%

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

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

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

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

    if -41000 < y < 430

    1. Initial program 74.7%

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

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

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

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

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

    if 5.2000000000000005e226 < y < 8.1999999999999999e264

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -41000:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq 430:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+226} \lor \neg \left(y \leq 8.2 \cdot 10^{+264}\right):\\ \;\;\;\;\frac{1}{0}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot \left(x \cdot -0.16666666666666666\right)\right)\\ \end{array} \]

Alternative 10: 50.4% accurate, 28.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -41000:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq 510:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{0}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y -41000.0) (/ 1.0 0.0) (if (<= y 510.0) y (/ 1.0 0.0))))
double code(double x, double y) {
	double tmp;
	if (y <= -41000.0) {
		tmp = 1.0 / 0.0;
	} else if (y <= 510.0) {
		tmp = y;
	} else {
		tmp = 1.0 / 0.0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= (-41000.0d0)) then
        tmp = 1.0d0 / 0.0d0
    else if (y <= 510.0d0) then
        tmp = y
    else
        tmp = 1.0d0 / 0.0d0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= -41000.0) {
		tmp = 1.0 / 0.0;
	} else if (y <= 510.0) {
		tmp = y;
	} else {
		tmp = 1.0 / 0.0;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= -41000.0:
		tmp = 1.0 / 0.0
	elif y <= 510.0:
		tmp = y
	else:
		tmp = 1.0 / 0.0
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= -41000.0)
		tmp = Float64(1.0 / 0.0);
	elseif (y <= 510.0)
		tmp = y;
	else
		tmp = Float64(1.0 / 0.0);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= -41000.0)
		tmp = 1.0 / 0.0;
	elseif (y <= 510.0)
		tmp = y;
	else
		tmp = 1.0 / 0.0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, -41000.0], N[(1.0 / 0.0), $MachinePrecision], If[LessEqual[y, 510.0], y, N[(1.0 / 0.0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -41000:\\
\;\;\;\;\frac{1}{0}\\

\mathbf{elif}\;y \leq 510:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -41000 or 510 < y

    1. Initial program 100.0%

      \[\frac{\sin x \cdot \sinh y}{x} \]
    2. Step-by-step derivation
      1. associate-*r/100.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. Step-by-step derivation
      1. associate-*r/100.0%

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

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

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

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

    if -41000 < y < 510

    1. Initial program 74.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -41000:\\ \;\;\;\;\frac{1}{0}\\ \mathbf{elif}\;y \leq 510:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{0}\\ \end{array} \]

Alternative 11: 28.2% 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 87.5%

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

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

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

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

    \[\leadsto \color{blue}{y} \]
  6. Final simplification27.3%

    \[\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 2024034 
(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))