Linear.Quaternion:$ccosh from linear-1.19.1.3

Percentage Accurate: 88.9% → 99.8%
Time: 9.5s
Alternatives: 12
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 12 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.8% 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 92.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. Final simplification99.9%

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

Alternative 2: 85.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)\\ \mathbf{if}\;y \leq -490:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 720:\\ \;\;\;\;\frac{y}{\frac{x}{\sin x}}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+226}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 4.35 \cdot 10^{+248}:\\ \;\;\;\;y \cdot \left(x \cdot \left(x \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{y \cdot y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (log1p (expm1 y))))
   (if (<= y -490.0)
     t_0
     (if (<= y 720.0)
       (/ y (/ x (sin x)))
       (if (<= y 2.1e+226)
         t_0
         (if (<= y 4.35e+248)
           (* y (* x (* x -0.16666666666666666)))
           (sqrt (* y y))))))))
double code(double x, double y) {
	double t_0 = log1p(expm1(y));
	double tmp;
	if (y <= -490.0) {
		tmp = t_0;
	} else if (y <= 720.0) {
		tmp = y / (x / sin(x));
	} else if (y <= 2.1e+226) {
		tmp = t_0;
	} else if (y <= 4.35e+248) {
		tmp = y * (x * (x * -0.16666666666666666));
	} else {
		tmp = sqrt((y * y));
	}
	return tmp;
}
public static double code(double x, double y) {
	double t_0 = Math.log1p(Math.expm1(y));
	double tmp;
	if (y <= -490.0) {
		tmp = t_0;
	} else if (y <= 720.0) {
		tmp = y / (x / Math.sin(x));
	} else if (y <= 2.1e+226) {
		tmp = t_0;
	} else if (y <= 4.35e+248) {
		tmp = y * (x * (x * -0.16666666666666666));
	} else {
		tmp = Math.sqrt((y * y));
	}
	return tmp;
}
def code(x, y):
	t_0 = math.log1p(math.expm1(y))
	tmp = 0
	if y <= -490.0:
		tmp = t_0
	elif y <= 720.0:
		tmp = y / (x / math.sin(x))
	elif y <= 2.1e+226:
		tmp = t_0
	elif y <= 4.35e+248:
		tmp = y * (x * (x * -0.16666666666666666))
	else:
		tmp = math.sqrt((y * y))
	return tmp
function code(x, y)
	t_0 = log1p(expm1(y))
	tmp = 0.0
	if (y <= -490.0)
		tmp = t_0;
	elseif (y <= 720.0)
		tmp = Float64(y / Float64(x / sin(x)));
	elseif (y <= 2.1e+226)
		tmp = t_0;
	elseif (y <= 4.35e+248)
		tmp = Float64(y * Float64(x * Float64(x * -0.16666666666666666)));
	else
		tmp = sqrt(Float64(y * y));
	end
	return tmp
end
code[x_, y_] := Block[{t$95$0 = N[Log[1 + N[(Exp[y] - 1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -490.0], t$95$0, If[LessEqual[y, 720.0], N[(y / N[(x / N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e+226], t$95$0, If[LessEqual[y, 4.35e+248], N[(y * N[(x * N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(y * y), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)\\
\mathbf{if}\;y \leq -490:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;y \leq 2.1 \cdot 10^{+226}:\\
\;\;\;\;t_0\\

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

\mathbf{else}:\\
\;\;\;\;\sqrt{y \cdot y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -490 or 720 < y < 2.09999999999999993e226

    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. Taylor expanded in y around 0 4.4%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
    7. Simplified14.9%

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

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

        \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)} \]
    9. Applied egg-rr80.0%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)} \]

    if -490 < y < 720

    1. Initial program 84.3%

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

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

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

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

    if 2.09999999999999993e226 < y < 4.34999999999999995e248

    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. Taylor expanded in y around 0 3.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, -0.16666666666666666 \cdot \color{blue}{\left(x \cdot x\right)}, -\left(-y\right)\right) \]
      8. associate-*r*85.7%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\left(-0.16666666666666666 \cdot x\right) \cdot x}, -\left(-y\right)\right) \]
      9. remove-double-neg85.7%

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

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

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

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

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

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

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

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

    if 4.34999999999999995e248 < 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. Taylor expanded in y around 0 8.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y} \]
      7. add-sqr-sqrt9.5%

        \[\leadsto \color{blue}{\sqrt{y} \cdot \sqrt{y}} \]
      8. sqrt-unprod100.0%

        \[\leadsto \color{blue}{\sqrt{y \cdot y}} \]
    9. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\sqrt{y \cdot y}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification90.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -490:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)\\ \mathbf{elif}\;y \leq 720:\\ \;\;\;\;\frac{y}{\frac{x}{\sin x}}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+226}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)\\ \mathbf{elif}\;y \leq 4.35 \cdot 10^{+248}:\\ \;\;\;\;y \cdot \left(x \cdot \left(x \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{y \cdot y}\\ \end{array} \]

Alternative 3: 61.2% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{if}\;y \leq -270:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 0.175:\\ \;\;\;\;\frac{y}{1 + x \cdot \left(x \cdot 0.16666666666666666\right)}\\ \mathbf{elif}\;y \leq 1.42 \cdot 10^{+135}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{y \cdot y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 6.0 (/ (/ y x) x))))
   (if (<= y -270.0)
     t_0
     (if (<= y 0.175)
       (/ y (+ 1.0 (* x (* x 0.16666666666666666))))
       (if (<= y 1.42e+135) t_0 (sqrt (* y y)))))))
double code(double x, double y) {
	double t_0 = 6.0 * ((y / x) / x);
	double tmp;
	if (y <= -270.0) {
		tmp = t_0;
	} else if (y <= 0.175) {
		tmp = y / (1.0 + (x * (x * 0.16666666666666666)));
	} else if (y <= 1.42e+135) {
		tmp = t_0;
	} else {
		tmp = sqrt((y * y));
	}
	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 = 6.0d0 * ((y / x) / x)
    if (y <= (-270.0d0)) then
        tmp = t_0
    else if (y <= 0.175d0) then
        tmp = y / (1.0d0 + (x * (x * 0.16666666666666666d0)))
    else if (y <= 1.42d+135) then
        tmp = t_0
    else
        tmp = sqrt((y * y))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 6.0 * ((y / x) / x);
	double tmp;
	if (y <= -270.0) {
		tmp = t_0;
	} else if (y <= 0.175) {
		tmp = y / (1.0 + (x * (x * 0.16666666666666666)));
	} else if (y <= 1.42e+135) {
		tmp = t_0;
	} else {
		tmp = Math.sqrt((y * y));
	}
	return tmp;
}
def code(x, y):
	t_0 = 6.0 * ((y / x) / x)
	tmp = 0
	if y <= -270.0:
		tmp = t_0
	elif y <= 0.175:
		tmp = y / (1.0 + (x * (x * 0.16666666666666666)))
	elif y <= 1.42e+135:
		tmp = t_0
	else:
		tmp = math.sqrt((y * y))
	return tmp
function code(x, y)
	t_0 = Float64(6.0 * Float64(Float64(y / x) / x))
	tmp = 0.0
	if (y <= -270.0)
		tmp = t_0;
	elseif (y <= 0.175)
		tmp = Float64(y / Float64(1.0 + Float64(x * Float64(x * 0.16666666666666666))));
	elseif (y <= 1.42e+135)
		tmp = t_0;
	else
		tmp = sqrt(Float64(y * y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 6.0 * ((y / x) / x);
	tmp = 0.0;
	if (y <= -270.0)
		tmp = t_0;
	elseif (y <= 0.175)
		tmp = y / (1.0 + (x * (x * 0.16666666666666666)));
	elseif (y <= 1.42e+135)
		tmp = t_0;
	else
		tmp = sqrt((y * y));
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(6.0 * N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -270.0], t$95$0, If[LessEqual[y, 0.175], N[(y / N[(1.0 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.42e+135], t$95$0, N[Sqrt[N[(y * y), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq 1.42 \cdot 10^{+135}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\sqrt{y \cdot y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -270 or 0.17499999999999999 < y < 1.41999999999999998e135

    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. Taylor expanded in y around 0 4.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{6 \cdot \frac{y}{{x}^{2}}} \]
    11. Step-by-step derivation
      1. unpow241.1%

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

        \[\leadsto 6 \cdot \color{blue}{\frac{\frac{y}{x}}{x}} \]
    12. Simplified41.2%

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

    if -270 < y < 0.17499999999999999

    1. Initial program 84.2%

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

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

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

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

      \[\leadsto \frac{y}{\color{blue}{1 + 0.16666666666666666 \cdot {x}^{2}}} \]
    8. Step-by-step derivation
      1. *-commutative82.3%

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

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

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

      \[\leadsto \frac{y}{1 + \color{blue}{0.16666666666666666 \cdot {x}^{2}}} \]
    11. Step-by-step derivation
      1. *-commutative82.3%

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

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

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

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

    if 1.41999999999999998e135 < 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. Taylor expanded in y around 0 5.1%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
    7. Simplified26.3%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
    8. Step-by-step derivation
      1. div-inv26.3%

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

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

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

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

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

        \[\leadsto \color{blue}{y} \]
      7. add-sqr-sqrt5.0%

        \[\leadsto \color{blue}{\sqrt{y} \cdot \sqrt{y}} \]
      8. sqrt-unprod61.9%

        \[\leadsto \color{blue}{\sqrt{y \cdot y}} \]
    9. Applied egg-rr61.9%

      \[\leadsto \color{blue}{\sqrt{y \cdot y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -270:\\ \;\;\;\;6 \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;y \leq 0.175:\\ \;\;\;\;\frac{y}{1 + x \cdot \left(x \cdot 0.16666666666666666\right)}\\ \mathbf{elif}\;y \leq 1.42 \cdot 10^{+135}:\\ \;\;\;\;6 \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{y \cdot y}\\ \end{array} \]

Alternative 4: 72.6% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{if}\;y \leq -430:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 450:\\ \;\;\;\;\sin x \cdot \frac{y}{x}\\ \mathbf{elif}\;y \leq 1.42 \cdot 10^{+135}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{y \cdot y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 6.0 (/ (/ y x) x))))
   (if (<= y -430.0)
     t_0
     (if (<= y 450.0)
       (* (sin x) (/ y x))
       (if (<= y 1.42e+135) t_0 (sqrt (* y y)))))))
double code(double x, double y) {
	double t_0 = 6.0 * ((y / x) / x);
	double tmp;
	if (y <= -430.0) {
		tmp = t_0;
	} else if (y <= 450.0) {
		tmp = sin(x) * (y / x);
	} else if (y <= 1.42e+135) {
		tmp = t_0;
	} else {
		tmp = sqrt((y * y));
	}
	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 = 6.0d0 * ((y / x) / x)
    if (y <= (-430.0d0)) then
        tmp = t_0
    else if (y <= 450.0d0) then
        tmp = sin(x) * (y / x)
    else if (y <= 1.42d+135) then
        tmp = t_0
    else
        tmp = sqrt((y * y))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 6.0 * ((y / x) / x);
	double tmp;
	if (y <= -430.0) {
		tmp = t_0;
	} else if (y <= 450.0) {
		tmp = Math.sin(x) * (y / x);
	} else if (y <= 1.42e+135) {
		tmp = t_0;
	} else {
		tmp = Math.sqrt((y * y));
	}
	return tmp;
}
def code(x, y):
	t_0 = 6.0 * ((y / x) / x)
	tmp = 0
	if y <= -430.0:
		tmp = t_0
	elif y <= 450.0:
		tmp = math.sin(x) * (y / x)
	elif y <= 1.42e+135:
		tmp = t_0
	else:
		tmp = math.sqrt((y * y))
	return tmp
function code(x, y)
	t_0 = Float64(6.0 * Float64(Float64(y / x) / x))
	tmp = 0.0
	if (y <= -430.0)
		tmp = t_0;
	elseif (y <= 450.0)
		tmp = Float64(sin(x) * Float64(y / x));
	elseif (y <= 1.42e+135)
		tmp = t_0;
	else
		tmp = sqrt(Float64(y * y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 6.0 * ((y / x) / x);
	tmp = 0.0;
	if (y <= -430.0)
		tmp = t_0;
	elseif (y <= 450.0)
		tmp = sin(x) * (y / x);
	elseif (y <= 1.42e+135)
		tmp = t_0;
	else
		tmp = sqrt((y * y));
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(6.0 * N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -430.0], t$95$0, If[LessEqual[y, 450.0], N[(N[Sin[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.42e+135], t$95$0, N[Sqrt[N[(y * y), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq 1.42 \cdot 10^{+135}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\sqrt{y \cdot y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -430 or 450 < y < 1.41999999999999998e135

    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. Taylor expanded in y around 0 4.5%

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

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

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

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

        \[\leadsto \frac{y}{1 + \color{blue}{{x}^{2} \cdot 0.16666666666666666}} \]
      2. unpow23.8%

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

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

      \[\leadsto \color{blue}{6 \cdot \frac{y}{{x}^{2}}} \]
    11. Step-by-step derivation
      1. unpow241.5%

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

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

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

    if -430 < y < 450

    1. Initial program 84.3%

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

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

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

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

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

    if 1.41999999999999998e135 < 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. Taylor expanded in y around 0 5.1%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
    7. Simplified26.3%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
    8. Step-by-step derivation
      1. div-inv26.3%

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

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

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

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

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

        \[\leadsto \color{blue}{y} \]
      7. add-sqr-sqrt5.0%

        \[\leadsto \color{blue}{\sqrt{y} \cdot \sqrt{y}} \]
      8. sqrt-unprod61.9%

        \[\leadsto \color{blue}{\sqrt{y \cdot y}} \]
    9. Applied egg-rr61.9%

      \[\leadsto \color{blue}{\sqrt{y \cdot y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -430:\\ \;\;\;\;6 \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;y \leq 450:\\ \;\;\;\;\sin x \cdot \frac{y}{x}\\ \mathbf{elif}\;y \leq 1.42 \cdot 10^{+135}:\\ \;\;\;\;6 \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{y \cdot y}\\ \end{array} \]

Alternative 5: 72.7% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{if}\;y \leq -660:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 330:\\ \;\;\;\;\frac{y}{\frac{x}{\sin x}}\\ \mathbf{elif}\;y \leq 1.42 \cdot 10^{+135}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{y \cdot y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 6.0 (/ (/ y x) x))))
   (if (<= y -660.0)
     t_0
     (if (<= y 330.0)
       (/ y (/ x (sin x)))
       (if (<= y 1.42e+135) t_0 (sqrt (* y y)))))))
double code(double x, double y) {
	double t_0 = 6.0 * ((y / x) / x);
	double tmp;
	if (y <= -660.0) {
		tmp = t_0;
	} else if (y <= 330.0) {
		tmp = y / (x / sin(x));
	} else if (y <= 1.42e+135) {
		tmp = t_0;
	} else {
		tmp = sqrt((y * y));
	}
	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 = 6.0d0 * ((y / x) / x)
    if (y <= (-660.0d0)) then
        tmp = t_0
    else if (y <= 330.0d0) then
        tmp = y / (x / sin(x))
    else if (y <= 1.42d+135) then
        tmp = t_0
    else
        tmp = sqrt((y * y))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 6.0 * ((y / x) / x);
	double tmp;
	if (y <= -660.0) {
		tmp = t_0;
	} else if (y <= 330.0) {
		tmp = y / (x / Math.sin(x));
	} else if (y <= 1.42e+135) {
		tmp = t_0;
	} else {
		tmp = Math.sqrt((y * y));
	}
	return tmp;
}
def code(x, y):
	t_0 = 6.0 * ((y / x) / x)
	tmp = 0
	if y <= -660.0:
		tmp = t_0
	elif y <= 330.0:
		tmp = y / (x / math.sin(x))
	elif y <= 1.42e+135:
		tmp = t_0
	else:
		tmp = math.sqrt((y * y))
	return tmp
function code(x, y)
	t_0 = Float64(6.0 * Float64(Float64(y / x) / x))
	tmp = 0.0
	if (y <= -660.0)
		tmp = t_0;
	elseif (y <= 330.0)
		tmp = Float64(y / Float64(x / sin(x)));
	elseif (y <= 1.42e+135)
		tmp = t_0;
	else
		tmp = sqrt(Float64(y * y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 6.0 * ((y / x) / x);
	tmp = 0.0;
	if (y <= -660.0)
		tmp = t_0;
	elseif (y <= 330.0)
		tmp = y / (x / sin(x));
	elseif (y <= 1.42e+135)
		tmp = t_0;
	else
		tmp = sqrt((y * y));
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(6.0 * N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -660.0], t$95$0, If[LessEqual[y, 330.0], N[(y / N[(x / N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.42e+135], t$95$0, N[Sqrt[N[(y * y), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq 1.42 \cdot 10^{+135}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\sqrt{y \cdot y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -660 or 330 < y < 1.41999999999999998e135

    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. Taylor expanded in y around 0 4.5%

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

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

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

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

        \[\leadsto \frac{y}{1 + \color{blue}{{x}^{2} \cdot 0.16666666666666666}} \]
      2. unpow23.8%

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

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

      \[\leadsto \color{blue}{6 \cdot \frac{y}{{x}^{2}}} \]
    11. Step-by-step derivation
      1. unpow241.5%

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

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

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

    if -660 < y < 330

    1. Initial program 84.3%

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

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

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

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

    if 1.41999999999999998e135 < 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. Taylor expanded in y around 0 5.1%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
    7. Simplified26.3%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
    8. Step-by-step derivation
      1. div-inv26.3%

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

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

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

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

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

        \[\leadsto \color{blue}{y} \]
      7. add-sqr-sqrt5.0%

        \[\leadsto \color{blue}{\sqrt{y} \cdot \sqrt{y}} \]
      8. sqrt-unprod61.9%

        \[\leadsto \color{blue}{\sqrt{y \cdot y}} \]
    9. Applied egg-rr61.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -660:\\ \;\;\;\;6 \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;y \leq 330:\\ \;\;\;\;\frac{y}{\frac{x}{\sin x}}\\ \mathbf{elif}\;y \leq 1.42 \cdot 10^{+135}:\\ \;\;\;\;6 \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{y \cdot y}\\ \end{array} \]

Alternative 6: 56.4% accurate, 11.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \frac{\frac{y}{x}}{x}\\ t_1 := \frac{x}{\frac{x}{y}}\\ \mathbf{if}\;y \leq -480:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 0.175:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{+194}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.52 \cdot 10^{+255}:\\ \;\;\;\;y + -0.16666666666666666 \cdot \left(y \cdot \left(x \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 6.0 (/ (/ y x) x))) (t_1 (/ x (/ x y))))
   (if (<= y -480.0)
     t_0
     (if (<= y 0.175)
       t_1
       (if (<= y 2.8e+194)
         t_0
         (if (<= y 1.52e+255)
           (+ y (* -0.16666666666666666 (* y (* x x))))
           t_1))))))
double code(double x, double y) {
	double t_0 = 6.0 * ((y / x) / x);
	double t_1 = x / (x / y);
	double tmp;
	if (y <= -480.0) {
		tmp = t_0;
	} else if (y <= 0.175) {
		tmp = t_1;
	} else if (y <= 2.8e+194) {
		tmp = t_0;
	} else if (y <= 1.52e+255) {
		tmp = y + (-0.16666666666666666 * (y * (x * x)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 6.0d0 * ((y / x) / x)
    t_1 = x / (x / y)
    if (y <= (-480.0d0)) then
        tmp = t_0
    else if (y <= 0.175d0) then
        tmp = t_1
    else if (y <= 2.8d+194) then
        tmp = t_0
    else if (y <= 1.52d+255) then
        tmp = y + ((-0.16666666666666666d0) * (y * (x * x)))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 6.0 * ((y / x) / x);
	double t_1 = x / (x / y);
	double tmp;
	if (y <= -480.0) {
		tmp = t_0;
	} else if (y <= 0.175) {
		tmp = t_1;
	} else if (y <= 2.8e+194) {
		tmp = t_0;
	} else if (y <= 1.52e+255) {
		tmp = y + (-0.16666666666666666 * (y * (x * x)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y):
	t_0 = 6.0 * ((y / x) / x)
	t_1 = x / (x / y)
	tmp = 0
	if y <= -480.0:
		tmp = t_0
	elif y <= 0.175:
		tmp = t_1
	elif y <= 2.8e+194:
		tmp = t_0
	elif y <= 1.52e+255:
		tmp = y + (-0.16666666666666666 * (y * (x * x)))
	else:
		tmp = t_1
	return tmp
function code(x, y)
	t_0 = Float64(6.0 * Float64(Float64(y / x) / x))
	t_1 = Float64(x / Float64(x / y))
	tmp = 0.0
	if (y <= -480.0)
		tmp = t_0;
	elseif (y <= 0.175)
		tmp = t_1;
	elseif (y <= 2.8e+194)
		tmp = t_0;
	elseif (y <= 1.52e+255)
		tmp = Float64(y + Float64(-0.16666666666666666 * Float64(y * Float64(x * x))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 6.0 * ((y / x) / x);
	t_1 = x / (x / y);
	tmp = 0.0;
	if (y <= -480.0)
		tmp = t_0;
	elseif (y <= 0.175)
		tmp = t_1;
	elseif (y <= 2.8e+194)
		tmp = t_0;
	elseif (y <= 1.52e+255)
		tmp = y + (-0.16666666666666666 * (y * (x * x)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(6.0 * N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -480.0], t$95$0, If[LessEqual[y, 0.175], t$95$1, If[LessEqual[y, 2.8e+194], t$95$0, If[LessEqual[y, 1.52e+255], N[(y + N[(-0.16666666666666666 * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 6 \cdot \frac{\frac{y}{x}}{x}\\
t_1 := \frac{x}{\frac{x}{y}}\\
\mathbf{if}\;y \leq -480:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 0.175:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.8 \cdot 10^{+194}:\\
\;\;\;\;t_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -480 or 0.17499999999999999 < y < 2.8000000000000001e194

    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. Taylor expanded in y around 0 4.6%

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

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

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

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

        \[\leadsto \frac{y}{1 + \color{blue}{{x}^{2} \cdot 0.16666666666666666}} \]
      2. unpow23.8%

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

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

      \[\leadsto \color{blue}{6 \cdot \frac{y}{{x}^{2}}} \]
    11. Step-by-step derivation
      1. unpow240.1%

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

        \[\leadsto 6 \cdot \color{blue}{\frac{\frac{y}{x}}{x}} \]
    12. Simplified40.2%

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

    if -480 < y < 0.17499999999999999 or 1.52000000000000001e255 < y

    1. Initial program 85.1%

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
    7. Simplified39.2%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y} \]
      7. log1p-expm1-u57.3%

        \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)} \]
    9. Applied egg-rr57.3%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)} \]
    10. Step-by-step derivation
      1. log1p-expm1-u51.9%

        \[\leadsto \color{blue}{y} \]
      2. *-un-lft-identity51.9%

        \[\leadsto \color{blue}{1 \cdot y} \]
      3. *-commutative51.9%

        \[\leadsto \color{blue}{y \cdot 1} \]
      4. metadata-eval51.9%

        \[\leadsto y \cdot \color{blue}{{x}^{0}} \]
      5. metadata-eval51.9%

        \[\leadsto y \cdot {x}^{\color{blue}{\left(-1 + 1\right)}} \]
      6. pow-prod-up51.7%

        \[\leadsto y \cdot \color{blue}{\left({x}^{-1} \cdot {x}^{1}\right)} \]
      7. inv-pow51.7%

        \[\leadsto y \cdot \left(\color{blue}{\frac{1}{x}} \cdot {x}^{1}\right) \]
      8. pow151.7%

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

        \[\leadsto \color{blue}{\left(y \cdot \frac{1}{x}\right) \cdot x} \]
      10. div-inv79.0%

        \[\leadsto \color{blue}{\frac{y}{x}} \cdot x \]
      11. *-commutative79.0%

        \[\leadsto \color{blue}{x \cdot \frac{y}{x}} \]
      12. associate-*r/39.2%

        \[\leadsto \color{blue}{\frac{x \cdot y}{x}} \]
      13. associate-/l*80.6%

        \[\leadsto \color{blue}{\frac{x}{\frac{x}{y}}} \]
    11. Applied egg-rr80.6%

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

    if 2.8000000000000001e194 < y < 1.52000000000000001e255

    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. Taylor expanded in y around 0 3.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -480:\\ \;\;\;\;6 \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;y \leq 0.175:\\ \;\;\;\;\frac{x}{\frac{x}{y}}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{+194}:\\ \;\;\;\;6 \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;y \leq 1.52 \cdot 10^{+255}:\\ \;\;\;\;y + -0.16666666666666666 \cdot \left(y \cdot \left(x \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{x}{y}}\\ \end{array} \]

Alternative 7: 57.0% accurate, 11.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{if}\;y \leq -260:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 0.175:\\ \;\;\;\;\frac{y}{1 + x \cdot \left(x \cdot 0.16666666666666666\right)}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{+195}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{+248}:\\ \;\;\;\;y + -0.16666666666666666 \cdot \left(y \cdot \left(x \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{x}{y}}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 6.0 (/ (/ y x) x))))
   (if (<= y -260.0)
     t_0
     (if (<= y 0.175)
       (/ y (+ 1.0 (* x (* x 0.16666666666666666))))
       (if (<= y 7.2e+195)
         t_0
         (if (<= y 5.6e+248)
           (+ y (* -0.16666666666666666 (* y (* x x))))
           (/ x (/ x y))))))))
double code(double x, double y) {
	double t_0 = 6.0 * ((y / x) / x);
	double tmp;
	if (y <= -260.0) {
		tmp = t_0;
	} else if (y <= 0.175) {
		tmp = y / (1.0 + (x * (x * 0.16666666666666666)));
	} else if (y <= 7.2e+195) {
		tmp = t_0;
	} else if (y <= 5.6e+248) {
		tmp = y + (-0.16666666666666666 * (y * (x * x)));
	} else {
		tmp = x / (x / y);
	}
	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 = 6.0d0 * ((y / x) / x)
    if (y <= (-260.0d0)) then
        tmp = t_0
    else if (y <= 0.175d0) then
        tmp = y / (1.0d0 + (x * (x * 0.16666666666666666d0)))
    else if (y <= 7.2d+195) then
        tmp = t_0
    else if (y <= 5.6d+248) then
        tmp = y + ((-0.16666666666666666d0) * (y * (x * x)))
    else
        tmp = x / (x / y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 6.0 * ((y / x) / x);
	double tmp;
	if (y <= -260.0) {
		tmp = t_0;
	} else if (y <= 0.175) {
		tmp = y / (1.0 + (x * (x * 0.16666666666666666)));
	} else if (y <= 7.2e+195) {
		tmp = t_0;
	} else if (y <= 5.6e+248) {
		tmp = y + (-0.16666666666666666 * (y * (x * x)));
	} else {
		tmp = x / (x / y);
	}
	return tmp;
}
def code(x, y):
	t_0 = 6.0 * ((y / x) / x)
	tmp = 0
	if y <= -260.0:
		tmp = t_0
	elif y <= 0.175:
		tmp = y / (1.0 + (x * (x * 0.16666666666666666)))
	elif y <= 7.2e+195:
		tmp = t_0
	elif y <= 5.6e+248:
		tmp = y + (-0.16666666666666666 * (y * (x * x)))
	else:
		tmp = x / (x / y)
	return tmp
function code(x, y)
	t_0 = Float64(6.0 * Float64(Float64(y / x) / x))
	tmp = 0.0
	if (y <= -260.0)
		tmp = t_0;
	elseif (y <= 0.175)
		tmp = Float64(y / Float64(1.0 + Float64(x * Float64(x * 0.16666666666666666))));
	elseif (y <= 7.2e+195)
		tmp = t_0;
	elseif (y <= 5.6e+248)
		tmp = Float64(y + Float64(-0.16666666666666666 * Float64(y * Float64(x * x))));
	else
		tmp = Float64(x / Float64(x / y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 6.0 * ((y / x) / x);
	tmp = 0.0;
	if (y <= -260.0)
		tmp = t_0;
	elseif (y <= 0.175)
		tmp = y / (1.0 + (x * (x * 0.16666666666666666)));
	elseif (y <= 7.2e+195)
		tmp = t_0;
	elseif (y <= 5.6e+248)
		tmp = y + (-0.16666666666666666 * (y * (x * x)));
	else
		tmp = x / (x / y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(6.0 * N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -260.0], t$95$0, If[LessEqual[y, 0.175], N[(y / N[(1.0 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+195], t$95$0, If[LessEqual[y, 5.6e+248], N[(y + N[(-0.16666666666666666 * N[(y * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(x / y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq 7.2 \cdot 10^{+195}:\\
\;\;\;\;t_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -260 or 0.17499999999999999 < y < 7.1999999999999997e195

    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. Taylor expanded in y around 0 4.6%

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

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

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

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

        \[\leadsto \frac{y}{1 + \color{blue}{{x}^{2} \cdot 0.16666666666666666}} \]
      2. unpow23.8%

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

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

      \[\leadsto \color{blue}{6 \cdot \frac{y}{{x}^{2}}} \]
    11. Step-by-step derivation
      1. unpow240.1%

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

        \[\leadsto 6 \cdot \color{blue}{\frac{\frac{y}{x}}{x}} \]
    12. Simplified40.2%

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

    if -260 < y < 0.17499999999999999

    1. Initial program 84.2%

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

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

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

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

      \[\leadsto \frac{y}{\color{blue}{1 + 0.16666666666666666 \cdot {x}^{2}}} \]
    8. Step-by-step derivation
      1. *-commutative82.3%

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

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

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

      \[\leadsto \frac{y}{1 + \color{blue}{0.16666666666666666 \cdot {x}^{2}}} \]
    11. Step-by-step derivation
      1. *-commutative82.3%

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

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

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

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

    if 7.1999999999999997e195 < y < 5.6000000000000004e248

    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. Taylor expanded in y around 0 3.7%

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

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

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

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

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

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

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

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

    if 5.6000000000000004e248 < 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. Taylor expanded in y around 0 8.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y} \]
      7. log1p-expm1-u100.0%

        \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)} \]
    9. Applied egg-rr100.0%

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

        \[\leadsto \color{blue}{y} \]
      2. *-un-lft-identity9.5%

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

        \[\leadsto \color{blue}{y \cdot 1} \]
      4. metadata-eval9.5%

        \[\leadsto y \cdot \color{blue}{{x}^{0}} \]
      5. metadata-eval9.5%

        \[\leadsto y \cdot {x}^{\color{blue}{\left(-1 + 1\right)}} \]
      6. pow-prod-up9.5%

        \[\leadsto y \cdot \color{blue}{\left({x}^{-1} \cdot {x}^{1}\right)} \]
      7. inv-pow9.5%

        \[\leadsto y \cdot \left(\color{blue}{\frac{1}{x}} \cdot {x}^{1}\right) \]
      8. pow19.5%

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

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

        \[\leadsto \color{blue}{\frac{y}{x}} \cdot x \]
      11. *-commutative65.8%

        \[\leadsto \color{blue}{x \cdot \frac{y}{x}} \]
      12. associate-*r/43.7%

        \[\leadsto \color{blue}{\frac{x \cdot y}{x}} \]
      13. associate-/l*65.8%

        \[\leadsto \color{blue}{\frac{x}{\frac{x}{y}}} \]
    11. Applied egg-rr65.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -260:\\ \;\;\;\;6 \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;y \leq 0.175:\\ \;\;\;\;\frac{y}{1 + x \cdot \left(x \cdot 0.16666666666666666\right)}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{+195}:\\ \;\;\;\;6 \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{+248}:\\ \;\;\;\;y + -0.16666666666666666 \cdot \left(y \cdot \left(x \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{x}{y}}\\ \end{array} \]

Alternative 8: 56.7% accurate, 13.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 6 \cdot \frac{\frac{y}{x}}{x}\\ t_1 := \frac{x}{\frac{x}{y}}\\ \mathbf{if}\;y \leq -310:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 0.175:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+225}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+248}:\\ \;\;\;\;y \cdot \left(x \cdot \left(x \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 6.0 (/ (/ y x) x))) (t_1 (/ x (/ x y))))
   (if (<= y -310.0)
     t_0
     (if (<= y 0.175)
       t_1
       (if (<= y 6e+225)
         t_0
         (if (<= y 5.2e+248) (* y (* x (* x -0.16666666666666666))) t_1))))))
double code(double x, double y) {
	double t_0 = 6.0 * ((y / x) / x);
	double t_1 = x / (x / y);
	double tmp;
	if (y <= -310.0) {
		tmp = t_0;
	} else if (y <= 0.175) {
		tmp = t_1;
	} else if (y <= 6e+225) {
		tmp = t_0;
	} else if (y <= 5.2e+248) {
		tmp = y * (x * (x * -0.16666666666666666));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 6.0d0 * ((y / x) / x)
    t_1 = x / (x / y)
    if (y <= (-310.0d0)) then
        tmp = t_0
    else if (y <= 0.175d0) then
        tmp = t_1
    else if (y <= 6d+225) then
        tmp = t_0
    else if (y <= 5.2d+248) then
        tmp = y * (x * (x * (-0.16666666666666666d0)))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 6.0 * ((y / x) / x);
	double t_1 = x / (x / y);
	double tmp;
	if (y <= -310.0) {
		tmp = t_0;
	} else if (y <= 0.175) {
		tmp = t_1;
	} else if (y <= 6e+225) {
		tmp = t_0;
	} else if (y <= 5.2e+248) {
		tmp = y * (x * (x * -0.16666666666666666));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y):
	t_0 = 6.0 * ((y / x) / x)
	t_1 = x / (x / y)
	tmp = 0
	if y <= -310.0:
		tmp = t_0
	elif y <= 0.175:
		tmp = t_1
	elif y <= 6e+225:
		tmp = t_0
	elif y <= 5.2e+248:
		tmp = y * (x * (x * -0.16666666666666666))
	else:
		tmp = t_1
	return tmp
function code(x, y)
	t_0 = Float64(6.0 * Float64(Float64(y / x) / x))
	t_1 = Float64(x / Float64(x / y))
	tmp = 0.0
	if (y <= -310.0)
		tmp = t_0;
	elseif (y <= 0.175)
		tmp = t_1;
	elseif (y <= 6e+225)
		tmp = t_0;
	elseif (y <= 5.2e+248)
		tmp = Float64(y * Float64(x * Float64(x * -0.16666666666666666)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 6.0 * ((y / x) / x);
	t_1 = x / (x / y);
	tmp = 0.0;
	if (y <= -310.0)
		tmp = t_0;
	elseif (y <= 0.175)
		tmp = t_1;
	elseif (y <= 6e+225)
		tmp = t_0;
	elseif (y <= 5.2e+248)
		tmp = y * (x * (x * -0.16666666666666666));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(6.0 * N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -310.0], t$95$0, If[LessEqual[y, 0.175], t$95$1, If[LessEqual[y, 6e+225], t$95$0, If[LessEqual[y, 5.2e+248], N[(y * N[(x * N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 6 \cdot \frac{\frac{y}{x}}{x}\\
t_1 := \frac{x}{\frac{x}{y}}\\
\mathbf{if}\;y \leq -310:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 0.175:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 6 \cdot 10^{+225}:\\
\;\;\;\;t_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -310 or 0.17499999999999999 < y < 6.000000000000001e225

    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. Taylor expanded in y around 0 4.6%

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

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

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

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

        \[\leadsto \frac{y}{1 + \color{blue}{{x}^{2} \cdot 0.16666666666666666}} \]
      2. unpow23.8%

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

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

      \[\leadsto \color{blue}{6 \cdot \frac{y}{{x}^{2}}} \]
    11. Step-by-step derivation
      1. unpow240.0%

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

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

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

    if -310 < y < 0.17499999999999999 or 5.20000000000000019e248 < y

    1. Initial program 85.1%

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
    7. Simplified39.2%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y} \]
      7. log1p-expm1-u57.3%

        \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)} \]
    9. Applied egg-rr57.3%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)} \]
    10. Step-by-step derivation
      1. log1p-expm1-u51.9%

        \[\leadsto \color{blue}{y} \]
      2. *-un-lft-identity51.9%

        \[\leadsto \color{blue}{1 \cdot y} \]
      3. *-commutative51.9%

        \[\leadsto \color{blue}{y \cdot 1} \]
      4. metadata-eval51.9%

        \[\leadsto y \cdot \color{blue}{{x}^{0}} \]
      5. metadata-eval51.9%

        \[\leadsto y \cdot {x}^{\color{blue}{\left(-1 + 1\right)}} \]
      6. pow-prod-up51.7%

        \[\leadsto y \cdot \color{blue}{\left({x}^{-1} \cdot {x}^{1}\right)} \]
      7. inv-pow51.7%

        \[\leadsto y \cdot \left(\color{blue}{\frac{1}{x}} \cdot {x}^{1}\right) \]
      8. pow151.7%

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

        \[\leadsto \color{blue}{\left(y \cdot \frac{1}{x}\right) \cdot x} \]
      10. div-inv79.0%

        \[\leadsto \color{blue}{\frac{y}{x}} \cdot x \]
      11. *-commutative79.0%

        \[\leadsto \color{blue}{x \cdot \frac{y}{x}} \]
      12. associate-*r/39.2%

        \[\leadsto \color{blue}{\frac{x \cdot y}{x}} \]
      13. associate-/l*80.6%

        \[\leadsto \color{blue}{\frac{x}{\frac{x}{y}}} \]
    11. Applied egg-rr80.6%

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

    if 6.000000000000001e225 < y < 5.20000000000000019e248

    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. Taylor expanded in y around 0 3.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, -0.16666666666666666 \cdot \color{blue}{\left(x \cdot x\right)}, -\left(-y\right)\right) \]
      8. associate-*r*85.7%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\left(-0.16666666666666666 \cdot x\right) \cdot x}, -\left(-y\right)\right) \]
      9. remove-double-neg85.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -310:\\ \;\;\;\;6 \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;y \leq 0.175:\\ \;\;\;\;\frac{x}{\frac{x}{y}}\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+225}:\\ \;\;\;\;6 \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+248}:\\ \;\;\;\;y \cdot \left(x \cdot \left(x \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{x}{y}}\\ \end{array} \]

Alternative 9: 57.4% accurate, 18.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -440 \lor \neg \left(y \leq 0.175\right):\\
\;\;\;\;6 \cdot \frac{\frac{y}{x}}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -440 or 0.17499999999999999 < 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. Taylor expanded in y around 0 4.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{6 \cdot \frac{y}{{x}^{2}}} \]
    11. Step-by-step derivation
      1. unpow239.4%

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

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

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

    if -440 < y < 0.17499999999999999

    1. Initial program 84.2%

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
    7. Simplified38.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y} \]
      7. log1p-expm1-u54.6%

        \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)} \]
    9. Applied egg-rr54.6%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)} \]
    10. Step-by-step derivation
      1. log1p-expm1-u54.6%

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

        \[\leadsto \color{blue}{1 \cdot y} \]
      3. *-commutative54.6%

        \[\leadsto \color{blue}{y \cdot 1} \]
      4. metadata-eval54.6%

        \[\leadsto y \cdot \color{blue}{{x}^{0}} \]
      5. metadata-eval54.6%

        \[\leadsto y \cdot {x}^{\color{blue}{\left(-1 + 1\right)}} \]
      6. pow-prod-up54.4%

        \[\leadsto y \cdot \color{blue}{\left({x}^{-1} \cdot {x}^{1}\right)} \]
      7. inv-pow54.4%

        \[\leadsto y \cdot \left(\color{blue}{\frac{1}{x}} \cdot {x}^{1}\right) \]
      8. pow154.4%

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

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

        \[\leadsto \color{blue}{\frac{y}{x}} \cdot x \]
      11. *-commutative79.9%

        \[\leadsto \color{blue}{x \cdot \frac{y}{x}} \]
      12. associate-*r/38.9%

        \[\leadsto \color{blue}{\frac{x \cdot y}{x}} \]
      13. associate-/l*81.6%

        \[\leadsto \color{blue}{\frac{x}{\frac{x}{y}}} \]
    11. Applied egg-rr81.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -440 \lor \neg \left(y \leq 0.175\right):\\ \;\;\;\;6 \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{x}{y}}\\ \end{array} \]

Alternative 10: 50.4% 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 92.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. Taylor expanded in y around 0 43.6%

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

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

      \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
  7. Simplified27.4%

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

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

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

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

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

Alternative 11: 50.0% accurate, 41.0× speedup?

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

\\
\frac{x}{\frac{x}{y}}
\end{array}
Derivation
  1. Initial program 92.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. Taylor expanded in y around 0 43.6%

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

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

      \[\leadsto \frac{\color{blue}{y \cdot x}}{x} \]
  7. Simplified27.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{y} \]
    7. log1p-expm1-u66.1%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)} \]
  9. Applied egg-rr66.1%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(y\right)\right)} \]
  10. Step-by-step derivation
    1. log1p-expm1-u28.9%

      \[\leadsto \color{blue}{y} \]
    2. *-un-lft-identity28.9%

      \[\leadsto \color{blue}{1 \cdot y} \]
    3. *-commutative28.9%

      \[\leadsto \color{blue}{y \cdot 1} \]
    4. metadata-eval28.9%

      \[\leadsto y \cdot \color{blue}{{x}^{0}} \]
    5. metadata-eval28.9%

      \[\leadsto y \cdot {x}^{\color{blue}{\left(-1 + 1\right)}} \]
    6. pow-prod-up28.8%

      \[\leadsto y \cdot \color{blue}{\left({x}^{-1} \cdot {x}^{1}\right)} \]
    7. inv-pow28.8%

      \[\leadsto y \cdot \left(\color{blue}{\frac{1}{x}} \cdot {x}^{1}\right) \]
    8. pow128.8%

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

      \[\leadsto \color{blue}{\left(y \cdot \frac{1}{x}\right) \cdot x} \]
    10. div-inv49.5%

      \[\leadsto \color{blue}{\frac{y}{x}} \cdot x \]
    11. *-commutative49.5%

      \[\leadsto \color{blue}{x \cdot \frac{y}{x}} \]
    12. associate-*r/27.4%

      \[\leadsto \color{blue}{\frac{x \cdot y}{x}} \]
    13. associate-/l*49.9%

      \[\leadsto \color{blue}{\frac{x}{\frac{x}{y}}} \]
  11. Applied egg-rr49.9%

    \[\leadsto \color{blue}{\frac{x}{\frac{x}{y}}} \]
  12. Final simplification49.9%

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

Alternative 12: 28.4% 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 92.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. Taylor expanded in y around 0 43.6%

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

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

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

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

    \[\leadsto \color{blue}{y} \]
  8. Final simplification28.9%

    \[\leadsto y \]

Developer target: 99.8% 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 2023271 
(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))