Linear.Quaternion:$ccosh from linear-1.19.1.3

Percentage Accurate: 88.7% → 99.9%
Time: 6.1s
Alternatives: 18
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;
}
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]
\begin{array}{l}

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

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 18 alternatives:

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

Initial Program: 88.7% 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;
}
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]
\begin{array}{l}

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

Alternative 1: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\sinh y}{x} \cdot \sin x \end{array} \]
(FPCore (x y) :precision binary64 (* (/ (sinh y) x) (sin x)))
double code(double x, double y) {
	return (sinh(y) / x) * sin(x);
}
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 = (sinh(y) / x) * sin(x)
end function
public static double code(double x, double y) {
	return (Math.sinh(y) / x) * Math.sin(x);
}
def code(x, y):
	return (math.sinh(y) / x) * math.sin(x)
function code(x, y)
	return Float64(Float64(sinh(y) / x) * sin(x))
end
function tmp = code(x, y)
	tmp = (sinh(y) / x) * sin(x);
end
code[x_, y_] := N[(N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\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. lift-sin.f64N/A

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\sinh y}}{x} \cdot \sin x \]
    10. lift-sin.f6499.9

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

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

Alternative 2: 92.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\ t_1 := \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)\\ \mathbf{if}\;y \leq -2.4 \cdot 10^{+132}:\\ \;\;\;\;\frac{\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot \sin x}{x} \cdot y\\ \mathbf{elif}\;y \leq -27:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-13}:\\ \;\;\;\;\left(t\_1 \cdot \frac{\sin x}{x}\right) \cdot y\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+106}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin x \cdot t\_1}{x} \cdot y\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (* 2.0 (sinh y)) (fma (* x x) -0.08333333333333333 0.5)))
        (t_1 (fma (* y y) 0.16666666666666666 1.0)))
   (if (<= y -2.4e+132)
     (* (/ (* (* (* y y) 0.16666666666666666) (sin x)) x) y)
     (if (<= y -27.0)
       t_0
       (if (<= y 2.1e-13)
         (* (* t_1 (/ (sin x) x)) y)
         (if (<= y 1.55e+106) t_0 (* (/ (* (sin x) t_1) x) y)))))))
double code(double x, double y) {
	double t_0 = (2.0 * sinh(y)) * fma((x * x), -0.08333333333333333, 0.5);
	double t_1 = fma((y * y), 0.16666666666666666, 1.0);
	double tmp;
	if (y <= -2.4e+132) {
		tmp = ((((y * y) * 0.16666666666666666) * sin(x)) / x) * y;
	} else if (y <= -27.0) {
		tmp = t_0;
	} else if (y <= 2.1e-13) {
		tmp = (t_1 * (sin(x) / x)) * y;
	} else if (y <= 1.55e+106) {
		tmp = t_0;
	} else {
		tmp = ((sin(x) * t_1) / x) * y;
	}
	return tmp;
}
function code(x, y)
	t_0 = Float64(Float64(2.0 * sinh(y)) * fma(Float64(x * x), -0.08333333333333333, 0.5))
	t_1 = fma(Float64(y * y), 0.16666666666666666, 1.0)
	tmp = 0.0
	if (y <= -2.4e+132)
		tmp = Float64(Float64(Float64(Float64(Float64(y * y) * 0.16666666666666666) * sin(x)) / x) * y);
	elseif (y <= -27.0)
		tmp = t_0;
	elseif (y <= 2.1e-13)
		tmp = Float64(Float64(t_1 * Float64(sin(x) / x)) * y);
	elseif (y <= 1.55e+106)
		tmp = t_0;
	else
		tmp = Float64(Float64(Float64(sin(x) * t_1) / x) * y);
	end
	return tmp
end
code[x_, y_] := Block[{t$95$0 = N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision]}, If[LessEqual[y, -2.4e+132], N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, -27.0], t$95$0, If[LessEqual[y, 2.1e-13], N[(N[(t$95$1 * N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 1.55e+106], t$95$0, N[(N[(N[(N[Sin[x], $MachinePrecision] * t$95$1), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\
t_1 := \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{+132}:\\
\;\;\;\;\frac{\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot \sin x}{x} \cdot y\\

\mathbf{elif}\;y \leq -27:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{-13}:\\
\;\;\;\;\left(t\_1 \cdot \frac{\sin x}{x}\right) \cdot y\\

\mathbf{elif}\;y \leq 1.55 \cdot 10^{+106}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{\sin x \cdot t\_1}{x} \cdot y\\


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

    1. Initial program 100.0%

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

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

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

        \[\leadsto \left(\frac{1}{6} \cdot \frac{{y}^{2} \cdot \sin x}{x} + \frac{\sin x}{x}\right) \cdot \color{blue}{y} \]
    4. Applied rewrites96.7%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot \sin x}{x} \cdot y} \]
    5. Taylor expanded in y around inf

      \[\leadsto \frac{\left(\frac{1}{6} \cdot {y}^{2}\right) \cdot \sin x}{x} \cdot y \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \frac{\left({y}^{2} \cdot \frac{1}{6}\right) \cdot \sin x}{x} \cdot y \]
      3. pow2N/A

        \[\leadsto \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \sin x}{x} \cdot y \]
      4. lift-*.f6496.7

        \[\leadsto \frac{\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot \sin x}{x} \cdot y \]
    7. Applied rewrites96.7%

      \[\leadsto \frac{\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot \sin x}{x} \cdot y \]

    if -2.4000000000000001e132 < y < -27 or 2.09999999999999989e-13 < y < 1.55e106

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{\frac{-1}{12} \cdot \left({x}^{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)\right) + \frac{1}{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{-1}{12} \cdot {x}^{2}\right) \cdot \left(e^{y} - \frac{1}{e^{y}}\right) + \color{blue}{\frac{1}{2}} \cdot \left(e^{y} - \frac{1}{e^{y}}\right) \]
      2. distribute-rgt-outN/A

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

        \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \color{blue}{\left(\frac{-1}{12} \cdot {x}^{2} + \frac{1}{2}\right)} \]
      4. rec-expN/A

        \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \left(\frac{-1}{12} \cdot \color{blue}{{x}^{2}} + \frac{1}{2}\right) \]
      5. sinh-undefN/A

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

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

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

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \left({x}^{2} \cdot \frac{-1}{12} + \frac{1}{2}\right) \]
      9. lower-fma.f64N/A

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left({x}^{2}, \color{blue}{\frac{-1}{12}}, \frac{1}{2}\right) \]
      10. unpow2N/A

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, \frac{-1}{12}, \frac{1}{2}\right) \]
      11. lower-*.f6471.4

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right) \]
    4. Applied rewrites71.4%

      \[\leadsto \color{blue}{\left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)} \]

    if -27 < y < 2.09999999999999989e-13

    1. Initial program 77.3%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot \sin x}{x} \cdot y} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot \sin x}{x} \cdot y \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot \sin x}{x} \cdot y \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot \sin x}{x} \cdot y \]
      4. lift-fma.f64N/A

        \[\leadsto \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6} + 1\right) \cdot \sin x}{x} \cdot y \]
      5. lift-sin.f64N/A

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

        \[\leadsto \left(\left(\left(y \cdot y\right) \cdot \frac{1}{6} + 1\right) \cdot \frac{\sin x}{x}\right) \cdot y \]
      7. +-commutativeN/A

        \[\leadsto \left(\left(1 + \left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \frac{\sin x}{x}\right) \cdot y \]
      8. pow2N/A

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

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

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

        \[\leadsto \left(\left(1 + {y}^{2} \cdot \frac{1}{6}\right) \cdot \frac{\sin x}{x}\right) \cdot y \]
      12. pow2N/A

        \[\leadsto \left(\left(1 + \left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \frac{\sin x}{x}\right) \cdot y \]
      13. +-commutativeN/A

        \[\leadsto \left(\left(\left(y \cdot y\right) \cdot \frac{1}{6} + 1\right) \cdot \frac{\sin x}{x}\right) \cdot y \]
      14. lift-fma.f64N/A

        \[\leadsto \left(\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot \frac{\sin x}{x}\right) \cdot y \]
      15. lift-*.f64N/A

        \[\leadsto \left(\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot \frac{\sin x}{x}\right) \cdot y \]
      16. lower-/.f64N/A

        \[\leadsto \left(\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot \frac{\sin x}{x}\right) \cdot y \]
      17. lift-sin.f6499.4

        \[\leadsto \left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot \frac{\sin x}{x}\right) \cdot y \]
    6. Applied rewrites99.4%

      \[\leadsto \left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot \frac{\sin x}{x}\right) \cdot y \]

    if 1.55e106 < y

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot \sin x}{x} \cdot y} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot \sin x}{x} \cdot y \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot \sin x}{x} \cdot y \]
      3. lift-fma.f64N/A

        \[\leadsto \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6} + 1\right) \cdot \sin x}{x} \cdot y \]
      4. lift-sin.f64N/A

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

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

        \[\leadsto \frac{\sin x \cdot \left(1 + \left(y \cdot y\right) \cdot \frac{1}{6}\right)}{x} \cdot y \]
      7. pow2N/A

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

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

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

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

        \[\leadsto \frac{\sin x \cdot \left(1 + {y}^{2} \cdot \frac{1}{6}\right)}{x} \cdot y \]
      12. pow2N/A

        \[\leadsto \frac{\sin x \cdot \left(1 + \left(y \cdot y\right) \cdot \frac{1}{6}\right)}{x} \cdot y \]
      13. +-commutativeN/A

        \[\leadsto \frac{\sin x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} + 1\right)}{x} \cdot y \]
      14. lift-fma.f64N/A

        \[\leadsto \frac{\sin x \cdot \mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right)}{x} \cdot y \]
      15. lift-*.f6493.4

        \[\leadsto \frac{\sin x \cdot \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)}{x} \cdot y \]
    6. Applied rewrites93.4%

      \[\leadsto \frac{\sin x \cdot \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)}{x} \cdot \color{blue}{y} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 3: 92.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\ t_1 := \frac{\sin x \cdot \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)}{x} \cdot y\\ \mathbf{if}\;y \leq -2.4 \cdot 10^{+132}:\\ \;\;\;\;\frac{\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot \sin x}{x} \cdot y\\ \mathbf{elif}\;y \leq -27:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-13}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+106}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (* 2.0 (sinh y)) (fma (* x x) -0.08333333333333333 0.5)))
        (t_1 (* (/ (* (sin x) (fma (* y y) 0.16666666666666666 1.0)) x) y)))
   (if (<= y -2.4e+132)
     (* (/ (* (* (* y y) 0.16666666666666666) (sin x)) x) y)
     (if (<= y -27.0)
       t_0
       (if (<= y 2.1e-13) t_1 (if (<= y 1.55e+106) t_0 t_1))))))
double code(double x, double y) {
	double t_0 = (2.0 * sinh(y)) * fma((x * x), -0.08333333333333333, 0.5);
	double t_1 = ((sin(x) * fma((y * y), 0.16666666666666666, 1.0)) / x) * y;
	double tmp;
	if (y <= -2.4e+132) {
		tmp = ((((y * y) * 0.16666666666666666) * sin(x)) / x) * y;
	} else if (y <= -27.0) {
		tmp = t_0;
	} else if (y <= 2.1e-13) {
		tmp = t_1;
	} else if (y <= 1.55e+106) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y)
	t_0 = Float64(Float64(2.0 * sinh(y)) * fma(Float64(x * x), -0.08333333333333333, 0.5))
	t_1 = Float64(Float64(Float64(sin(x) * fma(Float64(y * y), 0.16666666666666666, 1.0)) / x) * y)
	tmp = 0.0
	if (y <= -2.4e+132)
		tmp = Float64(Float64(Float64(Float64(Float64(y * y) * 0.16666666666666666) * sin(x)) / x) * y);
	elseif (y <= -27.0)
		tmp = t_0;
	elseif (y <= 2.1e-13)
		tmp = t_1;
	elseif (y <= 1.55e+106)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_] := Block[{t$95$0 = N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[Sin[x], $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.4e+132], N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, -27.0], t$95$0, If[LessEqual[y, 2.1e-13], t$95$1, If[LessEqual[y, 1.55e+106], t$95$0, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\
t_1 := \frac{\sin x \cdot \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)}{x} \cdot y\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{+132}:\\
\;\;\;\;\frac{\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot \sin x}{x} \cdot y\\

\mathbf{elif}\;y \leq -27:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.55 \cdot 10^{+106}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


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

    1. Initial program 100.0%

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

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

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

        \[\leadsto \left(\frac{1}{6} \cdot \frac{{y}^{2} \cdot \sin x}{x} + \frac{\sin x}{x}\right) \cdot \color{blue}{y} \]
    4. Applied rewrites96.7%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot \sin x}{x} \cdot y} \]
    5. Taylor expanded in y around inf

      \[\leadsto \frac{\left(\frac{1}{6} \cdot {y}^{2}\right) \cdot \sin x}{x} \cdot y \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \frac{\left({y}^{2} \cdot \frac{1}{6}\right) \cdot \sin x}{x} \cdot y \]
      3. pow2N/A

        \[\leadsto \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \sin x}{x} \cdot y \]
      4. lift-*.f6496.7

        \[\leadsto \frac{\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot \sin x}{x} \cdot y \]
    7. Applied rewrites96.7%

      \[\leadsto \frac{\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot \sin x}{x} \cdot y \]

    if -2.4000000000000001e132 < y < -27 or 2.09999999999999989e-13 < y < 1.55e106

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{\frac{-1}{12} \cdot \left({x}^{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)\right) + \frac{1}{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{-1}{12} \cdot {x}^{2}\right) \cdot \left(e^{y} - \frac{1}{e^{y}}\right) + \color{blue}{\frac{1}{2}} \cdot \left(e^{y} - \frac{1}{e^{y}}\right) \]
      2. distribute-rgt-outN/A

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

        \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \color{blue}{\left(\frac{-1}{12} \cdot {x}^{2} + \frac{1}{2}\right)} \]
      4. rec-expN/A

        \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \left(\frac{-1}{12} \cdot \color{blue}{{x}^{2}} + \frac{1}{2}\right) \]
      5. sinh-undefN/A

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

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

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

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \left({x}^{2} \cdot \frac{-1}{12} + \frac{1}{2}\right) \]
      9. lower-fma.f64N/A

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left({x}^{2}, \color{blue}{\frac{-1}{12}}, \frac{1}{2}\right) \]
      10. unpow2N/A

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, \frac{-1}{12}, \frac{1}{2}\right) \]
      11. lower-*.f6471.4

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right) \]
    4. Applied rewrites71.4%

      \[\leadsto \color{blue}{\left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)} \]

    if -27 < y < 2.09999999999999989e-13 or 1.55e106 < y

    1. Initial program 82.9%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot \sin x}{x} \cdot y} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot \sin x}{x} \cdot y \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot \sin x}{x} \cdot y \]
      3. lift-fma.f64N/A

        \[\leadsto \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6} + 1\right) \cdot \sin x}{x} \cdot y \]
      4. lift-sin.f64N/A

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

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

        \[\leadsto \frac{\sin x \cdot \left(1 + \left(y \cdot y\right) \cdot \frac{1}{6}\right)}{x} \cdot y \]
      7. pow2N/A

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

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

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

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

        \[\leadsto \frac{\sin x \cdot \left(1 + {y}^{2} \cdot \frac{1}{6}\right)}{x} \cdot y \]
      12. pow2N/A

        \[\leadsto \frac{\sin x \cdot \left(1 + \left(y \cdot y\right) \cdot \frac{1}{6}\right)}{x} \cdot y \]
      13. +-commutativeN/A

        \[\leadsto \frac{\sin x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} + 1\right)}{x} \cdot y \]
      14. lift-fma.f64N/A

        \[\leadsto \frac{\sin x \cdot \mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right)}{x} \cdot y \]
      15. lift-*.f6497.9

        \[\leadsto \frac{\sin x \cdot \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)}{x} \cdot y \]
    6. Applied rewrites97.9%

      \[\leadsto \frac{\sin x \cdot \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)}{x} \cdot \color{blue}{y} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 92.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\ t_1 := \frac{\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot \sin x}{x} \cdot y\\ \mathbf{if}\;y \leq -2.4 \cdot 10^{+132}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -27:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-13}:\\ \;\;\;\;\frac{\sin x}{x} \cdot y\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+106}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (* 2.0 (sinh y)) (fma (* x x) -0.08333333333333333 0.5)))
        (t_1 (* (/ (* (* (* y y) 0.16666666666666666) (sin x)) x) y)))
   (if (<= y -2.4e+132)
     t_1
     (if (<= y -27.0)
       t_0
       (if (<= y 2.1e-13)
         (* (/ (sin x) x) y)
         (if (<= y 1.55e+106) t_0 t_1))))))
double code(double x, double y) {
	double t_0 = (2.0 * sinh(y)) * fma((x * x), -0.08333333333333333, 0.5);
	double t_1 = ((((y * y) * 0.16666666666666666) * sin(x)) / x) * y;
	double tmp;
	if (y <= -2.4e+132) {
		tmp = t_1;
	} else if (y <= -27.0) {
		tmp = t_0;
	} else if (y <= 2.1e-13) {
		tmp = (sin(x) / x) * y;
	} else if (y <= 1.55e+106) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y)
	t_0 = Float64(Float64(2.0 * sinh(y)) * fma(Float64(x * x), -0.08333333333333333, 0.5))
	t_1 = Float64(Float64(Float64(Float64(Float64(y * y) * 0.16666666666666666) * sin(x)) / x) * y)
	tmp = 0.0
	if (y <= -2.4e+132)
		tmp = t_1;
	elseif (y <= -27.0)
		tmp = t_0;
	elseif (y <= 2.1e-13)
		tmp = Float64(Float64(sin(x) / x) * y);
	elseif (y <= 1.55e+106)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_] := Block[{t$95$0 = N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.4e+132], t$95$1, If[LessEqual[y, -27.0], t$95$0, If[LessEqual[y, 2.1e-13], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 1.55e+106], t$95$0, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\
t_1 := \frac{\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot \sin x}{x} \cdot y\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{+132}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -27:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;y \leq 1.55 \cdot 10^{+106}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.4000000000000001e132 or 1.55e106 < y

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot \sin x}{x} \cdot y} \]
    5. Taylor expanded in y around inf

      \[\leadsto \frac{\left(\frac{1}{6} \cdot {y}^{2}\right) \cdot \sin x}{x} \cdot y \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \frac{\left({y}^{2} \cdot \frac{1}{6}\right) \cdot \sin x}{x} \cdot y \]
      3. pow2N/A

        \[\leadsto \frac{\left(\left(y \cdot y\right) \cdot \frac{1}{6}\right) \cdot \sin x}{x} \cdot y \]
      4. lift-*.f6494.9

        \[\leadsto \frac{\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot \sin x}{x} \cdot y \]
    7. Applied rewrites94.9%

      \[\leadsto \frac{\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot \sin x}{x} \cdot y \]

    if -2.4000000000000001e132 < y < -27 or 2.09999999999999989e-13 < y < 1.55e106

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{\frac{-1}{12} \cdot \left({x}^{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)\right) + \frac{1}{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{-1}{12} \cdot {x}^{2}\right) \cdot \left(e^{y} - \frac{1}{e^{y}}\right) + \color{blue}{\frac{1}{2}} \cdot \left(e^{y} - \frac{1}{e^{y}}\right) \]
      2. distribute-rgt-outN/A

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

        \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \color{blue}{\left(\frac{-1}{12} \cdot {x}^{2} + \frac{1}{2}\right)} \]
      4. rec-expN/A

        \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \left(\frac{-1}{12} \cdot \color{blue}{{x}^{2}} + \frac{1}{2}\right) \]
      5. sinh-undefN/A

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

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

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

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \left({x}^{2} \cdot \frac{-1}{12} + \frac{1}{2}\right) \]
      9. lower-fma.f64N/A

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left({x}^{2}, \color{blue}{\frac{-1}{12}}, \frac{1}{2}\right) \]
      10. unpow2N/A

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, \frac{-1}{12}, \frac{1}{2}\right) \]
      11. lower-*.f6471.4

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right) \]
    4. Applied rewrites71.4%

      \[\leadsto \color{blue}{\left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)} \]

    if -27 < y < 2.09999999999999989e-13

    1. Initial program 77.3%

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

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

        \[\leadsto \frac{\sin x \cdot y}{x} \]
      2. associate-*l/N/A

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

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

        \[\leadsto \frac{\sin x}{x} \cdot y \]
      5. lift-sin.f6499.1

        \[\leadsto \frac{\sin x}{x} \cdot y \]
    4. Applied rewrites99.1%

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

Alternative 5: 86.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sin x \cdot \sinh y}{x}\\ t_1 := \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-6}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-48}:\\ \;\;\;\;\frac{\sin x}{x} \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ (* (sin x) (sinh y)) x))
        (t_1 (* (* 2.0 (sinh y)) (fma (* x x) -0.08333333333333333 0.5))))
   (if (<= t_0 -2e-6) t_1 (if (<= t_0 5e-48) (* (/ (sin x) x) y) t_1))))
double code(double x, double y) {
	double t_0 = (sin(x) * sinh(y)) / x;
	double t_1 = (2.0 * sinh(y)) * fma((x * x), -0.08333333333333333, 0.5);
	double tmp;
	if (t_0 <= -2e-6) {
		tmp = t_1;
	} else if (t_0 <= 5e-48) {
		tmp = (sin(x) / x) * y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y)
	t_0 = Float64(Float64(sin(x) * sinh(y)) / x)
	t_1 = Float64(Float64(2.0 * sinh(y)) * fma(Float64(x * x), -0.08333333333333333, 0.5))
	tmp = 0.0
	if (t_0 <= -2e-6)
		tmp = t_1;
	elseif (t_0 <= 5e-48)
		tmp = Float64(Float64(sin(x) / x) * y);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-6], t$95$1, If[LessEqual[t$95$0, 5e-48], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
t_1 := \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-48}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -1.99999999999999991e-6 or 4.9999999999999999e-48 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x)

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{\frac{-1}{12} \cdot \left({x}^{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)\right) + \frac{1}{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{-1}{12} \cdot {x}^{2}\right) \cdot \left(e^{y} - \frac{1}{e^{y}}\right) + \color{blue}{\frac{1}{2}} \cdot \left(e^{y} - \frac{1}{e^{y}}\right) \]
      2. distribute-rgt-outN/A

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

        \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \color{blue}{\left(\frac{-1}{12} \cdot {x}^{2} + \frac{1}{2}\right)} \]
      4. rec-expN/A

        \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \left(\frac{-1}{12} \cdot \color{blue}{{x}^{2}} + \frac{1}{2}\right) \]
      5. sinh-undefN/A

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

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

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

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \left({x}^{2} \cdot \frac{-1}{12} + \frac{1}{2}\right) \]
      9. lower-fma.f64N/A

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left({x}^{2}, \color{blue}{\frac{-1}{12}}, \frac{1}{2}\right) \]
      10. unpow2N/A

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, \frac{-1}{12}, \frac{1}{2}\right) \]
      11. lower-*.f6474.8

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right) \]
    4. Applied rewrites74.8%

      \[\leadsto \color{blue}{\left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)} \]

    if -1.99999999999999991e-6 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 4.9999999999999999e-48

    1. Initial program 76.9%

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

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

        \[\leadsto \frac{\sin x \cdot y}{x} \]
      2. associate-*l/N/A

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

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

        \[\leadsto \frac{\sin x}{x} \cdot y \]
      5. lift-sin.f6499.2

        \[\leadsto \frac{\sin x}{x} \cdot y \]
    4. Applied rewrites99.2%

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

Alternative 6: 73.8% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 4.5 \cdot 10^{+115}:\\ \;\;\;\;\left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(e^{y} - e^{-y}\right) \cdot 0.5\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x 4.5e+115)
   (* (* 2.0 (sinh y)) (fma (* x x) -0.08333333333333333 0.5))
   (* (- (exp y) (exp (- y))) 0.5)))
double code(double x, double y) {
	double tmp;
	if (x <= 4.5e+115) {
		tmp = (2.0 * sinh(y)) * fma((x * x), -0.08333333333333333, 0.5);
	} else {
		tmp = (exp(y) - exp(-y)) * 0.5;
	}
	return tmp;
}
function code(x, y)
	tmp = 0.0
	if (x <= 4.5e+115)
		tmp = Float64(Float64(2.0 * sinh(y)) * fma(Float64(x * x), -0.08333333333333333, 0.5));
	else
		tmp = Float64(Float64(exp(y) - exp(Float64(-y))) * 0.5);
	end
	return tmp
end
code[x_, y_] := If[LessEqual[x, 4.5e+115], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[y], $MachinePrecision] - N[Exp[(-y)], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.5 \cdot 10^{+115}:\\
\;\;\;\;\left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\

\mathbf{else}:\\
\;\;\;\;\left(e^{y} - e^{-y}\right) \cdot 0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 4.49999999999999963e115

    1. Initial program 86.7%

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

      \[\leadsto \color{blue}{\frac{-1}{12} \cdot \left({x}^{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)\right) + \frac{1}{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{-1}{12} \cdot {x}^{2}\right) \cdot \left(e^{y} - \frac{1}{e^{y}}\right) + \color{blue}{\frac{1}{2}} \cdot \left(e^{y} - \frac{1}{e^{y}}\right) \]
      2. distribute-rgt-outN/A

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

        \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \color{blue}{\left(\frac{-1}{12} \cdot {x}^{2} + \frac{1}{2}\right)} \]
      4. rec-expN/A

        \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \left(\frac{-1}{12} \cdot \color{blue}{{x}^{2}} + \frac{1}{2}\right) \]
      5. sinh-undefN/A

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

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

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

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \left({x}^{2} \cdot \frac{-1}{12} + \frac{1}{2}\right) \]
      9. lower-fma.f64N/A

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left({x}^{2}, \color{blue}{\frac{-1}{12}}, \frac{1}{2}\right) \]
      10. unpow2N/A

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, \frac{-1}{12}, \frac{1}{2}\right) \]
      11. lower-*.f6468.5

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right) \]
    4. Applied rewrites68.5%

      \[\leadsto \color{blue}{\left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)} \]

    if 4.49999999999999963e115 < x

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \color{blue}{\frac{1}{2}} \]
      3. rec-expN/A

        \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \frac{1}{2} \]
      4. sinh-undefN/A

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \frac{1}{2} \]
      5. lower-*.f64N/A

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \frac{1}{2} \]
      6. lift-sinh.f6426.7

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot 0.5 \]
    4. Applied rewrites26.7%

      \[\leadsto \color{blue}{\left(2 \cdot \sinh y\right) \cdot 0.5} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \frac{1}{2} \]
      2. lift-sinh.f64N/A

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \frac{1}{2} \]
      3. sinh-undef-revN/A

        \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \frac{1}{2} \]
      4. rec-expN/A

        \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \frac{1}{2} \]
      5. lower--.f64N/A

        \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \frac{1}{2} \]
      6. lower-exp.f64N/A

        \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \frac{1}{2} \]
      7. rec-expN/A

        \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \frac{1}{2} \]
      8. lower-exp.f64N/A

        \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \frac{1}{2} \]
      9. lower-neg.f6457.6

        \[\leadsto \left(e^{y} - e^{-y}\right) \cdot 0.5 \]
    6. Applied rewrites57.6%

      \[\leadsto \left(e^{y} - e^{-y}\right) \cdot 0.5 \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 73.8% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 4.5 \cdot 10^{+115}:\\ \;\;\;\;\left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x 4.5e+115)
   (* (* 2.0 (sinh y)) (fma (* x x) -0.08333333333333333 0.5))
   (/ (* x (* (* (* y y) y) 0.16666666666666666)) x)))
double code(double x, double y) {
	double tmp;
	if (x <= 4.5e+115) {
		tmp = (2.0 * sinh(y)) * fma((x * x), -0.08333333333333333, 0.5);
	} else {
		tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
	}
	return tmp;
}
function code(x, y)
	tmp = 0.0
	if (x <= 4.5e+115)
		tmp = Float64(Float64(2.0 * sinh(y)) * fma(Float64(x * x), -0.08333333333333333, 0.5));
	else
		tmp = Float64(Float64(x * Float64(Float64(Float64(y * y) * y) * 0.16666666666666666)) / x);
	end
	return tmp
end
code[x_, y_] := If[LessEqual[x, 4.5e+115], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.5 \cdot 10^{+115}:\\
\;\;\;\;\left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 4.49999999999999963e115

    1. Initial program 86.7%

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

      \[\leadsto \color{blue}{\frac{-1}{12} \cdot \left({x}^{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)\right) + \frac{1}{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)} \]
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(\frac{-1}{12} \cdot {x}^{2}\right) \cdot \left(e^{y} - \frac{1}{e^{y}}\right) + \color{blue}{\frac{1}{2}} \cdot \left(e^{y} - \frac{1}{e^{y}}\right) \]
      2. distribute-rgt-outN/A

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

        \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \color{blue}{\left(\frac{-1}{12} \cdot {x}^{2} + \frac{1}{2}\right)} \]
      4. rec-expN/A

        \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \left(\frac{-1}{12} \cdot \color{blue}{{x}^{2}} + \frac{1}{2}\right) \]
      5. sinh-undefN/A

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

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

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

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \left({x}^{2} \cdot \frac{-1}{12} + \frac{1}{2}\right) \]
      9. lower-fma.f64N/A

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left({x}^{2}, \color{blue}{\frac{-1}{12}}, \frac{1}{2}\right) \]
      10. unpow2N/A

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, \frac{-1}{12}, \frac{1}{2}\right) \]
      11. lower-*.f6468.5

        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right) \]
    4. Applied rewrites68.5%

      \[\leadsto \color{blue}{\left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)} \]

    if 4.49999999999999963e115 < x

    1. Initial program 99.9%

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

      \[\leadsto \frac{\color{blue}{x} \cdot \sinh y}{x} \]
    3. Step-by-step derivation
      1. Applied rewrites26.7%

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

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

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

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

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

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

          \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left({y}^{2}, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
        6. unpow2N/A

          \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
        7. lower-*.f6424.5

          \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}{x} \]
      4. Applied rewrites24.5%

        \[\leadsto \frac{x \cdot \color{blue}{\left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}}{x} \]
      5. Taylor expanded in y around inf

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

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

          \[\leadsto \frac{x \cdot \left({y}^{3} \cdot \frac{1}{6}\right)}{x} \]
        3. unpow3N/A

          \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
        4. pow2N/A

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

          \[\leadsto \frac{x \cdot \left(\left({y}^{2} \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
        6. pow2N/A

          \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
        7. lift-*.f6451.4

          \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x} \]
      7. Applied rewrites51.4%

        \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \color{blue}{0.16666666666666666}\right)}{x} \]
    4. Recombined 2 regimes into one program.
    5. Add Preprocessing

    Alternative 8: 67.1% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 2 \cdot \sinh y\\ \mathbf{if}\;x \leq 16:\\ \;\;\;\;t\_0 \cdot 0.5\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{+115}:\\ \;\;\;\;t\_0 \cdot \left(\left(x \cdot x\right) \cdot -0.08333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x}\\ \end{array} \end{array} \]
    (FPCore (x y)
     :precision binary64
     (let* ((t_0 (* 2.0 (sinh y))))
       (if (<= x 16.0)
         (* t_0 0.5)
         (if (<= x 4.5e+115)
           (* t_0 (* (* x x) -0.08333333333333333))
           (/ (* x (* (* (* y y) y) 0.16666666666666666)) x)))))
    double code(double x, double y) {
    	double t_0 = 2.0 * sinh(y);
    	double tmp;
    	if (x <= 16.0) {
    		tmp = t_0 * 0.5;
    	} else if (x <= 4.5e+115) {
    		tmp = t_0 * ((x * x) * -0.08333333333333333);
    	} else {
    		tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
    	}
    	return tmp;
    }
    
    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
        real(8) :: t_0
        real(8) :: tmp
        t_0 = 2.0d0 * sinh(y)
        if (x <= 16.0d0) then
            tmp = t_0 * 0.5d0
        else if (x <= 4.5d+115) then
            tmp = t_0 * ((x * x) * (-0.08333333333333333d0))
        else
            tmp = (x * (((y * y) * y) * 0.16666666666666666d0)) / x
        end if
        code = tmp
    end function
    
    public static double code(double x, double y) {
    	double t_0 = 2.0 * Math.sinh(y);
    	double tmp;
    	if (x <= 16.0) {
    		tmp = t_0 * 0.5;
    	} else if (x <= 4.5e+115) {
    		tmp = t_0 * ((x * x) * -0.08333333333333333);
    	} else {
    		tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
    	}
    	return tmp;
    }
    
    def code(x, y):
    	t_0 = 2.0 * math.sinh(y)
    	tmp = 0
    	if x <= 16.0:
    		tmp = t_0 * 0.5
    	elif x <= 4.5e+115:
    		tmp = t_0 * ((x * x) * -0.08333333333333333)
    	else:
    		tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x
    	return tmp
    
    function code(x, y)
    	t_0 = Float64(2.0 * sinh(y))
    	tmp = 0.0
    	if (x <= 16.0)
    		tmp = Float64(t_0 * 0.5);
    	elseif (x <= 4.5e+115)
    		tmp = Float64(t_0 * Float64(Float64(x * x) * -0.08333333333333333));
    	else
    		tmp = Float64(Float64(x * Float64(Float64(Float64(y * y) * y) * 0.16666666666666666)) / x);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y)
    	t_0 = 2.0 * sinh(y);
    	tmp = 0.0;
    	if (x <= 16.0)
    		tmp = t_0 * 0.5;
    	elseif (x <= 4.5e+115)
    		tmp = t_0 * ((x * x) * -0.08333333333333333);
    	else
    		tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_] := Block[{t$95$0 = N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 16.0], N[(t$95$0 * 0.5), $MachinePrecision], If[LessEqual[x, 4.5e+115], N[(t$95$0 * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := 2 \cdot \sinh y\\
    \mathbf{if}\;x \leq 16:\\
    \;\;\;\;t\_0 \cdot 0.5\\
    
    \mathbf{elif}\;x \leq 4.5 \cdot 10^{+115}:\\
    \;\;\;\;t\_0 \cdot \left(\left(x \cdot x\right) \cdot -0.08333333333333333\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < 16

      1. Initial program 85.0%

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

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

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

          \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \color{blue}{\frac{1}{2}} \]
        3. rec-expN/A

          \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \frac{1}{2} \]
        4. sinh-undefN/A

          \[\leadsto \left(2 \cdot \sinh y\right) \cdot \frac{1}{2} \]
        5. lower-*.f64N/A

          \[\leadsto \left(2 \cdot \sinh y\right) \cdot \frac{1}{2} \]
        6. lift-sinh.f6474.6

          \[\leadsto \left(2 \cdot \sinh y\right) \cdot 0.5 \]
      4. Applied rewrites74.6%

        \[\leadsto \color{blue}{\left(2 \cdot \sinh y\right) \cdot 0.5} \]

      if 16 < x < 4.49999999999999963e115

      1. Initial program 99.8%

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

        \[\leadsto \color{blue}{\frac{-1}{12} \cdot \left({x}^{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)\right) + \frac{1}{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)} \]
      3. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \left(\frac{-1}{12} \cdot {x}^{2}\right) \cdot \left(e^{y} - \frac{1}{e^{y}}\right) + \color{blue}{\frac{1}{2}} \cdot \left(e^{y} - \frac{1}{e^{y}}\right) \]
        2. distribute-rgt-outN/A

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

          \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \color{blue}{\left(\frac{-1}{12} \cdot {x}^{2} + \frac{1}{2}\right)} \]
        4. rec-expN/A

          \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \left(\frac{-1}{12} \cdot \color{blue}{{x}^{2}} + \frac{1}{2}\right) \]
        5. sinh-undefN/A

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

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

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

          \[\leadsto \left(2 \cdot \sinh y\right) \cdot \left({x}^{2} \cdot \frac{-1}{12} + \frac{1}{2}\right) \]
        9. lower-fma.f64N/A

          \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left({x}^{2}, \color{blue}{\frac{-1}{12}}, \frac{1}{2}\right) \]
        10. unpow2N/A

          \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, \frac{-1}{12}, \frac{1}{2}\right) \]
        11. lower-*.f6424.2

          \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right) \]
      4. Applied rewrites24.2%

        \[\leadsto \color{blue}{\left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)} \]
      5. Taylor expanded in x around inf

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

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

          \[\leadsto \left(2 \cdot \sinh y\right) \cdot \left({x}^{2} \cdot \frac{-1}{12}\right) \]
        3. pow2N/A

          \[\leadsto \left(2 \cdot \sinh y\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{-1}{12}\right) \]
        4. lift-*.f6424.2

          \[\leadsto \left(2 \cdot \sinh y\right) \cdot \left(\left(x \cdot x\right) \cdot -0.08333333333333333\right) \]
      7. Applied rewrites24.2%

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

      if 4.49999999999999963e115 < x

      1. Initial program 99.9%

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

        \[\leadsto \frac{\color{blue}{x} \cdot \sinh y}{x} \]
      3. Step-by-step derivation
        1. Applied rewrites26.7%

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

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

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

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

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

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

            \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left({y}^{2}, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
          6. unpow2N/A

            \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
          7. lower-*.f6424.5

            \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}{x} \]
        4. Applied rewrites24.5%

          \[\leadsto \frac{x \cdot \color{blue}{\left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}}{x} \]
        5. Taylor expanded in y around inf

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

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

            \[\leadsto \frac{x \cdot \left({y}^{3} \cdot \frac{1}{6}\right)}{x} \]
          3. unpow3N/A

            \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
          4. pow2N/A

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

            \[\leadsto \frac{x \cdot \left(\left({y}^{2} \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
          6. pow2N/A

            \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
          7. lift-*.f6451.4

            \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x} \]
        7. Applied rewrites51.4%

          \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \color{blue}{0.16666666666666666}\right)}{x} \]
      4. Recombined 3 regimes into one program.
      5. Add Preprocessing

      Alternative 9: 66.9% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 4 \cdot 10^{+46}:\\ \;\;\;\;\left(2 \cdot \sinh y\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{+115}:\\ \;\;\;\;\left(\mathsf{fma}\left(0.3333333333333333, y \cdot y, 2\right) \cdot y\right) \cdot \left(\left(x \cdot x\right) \cdot -0.08333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x}\\ \end{array} \end{array} \]
      (FPCore (x y)
       :precision binary64
       (if (<= x 4e+46)
         (* (* 2.0 (sinh y)) 0.5)
         (if (<= x 4.5e+115)
           (*
            (* (fma 0.3333333333333333 (* y y) 2.0) y)
            (* (* x x) -0.08333333333333333))
           (/ (* x (* (* (* y y) y) 0.16666666666666666)) x))))
      double code(double x, double y) {
      	double tmp;
      	if (x <= 4e+46) {
      		tmp = (2.0 * sinh(y)) * 0.5;
      	} else if (x <= 4.5e+115) {
      		tmp = (fma(0.3333333333333333, (y * y), 2.0) * y) * ((x * x) * -0.08333333333333333);
      	} else {
      		tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
      	}
      	return tmp;
      }
      
      function code(x, y)
      	tmp = 0.0
      	if (x <= 4e+46)
      		tmp = Float64(Float64(2.0 * sinh(y)) * 0.5);
      	elseif (x <= 4.5e+115)
      		tmp = Float64(Float64(fma(0.3333333333333333, Float64(y * y), 2.0) * y) * Float64(Float64(x * x) * -0.08333333333333333));
      	else
      		tmp = Float64(Float64(x * Float64(Float64(Float64(y * y) * y) * 0.16666666666666666)) / x);
      	end
      	return tmp
      end
      
      code[x_, y_] := If[LessEqual[x, 4e+46], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 4.5e+115], N[(N[(N[(0.3333333333333333 * N[(y * y), $MachinePrecision] + 2.0), $MachinePrecision] * y), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq 4 \cdot 10^{+46}:\\
      \;\;\;\;\left(2 \cdot \sinh y\right) \cdot 0.5\\
      
      \mathbf{elif}\;x \leq 4.5 \cdot 10^{+115}:\\
      \;\;\;\;\left(\mathsf{fma}\left(0.3333333333333333, y \cdot y, 2\right) \cdot y\right) \cdot \left(\left(x \cdot x\right) \cdot -0.08333333333333333\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if x < 4e46

        1. Initial program 85.8%

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

          \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)} \]
        3. Step-by-step derivation
          1. *-commutativeN/A

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

            \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \color{blue}{\frac{1}{2}} \]
          3. rec-expN/A

            \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \frac{1}{2} \]
          4. sinh-undefN/A

            \[\leadsto \left(2 \cdot \sinh y\right) \cdot \frac{1}{2} \]
          5. lower-*.f64N/A

            \[\leadsto \left(2 \cdot \sinh y\right) \cdot \frac{1}{2} \]
          6. lift-sinh.f6472.4

            \[\leadsto \left(2 \cdot \sinh y\right) \cdot 0.5 \]
        4. Applied rewrites72.4%

          \[\leadsto \color{blue}{\left(2 \cdot \sinh y\right) \cdot 0.5} \]

        if 4e46 < x < 4.49999999999999963e115

        1. Initial program 99.8%

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

          \[\leadsto \color{blue}{\frac{-1}{12} \cdot \left({x}^{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)\right) + \frac{1}{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)} \]
        3. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \left(\frac{-1}{12} \cdot {x}^{2}\right) \cdot \left(e^{y} - \frac{1}{e^{y}}\right) + \color{blue}{\frac{1}{2}} \cdot \left(e^{y} - \frac{1}{e^{y}}\right) \]
          2. distribute-rgt-outN/A

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

            \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \color{blue}{\left(\frac{-1}{12} \cdot {x}^{2} + \frac{1}{2}\right)} \]
          4. rec-expN/A

            \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \left(\frac{-1}{12} \cdot \color{blue}{{x}^{2}} + \frac{1}{2}\right) \]
          5. sinh-undefN/A

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

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

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

            \[\leadsto \left(2 \cdot \sinh y\right) \cdot \left({x}^{2} \cdot \frac{-1}{12} + \frac{1}{2}\right) \]
          9. lower-fma.f64N/A

            \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left({x}^{2}, \color{blue}{\frac{-1}{12}}, \frac{1}{2}\right) \]
          10. unpow2N/A

            \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, \frac{-1}{12}, \frac{1}{2}\right) \]
          11. lower-*.f6423.8

            \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right) \]
        4. Applied rewrites23.8%

          \[\leadsto \color{blue}{\left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)} \]
        5. Taylor expanded in x around inf

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

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

            \[\leadsto \left(2 \cdot \sinh y\right) \cdot \left({x}^{2} \cdot \frac{-1}{12}\right) \]
          3. pow2N/A

            \[\leadsto \left(2 \cdot \sinh y\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{-1}{12}\right) \]
          4. lift-*.f6423.8

            \[\leadsto \left(2 \cdot \sinh y\right) \cdot \left(\left(x \cdot x\right) \cdot -0.08333333333333333\right) \]
        7. Applied rewrites23.8%

          \[\leadsto \left(2 \cdot \sinh y\right) \cdot \left(\left(x \cdot x\right) \cdot \color{blue}{-0.08333333333333333}\right) \]
        8. Taylor expanded in y around 0

          \[\leadsto \left(y \cdot \left(2 + \frac{1}{3} \cdot {y}^{2}\right)\right) \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot \frac{-1}{12}\right) \]
        9. Step-by-step derivation
          1. *-commutativeN/A

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

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

            \[\leadsto \left(\left(\frac{1}{3} \cdot {y}^{2} + 2\right) \cdot y\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{-1}{12}\right) \]
          4. lower-fma.f64N/A

            \[\leadsto \left(\mathsf{fma}\left(\frac{1}{3}, {y}^{2}, 2\right) \cdot y\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{-1}{12}\right) \]
          5. pow2N/A

            \[\leadsto \left(\mathsf{fma}\left(\frac{1}{3}, y \cdot y, 2\right) \cdot y\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{-1}{12}\right) \]
          6. lift-*.f6421.4

            \[\leadsto \left(\mathsf{fma}\left(0.3333333333333333, y \cdot y, 2\right) \cdot y\right) \cdot \left(\left(x \cdot x\right) \cdot -0.08333333333333333\right) \]
        10. Applied rewrites21.4%

          \[\leadsto \left(\mathsf{fma}\left(0.3333333333333333, y \cdot y, 2\right) \cdot y\right) \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot -0.08333333333333333\right) \]

        if 4.49999999999999963e115 < x

        1. Initial program 99.9%

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

          \[\leadsto \frac{\color{blue}{x} \cdot \sinh y}{x} \]
        3. Step-by-step derivation
          1. Applied rewrites26.7%

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

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

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

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

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

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

              \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left({y}^{2}, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
            6. unpow2N/A

              \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
            7. lower-*.f6424.5

              \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}{x} \]
          4. Applied rewrites24.5%

            \[\leadsto \frac{x \cdot \color{blue}{\left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}}{x} \]
          5. Taylor expanded in y around inf

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

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

              \[\leadsto \frac{x \cdot \left({y}^{3} \cdot \frac{1}{6}\right)}{x} \]
            3. unpow3N/A

              \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
            4. pow2N/A

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

              \[\leadsto \frac{x \cdot \left(\left({y}^{2} \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
            6. pow2N/A

              \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
            7. lift-*.f6451.4

              \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x} \]
          7. Applied rewrites51.4%

            \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \color{blue}{0.16666666666666666}\right)}{x} \]
        4. Recombined 3 regimes into one program.
        5. Add Preprocessing

        Alternative 10: 66.9% accurate, 1.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.1 \cdot 10^{+162}:\\ \;\;\;\;\left(\mathsf{fma}\left(0.3333333333333333, y \cdot y, 2\right) \cdot y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\sinh y}{x}\\ \end{array} \end{array} \]
        (FPCore (x y)
         :precision binary64
         (if (<= y -1.1e+162)
           (*
            (* (fma 0.3333333333333333 (* y y) 2.0) y)
            (fma (* x x) -0.08333333333333333 0.5))
           (* x (/ (sinh y) x))))
        double code(double x, double y) {
        	double tmp;
        	if (y <= -1.1e+162) {
        		tmp = (fma(0.3333333333333333, (y * y), 2.0) * y) * fma((x * x), -0.08333333333333333, 0.5);
        	} else {
        		tmp = x * (sinh(y) / x);
        	}
        	return tmp;
        }
        
        function code(x, y)
        	tmp = 0.0
        	if (y <= -1.1e+162)
        		tmp = Float64(Float64(fma(0.3333333333333333, Float64(y * y), 2.0) * y) * fma(Float64(x * x), -0.08333333333333333, 0.5));
        	else
        		tmp = Float64(x * Float64(sinh(y) / x));
        	end
        	return tmp
        end
        
        code[x_, y_] := If[LessEqual[y, -1.1e+162], N[(N[(N[(0.3333333333333333 * N[(y * y), $MachinePrecision] + 2.0), $MachinePrecision] * y), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \leq -1.1 \cdot 10^{+162}:\\
        \;\;\;\;\left(\mathsf{fma}\left(0.3333333333333333, y \cdot y, 2\right) \cdot y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;x \cdot \frac{\sinh y}{x}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -1.1000000000000001e162

          1. Initial program 100.0%

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

            \[\leadsto \color{blue}{\frac{-1}{12} \cdot \left({x}^{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)\right) + \frac{1}{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)} \]
          3. Step-by-step derivation
            1. associate-*r*N/A

              \[\leadsto \left(\frac{-1}{12} \cdot {x}^{2}\right) \cdot \left(e^{y} - \frac{1}{e^{y}}\right) + \color{blue}{\frac{1}{2}} \cdot \left(e^{y} - \frac{1}{e^{y}}\right) \]
            2. distribute-rgt-outN/A

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

              \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \color{blue}{\left(\frac{-1}{12} \cdot {x}^{2} + \frac{1}{2}\right)} \]
            4. rec-expN/A

              \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \left(\frac{-1}{12} \cdot \color{blue}{{x}^{2}} + \frac{1}{2}\right) \]
            5. sinh-undefN/A

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

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

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

              \[\leadsto \left(2 \cdot \sinh y\right) \cdot \left({x}^{2} \cdot \frac{-1}{12} + \frac{1}{2}\right) \]
            9. lower-fma.f64N/A

              \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left({x}^{2}, \color{blue}{\frac{-1}{12}}, \frac{1}{2}\right) \]
            10. unpow2N/A

              \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, \frac{-1}{12}, \frac{1}{2}\right) \]
            11. lower-*.f6475.2

              \[\leadsto \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right) \]
          4. Applied rewrites75.2%

            \[\leadsto \color{blue}{\left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)} \]
          5. Taylor expanded in y around 0

            \[\leadsto \left(y \cdot \left(2 + \frac{1}{3} \cdot {y}^{2}\right)\right) \cdot \mathsf{fma}\left(\color{blue}{x \cdot x}, \frac{-1}{12}, \frac{1}{2}\right) \]
          6. Step-by-step derivation
            1. *-commutativeN/A

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

              \[\leadsto \left(\left(2 + \frac{1}{3} \cdot {y}^{2}\right) \cdot y\right) \cdot \mathsf{fma}\left(x \cdot \color{blue}{x}, \frac{-1}{12}, \frac{1}{2}\right) \]
            3. +-commutativeN/A

              \[\leadsto \left(\left(\frac{1}{3} \cdot {y}^{2} + 2\right) \cdot y\right) \cdot \mathsf{fma}\left(x \cdot x, \frac{-1}{12}, \frac{1}{2}\right) \]
            4. lower-fma.f64N/A

              \[\leadsto \left(\mathsf{fma}\left(\frac{1}{3}, {y}^{2}, 2\right) \cdot y\right) \cdot \mathsf{fma}\left(x \cdot x, \frac{-1}{12}, \frac{1}{2}\right) \]
            5. unpow2N/A

              \[\leadsto \left(\mathsf{fma}\left(\frac{1}{3}, y \cdot y, 2\right) \cdot y\right) \cdot \mathsf{fma}\left(x \cdot x, \frac{-1}{12}, \frac{1}{2}\right) \]
            6. lower-*.f6475.2

              \[\leadsto \left(\mathsf{fma}\left(0.3333333333333333, y \cdot y, 2\right) \cdot y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right) \]
          7. Applied rewrites75.2%

            \[\leadsto \left(\mathsf{fma}\left(0.3333333333333333, y \cdot y, 2\right) \cdot y\right) \cdot \mathsf{fma}\left(\color{blue}{x \cdot x}, -0.08333333333333333, 0.5\right) \]

          if -1.1000000000000001e162 < y

          1. Initial program 87.1%

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

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

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

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

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

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

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

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

                \[\leadsto x \cdot \frac{\color{blue}{\sinh y}}{x} \]
              7. lift-/.f6473.6

                \[\leadsto x \cdot \color{blue}{\frac{\sinh y}{x}} \]
            3. Applied rewrites73.6%

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

          Alternative 11: 66.4% accurate, 2.2× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 550000:\\ \;\;\;\;\left(2 \cdot \sinh y\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x}\\ \end{array} \end{array} \]
          (FPCore (x y)
           :precision binary64
           (if (<= x 550000.0)
             (* (* 2.0 (sinh y)) 0.5)
             (/ (* x (* (* (* y y) y) 0.16666666666666666)) x)))
          double code(double x, double y) {
          	double tmp;
          	if (x <= 550000.0) {
          		tmp = (2.0 * sinh(y)) * 0.5;
          	} else {
          		tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
          	}
          	return tmp;
          }
          
          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
              real(8) :: tmp
              if (x <= 550000.0d0) then
                  tmp = (2.0d0 * sinh(y)) * 0.5d0
              else
                  tmp = (x * (((y * y) * y) * 0.16666666666666666d0)) / x
              end if
              code = tmp
          end function
          
          public static double code(double x, double y) {
          	double tmp;
          	if (x <= 550000.0) {
          		tmp = (2.0 * Math.sinh(y)) * 0.5;
          	} else {
          		tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
          	}
          	return tmp;
          }
          
          def code(x, y):
          	tmp = 0
          	if x <= 550000.0:
          		tmp = (2.0 * math.sinh(y)) * 0.5
          	else:
          		tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x
          	return tmp
          
          function code(x, y)
          	tmp = 0.0
          	if (x <= 550000.0)
          		tmp = Float64(Float64(2.0 * sinh(y)) * 0.5);
          	else
          		tmp = Float64(Float64(x * Float64(Float64(Float64(y * y) * y) * 0.16666666666666666)) / x);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	tmp = 0.0;
          	if (x <= 550000.0)
          		tmp = (2.0 * sinh(y)) * 0.5;
          	else
          		tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := If[LessEqual[x, 550000.0], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(x * N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x \leq 550000:\\
          \;\;\;\;\left(2 \cdot \sinh y\right) \cdot 0.5\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < 5.5e5

            1. Initial program 85.1%

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

              \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)} \]
            3. Step-by-step derivation
              1. *-commutativeN/A

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

                \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \color{blue}{\frac{1}{2}} \]
              3. rec-expN/A

                \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \frac{1}{2} \]
              4. sinh-undefN/A

                \[\leadsto \left(2 \cdot \sinh y\right) \cdot \frac{1}{2} \]
              5. lower-*.f64N/A

                \[\leadsto \left(2 \cdot \sinh y\right) \cdot \frac{1}{2} \]
              6. lift-sinh.f6474.4

                \[\leadsto \left(2 \cdot \sinh y\right) \cdot 0.5 \]
            4. Applied rewrites74.4%

              \[\leadsto \color{blue}{\left(2 \cdot \sinh y\right) \cdot 0.5} \]

            if 5.5e5 < x

            1. Initial program 99.8%

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

              \[\leadsto \frac{\color{blue}{x} \cdot \sinh y}{x} \]
            3. Step-by-step derivation
              1. Applied rewrites28.0%

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

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

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

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

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

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

                  \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left({y}^{2}, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
                6. unpow2N/A

                  \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
                7. lower-*.f6424.1

                  \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}{x} \]
              4. Applied rewrites24.1%

                \[\leadsto \frac{x \cdot \color{blue}{\left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}}{x} \]
              5. Taylor expanded in y around inf

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

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

                  \[\leadsto \frac{x \cdot \left({y}^{3} \cdot \frac{1}{6}\right)}{x} \]
                3. unpow3N/A

                  \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
                4. pow2N/A

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

                  \[\leadsto \frac{x \cdot \left(\left({y}^{2} \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
                6. pow2N/A

                  \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
                7. lift-*.f6444.2

                  \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x} \]
              7. Applied rewrites44.2%

                \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \color{blue}{0.16666666666666666}\right)}{x} \]
            4. Recombined 2 regimes into one program.
            5. Add Preprocessing

            Alternative 12: 66.4% accurate, 2.6× speedup?

            \[\begin{array}{l} \\ x \cdot \frac{\sinh y}{x} \end{array} \]
            (FPCore (x y) :precision binary64 (* x (/ (sinh y) x)))
            double code(double x, double y) {
            	return 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 = x * (sinh(y) / x)
            end function
            
            public static double code(double x, double y) {
            	return x * (Math.sinh(y) / x);
            }
            
            def code(x, y):
            	return x * (math.sinh(y) / x)
            
            function code(x, y)
            	return Float64(x * Float64(sinh(y) / x))
            end
            
            function tmp = code(x, y)
            	tmp = x * (sinh(y) / x);
            end
            
            code[x_, y_] := N[(x * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            x \cdot \frac{\sinh y}{x}
            \end{array}
            
            Derivation
            1. Initial program 88.7%

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

              \[\leadsto \frac{\color{blue}{x} \cdot \sinh y}{x} \]
            3. Step-by-step derivation
              1. Applied rewrites52.0%

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

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

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

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

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

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

                  \[\leadsto x \cdot \frac{\color{blue}{\sinh y}}{x} \]
                7. lift-/.f6473.8

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

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

              Alternative 13: 65.9% accurate, 2.3× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 550000:\\ \;\;\;\;x \cdot \frac{\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x}\\ \end{array} \end{array} \]
              (FPCore (x y)
               :precision binary64
               (if (<= x 550000.0)
                 (* x (/ (* (fma (* y y) 0.16666666666666666 1.0) y) x))
                 (/ (* x (* (* (* y y) y) 0.16666666666666666)) x)))
              double code(double x, double y) {
              	double tmp;
              	if (x <= 550000.0) {
              		tmp = x * ((fma((y * y), 0.16666666666666666, 1.0) * y) / x);
              	} else {
              		tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
              	}
              	return tmp;
              }
              
              function code(x, y)
              	tmp = 0.0
              	if (x <= 550000.0)
              		tmp = Float64(x * Float64(Float64(fma(Float64(y * y), 0.16666666666666666, 1.0) * y) / x));
              	else
              		tmp = Float64(Float64(x * Float64(Float64(Float64(y * y) * y) * 0.16666666666666666)) / x);
              	end
              	return tmp
              end
              
              code[x_, y_] := If[LessEqual[x, 550000.0], N[(x * N[(N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;x \leq 550000:\\
              \;\;\;\;x \cdot \frac{\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y}{x}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < 5.5e5

                1. Initial program 85.1%

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left({y}^{2}, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
                    6. unpow2N/A

                      \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
                    7. lower-*.f6448.3

                      \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}{x} \]
                  4. Applied rewrites48.3%

                    \[\leadsto \frac{x \cdot \color{blue}{\left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}}{x} \]
                  5. Step-by-step derivation
                    1. lift-/.f64N/A

                      \[\leadsto \color{blue}{\frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot y\right)}{x}} \]
                    2. lift-*.f64N/A

                      \[\leadsto \frac{\color{blue}{x \cdot \left(\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot y\right)}}{x} \]
                    3. associate-/l*N/A

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

                      \[\leadsto \color{blue}{x \cdot \frac{\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot y}{x}} \]
                    5. lower-/.f6474.1

                      \[\leadsto x \cdot \color{blue}{\frac{\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y}{x}} \]
                  6. Applied rewrites74.1%

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

                  if 5.5e5 < x

                  1. Initial program 99.8%

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

                    \[\leadsto \frac{\color{blue}{x} \cdot \sinh y}{x} \]
                  3. Step-by-step derivation
                    1. Applied rewrites28.0%

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

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

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

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

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

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

                        \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left({y}^{2}, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
                      6. unpow2N/A

                        \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
                      7. lower-*.f6424.1

                        \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}{x} \]
                    4. Applied rewrites24.1%

                      \[\leadsto \frac{x \cdot \color{blue}{\left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}}{x} \]
                    5. Taylor expanded in y around inf

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

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

                        \[\leadsto \frac{x \cdot \left({y}^{3} \cdot \frac{1}{6}\right)}{x} \]
                      3. unpow3N/A

                        \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
                      4. pow2N/A

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

                        \[\leadsto \frac{x \cdot \left(\left({y}^{2} \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
                      6. pow2N/A

                        \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
                      7. lift-*.f6444.2

                        \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x} \]
                    7. Applied rewrites44.2%

                      \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \color{blue}{0.16666666666666666}\right)}{x} \]
                  4. Recombined 2 regimes into one program.
                  5. Add Preprocessing

                  Alternative 14: 61.6% accurate, 2.6× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 550000:\\ \;\;\;\;\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x}\\ \end{array} \end{array} \]
                  (FPCore (x y)
                   :precision binary64
                   (if (<= x 550000.0)
                     (* (fma (* y y) 0.16666666666666666 1.0) y)
                     (/ (* x (* (* (* y y) y) 0.16666666666666666)) x)))
                  double code(double x, double y) {
                  	double tmp;
                  	if (x <= 550000.0) {
                  		tmp = fma((y * y), 0.16666666666666666, 1.0) * y;
                  	} else {
                  		tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
                  	}
                  	return tmp;
                  }
                  
                  function code(x, y)
                  	tmp = 0.0
                  	if (x <= 550000.0)
                  		tmp = Float64(fma(Float64(y * y), 0.16666666666666666, 1.0) * y);
                  	else
                  		tmp = Float64(Float64(x * Float64(Float64(Float64(y * y) * y) * 0.16666666666666666)) / x);
                  	end
                  	return tmp
                  end
                  
                  code[x_, y_] := If[LessEqual[x, 550000.0], N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] * y), $MachinePrecision], N[(N[(x * N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;x \leq 550000:\\
                  \;\;\;\;\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if x < 5.5e5

                    1. Initial program 85.1%

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

                      \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)} \]
                    3. Step-by-step derivation
                      1. *-commutativeN/A

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

                        \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \color{blue}{\frac{1}{2}} \]
                      3. rec-expN/A

                        \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \frac{1}{2} \]
                      4. sinh-undefN/A

                        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \frac{1}{2} \]
                      5. lower-*.f64N/A

                        \[\leadsto \left(2 \cdot \sinh y\right) \cdot \frac{1}{2} \]
                      6. lift-sinh.f6474.4

                        \[\leadsto \left(2 \cdot \sinh y\right) \cdot 0.5 \]
                    4. Applied rewrites74.4%

                      \[\leadsto \color{blue}{\left(2 \cdot \sinh y\right) \cdot 0.5} \]
                    5. Taylor expanded in y around 0

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left({y}^{2}, \frac{1}{6}, 1\right) \cdot y \]
                      6. unpow2N/A

                        \[\leadsto \mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot y \]
                      7. lower-*.f6461.7

                        \[\leadsto \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y \]
                    7. Applied rewrites61.7%

                      \[\leadsto \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot \color{blue}{y} \]

                    if 5.5e5 < x

                    1. Initial program 99.8%

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

                      \[\leadsto \frac{\color{blue}{x} \cdot \sinh y}{x} \]
                    3. Step-by-step derivation
                      1. Applied rewrites28.0%

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

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

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

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

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

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

                          \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left({y}^{2}, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
                        6. unpow2N/A

                          \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
                        7. lower-*.f6424.1

                          \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}{x} \]
                      4. Applied rewrites24.1%

                        \[\leadsto \frac{x \cdot \color{blue}{\left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}}{x} \]
                      5. Taylor expanded in y around inf

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

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

                          \[\leadsto \frac{x \cdot \left({y}^{3} \cdot \frac{1}{6}\right)}{x} \]
                        3. unpow3N/A

                          \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
                        4. pow2N/A

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

                          \[\leadsto \frac{x \cdot \left(\left({y}^{2} \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
                        6. pow2N/A

                          \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \frac{1}{6}\right)}{x} \]
                        7. lift-*.f6444.2

                          \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x} \]
                      7. Applied rewrites44.2%

                        \[\leadsto \frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot \color{blue}{0.16666666666666666}\right)}{x} \]
                    4. Recombined 2 regimes into one program.
                    5. Add Preprocessing

                    Alternative 15: 60.8% accurate, 2.2× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\\ \mathbf{if}\;y \leq -6.2 \cdot 10^{-143}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 2 \cdot 10^{-130}:\\ \;\;\;\;x \cdot \frac{y}{x}\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+82}:\\ \;\;\;\;\mathsf{fma}\left(x \cdot x, -0.16666666666666666 \cdot y, y\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    (FPCore (x y)
                     :precision binary64
                     (let* ((t_0 (* (fma (* y y) 0.16666666666666666 1.0) y)))
                       (if (<= y -6.2e-143)
                         t_0
                         (if (<= y 2e-130)
                           (* x (/ y x))
                           (if (<= y 1.35e+82) (fma (* x x) (* -0.16666666666666666 y) y) t_0)))))
                    double code(double x, double y) {
                    	double t_0 = fma((y * y), 0.16666666666666666, 1.0) * y;
                    	double tmp;
                    	if (y <= -6.2e-143) {
                    		tmp = t_0;
                    	} else if (y <= 2e-130) {
                    		tmp = x * (y / x);
                    	} else if (y <= 1.35e+82) {
                    		tmp = fma((x * x), (-0.16666666666666666 * y), y);
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    function code(x, y)
                    	t_0 = Float64(fma(Float64(y * y), 0.16666666666666666, 1.0) * y)
                    	tmp = 0.0
                    	if (y <= -6.2e-143)
                    		tmp = t_0;
                    	elseif (y <= 2e-130)
                    		tmp = Float64(x * Float64(y / x));
                    	elseif (y <= 1.35e+82)
                    		tmp = fma(Float64(x * x), Float64(-0.16666666666666666 * y), y);
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    code[x_, y_] := Block[{t$95$0 = N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -6.2e-143], t$95$0, If[LessEqual[y, 2e-130], N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+82], N[(N[(x * x), $MachinePrecision] * N[(-0.16666666666666666 * y), $MachinePrecision] + y), $MachinePrecision], t$95$0]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\\
                    \mathbf{if}\;y \leq -6.2 \cdot 10^{-143}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;y \leq 2 \cdot 10^{-130}:\\
                    \;\;\;\;x \cdot \frac{y}{x}\\
                    
                    \mathbf{elif}\;y \leq 1.35 \cdot 10^{+82}:\\
                    \;\;\;\;\mathsf{fma}\left(x \cdot x, -0.16666666666666666 \cdot y, y\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if y < -6.20000000000000015e-143 or 1.35e82 < y

                      1. Initial program 98.0%

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

                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)} \]
                      3. Step-by-step derivation
                        1. *-commutativeN/A

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

                          \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \color{blue}{\frac{1}{2}} \]
                        3. rec-expN/A

                          \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \frac{1}{2} \]
                        4. sinh-undefN/A

                          \[\leadsto \left(2 \cdot \sinh y\right) \cdot \frac{1}{2} \]
                        5. lower-*.f64N/A

                          \[\leadsto \left(2 \cdot \sinh y\right) \cdot \frac{1}{2} \]
                        6. lift-sinh.f6469.3

                          \[\leadsto \left(2 \cdot \sinh y\right) \cdot 0.5 \]
                      4. Applied rewrites69.3%

                        \[\leadsto \color{blue}{\left(2 \cdot \sinh y\right) \cdot 0.5} \]
                      5. Taylor expanded in y around 0

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left({y}^{2}, \frac{1}{6}, 1\right) \cdot y \]
                        6. unpow2N/A

                          \[\leadsto \mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot y \]
                        7. lower-*.f6456.8

                          \[\leadsto \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y \]
                      7. Applied rewrites56.8%

                        \[\leadsto \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot \color{blue}{y} \]

                      if -6.20000000000000015e-143 < y < 2.0000000000000002e-130

                      1. Initial program 67.7%

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

                        \[\leadsto \frac{\color{blue}{x} \cdot \sinh y}{x} \]
                      3. Step-by-step derivation
                        1. Applied rewrites21.0%

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

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

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

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

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

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

                            \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left({y}^{2}, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
                          6. unpow2N/A

                            \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
                          7. lower-*.f6421.0

                            \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}{x} \]
                        4. Applied rewrites21.0%

                          \[\leadsto \frac{x \cdot \color{blue}{\left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}}{x} \]
                        5. Taylor expanded in y around 0

                          \[\leadsto \frac{x \cdot y}{x} \]
                        6. Step-by-step derivation
                          1. Applied rewrites21.0%

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

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

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

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

                              \[\leadsto \color{blue}{x \cdot \frac{y}{x}} \]
                            5. lower-/.f6483.4

                              \[\leadsto x \cdot \color{blue}{\frac{y}{x}} \]
                          3. Applied rewrites83.4%

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

                          if 2.0000000000000002e-130 < y < 1.35e82

                          1. Initial program 94.2%

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

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

                              \[\leadsto \frac{\sin x \cdot y}{x} \]
                            2. associate-*l/N/A

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

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

                              \[\leadsto \frac{\sin x}{x} \cdot y \]
                            5. lift-sin.f6462.4

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left({x}^{2} \cdot y, \frac{-1}{6}, y\right) \]
                            4. lower-*.f64N/A

                              \[\leadsto \mathsf{fma}\left({x}^{2} \cdot y, \frac{-1}{6}, y\right) \]
                            5. pow2N/A

                              \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{-1}{6}, y\right) \]
                            6. lift-*.f6435.5

                              \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot y, -0.16666666666666666, y\right) \]
                          7. Applied rewrites35.5%

                            \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \color{blue}{-0.16666666666666666}, y\right) \]
                          8. Step-by-step derivation
                            1. lift-*.f64N/A

                              \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{-1}{6}, y\right) \]
                            2. lift-*.f64N/A

                              \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{-1}{6}, y\right) \]
                            3. pow2N/A

                              \[\leadsto \mathsf{fma}\left({x}^{2} \cdot y, \frac{-1}{6}, y\right) \]
                            4. lower-fma.f64N/A

                              \[\leadsto \left({x}^{2} \cdot y\right) \cdot \frac{-1}{6} + y \]
                            5. associate-*l*N/A

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

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

                              \[\leadsto \mathsf{fma}\left({x}^{2}, \frac{-1}{6} \cdot \color{blue}{y}, y\right) \]
                            8. pow2N/A

                              \[\leadsto \mathsf{fma}\left(x \cdot x, \frac{-1}{6} \cdot y, y\right) \]
                            9. lift-*.f64N/A

                              \[\leadsto \mathsf{fma}\left(x \cdot x, \frac{-1}{6} \cdot y, y\right) \]
                            10. lower-*.f6435.5

                              \[\leadsto \mathsf{fma}\left(x \cdot x, -0.16666666666666666 \cdot y, y\right) \]
                          9. Applied rewrites35.5%

                            \[\leadsto \mathsf{fma}\left(x \cdot x, -0.16666666666666666 \cdot \color{blue}{y}, y\right) \]
                        7. Recombined 3 regimes into one program.
                        8. Add Preprocessing

                        Alternative 16: 57.5% accurate, 2.6× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\\ \mathbf{if}\;y \leq -6.2 \cdot 10^{-143}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+86}:\\ \;\;\;\;x \cdot \frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                        (FPCore (x y)
                         :precision binary64
                         (let* ((t_0 (* (fma (* y y) 0.16666666666666666 1.0) y)))
                           (if (<= y -6.2e-143) t_0 (if (<= y 8.5e+86) (* x (/ y x)) t_0))))
                        double code(double x, double y) {
                        	double t_0 = fma((y * y), 0.16666666666666666, 1.0) * y;
                        	double tmp;
                        	if (y <= -6.2e-143) {
                        		tmp = t_0;
                        	} else if (y <= 8.5e+86) {
                        		tmp = x * (y / x);
                        	} else {
                        		tmp = t_0;
                        	}
                        	return tmp;
                        }
                        
                        function code(x, y)
                        	t_0 = Float64(fma(Float64(y * y), 0.16666666666666666, 1.0) * y)
                        	tmp = 0.0
                        	if (y <= -6.2e-143)
                        		tmp = t_0;
                        	elseif (y <= 8.5e+86)
                        		tmp = Float64(x * Float64(y / x));
                        	else
                        		tmp = t_0;
                        	end
                        	return tmp
                        end
                        
                        code[x_, y_] := Block[{t$95$0 = N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -6.2e-143], t$95$0, If[LessEqual[y, 8.5e+86], N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\\
                        \mathbf{if}\;y \leq -6.2 \cdot 10^{-143}:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{elif}\;y \leq 8.5 \cdot 10^{+86}:\\
                        \;\;\;\;x \cdot \frac{y}{x}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_0\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if y < -6.20000000000000015e-143 or 8.5000000000000005e86 < y

                          1. Initial program 98.0%

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

                            \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(e^{y} - \frac{1}{e^{y}}\right)} \]
                          3. Step-by-step derivation
                            1. *-commutativeN/A

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

                              \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \color{blue}{\frac{1}{2}} \]
                            3. rec-expN/A

                              \[\leadsto \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \frac{1}{2} \]
                            4. sinh-undefN/A

                              \[\leadsto \left(2 \cdot \sinh y\right) \cdot \frac{1}{2} \]
                            5. lower-*.f64N/A

                              \[\leadsto \left(2 \cdot \sinh y\right) \cdot \frac{1}{2} \]
                            6. lift-sinh.f6469.4

                              \[\leadsto \left(2 \cdot \sinh y\right) \cdot 0.5 \]
                          4. Applied rewrites69.4%

                            \[\leadsto \color{blue}{\left(2 \cdot \sinh y\right) \cdot 0.5} \]
                          5. Taylor expanded in y around 0

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left({y}^{2}, \frac{1}{6}, 1\right) \cdot y \]
                            6. unpow2N/A

                              \[\leadsto \mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot y \]
                            7. lower-*.f6457.1

                              \[\leadsto \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y \]
                          7. Applied rewrites57.1%

                            \[\leadsto \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot \color{blue}{y} \]

                          if -6.20000000000000015e-143 < y < 8.5000000000000005e86

                          1. Initial program 77.7%

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

                            \[\leadsto \frac{\color{blue}{x} \cdot \sinh y}{x} \]
                          3. Step-by-step derivation
                            1. Applied rewrites33.7%

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

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

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

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

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

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

                                \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left({y}^{2}, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
                              6. unpow2N/A

                                \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
                              7. lower-*.f6424.8

                                \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}{x} \]
                            4. Applied rewrites24.8%

                              \[\leadsto \frac{x \cdot \color{blue}{\left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}}{x} \]
                            5. Taylor expanded in y around 0

                              \[\leadsto \frac{x \cdot y}{x} \]
                            6. Step-by-step derivation
                              1. Applied rewrites23.4%

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

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

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

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

                                  \[\leadsto \color{blue}{x \cdot \frac{y}{x}} \]
                                5. lower-/.f6466.9

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

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

                            Alternative 17: 50.1% accurate, 7.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);
                            }
                            
                            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(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 88.7%

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

                              \[\leadsto \frac{\color{blue}{x} \cdot \sinh y}{x} \]
                            3. Step-by-step derivation
                              1. Applied rewrites52.0%

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

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

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

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

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

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

                                  \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left({y}^{2}, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
                                6. unpow2N/A

                                  \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, \frac{1}{6}, 1\right) \cdot y\right)}{x} \]
                                7. lower-*.f6442.5

                                  \[\leadsto \frac{x \cdot \left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}{x} \]
                              4. Applied rewrites42.5%

                                \[\leadsto \frac{x \cdot \color{blue}{\left(\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\right)}}{x} \]
                              5. Taylor expanded in y around 0

                                \[\leadsto \frac{x \cdot y}{x} \]
                              6. Step-by-step derivation
                                1. Applied rewrites22.6%

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

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

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

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

                                    \[\leadsto \color{blue}{x \cdot \frac{y}{x}} \]
                                  5. lower-/.f6450.1

                                    \[\leadsto x \cdot \color{blue}{\frac{y}{x}} \]
                                3. Applied rewrites50.1%

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

                                Alternative 18: 28.0% accurate, 51.3× speedup?

                                \[\begin{array}{l} \\ y \end{array} \]
                                (FPCore (x y) :precision binary64 y)
                                double code(double x, double y) {
                                	return 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 = 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 88.7%

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

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

                                    \[\leadsto \frac{\sin x \cdot y}{x} \]
                                  2. associate-*l/N/A

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

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

                                    \[\leadsto \frac{\sin x}{x} \cdot y \]
                                  5. lift-sin.f6452.3

                                    \[\leadsto \frac{\sin x}{x} \cdot y \]
                                4. Applied rewrites52.3%

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

                                  \[\leadsto y \]
                                6. Step-by-step derivation
                                  1. Applied rewrites28.0%

                                    \[\leadsto y \]
                                  2. Add Preprocessing

                                  Reproduce

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