Linear.Quaternion:$ccosh from linear-1.19.1.3

Percentage Accurate: 89.5% → 99.9%
Time: 12.9s
Alternatives: 6
Speedup: 1.0×

Specification

?
\[\frac{\sin x \cdot \sinh y}{x} \]
(FPCore (x y)
  :precision binary64
  (/ (* (sin x) (sinh y)) x))
double code(double x, double y) {
	return (sin(x) * sinh(y)) / x;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    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]
\frac{\sin x \cdot \sinh y}{x}

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 6 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?

\[\frac{\sin x \cdot \sinh y}{x} \]
(FPCore (x y)
  :precision binary64
  (/ (* (sin x) (sinh y)) x))
double code(double x, double y) {
	return (sin(x) * sinh(y)) / x;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    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]
\frac{\sin x \cdot \sinh y}{x}

Alternative 1: 99.9% accurate, 1.0× speedup?

\[\frac{\sin x}{x} \cdot \sinh y \]
(FPCore (x y)
  :precision binary64
  (* (/ (sin x) x) (sinh y)))
double code(double x, double y) {
	return (sin(x) / x) * sinh(y);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    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]
\frac{\sin x}{x} \cdot \sinh y
Derivation
  1. Initial program 89.5%

    \[\frac{\sin x \cdot \sinh y}{x} \]
  2. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{\sin x \cdot \sinh y}{x}} \]
    2. mult-flipN/A

      \[\leadsto \color{blue}{\left(\sin x \cdot \sinh y\right) \cdot \frac{1}{x}} \]
    3. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(\sin x \cdot \sinh y\right)} \cdot \frac{1}{x} \]
    4. *-commutativeN/A

      \[\leadsto \color{blue}{\left(\sinh y \cdot \sin x\right)} \cdot \frac{1}{x} \]
    5. associate-*l*N/A

      \[\leadsto \color{blue}{\sinh y \cdot \left(\sin x \cdot \frac{1}{x}\right)} \]
    6. *-commutativeN/A

      \[\leadsto \color{blue}{\left(\sin x \cdot \frac{1}{x}\right) \cdot \sinh y} \]
    7. lower-*.f64N/A

      \[\leadsto \color{blue}{\left(\sin x \cdot \frac{1}{x}\right) \cdot \sinh y} \]
    8. mult-flip-revN/A

      \[\leadsto \color{blue}{\frac{\sin x}{x}} \cdot \sinh y \]
    9. lower-/.f6499.9%

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

    \[\leadsto \color{blue}{\frac{\sin x}{x} \cdot \sinh y} \]
  4. Add Preprocessing

Alternative 2: 99.3% accurate, 0.3× speedup?

\[\begin{array}{l} t_0 := \sinh \left(\left|y\right|\right)\\ t_1 := \frac{\sin x \cdot t\_0}{x}\\ \mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\left(1 + \frac{-1}{6} \cdot {x}^{2}\right) \cdot t\_0\\ \mathbf{elif}\;t\_1 \leq \frac{7482888383134223}{374144419156711147060143317175368453031918731001856}:\\ \;\;\;\;\frac{\left|y\right|}{x} \cdot \sin x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot t\_0\\ \end{array} \end{array} \]
(FPCore (x y)
  :precision binary64
  (let* ((t_0 (sinh (fabs y))) (t_1 (/ (* (sin x) t_0) x)))
  (*
   (copysign 1 y)
   (if (<= t_1 (- INFINITY))
     (* (+ 1 (* -1/6 (pow x 2))) t_0)
     (if (<=
          t_1
          7482888383134223/374144419156711147060143317175368453031918731001856)
       (* (/ (fabs y) x) (sin x))
       (* 1 t_0))))))
double code(double x, double y) {
	double t_0 = sinh(fabs(y));
	double t_1 = (sin(x) * t_0) / x;
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = (1.0 + (-0.16666666666666666 * pow(x, 2.0))) * t_0;
	} else if (t_1 <= 2e-35) {
		tmp = (fabs(y) / x) * sin(x);
	} else {
		tmp = 1.0 * t_0;
	}
	return copysign(1.0, y) * tmp;
}
public static double code(double x, double y) {
	double t_0 = Math.sinh(Math.abs(y));
	double t_1 = (Math.sin(x) * t_0) / x;
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = (1.0 + (-0.16666666666666666 * Math.pow(x, 2.0))) * t_0;
	} else if (t_1 <= 2e-35) {
		tmp = (Math.abs(y) / x) * Math.sin(x);
	} else {
		tmp = 1.0 * t_0;
	}
	return Math.copySign(1.0, y) * tmp;
}
def code(x, y):
	t_0 = math.sinh(math.fabs(y))
	t_1 = (math.sin(x) * t_0) / x
	tmp = 0
	if t_1 <= -math.inf:
		tmp = (1.0 + (-0.16666666666666666 * math.pow(x, 2.0))) * t_0
	elif t_1 <= 2e-35:
		tmp = (math.fabs(y) / x) * math.sin(x)
	else:
		tmp = 1.0 * t_0
	return math.copysign(1.0, y) * tmp
function code(x, y)
	t_0 = sinh(abs(y))
	t_1 = Float64(Float64(sin(x) * t_0) / x)
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(1.0 + Float64(-0.16666666666666666 * (x ^ 2.0))) * t_0);
	elseif (t_1 <= 2e-35)
		tmp = Float64(Float64(abs(y) / x) * sin(x));
	else
		tmp = Float64(1.0 * t_0);
	end
	return Float64(copysign(1.0, y) * tmp)
end
function tmp_2 = code(x, y)
	t_0 = sinh(abs(y));
	t_1 = (sin(x) * t_0) / x;
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = (1.0 + (-0.16666666666666666 * (x ^ 2.0))) * t_0;
	elseif (t_1 <= 2e-35)
		tmp = (abs(y) / x) * sin(x);
	else
		tmp = 1.0 * t_0;
	end
	tmp_2 = (sign(y) * abs(1.0)) * tmp;
end
code[x_, y_] := Block[{t$95$0 = N[Sinh[N[Abs[y], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sin[x], $MachinePrecision] * t$95$0), $MachinePrecision] / x), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$1, (-Infinity)], N[(N[(1 + N[(-1/6 * N[Power[x, 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[t$95$1, 7482888383134223/374144419156711147060143317175368453031918731001856], N[(N[(N[Abs[y], $MachinePrecision] / x), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision], N[(1 * t$95$0), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \sinh \left(\left|y\right|\right)\\
t_1 := \frac{\sin x \cdot t\_0}{x}\\
\mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(1 + \frac{-1}{6} \cdot {x}^{2}\right) \cdot t\_0\\

\mathbf{elif}\;t\_1 \leq \frac{7482888383134223}{374144419156711147060143317175368453031918731001856}:\\
\;\;\;\;\frac{\left|y\right|}{x} \cdot \sin x\\

\mathbf{else}:\\
\;\;\;\;1 \cdot t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -inf.0

    1. Initial program 89.5%

      \[\frac{\sin x \cdot \sinh y}{x} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sin x \cdot \sinh y}{x}} \]
      2. mult-flipN/A

        \[\leadsto \color{blue}{\left(\sin x \cdot \sinh y\right) \cdot \frac{1}{x}} \]
      3. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\sin x \cdot \sinh y\right)} \cdot \frac{1}{x} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\sinh y \cdot \sin x\right)} \cdot \frac{1}{x} \]
      5. associate-*l*N/A

        \[\leadsto \color{blue}{\sinh y \cdot \left(\sin x \cdot \frac{1}{x}\right)} \]
      6. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\sin x \cdot \frac{1}{x}\right) \cdot \sinh y} \]
      7. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\sin x \cdot \frac{1}{x}\right) \cdot \sinh y} \]
      8. mult-flip-revN/A

        \[\leadsto \color{blue}{\frac{\sin x}{x}} \cdot \sinh y \]
      9. lower-/.f6499.9%

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

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

      \[\leadsto \color{blue}{\left(1 + \frac{-1}{6} \cdot {x}^{2}\right)} \cdot \sinh y \]
    5. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \left(1 + \color{blue}{\frac{-1}{6} \cdot {x}^{2}}\right) \cdot \sinh y \]
      2. lower-*.f64N/A

        \[\leadsto \left(1 + \frac{-1}{6} \cdot \color{blue}{{x}^{2}}\right) \cdot \sinh y \]
      3. lower-pow.f6462.9%

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

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

    if -inf.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 2e-35

    1. Initial program 89.5%

      \[\frac{\sin x \cdot \sinh y}{x} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sin x \cdot \sinh y}{x}} \]
      2. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\sin x \cdot \frac{\sinh y}{x}} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{\sinh y}{x} \cdot \sin x} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{\sinh y}{x} \cdot \sin x} \]
      6. lower-/.f6499.8%

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

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

      \[\leadsto \color{blue}{\frac{y}{x}} \cdot \sin x \]
    5. Step-by-step derivation
      1. lower-/.f6462.9%

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

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

    if 2e-35 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x)

    1. Initial program 89.5%

      \[\frac{\sin x \cdot \sinh y}{x} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sin x \cdot \sinh y}{x}} \]
      2. mult-flipN/A

        \[\leadsto \color{blue}{\left(\sin x \cdot \sinh y\right) \cdot \frac{1}{x}} \]
      3. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\sin x \cdot \sinh y\right)} \cdot \frac{1}{x} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\sinh y \cdot \sin x\right)} \cdot \frac{1}{x} \]
      5. associate-*l*N/A

        \[\leadsto \color{blue}{\sinh y \cdot \left(\sin x \cdot \frac{1}{x}\right)} \]
      6. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\sin x \cdot \frac{1}{x}\right) \cdot \sinh y} \]
      7. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\sin x \cdot \frac{1}{x}\right) \cdot \sinh y} \]
      8. mult-flip-revN/A

        \[\leadsto \color{blue}{\frac{\sin x}{x}} \cdot \sinh y \]
      9. lower-/.f6499.9%

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

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

      \[\leadsto \color{blue}{1} \cdot \sinh y \]
    5. Step-by-step derivation
      1. Applied rewrites63.2%

        \[\leadsto \color{blue}{1} \cdot \sinh y \]
    6. Recombined 3 regimes into one program.
    7. Add Preprocessing

    Alternative 3: 97.4% accurate, 0.3× speedup?

    \[\begin{array}{l} t_0 := \sinh \left(\left|y\right|\right)\\ t_1 := \frac{\sin x \cdot t\_0}{x}\\ \mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\frac{\left(\left(\left(x \cdot x\right) \cdot \frac{-1}{6} - -1\right) \cdot x\right) \cdot \left|y\right|}{x}\\ \mathbf{elif}\;t\_1 \leq \frac{7482888383134223}{374144419156711147060143317175368453031918731001856}:\\ \;\;\;\;\frac{\left|y\right|}{x} \cdot \sin x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot t\_0\\ \end{array} \end{array} \]
    (FPCore (x y)
      :precision binary64
      (let* ((t_0 (sinh (fabs y))) (t_1 (/ (* (sin x) t_0) x)))
      (*
       (copysign 1 y)
       (if (<= t_1 (- INFINITY))
         (/ (* (* (- (* (* x x) -1/6) -1) x) (fabs y)) x)
         (if (<=
              t_1
              7482888383134223/374144419156711147060143317175368453031918731001856)
           (* (/ (fabs y) x) (sin x))
           (* 1 t_0))))))
    double code(double x, double y) {
    	double t_0 = sinh(fabs(y));
    	double t_1 = (sin(x) * t_0) / x;
    	double tmp;
    	if (t_1 <= -((double) INFINITY)) {
    		tmp = (((((x * x) * -0.16666666666666666) - -1.0) * x) * fabs(y)) / x;
    	} else if (t_1 <= 2e-35) {
    		tmp = (fabs(y) / x) * sin(x);
    	} else {
    		tmp = 1.0 * t_0;
    	}
    	return copysign(1.0, y) * tmp;
    }
    
    public static double code(double x, double y) {
    	double t_0 = Math.sinh(Math.abs(y));
    	double t_1 = (Math.sin(x) * t_0) / x;
    	double tmp;
    	if (t_1 <= -Double.POSITIVE_INFINITY) {
    		tmp = (((((x * x) * -0.16666666666666666) - -1.0) * x) * Math.abs(y)) / x;
    	} else if (t_1 <= 2e-35) {
    		tmp = (Math.abs(y) / x) * Math.sin(x);
    	} else {
    		tmp = 1.0 * t_0;
    	}
    	return Math.copySign(1.0, y) * tmp;
    }
    
    def code(x, y):
    	t_0 = math.sinh(math.fabs(y))
    	t_1 = (math.sin(x) * t_0) / x
    	tmp = 0
    	if t_1 <= -math.inf:
    		tmp = (((((x * x) * -0.16666666666666666) - -1.0) * x) * math.fabs(y)) / x
    	elif t_1 <= 2e-35:
    		tmp = (math.fabs(y) / x) * math.sin(x)
    	else:
    		tmp = 1.0 * t_0
    	return math.copysign(1.0, y) * tmp
    
    function code(x, y)
    	t_0 = sinh(abs(y))
    	t_1 = Float64(Float64(sin(x) * t_0) / x)
    	tmp = 0.0
    	if (t_1 <= Float64(-Inf))
    		tmp = Float64(Float64(Float64(Float64(Float64(Float64(x * x) * -0.16666666666666666) - -1.0) * x) * abs(y)) / x);
    	elseif (t_1 <= 2e-35)
    		tmp = Float64(Float64(abs(y) / x) * sin(x));
    	else
    		tmp = Float64(1.0 * t_0);
    	end
    	return Float64(copysign(1.0, y) * tmp)
    end
    
    function tmp_2 = code(x, y)
    	t_0 = sinh(abs(y));
    	t_1 = (sin(x) * t_0) / x;
    	tmp = 0.0;
    	if (t_1 <= -Inf)
    		tmp = (((((x * x) * -0.16666666666666666) - -1.0) * x) * abs(y)) / x;
    	elseif (t_1 <= 2e-35)
    		tmp = (abs(y) / x) * sin(x);
    	else
    		tmp = 1.0 * t_0;
    	end
    	tmp_2 = (sign(y) * abs(1.0)) * tmp;
    end
    
    code[x_, y_] := Block[{t$95$0 = N[Sinh[N[Abs[y], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sin[x], $MachinePrecision] * t$95$0), $MachinePrecision] / x), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(N[(N[(N[(x * x), $MachinePrecision] * -1/6), $MachinePrecision] - -1), $MachinePrecision] * x), $MachinePrecision] * N[Abs[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$1, 7482888383134223/374144419156711147060143317175368453031918731001856], N[(N[(N[Abs[y], $MachinePrecision] / x), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision], N[(1 * t$95$0), $MachinePrecision]]]), $MachinePrecision]]]
    
    \begin{array}{l}
    t_0 := \sinh \left(\left|y\right|\right)\\
    t_1 := \frac{\sin x \cdot t\_0}{x}\\
    \mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l}
    \mathbf{if}\;t\_1 \leq -\infty:\\
    \;\;\;\;\frac{\left(\left(\left(x \cdot x\right) \cdot \frac{-1}{6} - -1\right) \cdot x\right) \cdot \left|y\right|}{x}\\
    
    \mathbf{elif}\;t\_1 \leq \frac{7482888383134223}{374144419156711147060143317175368453031918731001856}:\\
    \;\;\;\;\frac{\left|y\right|}{x} \cdot \sin x\\
    
    \mathbf{else}:\\
    \;\;\;\;1 \cdot t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -inf.0

      1. Initial program 89.5%

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

        \[\leadsto \frac{\color{blue}{y \cdot \sin x}}{x} \]
      3. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{y \cdot \color{blue}{\sin x}}{x} \]
        2. lower-sin.f6440.7%

          \[\leadsto \frac{y \cdot \sin x}{x} \]
      4. Applied rewrites40.7%

        \[\leadsto \frac{\color{blue}{y \cdot \sin x}}{x} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{y \cdot \sin x}{x}} \]
        2. mult-flipN/A

          \[\leadsto \color{blue}{\left(y \cdot \sin x\right) \cdot \frac{1}{x}} \]
        3. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{1}{x} \cdot \left(y \cdot \sin x\right)} \]
        4. lower-*.f64N/A

          \[\leadsto \color{blue}{\frac{1}{x} \cdot \left(y \cdot \sin x\right)} \]
        5. lower-/.f6440.6%

          \[\leadsto \color{blue}{\frac{1}{x}} \cdot \left(y \cdot \sin x\right) \]
      6. Applied rewrites40.6%

        \[\leadsto \color{blue}{\frac{1}{x} \cdot \left(y \cdot \sin x\right)} \]
      7. Taylor expanded in x around 0

        \[\leadsto \frac{1}{x} \cdot \left(y \cdot \left(x \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {x}^{2}\right)}\right)\right) \]
      8. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{1}{x} \cdot \left(y \cdot \left(x \cdot \left(1 + \color{blue}{\frac{-1}{6} \cdot {x}^{2}}\right)\right)\right) \]
        2. lower-+.f64N/A

          \[\leadsto \frac{1}{x} \cdot \left(y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot \color{blue}{{x}^{2}}\right)\right)\right) \]
        3. lower-*.f64N/A

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

          \[\leadsto \frac{1}{x} \cdot \left(y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)\right) \]
      9. Applied rewrites26.2%

        \[\leadsto \frac{1}{x} \cdot \left(y \cdot \left(x \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {x}^{2}\right)}\right)\right) \]
      10. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{\frac{1}{x} \cdot \left(y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)\right)} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{\left(y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)\right) \cdot \frac{1}{x}} \]
        3. lift-/.f64N/A

          \[\leadsto \left(y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{x}} \]
        4. mult-flip-revN/A

          \[\leadsto \color{blue}{\frac{y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)}{x}} \]
        5. lower-/.f6426.2%

          \[\leadsto \color{blue}{\frac{y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)}{x}} \]
      11. Applied rewrites26.2%

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

      if -inf.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 2e-35

      1. Initial program 89.5%

        \[\frac{\sin x \cdot \sinh y}{x} \]
      2. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{\sin x \cdot \sinh y}{x}} \]
        2. lift-*.f64N/A

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

          \[\leadsto \color{blue}{\sin x \cdot \frac{\sinh y}{x}} \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{\sinh y}{x} \cdot \sin x} \]
        5. lower-*.f64N/A

          \[\leadsto \color{blue}{\frac{\sinh y}{x} \cdot \sin x} \]
        6. lower-/.f6499.8%

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

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

        \[\leadsto \color{blue}{\frac{y}{x}} \cdot \sin x \]
      5. Step-by-step derivation
        1. lower-/.f6462.9%

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

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

      if 2e-35 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x)

      1. Initial program 89.5%

        \[\frac{\sin x \cdot \sinh y}{x} \]
      2. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{\sin x \cdot \sinh y}{x}} \]
        2. mult-flipN/A

          \[\leadsto \color{blue}{\left(\sin x \cdot \sinh y\right) \cdot \frac{1}{x}} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(\sin x \cdot \sinh y\right)} \cdot \frac{1}{x} \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{\left(\sinh y \cdot \sin x\right)} \cdot \frac{1}{x} \]
        5. associate-*l*N/A

          \[\leadsto \color{blue}{\sinh y \cdot \left(\sin x \cdot \frac{1}{x}\right)} \]
        6. *-commutativeN/A

          \[\leadsto \color{blue}{\left(\sin x \cdot \frac{1}{x}\right) \cdot \sinh y} \]
        7. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(\sin x \cdot \frac{1}{x}\right) \cdot \sinh y} \]
        8. mult-flip-revN/A

          \[\leadsto \color{blue}{\frac{\sin x}{x}} \cdot \sinh y \]
        9. lower-/.f6499.9%

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

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

        \[\leadsto \color{blue}{1} \cdot \sinh y \]
      5. Step-by-step derivation
        1. Applied rewrites63.2%

          \[\leadsto \color{blue}{1} \cdot \sinh y \]
      6. Recombined 3 regimes into one program.
      7. Add Preprocessing

      Alternative 4: 73.9% accurate, 0.5× speedup?

      \[\begin{array}{l} t_0 := \sinh \left(\left|y\right|\right)\\ \mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l} \mathbf{if}\;\frac{\sin x \cdot t\_0}{x} \leq \frac{-3366486976990959}{168324348849547952231711676252164117297610873690341563503944988898199428937506586307637329160882830439263455003397702966816621832005881723620090072660860187198567157476110227142133240252298326952681384055545004032}:\\ \;\;\;\;\frac{\left(\left(\left(x \cdot x\right) \cdot \frac{-1}{6} - -1\right) \cdot x\right) \cdot \left|y\right|}{x}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot t\_0\\ \end{array} \end{array} \]
      (FPCore (x y)
        :precision binary64
        (let* ((t_0 (sinh (fabs y))))
        (*
         (copysign 1 y)
         (if (<=
              (/ (* (sin x) t_0) x)
              -3366486976990959/168324348849547952231711676252164117297610873690341563503944988898199428937506586307637329160882830439263455003397702966816621832005881723620090072660860187198567157476110227142133240252298326952681384055545004032)
           (/ (* (* (- (* (* x x) -1/6) -1) x) (fabs y)) x)
           (* 1 t_0)))))
      double code(double x, double y) {
      	double t_0 = sinh(fabs(y));
      	double tmp;
      	if (((sin(x) * t_0) / x) <= -2e-197) {
      		tmp = (((((x * x) * -0.16666666666666666) - -1.0) * x) * fabs(y)) / x;
      	} else {
      		tmp = 1.0 * t_0;
      	}
      	return copysign(1.0, y) * tmp;
      }
      
      public static double code(double x, double y) {
      	double t_0 = Math.sinh(Math.abs(y));
      	double tmp;
      	if (((Math.sin(x) * t_0) / x) <= -2e-197) {
      		tmp = (((((x * x) * -0.16666666666666666) - -1.0) * x) * Math.abs(y)) / x;
      	} else {
      		tmp = 1.0 * t_0;
      	}
      	return Math.copySign(1.0, y) * tmp;
      }
      
      def code(x, y):
      	t_0 = math.sinh(math.fabs(y))
      	tmp = 0
      	if ((math.sin(x) * t_0) / x) <= -2e-197:
      		tmp = (((((x * x) * -0.16666666666666666) - -1.0) * x) * math.fabs(y)) / x
      	else:
      		tmp = 1.0 * t_0
      	return math.copysign(1.0, y) * tmp
      
      function code(x, y)
      	t_0 = sinh(abs(y))
      	tmp = 0.0
      	if (Float64(Float64(sin(x) * t_0) / x) <= -2e-197)
      		tmp = Float64(Float64(Float64(Float64(Float64(Float64(x * x) * -0.16666666666666666) - -1.0) * x) * abs(y)) / x);
      	else
      		tmp = Float64(1.0 * t_0);
      	end
      	return Float64(copysign(1.0, y) * tmp)
      end
      
      function tmp_2 = code(x, y)
      	t_0 = sinh(abs(y));
      	tmp = 0.0;
      	if (((sin(x) * t_0) / x) <= -2e-197)
      		tmp = (((((x * x) * -0.16666666666666666) - -1.0) * x) * abs(y)) / x;
      	else
      		tmp = 1.0 * t_0;
      	end
      	tmp_2 = (sign(y) * abs(1.0)) * tmp;
      end
      
      code[x_, y_] := Block[{t$95$0 = N[Sinh[N[Abs[y], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(N[Sin[x], $MachinePrecision] * t$95$0), $MachinePrecision] / x), $MachinePrecision], -3366486976990959/168324348849547952231711676252164117297610873690341563503944988898199428937506586307637329160882830439263455003397702966816621832005881723620090072660860187198567157476110227142133240252298326952681384055545004032], N[(N[(N[(N[(N[(N[(x * x), $MachinePrecision] * -1/6), $MachinePrecision] - -1), $MachinePrecision] * x), $MachinePrecision] * N[Abs[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(1 * t$95$0), $MachinePrecision]]), $MachinePrecision]]
      
      \begin{array}{l}
      t_0 := \sinh \left(\left|y\right|\right)\\
      \mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l}
      \mathbf{if}\;\frac{\sin x \cdot t\_0}{x} \leq \frac{-3366486976990959}{168324348849547952231711676252164117297610873690341563503944988898199428937506586307637329160882830439263455003397702966816621832005881723620090072660860187198567157476110227142133240252298326952681384055545004032}:\\
      \;\;\;\;\frac{\left(\left(\left(x \cdot x\right) \cdot \frac{-1}{6} - -1\right) \cdot x\right) \cdot \left|y\right|}{x}\\
      
      \mathbf{else}:\\
      \;\;\;\;1 \cdot t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -2e-197

        1. Initial program 89.5%

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

          \[\leadsto \frac{\color{blue}{y \cdot \sin x}}{x} \]
        3. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \frac{y \cdot \color{blue}{\sin x}}{x} \]
          2. lower-sin.f6440.7%

            \[\leadsto \frac{y \cdot \sin x}{x} \]
        4. Applied rewrites40.7%

          \[\leadsto \frac{\color{blue}{y \cdot \sin x}}{x} \]
        5. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{y \cdot \sin x}{x}} \]
          2. mult-flipN/A

            \[\leadsto \color{blue}{\left(y \cdot \sin x\right) \cdot \frac{1}{x}} \]
          3. *-commutativeN/A

            \[\leadsto \color{blue}{\frac{1}{x} \cdot \left(y \cdot \sin x\right)} \]
          4. lower-*.f64N/A

            \[\leadsto \color{blue}{\frac{1}{x} \cdot \left(y \cdot \sin x\right)} \]
          5. lower-/.f6440.6%

            \[\leadsto \color{blue}{\frac{1}{x}} \cdot \left(y \cdot \sin x\right) \]
        6. Applied rewrites40.6%

          \[\leadsto \color{blue}{\frac{1}{x} \cdot \left(y \cdot \sin x\right)} \]
        7. Taylor expanded in x around 0

          \[\leadsto \frac{1}{x} \cdot \left(y \cdot \left(x \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {x}^{2}\right)}\right)\right) \]
        8. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \frac{1}{x} \cdot \left(y \cdot \left(x \cdot \left(1 + \color{blue}{\frac{-1}{6} \cdot {x}^{2}}\right)\right)\right) \]
          2. lower-+.f64N/A

            \[\leadsto \frac{1}{x} \cdot \left(y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot \color{blue}{{x}^{2}}\right)\right)\right) \]
          3. lower-*.f64N/A

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

            \[\leadsto \frac{1}{x} \cdot \left(y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)\right) \]
        9. Applied rewrites26.2%

          \[\leadsto \frac{1}{x} \cdot \left(y \cdot \left(x \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {x}^{2}\right)}\right)\right) \]
        10. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \color{blue}{\frac{1}{x} \cdot \left(y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)\right)} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{\left(y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)\right) \cdot \frac{1}{x}} \]
          3. lift-/.f64N/A

            \[\leadsto \left(y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{x}} \]
          4. mult-flip-revN/A

            \[\leadsto \color{blue}{\frac{y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)}{x}} \]
          5. lower-/.f6426.2%

            \[\leadsto \color{blue}{\frac{y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)}{x}} \]
        11. Applied rewrites26.2%

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

        if -2e-197 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x)

        1. Initial program 89.5%

          \[\frac{\sin x \cdot \sinh y}{x} \]
        2. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{\sin x \cdot \sinh y}{x}} \]
          2. mult-flipN/A

            \[\leadsto \color{blue}{\left(\sin x \cdot \sinh y\right) \cdot \frac{1}{x}} \]
          3. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(\sin x \cdot \sinh y\right)} \cdot \frac{1}{x} \]
          4. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\sinh y \cdot \sin x\right)} \cdot \frac{1}{x} \]
          5. associate-*l*N/A

            \[\leadsto \color{blue}{\sinh y \cdot \left(\sin x \cdot \frac{1}{x}\right)} \]
          6. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\sin x \cdot \frac{1}{x}\right) \cdot \sinh y} \]
          7. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(\sin x \cdot \frac{1}{x}\right) \cdot \sinh y} \]
          8. mult-flip-revN/A

            \[\leadsto \color{blue}{\frac{\sin x}{x}} \cdot \sinh y \]
          9. lower-/.f6499.9%

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

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

          \[\leadsto \color{blue}{1} \cdot \sinh y \]
        5. Step-by-step derivation
          1. Applied rewrites63.2%

            \[\leadsto \color{blue}{1} \cdot \sinh y \]
        6. Recombined 2 regimes into one program.
        7. Add Preprocessing

        Alternative 5: 33.3% accurate, 0.6× speedup?

        \[\mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l} \mathbf{if}\;\frac{\sin x \cdot \sinh \left(\left|y\right|\right)}{x} \leq \frac{-3366486976990959}{168324348849547952231711676252164117297610873690341563503944988898199428937506586307637329160882830439263455003397702966816621832005881723620090072660860187198567157476110227142133240252298326952681384055545004032}:\\ \;\;\;\;\frac{\left(\left(\left(x \cdot x\right) \cdot \frac{-1}{6} - -1\right) \cdot x\right) \cdot \left|y\right|}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left|y\right|}{x}\\ \end{array} \]
        (FPCore (x y)
          :precision binary64
          (*
         (copysign 1 y)
         (if (<=
              (/ (* (sin x) (sinh (fabs y))) x)
              -3366486976990959/168324348849547952231711676252164117297610873690341563503944988898199428937506586307637329160882830439263455003397702966816621832005881723620090072660860187198567157476110227142133240252298326952681384055545004032)
           (/ (* (* (- (* (* x x) -1/6) -1) x) (fabs y)) x)
           (/ (* x (fabs y)) x))))
        double code(double x, double y) {
        	double tmp;
        	if (((sin(x) * sinh(fabs(y))) / x) <= -2e-197) {
        		tmp = (((((x * x) * -0.16666666666666666) - -1.0) * x) * fabs(y)) / x;
        	} else {
        		tmp = (x * fabs(y)) / x;
        	}
        	return copysign(1.0, y) * tmp;
        }
        
        public static double code(double x, double y) {
        	double tmp;
        	if (((Math.sin(x) * Math.sinh(Math.abs(y))) / x) <= -2e-197) {
        		tmp = (((((x * x) * -0.16666666666666666) - -1.0) * x) * Math.abs(y)) / x;
        	} else {
        		tmp = (x * Math.abs(y)) / x;
        	}
        	return Math.copySign(1.0, y) * tmp;
        }
        
        def code(x, y):
        	tmp = 0
        	if ((math.sin(x) * math.sinh(math.fabs(y))) / x) <= -2e-197:
        		tmp = (((((x * x) * -0.16666666666666666) - -1.0) * x) * math.fabs(y)) / x
        	else:
        		tmp = (x * math.fabs(y)) / x
        	return math.copysign(1.0, y) * tmp
        
        function code(x, y)
        	tmp = 0.0
        	if (Float64(Float64(sin(x) * sinh(abs(y))) / x) <= -2e-197)
        		tmp = Float64(Float64(Float64(Float64(Float64(Float64(x * x) * -0.16666666666666666) - -1.0) * x) * abs(y)) / x);
        	else
        		tmp = Float64(Float64(x * abs(y)) / x);
        	end
        	return Float64(copysign(1.0, y) * tmp)
        end
        
        function tmp_2 = code(x, y)
        	tmp = 0.0;
        	if (((sin(x) * sinh(abs(y))) / x) <= -2e-197)
        		tmp = (((((x * x) * -0.16666666666666666) - -1.0) * x) * abs(y)) / x;
        	else
        		tmp = (x * abs(y)) / x;
        	end
        	tmp_2 = (sign(y) * abs(1.0)) * tmp;
        end
        
        code[x_, y_] := N[(N[With[{TMP1 = Abs[1], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[N[Abs[y], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -3366486976990959/168324348849547952231711676252164117297610873690341563503944988898199428937506586307637329160882830439263455003397702966816621832005881723620090072660860187198567157476110227142133240252298326952681384055545004032], N[(N[(N[(N[(N[(N[(x * x), $MachinePrecision] * -1/6), $MachinePrecision] - -1), $MachinePrecision] * x), $MachinePrecision] * N[Abs[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(x * N[Abs[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
        
        \mathsf{copysign}\left(1, y\right) \cdot \begin{array}{l}
        \mathbf{if}\;\frac{\sin x \cdot \sinh \left(\left|y\right|\right)}{x} \leq \frac{-3366486976990959}{168324348849547952231711676252164117297610873690341563503944988898199428937506586307637329160882830439263455003397702966816621832005881723620090072660860187198567157476110227142133240252298326952681384055545004032}:\\
        \;\;\;\;\frac{\left(\left(\left(x \cdot x\right) \cdot \frac{-1}{6} - -1\right) \cdot x\right) \cdot \left|y\right|}{x}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{x \cdot \left|y\right|}{x}\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -2e-197

          1. Initial program 89.5%

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

            \[\leadsto \frac{\color{blue}{y \cdot \sin x}}{x} \]
          3. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \frac{y \cdot \color{blue}{\sin x}}{x} \]
            2. lower-sin.f6440.7%

              \[\leadsto \frac{y \cdot \sin x}{x} \]
          4. Applied rewrites40.7%

            \[\leadsto \frac{\color{blue}{y \cdot \sin x}}{x} \]
          5. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{y \cdot \sin x}{x}} \]
            2. mult-flipN/A

              \[\leadsto \color{blue}{\left(y \cdot \sin x\right) \cdot \frac{1}{x}} \]
            3. *-commutativeN/A

              \[\leadsto \color{blue}{\frac{1}{x} \cdot \left(y \cdot \sin x\right)} \]
            4. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{1}{x} \cdot \left(y \cdot \sin x\right)} \]
            5. lower-/.f6440.6%

              \[\leadsto \color{blue}{\frac{1}{x}} \cdot \left(y \cdot \sin x\right) \]
          6. Applied rewrites40.6%

            \[\leadsto \color{blue}{\frac{1}{x} \cdot \left(y \cdot \sin x\right)} \]
          7. Taylor expanded in x around 0

            \[\leadsto \frac{1}{x} \cdot \left(y \cdot \left(x \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {x}^{2}\right)}\right)\right) \]
          8. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \frac{1}{x} \cdot \left(y \cdot \left(x \cdot \left(1 + \color{blue}{\frac{-1}{6} \cdot {x}^{2}}\right)\right)\right) \]
            2. lower-+.f64N/A

              \[\leadsto \frac{1}{x} \cdot \left(y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot \color{blue}{{x}^{2}}\right)\right)\right) \]
            3. lower-*.f64N/A

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

              \[\leadsto \frac{1}{x} \cdot \left(y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)\right) \]
          9. Applied rewrites26.2%

            \[\leadsto \frac{1}{x} \cdot \left(y \cdot \left(x \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {x}^{2}\right)}\right)\right) \]
          10. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \color{blue}{\frac{1}{x} \cdot \left(y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)\right)} \]
            2. *-commutativeN/A

              \[\leadsto \color{blue}{\left(y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)\right) \cdot \frac{1}{x}} \]
            3. lift-/.f64N/A

              \[\leadsto \left(y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{x}} \]
            4. mult-flip-revN/A

              \[\leadsto \color{blue}{\frac{y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)}{x}} \]
            5. lower-/.f6426.2%

              \[\leadsto \color{blue}{\frac{y \cdot \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)}{x}} \]
          11. Applied rewrites26.2%

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

          if -2e-197 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x)

          1. Initial program 89.5%

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

            \[\leadsto \frac{\color{blue}{y \cdot \sin x}}{x} \]
          3. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \frac{y \cdot \color{blue}{\sin x}}{x} \]
            2. lower-sin.f6440.7%

              \[\leadsto \frac{y \cdot \sin x}{x} \]
          4. Applied rewrites40.7%

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

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

              \[\leadsto \frac{x \cdot y}{x} \]
          7. Applied rewrites22.7%

            \[\leadsto \frac{x \cdot \color{blue}{y}}{x} \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 6: 22.7% accurate, 12.8× speedup?

        \[\frac{x \cdot y}{x} \]
        (FPCore (x y)
          :precision binary64
          (/ (* x y) x))
        double code(double x, double y) {
        	return (x * y) / x;
        }
        
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(x, y)
        use fmin_fmax_functions
            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(Float64(x * y) / x)
        end
        
        function tmp = code(x, y)
        	tmp = (x * y) / x;
        end
        
        code[x_, y_] := N[(N[(x * y), $MachinePrecision] / x), $MachinePrecision]
        
        \frac{x \cdot y}{x}
        
        Derivation
        1. Initial program 89.5%

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

          \[\leadsto \frac{\color{blue}{y \cdot \sin x}}{x} \]
        3. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \frac{y \cdot \color{blue}{\sin x}}{x} \]
          2. lower-sin.f6440.7%

            \[\leadsto \frac{y \cdot \sin x}{x} \]
        4. Applied rewrites40.7%

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

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

            \[\leadsto \frac{x \cdot y}{x} \]
        7. Applied rewrites22.7%

          \[\leadsto \frac{x \cdot \color{blue}{y}}{x} \]
        8. Add Preprocessing

        Reproduce

        ?
        herbie shell --seed 2025271 -o generate:evaluate
        (FPCore (x y)
          :name "Linear.Quaternion:$ccosh from linear-1.19.1.3"
          :precision binary64
          (/ (* (sin x) (sinh y)) x))