Linear.Quaternion:$ccosh from linear-1.19.1.3

Percentage Accurate: 89.5% → 99.9%
Time: 8.1s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 89.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 2: 86.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -2 \cdot 10^{+34}:\\
\;\;\;\;\sinh y\\

\mathbf{elif}\;\sinh y \leq 2 \cdot 10^{-10}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (sinh.f64 y) < -1.99999999999999989e34

    1. Initial program 100.0%

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

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

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

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

    if -1.99999999999999989e34 < (sinh.f64 y) < 2.00000000000000007e-10

    1. Initial program 74.7%

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

      \[\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. Step-by-step derivation
      1. clear-num99.1%

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

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

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

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

    if 2.00000000000000007e-10 < (sinh.f64 y)

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

Alternative 3: 86.6% accurate, 0.7× speedup?

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

\mathbf{elif}\;\sinh y \leq 2 \cdot 10^{-10}:\\
\;\;\;\;\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) < -5.00000000000000036e-18 or 2.00000000000000007e-10 < (sinh.f64 y)

    1. Initial program 100.0%

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

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

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

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

    if -5.00000000000000036e-18 < (sinh.f64 y) < 2.00000000000000007e-10

    1. Initial program 74.5%

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

      \[\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}}} \]
      2. associate-/r/99.8%

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

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

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

Alternative 4: 87.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -2 \cdot 10^{+34}:\\
\;\;\;\;\sinh y\\

\mathbf{elif}\;\sinh y \leq 2 \cdot 10^{-10}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (sinh.f64 y) < -1.99999999999999989e34 or 2.00000000000000007e-10 < (sinh.f64 y)

    1. Initial program 100.0%

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

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

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

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

    if -1.99999999999999989e34 < (sinh.f64 y) < 2.00000000000000007e-10

    1. Initial program 74.7%

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

      \[\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. Step-by-step derivation
      1. clear-num99.1%

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

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

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

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

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

Alternative 5: 75.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\sinh y \leq -2 \cdot 10^{+34}:\\
\;\;\;\;\sinh y\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (sinh.f64 y) < -1.99999999999999989e34 or 2.00000000000000007e-10 < (sinh.f64 y)

    1. Initial program 100.0%

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

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

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

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

    if -1.99999999999999989e34 < (sinh.f64 y) < 2.00000000000000007e-10

    1. Initial program 74.7%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sinh y \leq -2 \cdot 10^{+34}:\\ \;\;\;\;\sinh y\\ \mathbf{elif}\;\sinh y \leq 2 \cdot 10^{-10}:\\ \;\;\;\;\frac{y}{1 + x \cdot \left(x \cdot 0.16666666666666666\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.5%

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

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

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

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

Alternative 7: 57.5% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;y \leq 4.6 \cdot 10^{+142}:\\
\;\;\;\;\frac{\frac{y}{x}}{x \cdot 0.16666666666666666 + \frac{1}{x}}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{6 \cdot y}{x \cdot x}} \]
    13. Step-by-step derivation
      1. *-un-lft-identity53.5%

        \[\leadsto \frac{6 \cdot y}{\color{blue}{1 \cdot \left(x \cdot x\right)}} \]
      2. times-frac53.5%

        \[\leadsto \color{blue}{\frac{6}{1} \cdot \frac{y}{x \cdot x}} \]
      3. metadata-eval53.5%

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

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

    if -2.8e11 < y < 4.60000000000000004e142

    1. Initial program 80.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 60.2%

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

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

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

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

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

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

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

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

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

    if 4.60000000000000004e142 < 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 6.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{y} \cdot \sqrt{y}} \]
      8. sqrt-unprod59.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -280000000000:\\ \;\;\;\;6 \cdot \frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{+142}:\\ \;\;\;\;\frac{\frac{y}{x}}{x \cdot 0.16666666666666666 + \frac{1}{x}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{y \cdot y}\\ \end{array} \]

Alternative 8: 56.5% accurate, 15.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -280000000000 \lor \neg \left(y \leq 220\right):\\ \;\;\;\;6 \cdot \frac{y}{x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{1 + x \cdot \left(x \cdot 0.16666666666666666\right)}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= y -280000000000.0) (not (<= y 220.0)))
   (* 6.0 (/ y (* x x)))
   (/ y (+ 1.0 (* x (* x 0.16666666666666666))))))
double code(double x, double y) {
	double tmp;
	if ((y <= -280000000000.0) || !(y <= 220.0)) {
		tmp = 6.0 * (y / (x * x));
	} else {
		tmp = y / (1.0 + (x * (x * 0.16666666666666666)));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((y <= (-280000000000.0d0)) .or. (.not. (y <= 220.0d0))) then
        tmp = 6.0d0 * (y / (x * x))
    else
        tmp = y / (1.0d0 + (x * (x * 0.16666666666666666d0)))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((y <= -280000000000.0) || !(y <= 220.0)) {
		tmp = 6.0 * (y / (x * x));
	} else {
		tmp = y / (1.0 + (x * (x * 0.16666666666666666)));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (y <= -280000000000.0) or not (y <= 220.0):
		tmp = 6.0 * (y / (x * x))
	else:
		tmp = y / (1.0 + (x * (x * 0.16666666666666666)))
	return tmp
function code(x, y)
	tmp = 0.0
	if ((y <= -280000000000.0) || !(y <= 220.0))
		tmp = Float64(6.0 * Float64(y / Float64(x * x)));
	else
		tmp = Float64(y / Float64(1.0 + Float64(x * Float64(x * 0.16666666666666666))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((y <= -280000000000.0) || ~((y <= 220.0)))
		tmp = 6.0 * (y / (x * x));
	else
		tmp = y / (1.0 + (x * (x * 0.16666666666666666)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[y, -280000000000.0], N[Not[LessEqual[y, 220.0]], $MachinePrecision]], N[(6.0 * N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(1.0 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.8e11 or 220 < 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.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}}} \]
    6. Simplified4.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{6 \cdot y}{\color{blue}{1 \cdot \left(x \cdot x\right)}} \]
      2. times-frac46.7%

        \[\leadsto \color{blue}{\frac{6}{1} \cdot \frac{y}{x \cdot x}} \]
      3. metadata-eval46.7%

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

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

    if -2.8e11 < y < 220

    1. Initial program 76.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 72.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 56.3% accurate, 18.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3100 or 250 < 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 4.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{6}{1} \cdot \frac{y}{x \cdot x}} \]
      3. metadata-eval45.6%

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

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

    if -3100 < y < 250

    1. Initial program 75.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 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.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 27.9% accurate, 205.0× speedup?

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

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

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

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

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

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

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

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

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

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

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