Linear.Quaternion:$ccosh from linear-1.19.1.3

Percentage Accurate: 88.4% → 99.8%
Time: 5.3s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 88.4% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

    \[\frac{\sin x \cdot \sinh y}{x} \]
  2. Applied rewrites75.4%

    \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(y + y\right) \cdot \frac{\sin x}{x + x}}{e^{y}}} \]
  3. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(y + y\right) \cdot \frac{\sin x}{x + x}}{e^{y}}} \]
    2. lift-*.f64N/A

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

      \[\leadsto \frac{\color{blue}{\frac{\sin x}{x + x} \cdot \mathsf{expm1}\left(y + y\right)}}{e^{y}} \]
    4. associate-/l*N/A

      \[\leadsto \color{blue}{\frac{\sin x}{x + x} \cdot \frac{\mathsf{expm1}\left(y + y\right)}{e^{y}}} \]
    5. lift-/.f64N/A

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

      \[\leadsto \frac{\sin x}{x + x} \cdot \frac{\color{blue}{e^{y + y} - 1}}{e^{y}} \]
    7. lift-+.f64N/A

      \[\leadsto \frac{\sin x}{x + x} \cdot \frac{e^{\color{blue}{y + y}} - 1}{e^{y}} \]
    8. exp-sumN/A

      \[\leadsto \frac{\sin x}{x + x} \cdot \frac{\color{blue}{e^{y} \cdot e^{y}} - 1}{e^{y}} \]
    9. lift-exp.f64N/A

      \[\leadsto \frac{\sin x}{x + x} \cdot \frac{\color{blue}{e^{y}} \cdot e^{y} - 1}{e^{y}} \]
    10. lift-exp.f64N/A

      \[\leadsto \frac{\sin x}{x + x} \cdot \frac{e^{y} \cdot \color{blue}{e^{y}} - 1}{e^{y}} \]
    11. sub-to-fraction-revN/A

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

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

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

      \[\leadsto \frac{\sin x}{x + x} \cdot \left(e^{y} - \color{blue}{e^{\mathsf{neg}\left(y\right)}}\right) \]
    15. associate-*l/N/A

      \[\leadsto \color{blue}{\frac{\sin x \cdot \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right)}{x + x}} \]
    16. associate-*r/N/A

      \[\leadsto \color{blue}{\sin x \cdot \frac{e^{y} - e^{\mathsf{neg}\left(y\right)}}{x + x}} \]
    17. lift-+.f64N/A

      \[\leadsto \sin x \cdot \frac{e^{y} - e^{\mathsf{neg}\left(y\right)}}{\color{blue}{x + x}} \]
    18. count-2N/A

      \[\leadsto \sin x \cdot \frac{e^{y} - e^{\mathsf{neg}\left(y\right)}}{\color{blue}{2 \cdot x}} \]
  4. Applied rewrites99.8%

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

Alternative 2: 90.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.75:\\ \;\;\;\;\frac{\sin x \cdot \mathsf{fma}\left(0.16666666666666666 \cdot y, y, 1\right)}{x} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin x \cdot \cosh y}{x}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 1.75)
   (* (/ (* (sin x) (fma (* 0.16666666666666666 y) y 1.0)) x) y)
   (/ (* (sin x) (cosh y)) x)))
double code(double x, double y) {
	double tmp;
	if (y <= 1.75) {
		tmp = ((sin(x) * fma((0.16666666666666666 * y), y, 1.0)) / x) * y;
	} else {
		tmp = (sin(x) * cosh(y)) / x;
	}
	return tmp;
}
function code(x, y)
	tmp = 0.0
	if (y <= 1.75)
		tmp = Float64(Float64(Float64(sin(x) * fma(Float64(0.16666666666666666 * y), y, 1.0)) / x) * y);
	else
		tmp = Float64(Float64(sin(x) * cosh(y)) / x);
	end
	return tmp
end
code[x_, y_] := If[LessEqual[y, 1.75], N[(N[(N[(N[Sin[x], $MachinePrecision] * N[(N[(0.16666666666666666 * y), $MachinePrecision] * y + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[Sin[x], $MachinePrecision] * N[Cosh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.75:\\
\;\;\;\;\frac{\sin x \cdot \mathsf{fma}\left(0.16666666666666666 \cdot y, y, 1\right)}{x} \cdot y\\

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


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

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \mathsf{fma}\left(0.16666666666666666, \frac{{y}^{2} \cdot \sin x}{x}, \frac{\sin x}{x}\right) \]
    4. Applied rewrites81.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sin x \cdot \mathsf{fma}\left(\frac{1}{6} \cdot y, y, 1\right)}{x} \cdot y \]
      8. lift-sin.f6481.7

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

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

    if 1.75 < y

    1. Initial program 88.4%

      \[\frac{\sin x \cdot \sinh y}{x} \]
    2. Applied rewrites27.1%

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

Alternative 3: 80.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sin x \cdot \sinh y}{x}\\ \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;\frac{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot \cosh y}{x}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-67}:\\ \;\;\;\;\frac{\sin x}{x} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\sinh y\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ (* (sin x) (sinh y)) x)))
   (if (<= t_0 (- INFINITY))
     (/ (* (* x (+ 1.0 (* -0.16666666666666666 (pow x 2.0)))) (cosh y)) x)
     (if (<= t_0 5e-67) (* (/ (sin x) x) y) (sinh y)))))
double code(double x, double y) {
	double t_0 = (sin(x) * sinh(y)) / x;
	double tmp;
	if (t_0 <= -((double) INFINITY)) {
		tmp = ((x * (1.0 + (-0.16666666666666666 * pow(x, 2.0)))) * cosh(y)) / x;
	} else if (t_0 <= 5e-67) {
		tmp = (sin(x) / x) * y;
	} else {
		tmp = sinh(y);
	}
	return tmp;
}
public static double code(double x, double y) {
	double t_0 = (Math.sin(x) * Math.sinh(y)) / x;
	double tmp;
	if (t_0 <= -Double.POSITIVE_INFINITY) {
		tmp = ((x * (1.0 + (-0.16666666666666666 * Math.pow(x, 2.0)))) * Math.cosh(y)) / x;
	} else if (t_0 <= 5e-67) {
		tmp = (Math.sin(x) / x) * y;
	} else {
		tmp = Math.sinh(y);
	}
	return tmp;
}
def code(x, y):
	t_0 = (math.sin(x) * math.sinh(y)) / x
	tmp = 0
	if t_0 <= -math.inf:
		tmp = ((x * (1.0 + (-0.16666666666666666 * math.pow(x, 2.0)))) * math.cosh(y)) / x
	elif t_0 <= 5e-67:
		tmp = (math.sin(x) / x) * y
	else:
		tmp = math.sinh(y)
	return tmp
function code(x, y)
	t_0 = Float64(Float64(sin(x) * sinh(y)) / x)
	tmp = 0.0
	if (t_0 <= Float64(-Inf))
		tmp = Float64(Float64(Float64(x * Float64(1.0 + Float64(-0.16666666666666666 * (x ^ 2.0)))) * cosh(y)) / x);
	elseif (t_0 <= 5e-67)
		tmp = Float64(Float64(sin(x) / x) * y);
	else
		tmp = sinh(y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (sin(x) * sinh(y)) / x;
	tmp = 0.0;
	if (t_0 <= -Inf)
		tmp = ((x * (1.0 + (-0.16666666666666666 * (x ^ 2.0)))) * cosh(y)) / x;
	elseif (t_0 <= 5e-67)
		tmp = (sin(x) / x) * y;
	else
		tmp = sinh(y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(x * N[(1.0 + N[(-0.16666666666666666 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cosh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$0, 5e-67], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\frac{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot \cosh y}{x}\\

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

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


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

    1. Initial program 88.4%

      \[\frac{\sin x \cdot \sinh y}{x} \]
    2. Applied rewrites27.1%

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

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

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

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

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

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

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

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

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{\sin x}{x} \cdot y} \]
        7. lower-*.f6452.4

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

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

      if 4.9999999999999999e-67 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x)

      1. Initial program 88.4%

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

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

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

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

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

          \[\leadsto \frac{1}{2} \cdot \left(e^{y} - \frac{1}{\color{blue}{e^{y}}}\right) \]
        5. lower-exp.f6452.2

          \[\leadsto 0.5 \cdot \left(e^{y} - \frac{1}{e^{y}}\right) \]
      4. Applied rewrites52.2%

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

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

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

          \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \frac{1}{\color{blue}{2}} \]
        4. mult-flipN/A

          \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{\color{blue}{2}} \]
        5. lift--.f64N/A

          \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
        6. lift-exp.f64N/A

          \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
        7. lift-/.f64N/A

          \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
        8. lift-exp.f64N/A

          \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
        9. rec-expN/A

          \[\leadsto \frac{e^{y} - e^{\mathsf{neg}\left(y\right)}}{2} \]
        10. sinh-defN/A

          \[\leadsto \sinh y \]
        11. lift-sinh.f6464.3

          \[\leadsto \sinh y \]
      6. Applied rewrites64.3%

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

    Alternative 4: 75.9% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.15:\\ \;\;\;\;\frac{\sin x}{x} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin x \cdot \cosh y}{x}\\ \end{array} \end{array} \]
    (FPCore (x y)
     :precision binary64
     (if (<= y 1.15) (* (/ (sin x) x) y) (/ (* (sin x) (cosh y)) x)))
    double code(double x, double y) {
    	double tmp;
    	if (y <= 1.15) {
    		tmp = (sin(x) / x) * y;
    	} else {
    		tmp = (sin(x) * cosh(y)) / x;
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8) :: tmp
        if (y <= 1.15d0) then
            tmp = (sin(x) / x) * y
        else
            tmp = (sin(x) * cosh(y)) / x
        end if
        code = tmp
    end function
    
    public static double code(double x, double y) {
    	double tmp;
    	if (y <= 1.15) {
    		tmp = (Math.sin(x) / x) * y;
    	} else {
    		tmp = (Math.sin(x) * Math.cosh(y)) / x;
    	}
    	return tmp;
    }
    
    def code(x, y):
    	tmp = 0
    	if y <= 1.15:
    		tmp = (math.sin(x) / x) * y
    	else:
    		tmp = (math.sin(x) * math.cosh(y)) / x
    	return tmp
    
    function code(x, y)
    	tmp = 0.0
    	if (y <= 1.15)
    		tmp = Float64(Float64(sin(x) / x) * y);
    	else
    		tmp = Float64(Float64(sin(x) * cosh(y)) / x);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y)
    	tmp = 0.0;
    	if (y <= 1.15)
    		tmp = (sin(x) / x) * y;
    	else
    		tmp = (sin(x) * cosh(y)) / x;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_] := If[LessEqual[y, 1.15], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[Sin[x], $MachinePrecision] * N[Cosh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq 1.15:\\
    \;\;\;\;\frac{\sin x}{x} \cdot y\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\sin x \cdot \cosh y}{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 1.1499999999999999

      1. Initial program 88.4%

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{\sin x}{x} \cdot y} \]
          7. lower-*.f6452.4

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

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

        if 1.1499999999999999 < y

        1. Initial program 88.4%

          \[\frac{\sin x \cdot \sinh y}{x} \]
        2. Applied rewrites27.1%

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

      Alternative 5: 74.4% accurate, 0.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sin x \cdot \sinh y}{x}\\ \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;\frac{\left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot y}{x}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-67}:\\ \;\;\;\;\frac{\sin x}{x} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\sinh y\\ \end{array} \end{array} \]
      (FPCore (x y)
       :precision binary64
       (let* ((t_0 (/ (* (sin x) (sinh y)) x)))
         (if (<= t_0 (- INFINITY))
           (/
            (* (* x (+ 1.0 (* -0.16666666666666666 (sqrt (* (* x x) (* x x)))))) y)
            x)
           (if (<= t_0 5e-67) (* (/ (sin x) x) y) (sinh y)))))
      double code(double x, double y) {
      	double t_0 = (sin(x) * sinh(y)) / x;
      	double tmp;
      	if (t_0 <= -((double) INFINITY)) {
      		tmp = ((x * (1.0 + (-0.16666666666666666 * sqrt(((x * x) * (x * x)))))) * y) / x;
      	} else if (t_0 <= 5e-67) {
      		tmp = (sin(x) / x) * y;
      	} else {
      		tmp = sinh(y);
      	}
      	return tmp;
      }
      
      public static double code(double x, double y) {
      	double t_0 = (Math.sin(x) * Math.sinh(y)) / x;
      	double tmp;
      	if (t_0 <= -Double.POSITIVE_INFINITY) {
      		tmp = ((x * (1.0 + (-0.16666666666666666 * Math.sqrt(((x * x) * (x * x)))))) * y) / x;
      	} else if (t_0 <= 5e-67) {
      		tmp = (Math.sin(x) / x) * y;
      	} else {
      		tmp = Math.sinh(y);
      	}
      	return tmp;
      }
      
      def code(x, y):
      	t_0 = (math.sin(x) * math.sinh(y)) / x
      	tmp = 0
      	if t_0 <= -math.inf:
      		tmp = ((x * (1.0 + (-0.16666666666666666 * math.sqrt(((x * x) * (x * x)))))) * y) / x
      	elif t_0 <= 5e-67:
      		tmp = (math.sin(x) / x) * y
      	else:
      		tmp = math.sinh(y)
      	return tmp
      
      function code(x, y)
      	t_0 = Float64(Float64(sin(x) * sinh(y)) / x)
      	tmp = 0.0
      	if (t_0 <= Float64(-Inf))
      		tmp = Float64(Float64(Float64(x * Float64(1.0 + Float64(-0.16666666666666666 * sqrt(Float64(Float64(x * x) * Float64(x * x)))))) * y) / x);
      	elseif (t_0 <= 5e-67)
      		tmp = Float64(Float64(sin(x) / x) * y);
      	else
      		tmp = sinh(y);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y)
      	t_0 = (sin(x) * sinh(y)) / x;
      	tmp = 0.0;
      	if (t_0 <= -Inf)
      		tmp = ((x * (1.0 + (-0.16666666666666666 * sqrt(((x * x) * (x * x)))))) * y) / x;
      	elseif (t_0 <= 5e-67)
      		tmp = (sin(x) / x) * y;
      	else
      		tmp = sinh(y);
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(x * N[(1.0 + N[(-0.16666666666666666 * N[Sqrt[N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$0, 5e-67], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{\sin x \cdot \sinh y}{x}\\
      \mathbf{if}\;t\_0 \leq -\infty:\\
      \;\;\;\;\frac{\left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot y}{x}\\
      
      \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-67}:\\
      \;\;\;\;\frac{\sin x}{x} \cdot y\\
      
      \mathbf{else}:\\
      \;\;\;\;\sinh y\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -inf.0

        1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot y}{x} \]
            4. lower-*.f6425.8

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

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

              \[\leadsto \frac{\left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right)\right) \cdot y}{x} \]
            7. lower-*.f6425.8

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

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

              \[\leadsto \frac{\left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot y}{x} \]
            10. lower-*.f6425.8

              \[\leadsto \frac{\left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot y}{x} \]
          6. Applied rewrites25.8%

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

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

          1. Initial program 88.4%

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{\sin x}{x} \cdot y} \]
              7. lower-*.f6452.4

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

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

            if 4.9999999999999999e-67 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x)

            1. Initial program 88.4%

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

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

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

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

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

                \[\leadsto \frac{1}{2} \cdot \left(e^{y} - \frac{1}{\color{blue}{e^{y}}}\right) \]
              5. lower-exp.f6452.2

                \[\leadsto 0.5 \cdot \left(e^{y} - \frac{1}{e^{y}}\right) \]
            4. Applied rewrites52.2%

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

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

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

                \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \frac{1}{\color{blue}{2}} \]
              4. mult-flipN/A

                \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{\color{blue}{2}} \]
              5. lift--.f64N/A

                \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
              6. lift-exp.f64N/A

                \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
              7. lift-/.f64N/A

                \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
              8. lift-exp.f64N/A

                \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
              9. rec-expN/A

                \[\leadsto \frac{e^{y} - e^{\mathsf{neg}\left(y\right)}}{2} \]
              10. sinh-defN/A

                \[\leadsto \sinh y \]
              11. lift-sinh.f6464.3

                \[\leadsto \sinh y \]
            6. Applied rewrites64.3%

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

          Alternative 6: 74.4% accurate, 0.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sin x \cdot \sinh y}{x}\\ \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;\frac{\left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot y}{x}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-67}:\\ \;\;\;\;\frac{y}{x} \cdot \sin x\\ \mathbf{else}:\\ \;\;\;\;\sinh y\\ \end{array} \end{array} \]
          (FPCore (x y)
           :precision binary64
           (let* ((t_0 (/ (* (sin x) (sinh y)) x)))
             (if (<= t_0 (- INFINITY))
               (/
                (* (* x (+ 1.0 (* -0.16666666666666666 (sqrt (* (* x x) (* x x)))))) y)
                x)
               (if (<= t_0 5e-67) (* (/ y x) (sin x)) (sinh y)))))
          double code(double x, double y) {
          	double t_0 = (sin(x) * sinh(y)) / x;
          	double tmp;
          	if (t_0 <= -((double) INFINITY)) {
          		tmp = ((x * (1.0 + (-0.16666666666666666 * sqrt(((x * x) * (x * x)))))) * y) / x;
          	} else if (t_0 <= 5e-67) {
          		tmp = (y / x) * sin(x);
          	} else {
          		tmp = sinh(y);
          	}
          	return tmp;
          }
          
          public static double code(double x, double y) {
          	double t_0 = (Math.sin(x) * Math.sinh(y)) / x;
          	double tmp;
          	if (t_0 <= -Double.POSITIVE_INFINITY) {
          		tmp = ((x * (1.0 + (-0.16666666666666666 * Math.sqrt(((x * x) * (x * x)))))) * y) / x;
          	} else if (t_0 <= 5e-67) {
          		tmp = (y / x) * Math.sin(x);
          	} else {
          		tmp = Math.sinh(y);
          	}
          	return tmp;
          }
          
          def code(x, y):
          	t_0 = (math.sin(x) * math.sinh(y)) / x
          	tmp = 0
          	if t_0 <= -math.inf:
          		tmp = ((x * (1.0 + (-0.16666666666666666 * math.sqrt(((x * x) * (x * x)))))) * y) / x
          	elif t_0 <= 5e-67:
          		tmp = (y / x) * math.sin(x)
          	else:
          		tmp = math.sinh(y)
          	return tmp
          
          function code(x, y)
          	t_0 = Float64(Float64(sin(x) * sinh(y)) / x)
          	tmp = 0.0
          	if (t_0 <= Float64(-Inf))
          		tmp = Float64(Float64(Float64(x * Float64(1.0 + Float64(-0.16666666666666666 * sqrt(Float64(Float64(x * x) * Float64(x * x)))))) * y) / x);
          	elseif (t_0 <= 5e-67)
          		tmp = Float64(Float64(y / x) * sin(x));
          	else
          		tmp = sinh(y);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	t_0 = (sin(x) * sinh(y)) / x;
          	tmp = 0.0;
          	if (t_0 <= -Inf)
          		tmp = ((x * (1.0 + (-0.16666666666666666 * sqrt(((x * x) * (x * x)))))) * y) / x;
          	elseif (t_0 <= 5e-67)
          		tmp = (y / x) * sin(x);
          	else
          		tmp = sinh(y);
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(x * N[(1.0 + N[(-0.16666666666666666 * N[Sqrt[N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$0, 5e-67], N[(N[(y / x), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision], N[Sinh[y], $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \frac{\sin x \cdot \sinh y}{x}\\
          \mathbf{if}\;t\_0 \leq -\infty:\\
          \;\;\;\;\frac{\left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot y}{x}\\
          
          \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-67}:\\
          \;\;\;\;\frac{y}{x} \cdot \sin x\\
          
          \mathbf{else}:\\
          \;\;\;\;\sinh y\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -inf.0

            1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot y}{x} \]
                4. lower-*.f6425.8

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

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

                  \[\leadsto \frac{\left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right)\right) \cdot y}{x} \]
                7. lower-*.f6425.8

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

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

                  \[\leadsto \frac{\left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot y}{x} \]
                10. lower-*.f6425.8

                  \[\leadsto \frac{\left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot y}{x} \]
              6. Applied rewrites25.8%

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

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

              1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

                if 4.9999999999999999e-67 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x)

                1. Initial program 88.4%

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

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

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

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

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

                    \[\leadsto \frac{1}{2} \cdot \left(e^{y} - \frac{1}{\color{blue}{e^{y}}}\right) \]
                  5. lower-exp.f6452.2

                    \[\leadsto 0.5 \cdot \left(e^{y} - \frac{1}{e^{y}}\right) \]
                4. Applied rewrites52.2%

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

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

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

                    \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \frac{1}{\color{blue}{2}} \]
                  4. mult-flipN/A

                    \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{\color{blue}{2}} \]
                  5. lift--.f64N/A

                    \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
                  6. lift-exp.f64N/A

                    \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
                  7. lift-/.f64N/A

                    \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
                  8. lift-exp.f64N/A

                    \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
                  9. rec-expN/A

                    \[\leadsto \frac{e^{y} - e^{\mathsf{neg}\left(y\right)}}{2} \]
                  10. sinh-defN/A

                    \[\leadsto \sinh y \]
                  11. lift-sinh.f6464.3

                    \[\leadsto \sinh y \]
                6. Applied rewrites64.3%

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

              Alternative 7: 62.7% accurate, 0.6× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\sin x \cdot \sinh y}{x} \leq -2 \cdot 10^{-210}:\\ \;\;\;\;\frac{\left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sinh y}{x} \cdot x\\ \end{array} \end{array} \]
              (FPCore (x y)
               :precision binary64
               (if (<= (/ (* (sin x) (sinh y)) x) -2e-210)
                 (/
                  (* (* x (+ 1.0 (* -0.16666666666666666 (sqrt (* (* x x) (* x x)))))) y)
                  x)
                 (* (/ (sinh y) x) x)))
              double code(double x, double y) {
              	double tmp;
              	if (((sin(x) * sinh(y)) / x) <= -2e-210) {
              		tmp = ((x * (1.0 + (-0.16666666666666666 * sqrt(((x * x) * (x * x)))))) * y) / x;
              	} else {
              		tmp = (sinh(y) / x) * x;
              	}
              	return tmp;
              }
              
              module fmin_fmax_functions
                  implicit none
                  private
                  public fmax
                  public fmin
              
                  interface fmax
                      module procedure fmax88
                      module procedure fmax44
                      module procedure fmax84
                      module procedure fmax48
                  end interface
                  interface fmin
                      module procedure fmin88
                      module procedure fmin44
                      module procedure fmin84
                      module procedure fmin48
                  end interface
              contains
                  real(8) function fmax88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmax44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmax84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmax48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                  end function
                  real(8) function fmin88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmin44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmin84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmin48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                  end function
              end module
              
              real(8) function code(x, y)
              use fmin_fmax_functions
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8) :: tmp
                  if (((sin(x) * sinh(y)) / x) <= (-2d-210)) then
                      tmp = ((x * (1.0d0 + ((-0.16666666666666666d0) * sqrt(((x * x) * (x * x)))))) * y) / x
                  else
                      tmp = (sinh(y) / x) * x
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y) {
              	double tmp;
              	if (((Math.sin(x) * Math.sinh(y)) / x) <= -2e-210) {
              		tmp = ((x * (1.0 + (-0.16666666666666666 * Math.sqrt(((x * x) * (x * x)))))) * y) / x;
              	} else {
              		tmp = (Math.sinh(y) / x) * x;
              	}
              	return tmp;
              }
              
              def code(x, y):
              	tmp = 0
              	if ((math.sin(x) * math.sinh(y)) / x) <= -2e-210:
              		tmp = ((x * (1.0 + (-0.16666666666666666 * math.sqrt(((x * x) * (x * x)))))) * y) / x
              	else:
              		tmp = (math.sinh(y) / x) * x
              	return tmp
              
              function code(x, y)
              	tmp = 0.0
              	if (Float64(Float64(sin(x) * sinh(y)) / x) <= -2e-210)
              		tmp = Float64(Float64(Float64(x * Float64(1.0 + Float64(-0.16666666666666666 * sqrt(Float64(Float64(x * x) * Float64(x * x)))))) * y) / x);
              	else
              		tmp = Float64(Float64(sinh(y) / x) * x);
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y)
              	tmp = 0.0;
              	if (((sin(x) * sinh(y)) / x) <= -2e-210)
              		tmp = ((x * (1.0 + (-0.16666666666666666 * sqrt(((x * x) * (x * x)))))) * y) / x;
              	else
              		tmp = (sinh(y) / x) * x;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_] := If[LessEqual[N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -2e-210], N[(N[(N[(x * N[(1.0 + N[(-0.16666666666666666 * N[Sqrt[N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision] * x), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;\frac{\sin x \cdot \sinh y}{x} \leq -2 \cdot 10^{-210}:\\
              \;\;\;\;\frac{\left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot y}{x}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{\sinh y}{x} \cdot x\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -2.0000000000000001e-210

                1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{\left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot y}{x} \]
                    4. lower-*.f6425.8

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

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

                      \[\leadsto \frac{\left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right)\right) \cdot y}{x} \]
                    7. lower-*.f6425.8

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

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

                      \[\leadsto \frac{\left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot y}{x} \]
                    10. lower-*.f6425.8

                      \[\leadsto \frac{\left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot y}{x} \]
                  6. Applied rewrites25.8%

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

                  if -2.0000000000000001e-210 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x)

                  1. Initial program 88.4%

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\frac{\sinh y}{x} \cdot x} \]
                      6. lower-/.f6474.6

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

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

                  Alternative 8: 61.3% accurate, 0.4× speedup?

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

                    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -2.0000000000000001e-210 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 0.0

                      1. Initial program 88.4%

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

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

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

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

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

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

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

                            \[\leadsto \color{blue}{\frac{\sinh y}{x} \cdot x} \]
                          6. lower-/.f6474.6

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

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

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

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

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

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

                        1. Initial program 88.4%

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

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

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

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

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

                            \[\leadsto \frac{1}{2} \cdot \left(e^{y} - \frac{1}{\color{blue}{e^{y}}}\right) \]
                          5. lower-exp.f6452.2

                            \[\leadsto 0.5 \cdot \left(e^{y} - \frac{1}{e^{y}}\right) \]
                        4. Applied rewrites52.2%

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

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

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

                            \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \frac{1}{\color{blue}{2}} \]
                          4. mult-flipN/A

                            \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{\color{blue}{2}} \]
                          5. lift--.f64N/A

                            \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
                          6. lift-exp.f64N/A

                            \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
                          7. lift-/.f64N/A

                            \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
                          8. lift-exp.f64N/A

                            \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
                          9. rec-expN/A

                            \[\leadsto \frac{e^{y} - e^{\mathsf{neg}\left(y\right)}}{2} \]
                          10. sinh-defN/A

                            \[\leadsto \sinh y \]
                          11. lift-sinh.f6464.3

                            \[\leadsto \sinh y \]
                        6. Applied rewrites64.3%

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

                      Alternative 9: 61.3% accurate, 0.7× speedup?

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

                        1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if -2.0000000000000001e-210 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x)

                          1. Initial program 88.4%

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

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

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

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

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

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

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

                                \[\leadsto \color{blue}{\frac{\sinh y}{x} \cdot x} \]
                              6. lower-/.f6474.6

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

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

                          Alternative 10: 61.2% accurate, 0.4× speedup?

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

                            1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              if -2.0000000000000001e-210 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 0.0

                              1. Initial program 88.4%

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

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{\frac{\sinh y}{x} \cdot x} \]
                                  6. lower-/.f6474.6

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

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

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

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

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

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

                                1. Initial program 88.4%

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

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

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

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

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

                                    \[\leadsto \frac{1}{2} \cdot \left(e^{y} - \frac{1}{\color{blue}{e^{y}}}\right) \]
                                  5. lower-exp.f6452.2

                                    \[\leadsto 0.5 \cdot \left(e^{y} - \frac{1}{e^{y}}\right) \]
                                4. Applied rewrites52.2%

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

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

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

                                    \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \frac{1}{\color{blue}{2}} \]
                                  4. mult-flipN/A

                                    \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{\color{blue}{2}} \]
                                  5. lift--.f64N/A

                                    \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
                                  6. lift-exp.f64N/A

                                    \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
                                  7. lift-/.f64N/A

                                    \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
                                  8. lift-exp.f64N/A

                                    \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
                                  9. rec-expN/A

                                    \[\leadsto \frac{e^{y} - e^{\mathsf{neg}\left(y\right)}}{2} \]
                                  10. sinh-defN/A

                                    \[\leadsto \sinh y \]
                                  11. lift-sinh.f6464.3

                                    \[\leadsto \sinh y \]
                                6. Applied rewrites64.3%

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

                              Alternative 11: 61.2% accurate, 0.8× speedup?

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

                                1. Initial program 88.4%

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

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

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

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

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

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

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

                                      \[\leadsto \color{blue}{\frac{\sinh y}{x} \cdot x} \]
                                    6. lower-/.f6474.6

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

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

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

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

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

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

                                  1. Initial program 88.4%

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

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

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

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

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

                                      \[\leadsto \frac{1}{2} \cdot \left(e^{y} - \frac{1}{\color{blue}{e^{y}}}\right) \]
                                    5. lower-exp.f6452.2

                                      \[\leadsto 0.5 \cdot \left(e^{y} - \frac{1}{e^{y}}\right) \]
                                  4. Applied rewrites52.2%

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

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

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

                                      \[\leadsto \left(e^{y} - \frac{1}{e^{y}}\right) \cdot \frac{1}{\color{blue}{2}} \]
                                    4. mult-flipN/A

                                      \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{\color{blue}{2}} \]
                                    5. lift--.f64N/A

                                      \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
                                    6. lift-exp.f64N/A

                                      \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
                                    7. lift-/.f64N/A

                                      \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
                                    8. lift-exp.f64N/A

                                      \[\leadsto \frac{e^{y} - \frac{1}{e^{y}}}{2} \]
                                    9. rec-expN/A

                                      \[\leadsto \frac{e^{y} - e^{\mathsf{neg}\left(y\right)}}{2} \]
                                    10. sinh-defN/A

                                      \[\leadsto \sinh y \]
                                    11. lift-sinh.f6464.3

                                      \[\leadsto \sinh y \]
                                  6. Applied rewrites64.3%

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

                                Alternative 12: 50.5% accurate, 7.0× speedup?

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

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

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

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

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

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

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

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

                                      \[\leadsto \color{blue}{\frac{\sinh y}{x} \cdot x} \]
                                    6. lower-/.f6474.6

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

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

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

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

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

                                  Alternative 13: 28.7% accurate, 7.7× speedup?

                                  \[\begin{array}{l} \\ \left(y + y\right) \cdot 0.5 \end{array} \]
                                  (FPCore (x y) :precision binary64 (* (+ y y) 0.5))
                                  double code(double x, double y) {
                                  	return (y + y) * 0.5;
                                  }
                                  
                                  module fmin_fmax_functions
                                      implicit none
                                      private
                                      public fmax
                                      public fmin
                                  
                                      interface fmax
                                          module procedure fmax88
                                          module procedure fmax44
                                          module procedure fmax84
                                          module procedure fmax48
                                      end interface
                                      interface fmin
                                          module procedure fmin88
                                          module procedure fmin44
                                          module procedure fmin84
                                          module procedure fmin48
                                      end interface
                                  contains
                                      real(8) function fmax88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmax44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmax84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmax48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmin44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmin48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                      end function
                                  end module
                                  
                                  real(8) function code(x, y)
                                  use fmin_fmax_functions
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      code = (y + y) * 0.5d0
                                  end function
                                  
                                  public static double code(double x, double y) {
                                  	return (y + y) * 0.5;
                                  }
                                  
                                  def code(x, y):
                                  	return (y + y) * 0.5
                                  
                                  function code(x, y)
                                  	return Float64(Float64(y + y) * 0.5)
                                  end
                                  
                                  function tmp = code(x, y)
                                  	tmp = (y + y) * 0.5;
                                  end
                                  
                                  code[x_, y_] := N[(N[(y + y), $MachinePrecision] * 0.5), $MachinePrecision]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \left(y + y\right) \cdot 0.5
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 88.4%

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

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

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

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

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

                                      \[\leadsto \frac{1}{2} \cdot \left(e^{y} - \frac{1}{\color{blue}{e^{y}}}\right) \]
                                    5. lower-exp.f6452.2

                                      \[\leadsto 0.5 \cdot \left(e^{y} - \frac{1}{e^{y}}\right) \]
                                  4. Applied rewrites52.2%

                                    \[\leadsto \color{blue}{0.5 \cdot \left(e^{y} - \frac{1}{e^{y}}\right)} \]
                                  5. Taylor expanded in y around 0

                                    \[\leadsto \frac{1}{2} \cdot \left(2 \cdot \color{blue}{y}\right) \]
                                  6. Step-by-step derivation
                                    1. lower-*.f6428.7

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

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

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

                                      \[\leadsto \left(2 \cdot y\right) \cdot \color{blue}{\frac{1}{2}} \]
                                    3. lower-*.f6428.7

                                      \[\leadsto \left(2 \cdot y\right) \cdot \color{blue}{0.5} \]
                                    4. lift-*.f64N/A

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

                                      \[\leadsto \left(y + y\right) \cdot \frac{1}{2} \]
                                    6. lower-+.f6428.7

                                      \[\leadsto \left(y + y\right) \cdot 0.5 \]
                                  9. Applied rewrites28.7%

                                    \[\leadsto \color{blue}{\left(y + y\right) \cdot 0.5} \]
                                  10. Add Preprocessing

                                  Reproduce

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