Linear.Quaternion:$ccosh from linear-1.19.1.3

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

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

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

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

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

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

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

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

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

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

Alternative 2: 87.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\sinh y \leq -0.002:\\ \;\;\;\;\sinh y\\ \mathbf{elif}\;\sinh y \leq 0.0005:\\ \;\;\;\;\frac{\sin x}{-0.16666666666666666 \cdot \left(y \cdot x\right) + \frac{x}{y}}\\ \mathbf{else}:\\ \;\;\;\;\sinh y\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= (sinh y) -0.002)
   (sinh y)
   (if (<= (sinh y) 0.0005)
     (/ (sin x) (+ (* -0.16666666666666666 (* y x)) (/ x y)))
     (sinh y))))
double code(double x, double y) {
	double tmp;
	if (sinh(y) <= -0.002) {
		tmp = sinh(y);
	} else if (sinh(y) <= 0.0005) {
		tmp = sin(x) / ((-0.16666666666666666 * (y * x)) + (x / 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) <= (-0.002d0)) then
        tmp = sinh(y)
    else if (sinh(y) <= 0.0005d0) then
        tmp = sin(x) / (((-0.16666666666666666d0) * (y * x)) + (x / 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) <= -0.002) {
		tmp = Math.sinh(y);
	} else if (Math.sinh(y) <= 0.0005) {
		tmp = Math.sin(x) / ((-0.16666666666666666 * (y * x)) + (x / y));
	} else {
		tmp = Math.sinh(y);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if math.sinh(y) <= -0.002:
		tmp = math.sinh(y)
	elif math.sinh(y) <= 0.0005:
		tmp = math.sin(x) / ((-0.16666666666666666 * (y * x)) + (x / y))
	else:
		tmp = math.sinh(y)
	return tmp
function code(x, y)
	tmp = 0.0
	if (sinh(y) <= -0.002)
		tmp = sinh(y);
	elseif (sinh(y) <= 0.0005)
		tmp = Float64(sin(x) / Float64(Float64(-0.16666666666666666 * Float64(y * x)) + Float64(x / y)));
	else
		tmp = sinh(y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (sinh(y) <= -0.002)
		tmp = sinh(y);
	elseif (sinh(y) <= 0.0005)
		tmp = sin(x) / ((-0.16666666666666666 * (y * x)) + (x / y));
	else
		tmp = sinh(y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], -0.002], N[Sinh[y], $MachinePrecision], If[LessEqual[N[Sinh[y], $MachinePrecision], 0.0005], N[(N[Sin[x], $MachinePrecision] / N[(N[(-0.16666666666666666 * N[(y * x), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -0.002:\\
\;\;\;\;\sinh y\\

\mathbf{elif}\;\sinh y \leq 0.0005:\\
\;\;\;\;\frac{\sin x}{-0.16666666666666666 \cdot \left(y \cdot x\right) + \frac{x}{y}}\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -2e-3 < (sinh.f64 y) < 5.0000000000000001e-4

    1. Initial program 73.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sinh y \leq -0.002:\\ \;\;\;\;\sinh y\\ \mathbf{elif}\;\sinh y \leq 0.0005:\\ \;\;\;\;\frac{\sin x}{-0.16666666666666666 \cdot \left(y \cdot x\right) + \frac{x}{y}}\\ \mathbf{else}:\\ \;\;\;\;\sinh y\\ \end{array} \]

Alternative 3: 87.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\sinh y \leq -0.002:\\ \;\;\;\;\sinh y\\ \mathbf{elif}\;\sinh y \leq 0.0005:\\ \;\;\;\;\sin x \cdot \frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\sinh y\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= (sinh y) -0.002)
   (sinh y)
   (if (<= (sinh y) 0.0005) (* (sin x) (/ y x)) (sinh y))))
double code(double x, double y) {
	double tmp;
	if (sinh(y) <= -0.002) {
		tmp = sinh(y);
	} else if (sinh(y) <= 0.0005) {
		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) <= (-0.002d0)) then
        tmp = sinh(y)
    else if (sinh(y) <= 0.0005d0) 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) <= -0.002) {
		tmp = Math.sinh(y);
	} else if (Math.sinh(y) <= 0.0005) {
		tmp = Math.sin(x) * (y / x);
	} else {
		tmp = Math.sinh(y);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if math.sinh(y) <= -0.002:
		tmp = math.sinh(y)
	elif math.sinh(y) <= 0.0005:
		tmp = math.sin(x) * (y / x)
	else:
		tmp = math.sinh(y)
	return tmp
function code(x, y)
	tmp = 0.0
	if (sinh(y) <= -0.002)
		tmp = sinh(y);
	elseif (sinh(y) <= 0.0005)
		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) <= -0.002)
		tmp = sinh(y);
	elseif (sinh(y) <= 0.0005)
		tmp = sin(x) * (y / x);
	else
		tmp = sinh(y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], -0.002], N[Sinh[y], $MachinePrecision], If[LessEqual[N[Sinh[y], $MachinePrecision], 0.0005], 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 -0.002:\\
\;\;\;\;\sinh y\\

\mathbf{elif}\;\sinh y \leq 0.0005:\\
\;\;\;\;\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) < -2e-3 or 5.0000000000000001e-4 < (sinh.f64 y)

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -2e-3 < (sinh.f64 y) < 5.0000000000000001e-4

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sinh y \leq -0.002:\\ \;\;\;\;\sinh y\\ \mathbf{elif}\;\sinh y \leq 0.0005:\\ \;\;\;\;\sin x \cdot \frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\sinh y\\ \end{array} \]

Alternative 4: 87.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\sinh y \leq -0.002:\\ \;\;\;\;\sinh y\\ \mathbf{elif}\;\sinh y \leq 0.0005:\\ \;\;\;\;\frac{y}{\frac{x}{\sin x}}\\ \mathbf{else}:\\ \;\;\;\;\sinh y\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= (sinh y) -0.002)
   (sinh y)
   (if (<= (sinh y) 0.0005) (/ y (/ x (sin x))) (sinh y))))
double code(double x, double y) {
	double tmp;
	if (sinh(y) <= -0.002) {
		tmp = sinh(y);
	} else if (sinh(y) <= 0.0005) {
		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) <= (-0.002d0)) then
        tmp = sinh(y)
    else if (sinh(y) <= 0.0005d0) 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) <= -0.002) {
		tmp = Math.sinh(y);
	} else if (Math.sinh(y) <= 0.0005) {
		tmp = y / (x / Math.sin(x));
	} else {
		tmp = Math.sinh(y);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if math.sinh(y) <= -0.002:
		tmp = math.sinh(y)
	elif math.sinh(y) <= 0.0005:
		tmp = y / (x / math.sin(x))
	else:
		tmp = math.sinh(y)
	return tmp
function code(x, y)
	tmp = 0.0
	if (sinh(y) <= -0.002)
		tmp = sinh(y);
	elseif (sinh(y) <= 0.0005)
		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) <= -0.002)
		tmp = sinh(y);
	elseif (sinh(y) <= 0.0005)
		tmp = y / (x / sin(x));
	else
		tmp = sinh(y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], -0.002], N[Sinh[y], $MachinePrecision], If[LessEqual[N[Sinh[y], $MachinePrecision], 0.0005], 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 -0.002:\\
\;\;\;\;\sinh y\\

\mathbf{elif}\;\sinh y \leq 0.0005:\\
\;\;\;\;\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) < -2e-3 or 5.0000000000000001e-4 < (sinh.f64 y)

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -2e-3 < (sinh.f64 y) < 5.0000000000000001e-4

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sinh y \leq -0.002:\\ \;\;\;\;\sinh y\\ \mathbf{elif}\;\sinh y \leq 0.0005:\\ \;\;\;\;\frac{y}{\frac{x}{\sin x}}\\ \mathbf{else}:\\ \;\;\;\;\sinh y\\ \end{array} \]

Alternative 5: 75.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\sinh y \leq -0.002:\\ \;\;\;\;\sinh y\\ \mathbf{elif}\;\sinh y \leq 0.0005:\\ \;\;\;\;\frac{y}{1 + 0.16666666666666666 \cdot \left(x \cdot x\right)}\\ \mathbf{else}:\\ \;\;\;\;\sinh y\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= (sinh y) -0.002)
   (sinh y)
   (if (<= (sinh y) 0.0005)
     (/ y (+ 1.0 (* 0.16666666666666666 (* x x))))
     (sinh y))))
double code(double x, double y) {
	double tmp;
	if (sinh(y) <= -0.002) {
		tmp = sinh(y);
	} else if (sinh(y) <= 0.0005) {
		tmp = y / (1.0 + (0.16666666666666666 * (x * 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) <= (-0.002d0)) then
        tmp = sinh(y)
    else if (sinh(y) <= 0.0005d0) then
        tmp = y / (1.0d0 + (0.16666666666666666d0 * (x * 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) <= -0.002) {
		tmp = Math.sinh(y);
	} else if (Math.sinh(y) <= 0.0005) {
		tmp = y / (1.0 + (0.16666666666666666 * (x * x)));
	} else {
		tmp = Math.sinh(y);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if math.sinh(y) <= -0.002:
		tmp = math.sinh(y)
	elif math.sinh(y) <= 0.0005:
		tmp = y / (1.0 + (0.16666666666666666 * (x * x)))
	else:
		tmp = math.sinh(y)
	return tmp
function code(x, y)
	tmp = 0.0
	if (sinh(y) <= -0.002)
		tmp = sinh(y);
	elseif (sinh(y) <= 0.0005)
		tmp = Float64(y / Float64(1.0 + Float64(0.16666666666666666 * Float64(x * x))));
	else
		tmp = sinh(y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (sinh(y) <= -0.002)
		tmp = sinh(y);
	elseif (sinh(y) <= 0.0005)
		tmp = y / (1.0 + (0.16666666666666666 * (x * x)));
	else
		tmp = sinh(y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[N[Sinh[y], $MachinePrecision], -0.002], N[Sinh[y], $MachinePrecision], If[LessEqual[N[Sinh[y], $MachinePrecision], 0.0005], N[(y / N[(1.0 + N[(0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -0.002:\\
\;\;\;\;\sinh y\\

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -2e-3 < (sinh.f64 y) < 5.0000000000000001e-4

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{y}{x}}{\color{blue}{0.16666666666666666 \cdot x + \frac{1}{x}}} \]
    10. Taylor expanded in y around 0 79.6%

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

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

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

        \[\leadsto \frac{y}{x \cdot \left(\frac{1}{x} + \color{blue}{x \cdot 0.16666666666666666}\right)} \]
      4. distribute-lft-in79.6%

        \[\leadsto \frac{y}{\color{blue}{x \cdot \frac{1}{x} + x \cdot \left(x \cdot 0.16666666666666666\right)}} \]
      5. rgt-mult-inverse79.8%

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

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

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

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

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

Alternative 6: 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 87.7%

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

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

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

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

Alternative 7: 60.1% accurate, 1.9× speedup?

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

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

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

\mathbf{elif}\;y \leq 2.7 \cdot 10^{+198}:\\
\;\;\;\;\frac{y \cdot 6}{x \cdot x}\\

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


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

    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.9%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{y}{x}}{\color{blue}{0.16666666666666666 \cdot x + \frac{1}{x}}} \]
    10. Taylor expanded in x around inf 52.8%

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

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

        \[\leadsto \color{blue}{\frac{6 \cdot y}{x \cdot x}} \]
      3. times-frac52.8%

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

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

    if -300 < y < 330

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{y}{x}}{\color{blue}{0.16666666666666666 \cdot x + \frac{1}{x}}} \]
    10. Taylor expanded in y around 0 78.2%

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot \frac{1}{x} + x \cdot \left(x \cdot 0.16666666666666666\right)}} \]
      5. rgt-mult-inverse78.4%

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

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

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

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

    if 330 < y < 2.6999999999999999e198

    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/29.6%

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

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

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

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

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

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

      \[\leadsto \frac{\frac{y}{x}}{\color{blue}{0.16666666666666666 \cdot x + \frac{1}{x}}} \]
    10. Taylor expanded in x around inf 57.4%

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

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

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

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

    if 2.6999999999999999e198 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 57.5% accurate, 15.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -300:\\ \;\;\;\;\frac{y}{x} \cdot \frac{6}{x}\\ \mathbf{elif}\;y \leq 330:\\ \;\;\;\;\frac{y}{1 + 0.16666666666666666 \cdot \left(x \cdot x\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot 6}{x \cdot x}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y -300.0)
   (* (/ y x) (/ 6.0 x))
   (if (<= y 330.0)
     (/ y (+ 1.0 (* 0.16666666666666666 (* x x))))
     (/ (* y 6.0) (* x x)))))
double code(double x, double y) {
	double tmp;
	if (y <= -300.0) {
		tmp = (y / x) * (6.0 / x);
	} else if (y <= 330.0) {
		tmp = y / (1.0 + (0.16666666666666666 * (x * x)));
	} else {
		tmp = (y * 6.0) / (x * x);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= (-300.0d0)) then
        tmp = (y / x) * (6.0d0 / x)
    else if (y <= 330.0d0) then
        tmp = y / (1.0d0 + (0.16666666666666666d0 * (x * x)))
    else
        tmp = (y * 6.0d0) / (x * x)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= -300.0) {
		tmp = (y / x) * (6.0 / x);
	} else if (y <= 330.0) {
		tmp = y / (1.0 + (0.16666666666666666 * (x * x)));
	} else {
		tmp = (y * 6.0) / (x * x);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= -300.0:
		tmp = (y / x) * (6.0 / x)
	elif y <= 330.0:
		tmp = y / (1.0 + (0.16666666666666666 * (x * x)))
	else:
		tmp = (y * 6.0) / (x * x)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= -300.0)
		tmp = Float64(Float64(y / x) * Float64(6.0 / x));
	elseif (y <= 330.0)
		tmp = Float64(y / Float64(1.0 + Float64(0.16666666666666666 * Float64(x * x))));
	else
		tmp = Float64(Float64(y * 6.0) / Float64(x * x));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= -300.0)
		tmp = (y / x) * (6.0 / x);
	elseif (y <= 330.0)
		tmp = y / (1.0 + (0.16666666666666666 * (x * x)));
	else
		tmp = (y * 6.0) / (x * x);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, -300.0], N[(N[(y / x), $MachinePrecision] * N[(6.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 330.0], N[(y / N[(1.0 + N[(0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 6.0), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    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.9%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{y}{x}}{\color{blue}{0.16666666666666666 \cdot x + \frac{1}{x}}} \]
    10. Taylor expanded in x around inf 52.8%

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

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

        \[\leadsto \color{blue}{\frac{6 \cdot y}{x \cdot x}} \]
      3. times-frac52.8%

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

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

    if -300 < y < 330

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{y}{x}}{\color{blue}{0.16666666666666666 \cdot x + \frac{1}{x}}} \]
    10. Taylor expanded in y around 0 78.2%

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot \frac{1}{x} + x \cdot \left(x \cdot 0.16666666666666666\right)}} \]
      5. rgt-mult-inverse78.4%

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

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

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

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

    if 330 < 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.3%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{y}{x}}{\color{blue}{0.16666666666666666 \cdot x + \frac{1}{x}}} \]
    10. Taylor expanded in x around inf 54.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -300:\\ \;\;\;\;\frac{y}{x} \cdot \frac{6}{x}\\ \mathbf{elif}\;y \leq 330:\\ \;\;\;\;\frac{y}{1 + 0.16666666666666666 \cdot \left(x \cdot x\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot 6}{x \cdot x}\\ \end{array} \]

Alternative 9: 57.0% accurate, 18.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -250 or 270 < 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.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}}} \]
      2. associate-/r/36.0%

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

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

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

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

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

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

      \[\leadsto \frac{\frac{y}{x}}{\color{blue}{0.16666666666666666 \cdot x + \frac{1}{x}}} \]
    10. Taylor expanded in x around inf 53.5%

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

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

        \[\leadsto \color{blue}{\frac{6 \cdot y}{x \cdot x}} \]
      3. times-frac53.5%

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

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

    if -250 < y < 270

    1. Initial program 74.1%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{x}{y}}} \]
      3. un-div-inv77.7%

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

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

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

Alternative 10: 57.0% accurate, 18.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -290:\\ \;\;\;\;\frac{y}{x} \cdot \frac{6}{x}\\ \mathbf{elif}\;y \leq 300:\\ \;\;\;\;\frac{x}{\frac{x}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot 6}{x \cdot x}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y -290.0)
   (* (/ y x) (/ 6.0 x))
   (if (<= y 300.0) (/ x (/ x y)) (/ (* y 6.0) (* x x)))))
double code(double x, double y) {
	double tmp;
	if (y <= -290.0) {
		tmp = (y / x) * (6.0 / x);
	} else if (y <= 300.0) {
		tmp = x / (x / y);
	} else {
		tmp = (y * 6.0) / (x * x);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= (-290.0d0)) then
        tmp = (y / x) * (6.0d0 / x)
    else if (y <= 300.0d0) then
        tmp = x / (x / y)
    else
        tmp = (y * 6.0d0) / (x * x)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= -290.0) {
		tmp = (y / x) * (6.0 / x);
	} else if (y <= 300.0) {
		tmp = x / (x / y);
	} else {
		tmp = (y * 6.0) / (x * x);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= -290.0:
		tmp = (y / x) * (6.0 / x)
	elif y <= 300.0:
		tmp = x / (x / y)
	else:
		tmp = (y * 6.0) / (x * x)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= -290.0)
		tmp = Float64(Float64(y / x) * Float64(6.0 / x));
	elseif (y <= 300.0)
		tmp = Float64(x / Float64(x / y));
	else
		tmp = Float64(Float64(y * 6.0) / Float64(x * x));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= -290.0)
		tmp = (y / x) * (6.0 / x);
	elseif (y <= 300.0)
		tmp = x / (x / y);
	else
		tmp = (y * 6.0) / (x * x);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, -290.0], N[(N[(y / x), $MachinePrecision] * N[(6.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 300.0], N[(x / N[(x / y), $MachinePrecision]), $MachinePrecision], N[(N[(y * 6.0), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 300:\\
\;\;\;\;\frac{x}{\frac{x}{y}}\\

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


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

    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.9%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{y}{x}}{\color{blue}{0.16666666666666666 \cdot x + \frac{1}{x}}} \]
    10. Taylor expanded in x around inf 52.8%

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

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

        \[\leadsto \color{blue}{\frac{6 \cdot y}{x \cdot x}} \]
      3. times-frac52.8%

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

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

    if -290 < y < 300

    1. Initial program 74.1%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{x}{y}}} \]
      3. un-div-inv77.7%

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

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

    if 300 < 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.3%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{y}{x}}{\color{blue}{0.16666666666666666 \cdot x + \frac{1}{x}}} \]
    10. Taylor expanded in x around inf 54.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -290:\\ \;\;\;\;\frac{y}{x} \cdot \frac{6}{x}\\ \mathbf{elif}\;y \leq 300:\\ \;\;\;\;\frac{x}{\frac{x}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot 6}{x \cdot x}\\ \end{array} \]

Alternative 11: 50.0% 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 87.7%

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

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

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

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

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

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

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

Alternative 12: 28.1% 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.7%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{y} \]
  8. Final simplification29.3%

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