Linear.Quaternion:$ccos from linear-1.19.1.3

Percentage Accurate: 100.0% → 100.0%
Time: 7.2s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

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

\\
\sin x \cdot \frac{\sinh y}{y}
\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 11 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

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

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

    \[\sin x \cdot \frac{\sinh y}{y} \]
  2. Add Preprocessing

Alternative 2: 86.8% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{\sinh y}{y}\\
t_1 := \sin x \cdot t\_0\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(x \cdot \mathsf{fma}\left(-0.16666666666666666 \cdot x, x, 1\right)\right) \cdot t\_0\\

\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;\sin x \cdot 1\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1

    1. Initial program 100.0%

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

      \[\leadsto \sin x \cdot \color{blue}{1} \]
    3. Step-by-step derivation
      1. Applied rewrites51.5%

        \[\leadsto \sin x \cdot \color{blue}{1} \]

      if 1 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y))

      1. Initial program 100.0%

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

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

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

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

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

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

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

            \[\leadsto \frac{\color{blue}{\sinh y \cdot x}}{y} \]
          6. lower-*.f6451.5

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

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

      Alternative 3: 62.2% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sinh y}{y}\\ \mathbf{if}\;\sin x \cdot t\_0 \leq 0.002:\\ \;\;\;\;\left(x \cdot \mathsf{fma}\left(-0.16666666666666666 \cdot x, x, 1\right)\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \left(\sinh y \cdot x\right)\\ \end{array} \end{array} \]
      (FPCore (x y)
       :precision binary64
       (let* ((t_0 (/ (sinh y) y)))
         (if (<= (* (sin x) t_0) 0.002)
           (* (* x (fma (* -0.16666666666666666 x) x 1.0)) t_0)
           (* (/ 1.0 y) (* (sinh y) x)))))
      double code(double x, double y) {
      	double t_0 = sinh(y) / y;
      	double tmp;
      	if ((sin(x) * t_0) <= 0.002) {
      		tmp = (x * fma((-0.16666666666666666 * x), x, 1.0)) * t_0;
      	} else {
      		tmp = (1.0 / y) * (sinh(y) * x);
      	}
      	return tmp;
      }
      
      function code(x, y)
      	t_0 = Float64(sinh(y) / y)
      	tmp = 0.0
      	if (Float64(sin(x) * t_0) <= 0.002)
      		tmp = Float64(Float64(x * fma(Float64(-0.16666666666666666 * x), x, 1.0)) * t_0);
      	else
      		tmp = Float64(Float64(1.0 / y) * Float64(sinh(y) * x));
      	end
      	return tmp
      end
      
      code[x_, y_] := Block[{t$95$0 = N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[N[(N[Sin[x], $MachinePrecision] * t$95$0), $MachinePrecision], 0.002], N[(N[(x * N[(N[(-0.16666666666666666 * x), $MachinePrecision] * x + 1.0), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{\sinh y}{y}\\
      \mathbf{if}\;\sin x \cdot t\_0 \leq 0.002:\\
      \;\;\;\;\left(x \cdot \mathsf{fma}\left(-0.16666666666666666 \cdot x, x, 1\right)\right) \cdot t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{1}{y} \cdot \left(\sinh y \cdot x\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 2e-3

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{y} \cdot \color{blue}{\left(\sinh y \cdot x\right)} \]
            9. lower-*.f6451.4

              \[\leadsto \frac{1}{y} \cdot \color{blue}{\left(\sinh y \cdot x\right)} \]
          3. Applied rewrites51.4%

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

        Alternative 4: 49.0% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sinh y}{y}\\ \mathbf{if}\;\sin x \cdot t\_0 \leq -0.1:\\ \;\;\;\;\frac{\left(\mathsf{fma}\left(-0.16666666666666666 \cdot x, x, 1\right) \cdot x\right) \cdot y}{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\_0\\ \end{array} \end{array} \]
        (FPCore (x y)
         :precision binary64
         (let* ((t_0 (/ (sinh y) y)))
           (if (<= (* (sin x) t_0) -0.1)
             (/ (* (* (fma (* -0.16666666666666666 x) x 1.0) x) y) y)
             (* x t_0))))
        double code(double x, double y) {
        	double t_0 = sinh(y) / y;
        	double tmp;
        	if ((sin(x) * t_0) <= -0.1) {
        		tmp = ((fma((-0.16666666666666666 * x), x, 1.0) * x) * y) / y;
        	} else {
        		tmp = x * t_0;
        	}
        	return tmp;
        }
        
        function code(x, y)
        	t_0 = Float64(sinh(y) / y)
        	tmp = 0.0
        	if (Float64(sin(x) * t_0) <= -0.1)
        		tmp = Float64(Float64(Float64(fma(Float64(-0.16666666666666666 * x), x, 1.0) * x) * y) / y);
        	else
        		tmp = Float64(x * t_0);
        	end
        	return tmp
        end
        
        code[x_, y_] := Block[{t$95$0 = N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[N[(N[Sin[x], $MachinePrecision] * t$95$0), $MachinePrecision], -0.1], N[(N[(N[(N[(N[(-0.16666666666666666 * x), $MachinePrecision] * x + 1.0), $MachinePrecision] * x), $MachinePrecision] * y), $MachinePrecision] / y), $MachinePrecision], N[(x * t$95$0), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \frac{\sinh y}{y}\\
        \mathbf{if}\;\sin x \cdot t\_0 \leq -0.1:\\
        \;\;\;\;\frac{\left(\mathsf{fma}\left(-0.16666666666666666 \cdot x, x, 1\right) \cdot x\right) \cdot y}{y}\\
        
        \mathbf{else}:\\
        \;\;\;\;x \cdot t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -0.10000000000000001

          1. Initial program 100.0%

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

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

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

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

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

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

            \[\leadsto \color{blue}{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right)} \cdot \frac{\sinh y}{y} \]
          5. Taylor expanded in y around 0

            \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right) \cdot \frac{\color{blue}{y}}{y} \]
          6. Step-by-step derivation
            1. Applied rewrites34.0%

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

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

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

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

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

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

            if -0.10000000000000001 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y))

            1. Initial program 100.0%

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

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

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

            Alternative 5: 48.7% accurate, 0.4× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin x \cdot \frac{\sinh y}{y}\\ t_1 := \mathsf{fma}\left(-0.16666666666666666 \cdot x, x, 1\right) \cdot x\\ \mathbf{if}\;t\_0 \leq -0.99:\\ \;\;\;\;\frac{t\_1 \cdot y}{y}\\ \mathbf{elif}\;t\_0 \leq 0.002:\\ \;\;\;\;\frac{y}{y} \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\sinh y \cdot x}{y}\\ \end{array} \end{array} \]
            (FPCore (x y)
             :precision binary64
             (let* ((t_0 (* (sin x) (/ (sinh y) y)))
                    (t_1 (* (fma (* -0.16666666666666666 x) x 1.0) x)))
               (if (<= t_0 -0.99)
                 (/ (* t_1 y) y)
                 (if (<= t_0 0.002) (* (/ y y) t_1) (/ (* (sinh y) x) y)))))
            double code(double x, double y) {
            	double t_0 = sin(x) * (sinh(y) / y);
            	double t_1 = fma((-0.16666666666666666 * x), x, 1.0) * x;
            	double tmp;
            	if (t_0 <= -0.99) {
            		tmp = (t_1 * y) / y;
            	} else if (t_0 <= 0.002) {
            		tmp = (y / y) * t_1;
            	} else {
            		tmp = (sinh(y) * x) / y;
            	}
            	return tmp;
            }
            
            function code(x, y)
            	t_0 = Float64(sin(x) * Float64(sinh(y) / y))
            	t_1 = Float64(fma(Float64(-0.16666666666666666 * x), x, 1.0) * x)
            	tmp = 0.0
            	if (t_0 <= -0.99)
            		tmp = Float64(Float64(t_1 * y) / y);
            	elseif (t_0 <= 0.002)
            		tmp = Float64(Float64(y / y) * t_1);
            	else
            		tmp = Float64(Float64(sinh(y) * x) / y);
            	end
            	return tmp
            end
            
            code[x_, y_] := Block[{t$95$0 = N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(-0.16666666666666666 * x), $MachinePrecision] * x + 1.0), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$0, -0.99], N[(N[(t$95$1 * y), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t$95$0, 0.002], N[(N[(y / y), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(N[Sinh[y], $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \sin x \cdot \frac{\sinh y}{y}\\
            t_1 := \mathsf{fma}\left(-0.16666666666666666 \cdot x, x, 1\right) \cdot x\\
            \mathbf{if}\;t\_0 \leq -0.99:\\
            \;\;\;\;\frac{t\_1 \cdot y}{y}\\
            
            \mathbf{elif}\;t\_0 \leq 0.002:\\
            \;\;\;\;\frac{y}{y} \cdot t\_1\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{\sinh y \cdot x}{y}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -0.98999999999999999

              1. Initial program 100.0%

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

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

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

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

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

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

                \[\leadsto \color{blue}{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right)} \cdot \frac{\sinh y}{y} \]
              5. Taylor expanded in y around 0

                \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right) \cdot \frac{\color{blue}{y}}{y} \]
              6. Step-by-step derivation
                1. Applied rewrites34.0%

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

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

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

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

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

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

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

                1. Initial program 100.0%

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right)} \cdot \frac{\sinh y}{y} \]
                5. Taylor expanded in y around 0

                  \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right) \cdot \frac{\color{blue}{y}}{y} \]
                6. Step-by-step derivation
                  1. Applied rewrites34.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  1. Initial program 100.0%

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

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

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

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

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

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

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

                        \[\leadsto \frac{\color{blue}{\sinh y \cdot x}}{y} \]
                      6. lower-*.f6451.5

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

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

                  Alternative 6: 34.0% accurate, 0.4× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin x \cdot \frac{\sinh y}{y}\\ t_1 := \mathsf{fma}\left(-0.16666666666666666 \cdot x, x, 1\right) \cdot x\\ \mathbf{if}\;t\_0 \leq -0.99:\\ \;\;\;\;\frac{t\_1 \cdot y}{y}\\ \mathbf{elif}\;t\_0 \leq 0.002:\\ \;\;\;\;\frac{y}{y} \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \left(y \cdot x\right)\\ \end{array} \end{array} \]
                  (FPCore (x y)
                   :precision binary64
                   (let* ((t_0 (* (sin x) (/ (sinh y) y)))
                          (t_1 (* (fma (* -0.16666666666666666 x) x 1.0) x)))
                     (if (<= t_0 -0.99)
                       (/ (* t_1 y) y)
                       (if (<= t_0 0.002) (* (/ y y) t_1) (* (/ 1.0 y) (* y x))))))
                  double code(double x, double y) {
                  	double t_0 = sin(x) * (sinh(y) / y);
                  	double t_1 = fma((-0.16666666666666666 * x), x, 1.0) * x;
                  	double tmp;
                  	if (t_0 <= -0.99) {
                  		tmp = (t_1 * y) / y;
                  	} else if (t_0 <= 0.002) {
                  		tmp = (y / y) * t_1;
                  	} else {
                  		tmp = (1.0 / y) * (y * x);
                  	}
                  	return tmp;
                  }
                  
                  function code(x, y)
                  	t_0 = Float64(sin(x) * Float64(sinh(y) / y))
                  	t_1 = Float64(fma(Float64(-0.16666666666666666 * x), x, 1.0) * x)
                  	tmp = 0.0
                  	if (t_0 <= -0.99)
                  		tmp = Float64(Float64(t_1 * y) / y);
                  	elseif (t_0 <= 0.002)
                  		tmp = Float64(Float64(y / y) * t_1);
                  	else
                  		tmp = Float64(Float64(1.0 / y) * Float64(y * x));
                  	end
                  	return tmp
                  end
                  
                  code[x_, y_] := Block[{t$95$0 = N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(-0.16666666666666666 * x), $MachinePrecision] * x + 1.0), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$0, -0.99], N[(N[(t$95$1 * y), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t$95$0, 0.002], N[(N[(y / y), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(y * x), $MachinePrecision]), $MachinePrecision]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \sin x \cdot \frac{\sinh y}{y}\\
                  t_1 := \mathsf{fma}\left(-0.16666666666666666 \cdot x, x, 1\right) \cdot x\\
                  \mathbf{if}\;t\_0 \leq -0.99:\\
                  \;\;\;\;\frac{t\_1 \cdot y}{y}\\
                  
                  \mathbf{elif}\;t\_0 \leq 0.002:\\
                  \;\;\;\;\frac{y}{y} \cdot t\_1\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{1}{y} \cdot \left(y \cdot x\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -0.98999999999999999

                    1. Initial program 100.0%

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right)} \cdot \frac{\sinh y}{y} \]
                    5. Taylor expanded in y around 0

                      \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right) \cdot \frac{\color{blue}{y}}{y} \]
                    6. Step-by-step derivation
                      1. Applied rewrites34.0%

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

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

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

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

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

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

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

                      1. Initial program 100.0%

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right)} \cdot \frac{\sinh y}{y} \]
                      5. Taylor expanded in y around 0

                        \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right) \cdot \frac{\color{blue}{y}}{y} \]
                      6. Step-by-step derivation
                        1. Applied rewrites34.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{1}{y} \cdot \color{blue}{\left(y \cdot x\right)} \]
                              9. lower-*.f6421.0

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

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

                          Alternative 7: 34.0% accurate, 0.4× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin x \cdot \frac{\sinh y}{y}\\ t_1 := \mathsf{fma}\left(-0.16666666666666666 \cdot x, x, 1\right) \cdot x\\ \mathbf{if}\;t\_0 \leq -0.106:\\ \;\;\;\;\frac{t\_1 \cdot y}{y}\\ \mathbf{elif}\;t\_0 \leq 0.002:\\ \;\;\;\;\frac{t\_1}{y} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \left(y \cdot x\right)\\ \end{array} \end{array} \]
                          (FPCore (x y)
                           :precision binary64
                           (let* ((t_0 (* (sin x) (/ (sinh y) y)))
                                  (t_1 (* (fma (* -0.16666666666666666 x) x 1.0) x)))
                             (if (<= t_0 -0.106)
                               (/ (* t_1 y) y)
                               (if (<= t_0 0.002) (* (/ t_1 y) y) (* (/ 1.0 y) (* y x))))))
                          double code(double x, double y) {
                          	double t_0 = sin(x) * (sinh(y) / y);
                          	double t_1 = fma((-0.16666666666666666 * x), x, 1.0) * x;
                          	double tmp;
                          	if (t_0 <= -0.106) {
                          		tmp = (t_1 * y) / y;
                          	} else if (t_0 <= 0.002) {
                          		tmp = (t_1 / y) * y;
                          	} else {
                          		tmp = (1.0 / y) * (y * x);
                          	}
                          	return tmp;
                          }
                          
                          function code(x, y)
                          	t_0 = Float64(sin(x) * Float64(sinh(y) / y))
                          	t_1 = Float64(fma(Float64(-0.16666666666666666 * x), x, 1.0) * x)
                          	tmp = 0.0
                          	if (t_0 <= -0.106)
                          		tmp = Float64(Float64(t_1 * y) / y);
                          	elseif (t_0 <= 0.002)
                          		tmp = Float64(Float64(t_1 / y) * y);
                          	else
                          		tmp = Float64(Float64(1.0 / y) * Float64(y * x));
                          	end
                          	return tmp
                          end
                          
                          code[x_, y_] := Block[{t$95$0 = N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(-0.16666666666666666 * x), $MachinePrecision] * x + 1.0), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$0, -0.106], N[(N[(t$95$1 * y), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t$95$0, 0.002], N[(N[(t$95$1 / y), $MachinePrecision] * y), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(y * x), $MachinePrecision]), $MachinePrecision]]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_0 := \sin x \cdot \frac{\sinh y}{y}\\
                          t_1 := \mathsf{fma}\left(-0.16666666666666666 \cdot x, x, 1\right) \cdot x\\
                          \mathbf{if}\;t\_0 \leq -0.106:\\
                          \;\;\;\;\frac{t\_1 \cdot y}{y}\\
                          
                          \mathbf{elif}\;t\_0 \leq 0.002:\\
                          \;\;\;\;\frac{t\_1}{y} \cdot y\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{1}{y} \cdot \left(y \cdot x\right)\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -0.105999999999999997

                            1. Initial program 100.0%

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

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

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

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

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

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

                              \[\leadsto \color{blue}{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right)} \cdot \frac{\sinh y}{y} \]
                            5. Taylor expanded in y around 0

                              \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right) \cdot \frac{\color{blue}{y}}{y} \]
                            6. Step-by-step derivation
                              1. Applied rewrites34.0%

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

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

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

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

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

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

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

                              1. Initial program 100.0%

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

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

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

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

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

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

                                \[\leadsto \color{blue}{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right)} \cdot \frac{\sinh y}{y} \]
                              5. Taylor expanded in y around 0

                                \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right) \cdot \frac{\color{blue}{y}}{y} \]
                              6. Step-by-step derivation
                                1. Applied rewrites34.0%

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \left(x \cdot \mathsf{fma}\left(\frac{-1}{6} \cdot x, \color{blue}{x}, 1\right)\right) \cdot \mathsf{Rewrite=>}\left(lift-/.f64, \left(\frac{y}{y}\right)\right) \]
                                  11. lift-fma.f64N/A

                                    \[\leadsto \left(x \cdot \mathsf{fma}\left(\frac{-1}{6} \cdot x, \color{blue}{x}, 1\right)\right) \cdot \mathsf{Rewrite=>}\left(mult-flip, \left(y \cdot \frac{1}{y}\right)\right) \]
                                  12. lift-fma.f64N/A

                                    \[\leadsto \left(x \cdot \mathsf{fma}\left(\frac{-1}{6} \cdot x, \color{blue}{x}, 1\right)\right) \cdot \left(y \cdot \mathsf{Rewrite<=}\left(lift-/.f64, \left(\frac{1}{y}\right)\right)\right) \]
                                  13. lift-fma.f64N/A

                                    \[\leadsto \left(x \cdot \mathsf{fma}\left(\frac{-1}{6} \cdot x, \color{blue}{x}, 1\right)\right) \cdot \mathsf{Rewrite=>}\left(*-commutative, \left(\frac{1}{y} \cdot y\right)\right) \]
                                  14. associate-*r*N/A

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

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

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

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

                                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \frac{1}{y} \cdot \color{blue}{\left(y \cdot x\right)} \]
                                      9. lower-*.f6421.0

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

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

                                  Alternative 8: 33.0% accurate, 0.7× speedup?

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

                                    1. Initial program 100.0%

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

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

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

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

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

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

                                      \[\leadsto \color{blue}{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right)} \cdot \frac{\sinh y}{y} \]
                                    5. Taylor expanded in y around 0

                                      \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right) \cdot \frac{\color{blue}{y}}{y} \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites34.0%

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \left(x \cdot \mathsf{fma}\left(\frac{-1}{6} \cdot x, \color{blue}{x}, 1\right)\right) \cdot \mathsf{Rewrite=>}\left(lift-/.f64, \left(\frac{y}{y}\right)\right) \]
                                        11. lift-fma.f64N/A

                                          \[\leadsto \left(x \cdot \mathsf{fma}\left(\frac{-1}{6} \cdot x, \color{blue}{x}, 1\right)\right) \cdot \mathsf{Rewrite=>}\left(mult-flip, \left(y \cdot \frac{1}{y}\right)\right) \]
                                        12. lift-fma.f64N/A

                                          \[\leadsto \left(x \cdot \mathsf{fma}\left(\frac{-1}{6} \cdot x, \color{blue}{x}, 1\right)\right) \cdot \left(y \cdot \mathsf{Rewrite<=}\left(lift-/.f64, \left(\frac{1}{y}\right)\right)\right) \]
                                        13. lift-fma.f64N/A

                                          \[\leadsto \left(x \cdot \mathsf{fma}\left(\frac{-1}{6} \cdot x, \color{blue}{x}, 1\right)\right) \cdot \mathsf{Rewrite=>}\left(*-commutative, \left(\frac{1}{y} \cdot y\right)\right) \]
                                        14. associate-*r*N/A

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

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

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

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

                                      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{1}{y} \cdot \color{blue}{\left(y \cdot x\right)} \]
                                            9. lower-*.f6421.0

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

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

                                        Alternative 9: 29.3% accurate, 0.8× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq 10^{-25}:\\ \;\;\;\;x \cdot \frac{y}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{y} \cdot \frac{y \cdot x}{2}\\ \end{array} \end{array} \]
                                        (FPCore (x y)
                                         :precision binary64
                                         (if (<= (* (sin x) (/ (sinh y) y)) 1e-25)
                                           (* x (/ y y))
                                           (* (/ 2.0 y) (/ (* y x) 2.0))))
                                        double code(double x, double y) {
                                        	double tmp;
                                        	if ((sin(x) * (sinh(y) / y)) <= 1e-25) {
                                        		tmp = x * (y / y);
                                        	} else {
                                        		tmp = (2.0 / y) * ((y * x) / 2.0);
                                        	}
                                        	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 ((sin(x) * (sinh(y) / y)) <= 1d-25) then
                                                tmp = x * (y / y)
                                            else
                                                tmp = (2.0d0 / y) * ((y * x) / 2.0d0)
                                            end if
                                            code = tmp
                                        end function
                                        
                                        public static double code(double x, double y) {
                                        	double tmp;
                                        	if ((Math.sin(x) * (Math.sinh(y) / y)) <= 1e-25) {
                                        		tmp = x * (y / y);
                                        	} else {
                                        		tmp = (2.0 / y) * ((y * x) / 2.0);
                                        	}
                                        	return tmp;
                                        }
                                        
                                        def code(x, y):
                                        	tmp = 0
                                        	if (math.sin(x) * (math.sinh(y) / y)) <= 1e-25:
                                        		tmp = x * (y / y)
                                        	else:
                                        		tmp = (2.0 / y) * ((y * x) / 2.0)
                                        	return tmp
                                        
                                        function code(x, y)
                                        	tmp = 0.0
                                        	if (Float64(sin(x) * Float64(sinh(y) / y)) <= 1e-25)
                                        		tmp = Float64(x * Float64(y / y));
                                        	else
                                        		tmp = Float64(Float64(2.0 / y) * Float64(Float64(y * x) / 2.0));
                                        	end
                                        	return tmp
                                        end
                                        
                                        function tmp_2 = code(x, y)
                                        	tmp = 0.0;
                                        	if ((sin(x) * (sinh(y) / y)) <= 1e-25)
                                        		tmp = x * (y / y);
                                        	else
                                        		tmp = (2.0 / y) * ((y * x) / 2.0);
                                        	end
                                        	tmp_2 = tmp;
                                        end
                                        
                                        code[x_, y_] := If[LessEqual[N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 1e-25], N[(x * N[(y / y), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / y), $MachinePrecision] * N[(N[(y * x), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;\sin x \cdot \frac{\sinh y}{y} \leq 10^{-25}:\\
                                        \;\;\;\;x \cdot \frac{y}{y}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\frac{2}{y} \cdot \frac{y \cdot x}{2}\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1.00000000000000004e-25

                                          1. Initial program 100.0%

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

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

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

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

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

                                              if 1.00000000000000004e-25 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y))

                                              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \color{blue}{\frac{x}{y}} \cdot y \]
                                                    10. lower-/.f6426.2

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

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

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

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

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

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

                                                      \[\leadsto \frac{\color{blue}{y \cdot x}}{y} \]
                                                    6. *-lft-identityN/A

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

                                                      \[\leadsto \color{blue}{1 \cdot \frac{y \cdot x}{y}} \]
                                                    8. metadata-evalN/A

                                                      \[\leadsto \color{blue}{\frac{2}{2}} \cdot \frac{y \cdot x}{y} \]
                                                    9. frac-timesN/A

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

                                                      \[\leadsto \frac{2 \cdot \left(y \cdot x\right)}{\color{blue}{y \cdot 2}} \]
                                                    11. times-fracN/A

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

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

                                                      \[\leadsto \color{blue}{\frac{2}{y}} \cdot \frac{y \cdot x}{2} \]
                                                    14. lower-/.f6421.0

                                                      \[\leadsto \frac{2}{y} \cdot \color{blue}{\frac{y \cdot x}{2}} \]
                                                  5. Applied rewrites21.0%

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

                                                Alternative 10: 29.3% accurate, 0.8× speedup?

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

                                                  1. Initial program 100.0%

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

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

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

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

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

                                                      if 1.00000000000000004e-25 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y))

                                                      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

                                                              \[\leadsto \frac{\color{blue}{y \cdot x}}{y} \]
                                                            6. lower-*.f6421.1

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

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

                                                        Alternative 11: 26.4% accurate, 7.0× speedup?

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

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

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

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

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

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

                                                            Reproduce

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