Linear.Quaternion:$ccos from linear-1.19.1.3

Percentage Accurate: 100.0% → 100.0%
Time: 3.7s
Alternatives: 9
Speedup: 1.0×

Specification

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

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

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

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

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

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

Alternative 1: 99.1% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_2 \leq 1000:\\
\;\;\;\;t\_0 \cdot 1\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y}{\left|x\right| \cdot \sinh y}}\\


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sinh y}{y} \cdot \left(\left({x}^{2} \cdot \frac{-1}{6} + 1\right) \cdot x\right) \]
      11. lower-fma.f6463.0%

        \[\leadsto \frac{\sinh y}{y} \cdot \left(\mathsf{fma}\left({x}^{2}, -0.16666666666666666, 1\right) \cdot x\right) \]
      12. lift-pow.f64N/A

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

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

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

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

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

    1. Initial program 100.0%

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

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

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

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

            \[\leadsto \frac{1}{\color{blue}{\frac{y}{x \cdot \sinh y}}} \]
          7. lower-*.f6451.1%

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

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

      Alternative 2: 74.9% accurate, 0.5× speedup?

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

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\sinh y}{y} \cdot \left(\left({x}^{2} \cdot \frac{-1}{6} + 1\right) \cdot x\right) \]
          11. lower-fma.f6463.0%

            \[\leadsto \frac{\sinh y}{y} \cdot \left(\mathsf{fma}\left({x}^{2}, -0.16666666666666666, 1\right) \cdot x\right) \]
          12. lift-pow.f64N/A

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

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

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

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

        if 9.99999999999999999e-15 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y))

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\sinh y \cdot \left(\frac{1}{y} \cdot x\right)} \]
            8. lower-*.f6450.6%

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

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{\left(\frac{1}{y} \cdot x\right) \cdot \left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right)}{2}} \]
            6. div-flipN/A

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

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

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

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

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

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

              \[\leadsto \frac{1}{\frac{2}{\color{blue}{\left(\left(e^{y} - e^{\mathsf{neg}\left(y\right)}\right) \cdot \frac{1}{y}\right) \cdot x}}} \]
          5. Applied rewrites62.1%

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{\color{blue}{\frac{\frac{\frac{2}{x}}{\sinh y}}{\frac{2}{y}}}} \]
            10. lower-/.f64N/A

              \[\leadsto \frac{1}{\color{blue}{\frac{\frac{\frac{2}{x}}{\sinh y}}{\frac{2}{y}}}} \]
            11. lower-/.f64N/A

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

              \[\leadsto \frac{1}{\frac{\frac{\color{blue}{\frac{2}{x}}}{\sinh y}}{\frac{2}{y}}} \]
            13. lower-/.f6450.4%

              \[\leadsto \frac{1}{\frac{\frac{\frac{2}{x}}{\sinh y}}{\color{blue}{\frac{2}{y}}}} \]
          7. Applied rewrites50.4%

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

        Alternative 3: 73.0% accurate, 0.6× speedup?

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

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\left(\left({x}^{2} \cdot \frac{-1}{6} + 1\right) \cdot x\right) \cdot y}{y} \]
              13. lower-fma.f6425.6%

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

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

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

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

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

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

            1. Initial program 100.0%

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

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

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

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

                  \[\leadsto \color{blue}{\frac{\sinh y}{y} \cdot x} \]
                3. lower-*.f6462.2%

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

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

            Alternative 4: 42.9% accurate, 0.4× speedup?

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

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{\left(\left({x}^{2} \cdot \frac{-1}{6} + 1\right) \cdot x\right) \cdot y}{y} \]
                  13. lower-fma.f6425.6%

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

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

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

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

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

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

                1. Initial program 100.0%

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

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

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

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

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

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

                    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 5: 42.9% accurate, 0.4× speedup?

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

                        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{\left(\left({x}^{2} \cdot \frac{-1}{6} + 1\right) \cdot x\right) \cdot y}{y} \]
                            13. lower-fma.f6425.6%

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

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

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

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

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

                          if -0.998 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 9.99999999999999999e-15

                          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left({x}^{2} \cdot x, -0.16666666666666666, x\right) \cdot \frac{y}{y} \]
                              18. lift-pow.f64N/A

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

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

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

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

                            if 9.99999999999999999e-15 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y))

                            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              Alternative 6: 32.1% accurate, 0.7× speedup?

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

                                1. Initial program 100.0%

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

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

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

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

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

                                    if 6.8000000000000001e-15 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y))

                                    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                                      Alternative 7: 32.1% accurate, 0.7× speedup?

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

                                        1. Initial program 100.0%

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

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

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

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

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

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

                                            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              Alternative 8: 27.0% accurate, 7.0× speedup?

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

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

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

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

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

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

                                                  Reproduce

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