Linear.Quaternion:$ccos from linear-1.19.1.3

Percentage Accurate: 100.0% → 100.0%
Time: 4.8s
Alternatives: 12
Speedup: 0.7×

Specification

?
\[\sin x \cdot \frac{\sinh y}{y} \]
(FPCore (x y)
  :precision binary64
  :pre TRUE
  (* (sin x) (/ (sinh y) y)))
double code(double x, double y) {
	return sin(x) * (sinh(y) / y);
}
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]
f(x, y):
	x in [-inf, +inf],
	y in [-inf, +inf]
code: THEORY
BEGIN
f(x, y: real): real =
	(sin(x)) * ((((1) / (2)) * ((exp(y)) + ((- (1)) / (exp(y))))) / y)
END code
\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 12 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
  :pre TRUE
  (* (sin x) (/ (sinh y) y)))
double code(double x, double y) {
	return sin(x) * (sinh(y) / y);
}
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]
f(x, y):
	x in [-inf, +inf],
	y in [-inf, +inf]
code: THEORY
BEGIN
f(x, y: real): real =
	(sin(x)) * ((((1) / (2)) * ((exp(y)) + ((- (1)) / (exp(y))))) / y)
END code
\sin x \cdot \frac{\sinh y}{y}

Alternative 1: 100.0% accurate, 0.7× speedup?

\[\begin{array}{l} \mathbf{if}\;\frac{\sinh y}{y} \leq 1.0005:\\ \;\;\;\;\sin x \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\frac{\sinh y \cdot \sin x}{y}\\ \end{array} \]
(FPCore (x y)
  :precision binary64
  :pre TRUE
  (if (<= (/ (sinh y) y) 1.0005)
  (* (sin x) 1.0)
  (/ (* (sinh y) (sin x)) y)))
double code(double x, double y) {
	double tmp;
	if ((sinh(y) / y) <= 1.0005) {
		tmp = sin(x) * 1.0;
	} else {
		tmp = (sinh(y) * sin(x)) / y;
	}
	return tmp;
}
real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((sinh(y) / y) <= 1.0005d0) then
        tmp = sin(x) * 1.0d0
    else
        tmp = (sinh(y) * sin(x)) / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((Math.sinh(y) / y) <= 1.0005) {
		tmp = Math.sin(x) * 1.0;
	} else {
		tmp = (Math.sinh(y) * Math.sin(x)) / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (math.sinh(y) / y) <= 1.0005:
		tmp = math.sin(x) * 1.0
	else:
		tmp = (math.sinh(y) * math.sin(x)) / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (Float64(sinh(y) / y) <= 1.0005)
		tmp = Float64(sin(x) * 1.0);
	else
		tmp = Float64(Float64(sinh(y) * sin(x)) / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((sinh(y) / y) <= 1.0005)
		tmp = sin(x) * 1.0;
	else
		tmp = (sinh(y) * sin(x)) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision], 1.0005], N[(N[Sin[x], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(N[Sinh[y], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
f(x, y):
	x in [-inf, +inf],
	y in [-inf, +inf]
code: THEORY
BEGIN
f(x, y: real): real =
	LET tmp = IF (((((1) / (2)) * ((exp(y)) + ((- (1)) / (exp(y))))) / y) <= (10004999999999999449329379785922355949878692626953125e-52)) THEN ((sin(x)) * (1)) ELSE (((((1) / (2)) * ((exp(y)) + ((- (1)) / (exp(y))))) * (sin(x))) / y) ENDIF IN
	tmp
END code
\begin{array}{l}
\mathbf{if}\;\frac{\sinh y}{y} \leq 1.0005:\\
\;\;\;\;\sin x \cdot 1\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (sinh.f64 y) y) < 1.0004999999999999

    1. Initial program 100.0%

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

      \[\leadsto \sin x \cdot 1 \]
    3. Step-by-step derivation
      1. Applied rewrites50.4%

        \[\leadsto \sin x \cdot 1 \]

      if 1.0004999999999999 < (/.f64 (sinh.f64 y) y)

      1. Initial program 100.0%

        \[\sin x \cdot \frac{\sinh y}{y} \]
      2. Step-by-step derivation
        1. Applied rewrites89.0%

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

      Alternative 2: 99.2% 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:\\ \;\;\;\;\sinh y \cdot \frac{\mathsf{fma}\left(-0.16666666666666666 \cdot \left|x\right|, \left|x\right|, 1\right) \cdot \left|x\right|}{y}\\ \mathbf{elif}\;t\_2 \leq 1:\\ \;\;\;\;t\_0 \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\left|x\right| \cdot t\_1\\ \end{array} \end{array} \]
      (FPCore (x y)
        :precision binary64
        :pre TRUE
        (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))
           (*
            (sinh y)
            (/
             (*
              (fma (* -0.16666666666666666 (fabs x)) (fabs x) 1.0)
              (fabs x))
             y))
           (if (<= t_2 1.0) (* t_0 1.0) (* (fabs x) t_1))))))
      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 = sinh(y) * ((fma((-0.16666666666666666 * fabs(x)), fabs(x), 1.0) * fabs(x)) / y);
      	} else if (t_2 <= 1.0) {
      		tmp = t_0 * 1.0;
      	} else {
      		tmp = fabs(x) * t_1;
      	}
      	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(sinh(y) * Float64(Float64(fma(Float64(-0.16666666666666666 * abs(x)), abs(x), 1.0) * abs(x)) / y));
      	elseif (t_2 <= 1.0)
      		tmp = Float64(t_0 * 1.0);
      	else
      		tmp = Float64(abs(x) * t_1);
      	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[(N[Sinh[y], $MachinePrecision] * N[(N[(N[(N[(-0.16666666666666666 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision] + 1.0), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1.0], N[(t$95$0 * 1.0), $MachinePrecision], N[(N[Abs[x], $MachinePrecision] * t$95$1), $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:\\
      \;\;\;\;\sinh y \cdot \frac{\mathsf{fma}\left(-0.16666666666666666 \cdot \left|x\right|, \left|x\right|, 1\right) \cdot \left|x\right|}{y}\\
      
      \mathbf{elif}\;t\_2 \leq 1:\\
      \;\;\;\;t\_0 \cdot 1\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|x\right| \cdot t\_1\\
      
      
      \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 \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right) \cdot \frac{\sinh y}{y} \]
        3. Step-by-step derivation
          1. Applied rewrites63.1%

            \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot \frac{\sinh y}{y} \]
          2. Step-by-step derivation
            1. Applied rewrites52.2%

              \[\leadsto \frac{\left(\mathsf{fma}\left(x \cdot x, -0.16666666666666666, 1\right) \cdot x\right) \cdot \sinh y}{y} \]
            2. Step-by-step derivation
              1. Applied rewrites51.6%

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

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

              1. Initial program 100.0%

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

                \[\leadsto \sin x \cdot 1 \]
              3. Step-by-step derivation
                1. Applied rewrites50.4%

                  \[\leadsto \sin x \cdot 1 \]

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

                1. Initial program 100.0%

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

                  \[\leadsto \frac{1}{2} \cdot \frac{x \cdot \left(e^{y} - \frac{1}{e^{y}}\right)}{y} \]
                3. Step-by-step derivation
                  1. Applied rewrites40.7%

                    \[\leadsto 0.5 \cdot \frac{x \cdot \left(e^{y} - \frac{1}{e^{y}}\right)}{y} \]
                  2. Step-by-step derivation
                    1. Applied rewrites63.4%

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

                  Alternative 3: 76.2% 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.035:\\ \;\;\;\;\sinh y \cdot \frac{\mathsf{fma}\left(-0.16666666666666666 \cdot \left|x\right|, \left|x\right|, 1\right) \cdot \left|x\right|}{y}\\ \mathbf{else}:\\ \;\;\;\;\left|x\right| \cdot t\_0\\ \end{array} \end{array} \]
                  (FPCore (x y)
                    :precision binary64
                    :pre TRUE
                    (let* ((t_0 (/ (sinh y) y)))
                    (*
                     (copysign 1.0 x)
                     (if (<= (* (sin (fabs x)) t_0) 0.035)
                       (*
                        (sinh y)
                        (/
                         (*
                          (fma (* -0.16666666666666666 (fabs x)) (fabs x) 1.0)
                          (fabs x))
                         y))
                       (* (fabs x) t_0)))))
                  double code(double x, double y) {
                  	double t_0 = sinh(y) / y;
                  	double tmp;
                  	if ((sin(fabs(x)) * t_0) <= 0.035) {
                  		tmp = sinh(y) * ((fma((-0.16666666666666666 * fabs(x)), fabs(x), 1.0) * fabs(x)) / y);
                  	} else {
                  		tmp = fabs(x) * t_0;
                  	}
                  	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.035)
                  		tmp = Float64(sinh(y) * Float64(Float64(fma(Float64(-0.16666666666666666 * abs(x)), abs(x), 1.0) * abs(x)) / y));
                  	else
                  		tmp = Float64(abs(x) * t_0);
                  	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.035], N[(N[Sinh[y], $MachinePrecision] * N[(N[(N[(N[(-0.16666666666666666 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision] + 1.0), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[Abs[x], $MachinePrecision] * t$95$0), $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.035:\\
                  \;\;\;\;\sinh y \cdot \frac{\mathsf{fma}\left(-0.16666666666666666 \cdot \left|x\right|, \left|x\right|, 1\right) \cdot \left|x\right|}{y}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left|x\right| \cdot t\_0\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 0.035000000000000003

                    1. Initial program 100.0%

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

                      \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right) \cdot \frac{\sinh y}{y} \]
                    3. Step-by-step derivation
                      1. Applied rewrites63.1%

                        \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot \frac{\sinh y}{y} \]
                      2. Step-by-step derivation
                        1. Applied rewrites52.2%

                          \[\leadsto \frac{\left(\mathsf{fma}\left(x \cdot x, -0.16666666666666666, 1\right) \cdot x\right) \cdot \sinh y}{y} \]
                        2. Step-by-step derivation
                          1. Applied rewrites51.6%

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

                          if 0.035000000000000003 < (*.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 \frac{1}{2} \cdot \frac{x \cdot \left(e^{y} - \frac{1}{e^{y}}\right)}{y} \]
                          3. Step-by-step derivation
                            1. Applied rewrites40.7%

                              \[\leadsto 0.5 \cdot \frac{x \cdot \left(e^{y} - \frac{1}{e^{y}}\right)}{y} \]
                            2. Step-by-step derivation
                              1. Applied rewrites63.4%

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

                            Alternative 4: 73.2% accurate, 0.6× speedup?

                            \[\begin{array}{l} t_0 := \left|x\right| \cdot \left|x\right|\\ t_1 := \frac{\sinh y}{y}\\ \mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l} \mathbf{if}\;\sin \left(\left|x\right|\right) \cdot t\_1 \leq 0.035:\\ \;\;\;\;\left(\left|x\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{t\_0 \cdot t\_0}\right)\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\left|x\right| \cdot t\_1\\ \end{array} \end{array} \]
                            (FPCore (x y)
                              :precision binary64
                              :pre TRUE
                              (let* ((t_0 (* (fabs x) (fabs x))) (t_1 (/ (sinh y) y)))
                              (*
                               (copysign 1.0 x)
                               (if (<= (* (sin (fabs x)) t_1) 0.035)
                                 (*
                                  (* (fabs x) (+ 1.0 (* -0.16666666666666666 (sqrt (* t_0 t_0)))))
                                  1.0)
                                 (* (fabs x) t_1)))))
                            double code(double x, double y) {
                            	double t_0 = fabs(x) * fabs(x);
                            	double t_1 = sinh(y) / y;
                            	double tmp;
                            	if ((sin(fabs(x)) * t_1) <= 0.035) {
                            		tmp = (fabs(x) * (1.0 + (-0.16666666666666666 * sqrt((t_0 * t_0))))) * 1.0;
                            	} else {
                            		tmp = fabs(x) * t_1;
                            	}
                            	return copysign(1.0, x) * tmp;
                            }
                            
                            public static double code(double x, double y) {
                            	double t_0 = Math.abs(x) * Math.abs(x);
                            	double t_1 = Math.sinh(y) / y;
                            	double tmp;
                            	if ((Math.sin(Math.abs(x)) * t_1) <= 0.035) {
                            		tmp = (Math.abs(x) * (1.0 + (-0.16666666666666666 * Math.sqrt((t_0 * t_0))))) * 1.0;
                            	} else {
                            		tmp = Math.abs(x) * t_1;
                            	}
                            	return Math.copySign(1.0, x) * tmp;
                            }
                            
                            def code(x, y):
                            	t_0 = math.fabs(x) * math.fabs(x)
                            	t_1 = math.sinh(y) / y
                            	tmp = 0
                            	if (math.sin(math.fabs(x)) * t_1) <= 0.035:
                            		tmp = (math.fabs(x) * (1.0 + (-0.16666666666666666 * math.sqrt((t_0 * t_0))))) * 1.0
                            	else:
                            		tmp = math.fabs(x) * t_1
                            	return math.copysign(1.0, x) * tmp
                            
                            function code(x, y)
                            	t_0 = Float64(abs(x) * abs(x))
                            	t_1 = Float64(sinh(y) / y)
                            	tmp = 0.0
                            	if (Float64(sin(abs(x)) * t_1) <= 0.035)
                            		tmp = Float64(Float64(abs(x) * Float64(1.0 + Float64(-0.16666666666666666 * sqrt(Float64(t_0 * t_0))))) * 1.0);
                            	else
                            		tmp = Float64(abs(x) * t_1);
                            	end
                            	return Float64(copysign(1.0, x) * tmp)
                            end
                            
                            function tmp_2 = code(x, y)
                            	t_0 = abs(x) * abs(x);
                            	t_1 = sinh(y) / y;
                            	tmp = 0.0;
                            	if ((sin(abs(x)) * t_1) <= 0.035)
                            		tmp = (abs(x) * (1.0 + (-0.16666666666666666 * sqrt((t_0 * t_0))))) * 1.0;
                            	else
                            		tmp = abs(x) * t_1;
                            	end
                            	tmp_2 = (sign(x) * abs(1.0)) * 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[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$1), $MachinePrecision], 0.035], N[(N[(N[Abs[x], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Sqrt[N[(t$95$0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Abs[x], $MachinePrecision] * t$95$1), $MachinePrecision]]), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            t_0 := \left|x\right| \cdot \left|x\right|\\
                            t_1 := \frac{\sinh y}{y}\\
                            \mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
                            \mathbf{if}\;\sin \left(\left|x\right|\right) \cdot t\_1 \leq 0.035:\\
                            \;\;\;\;\left(\left|x\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{t\_0 \cdot t\_0}\right)\right) \cdot 1\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\left|x\right| \cdot t\_1\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 0.035000000000000003

                              1. Initial program 100.0%

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

                                \[\leadsto \sin x \cdot 1 \]
                              3. Step-by-step derivation
                                1. Applied rewrites50.4%

                                  \[\leadsto \sin x \cdot 1 \]
                                2. Taylor expanded in x around 0

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

                                    \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right) \cdot 1 \]
                                  2. Step-by-step derivation
                                    1. Applied rewrites35.5%

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

                                    if 0.035000000000000003 < (*.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 \frac{1}{2} \cdot \frac{x \cdot \left(e^{y} - \frac{1}{e^{y}}\right)}{y} \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites40.7%

                                        \[\leadsto 0.5 \cdot \frac{x \cdot \left(e^{y} - \frac{1}{e^{y}}\right)}{y} \]
                                      2. Step-by-step derivation
                                        1. Applied rewrites63.4%

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

                                      Alternative 5: 73.2% 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.035:\\ \;\;\;\;\mathsf{fma}\left(-0.16666666666666666, \sqrt{\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|} \cdot \left|x\right|, \left|x\right|\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\left|x\right| \cdot t\_0\\ \end{array} \end{array} \]
                                      (FPCore (x y)
                                        :precision binary64
                                        :pre TRUE
                                        (let* ((t_0 (/ (sinh y) y)))
                                        (*
                                         (copysign 1.0 x)
                                         (if (<= (* (sin (fabs x)) t_0) 0.035)
                                           (*
                                            (fma
                                             -0.16666666666666666
                                             (*
                                              (sqrt (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)))
                                              (fabs x))
                                             (fabs x))
                                            1.0)
                                           (* (fabs x) t_0)))))
                                      double code(double x, double y) {
                                      	double t_0 = sinh(y) / y;
                                      	double tmp;
                                      	if ((sin(fabs(x)) * t_0) <= 0.035) {
                                      		tmp = fma(-0.16666666666666666, (sqrt((((fabs(x) * fabs(x)) * fabs(x)) * fabs(x))) * fabs(x)), fabs(x)) * 1.0;
                                      	} else {
                                      		tmp = fabs(x) * t_0;
                                      	}
                                      	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.035)
                                      		tmp = Float64(fma(-0.16666666666666666, Float64(sqrt(Float64(Float64(Float64(abs(x) * abs(x)) * abs(x)) * abs(x))) * abs(x)), abs(x)) * 1.0);
                                      	else
                                      		tmp = Float64(abs(x) * t_0);
                                      	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.035], N[(N[(-0.16666666666666666 * N[(N[Sqrt[N[(N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] + N[Abs[x], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Abs[x], $MachinePrecision] * t$95$0), $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.035:\\
                                      \;\;\;\;\mathsf{fma}\left(-0.16666666666666666, \sqrt{\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|} \cdot \left|x\right|, \left|x\right|\right) \cdot 1\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\left|x\right| \cdot t\_0\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 0.035000000000000003

                                        1. Initial program 100.0%

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

                                          \[\leadsto \sin x \cdot 1 \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites50.4%

                                            \[\leadsto \sin x \cdot 1 \]
                                          2. Taylor expanded in x around 0

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

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

                                                \[\leadsto \mathsf{fma}\left(-0.16666666666666666, \left(x \cdot x\right) \cdot x, x\right) \cdot 1 \]
                                              2. Step-by-step derivation
                                                1. rem-square-sqrtN/A

                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{6}, \sqrt{\left(\left(\sqrt{x \cdot x} \cdot \sqrt{x \cdot x}\right) \cdot x\right) \cdot x} \cdot x, x\right) \cdot 1 \]
                                                2. sqrt-unprodN/A

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

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

                                                  \[\leadsto \mathsf{fma}\left(-0.16666666666666666, \sqrt{\left(\sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)} \cdot x\right) \cdot x} \cdot x, x\right) \cdot 1 \]
                                                5. lift-*.f64N/A

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

                                                  \[\leadsto \mathsf{fma}\left(\frac{-1}{6}, \sqrt{\left(\sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)} \cdot x\right) \cdot x} \cdot x, x\right) \cdot 1 \]
                                                7. associate-*r*N/A

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

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

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

                                                \[\leadsto \mathsf{fma}\left(-0.16666666666666666, \sqrt{\left(\left(x \cdot x\right) \cdot x\right) \cdot x} \cdot x, x\right) \cdot 1 \]

                                              if 0.035000000000000003 < (*.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 \frac{1}{2} \cdot \frac{x \cdot \left(e^{y} - \frac{1}{e^{y}}\right)}{y} \]
                                              3. Step-by-step derivation
                                                1. Applied rewrites40.7%

                                                  \[\leadsto 0.5 \cdot \frac{x \cdot \left(e^{y} - \frac{1}{e^{y}}\right)}{y} \]
                                                2. Step-by-step derivation
                                                  1. Applied rewrites63.4%

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

                                                Alternative 6: 72.3% 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.035:\\ \;\;\;\;\mathsf{fma}\left(-0.16666666666666666, \left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|, \left|x\right|\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\left|x\right| \cdot t\_0\\ \end{array} \end{array} \]
                                                (FPCore (x y)
                                                  :precision binary64
                                                  :pre TRUE
                                                  (let* ((t_0 (/ (sinh y) y)))
                                                  (*
                                                   (copysign 1.0 x)
                                                   (if (<= (* (sin (fabs x)) t_0) 0.035)
                                                     (*
                                                      (fma
                                                       -0.16666666666666666
                                                       (* (* (fabs x) (fabs x)) (fabs x))
                                                       (fabs x))
                                                      1.0)
                                                     (* (fabs x) t_0)))))
                                                double code(double x, double y) {
                                                	double t_0 = sinh(y) / y;
                                                	double tmp;
                                                	if ((sin(fabs(x)) * t_0) <= 0.035) {
                                                		tmp = fma(-0.16666666666666666, ((fabs(x) * fabs(x)) * fabs(x)), fabs(x)) * 1.0;
                                                	} else {
                                                		tmp = fabs(x) * t_0;
                                                	}
                                                	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.035)
                                                		tmp = Float64(fma(-0.16666666666666666, Float64(Float64(abs(x) * abs(x)) * abs(x)), abs(x)) * 1.0);
                                                	else
                                                		tmp = Float64(abs(x) * t_0);
                                                	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.035], N[(N[(-0.16666666666666666 * N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] + N[Abs[x], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Abs[x], $MachinePrecision] * t$95$0), $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.035:\\
                                                \;\;\;\;\mathsf{fma}\left(-0.16666666666666666, \left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|, \left|x\right|\right) \cdot 1\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;\left|x\right| \cdot t\_0\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 2 regimes
                                                2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 0.035000000000000003

                                                  1. Initial program 100.0%

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

                                                    \[\leadsto \sin x \cdot 1 \]
                                                  3. Step-by-step derivation
                                                    1. Applied rewrites50.4%

                                                      \[\leadsto \sin x \cdot 1 \]
                                                    2. Taylor expanded in x around 0

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

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

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

                                                        if 0.035000000000000003 < (*.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 \frac{1}{2} \cdot \frac{x \cdot \left(e^{y} - \frac{1}{e^{y}}\right)}{y} \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites40.7%

                                                            \[\leadsto 0.5 \cdot \frac{x \cdot \left(e^{y} - \frac{1}{e^{y}}\right)}{y} \]
                                                          2. Step-by-step derivation
                                                            1. Applied rewrites63.4%

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

                                                          Alternative 7: 64.2% accurate, 0.6× 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.035:\\ \;\;\;\;\mathsf{fma}\left(-0.16666666666666666, \left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|, \left|x\right|\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)} \cdot \left|x\right|, 0.16666666666666666, \left|x\right|\right)\\ \end{array} \]
                                                          (FPCore (x y)
                                                            :precision binary64
                                                            :pre TRUE
                                                            (*
                                                           (copysign 1.0 x)
                                                           (if (<= (* (sin (fabs x)) (/ (sinh y) y)) 0.035)
                                                             (*
                                                              (fma
                                                               -0.16666666666666666
                                                               (* (* (fabs x) (fabs x)) (fabs x))
                                                               (fabs x))
                                                              1.0)
                                                             (fma
                                                              (* (sqrt (* (* y y) (* y y))) (fabs x))
                                                              0.16666666666666666
                                                              (fabs x)))))
                                                          double code(double x, double y) {
                                                          	double tmp;
                                                          	if ((sin(fabs(x)) * (sinh(y) / y)) <= 0.035) {
                                                          		tmp = fma(-0.16666666666666666, ((fabs(x) * fabs(x)) * fabs(x)), fabs(x)) * 1.0;
                                                          	} else {
                                                          		tmp = fma((sqrt(((y * y) * (y * y))) * fabs(x)), 0.16666666666666666, fabs(x));
                                                          	}
                                                          	return copysign(1.0, x) * tmp;
                                                          }
                                                          
                                                          function code(x, y)
                                                          	tmp = 0.0
                                                          	if (Float64(sin(abs(x)) * Float64(sinh(y) / y)) <= 0.035)
                                                          		tmp = Float64(fma(-0.16666666666666666, Float64(Float64(abs(x) * abs(x)) * abs(x)), abs(x)) * 1.0);
                                                          	else
                                                          		tmp = fma(Float64(sqrt(Float64(Float64(y * y) * Float64(y * y))) * abs(x)), 0.16666666666666666, abs(x));
                                                          	end
                                                          	return Float64(copysign(1.0, x) * 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.035], N[(N[(-0.16666666666666666 * N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] + N[Abs[x], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(N[Sqrt[N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * 0.16666666666666666 + N[Abs[x], $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.035:\\
                                                          \;\;\;\;\mathsf{fma}\left(-0.16666666666666666, \left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|, \left|x\right|\right) \cdot 1\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;\mathsf{fma}\left(\sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)} \cdot \left|x\right|, 0.16666666666666666, \left|x\right|\right)\\
                                                          
                                                          
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 2 regimes
                                                          2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 0.035000000000000003

                                                            1. Initial program 100.0%

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

                                                              \[\leadsto \sin x \cdot 1 \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites50.4%

                                                                \[\leadsto \sin x \cdot 1 \]
                                                              2. Taylor expanded in x around 0

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

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

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

                                                                  if 0.035000000000000003 < (*.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 \frac{1}{2} \cdot \frac{x \cdot \left(e^{y} - \frac{1}{e^{y}}\right)}{y} \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites40.7%

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

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

                                                                        \[\leadsto x + 0.16666666666666666 \cdot \left(x \cdot {y}^{2}\right) \]
                                                                      2. Applied rewrites48.1%

                                                                        \[\leadsto \mathsf{fma}\left(\left(y \cdot y\right) \cdot x, 0.16666666666666666, x\right) \]
                                                                      3. Step-by-step derivation
                                                                        1. rem-square-sqrtN/A

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

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

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

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

                                                                        \[\leadsto \mathsf{fma}\left(\sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)} \cdot x, 0.16666666666666666, x\right) \]
                                                                    4. Recombined 2 regimes into one program.
                                                                    5. Add Preprocessing

                                                                    Alternative 8: 57.2% 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.035:\\ \;\;\;\;\mathsf{fma}\left(-0.16666666666666666, \left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|, \left|x\right|\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(y \cdot y\right) \cdot \left|x\right|, 0.16666666666666666, \left|x\right|\right)\\ \end{array} \]
                                                                    (FPCore (x y)
                                                                      :precision binary64
                                                                      :pre TRUE
                                                                      (*
                                                                     (copysign 1.0 x)
                                                                     (if (<= (* (sin (fabs x)) (/ (sinh y) y)) 0.035)
                                                                       (*
                                                                        (fma
                                                                         -0.16666666666666666
                                                                         (* (* (fabs x) (fabs x)) (fabs x))
                                                                         (fabs x))
                                                                        1.0)
                                                                       (fma (* (* y y) (fabs x)) 0.16666666666666666 (fabs x)))))
                                                                    double code(double x, double y) {
                                                                    	double tmp;
                                                                    	if ((sin(fabs(x)) * (sinh(y) / y)) <= 0.035) {
                                                                    		tmp = fma(-0.16666666666666666, ((fabs(x) * fabs(x)) * fabs(x)), fabs(x)) * 1.0;
                                                                    	} else {
                                                                    		tmp = fma(((y * y) * fabs(x)), 0.16666666666666666, fabs(x));
                                                                    	}
                                                                    	return copysign(1.0, x) * tmp;
                                                                    }
                                                                    
                                                                    function code(x, y)
                                                                    	tmp = 0.0
                                                                    	if (Float64(sin(abs(x)) * Float64(sinh(y) / y)) <= 0.035)
                                                                    		tmp = Float64(fma(-0.16666666666666666, Float64(Float64(abs(x) * abs(x)) * abs(x)), abs(x)) * 1.0);
                                                                    	else
                                                                    		tmp = fma(Float64(Float64(y * y) * abs(x)), 0.16666666666666666, abs(x));
                                                                    	end
                                                                    	return Float64(copysign(1.0, x) * 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.035], N[(N[(-0.16666666666666666 * N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] + N[Abs[x], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(N[(y * y), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * 0.16666666666666666 + N[Abs[x], $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.035:\\
                                                                    \;\;\;\;\mathsf{fma}\left(-0.16666666666666666, \left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|, \left|x\right|\right) \cdot 1\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;\mathsf{fma}\left(\left(y \cdot y\right) \cdot \left|x\right|, 0.16666666666666666, \left|x\right|\right)\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 2 regimes
                                                                    2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 0.035000000000000003

                                                                      1. Initial program 100.0%

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

                                                                        \[\leadsto \sin x \cdot 1 \]
                                                                      3. Step-by-step derivation
                                                                        1. Applied rewrites50.4%

                                                                          \[\leadsto \sin x \cdot 1 \]
                                                                        2. Taylor expanded in x around 0

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

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

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

                                                                            if 0.035000000000000003 < (*.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 \frac{1}{2} \cdot \frac{x \cdot \left(e^{y} - \frac{1}{e^{y}}\right)}{y} \]
                                                                            3. Step-by-step derivation
                                                                              1. Applied rewrites40.7%

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

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

                                                                                  \[\leadsto x + 0.16666666666666666 \cdot \left(x \cdot {y}^{2}\right) \]
                                                                                2. Applied rewrites48.1%

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

                                                                              Alternative 9: 57.2% 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.035:\\ \;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666 \cdot \left|x\right|, \left|x\right|, 1\right) \cdot \left|x\right|\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(y \cdot y\right) \cdot \left|x\right|, 0.16666666666666666, \left|x\right|\right)\\ \end{array} \]
                                                                              (FPCore (x y)
                                                                                :precision binary64
                                                                                :pre TRUE
                                                                                (*
                                                                               (copysign 1.0 x)
                                                                               (if (<= (* (sin (fabs x)) (/ (sinh y) y)) 0.035)
                                                                                 (*
                                                                                  (* (fma (* -0.16666666666666666 (fabs x)) (fabs x) 1.0) (fabs x))
                                                                                  1.0)
                                                                                 (fma (* (* y y) (fabs x)) 0.16666666666666666 (fabs x)))))
                                                                              double code(double x, double y) {
                                                                              	double tmp;
                                                                              	if ((sin(fabs(x)) * (sinh(y) / y)) <= 0.035) {
                                                                              		tmp = (fma((-0.16666666666666666 * fabs(x)), fabs(x), 1.0) * fabs(x)) * 1.0;
                                                                              	} else {
                                                                              		tmp = fma(((y * y) * fabs(x)), 0.16666666666666666, fabs(x));
                                                                              	}
                                                                              	return copysign(1.0, x) * tmp;
                                                                              }
                                                                              
                                                                              function code(x, y)
                                                                              	tmp = 0.0
                                                                              	if (Float64(sin(abs(x)) * Float64(sinh(y) / y)) <= 0.035)
                                                                              		tmp = Float64(Float64(fma(Float64(-0.16666666666666666 * abs(x)), abs(x), 1.0) * abs(x)) * 1.0);
                                                                              	else
                                                                              		tmp = fma(Float64(Float64(y * y) * abs(x)), 0.16666666666666666, abs(x));
                                                                              	end
                                                                              	return Float64(copysign(1.0, x) * 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.035], N[(N[(N[(N[(-0.16666666666666666 * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision] + 1.0), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(N[(y * y), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * 0.16666666666666666 + N[Abs[x], $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.035:\\
                                                                              \;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666 \cdot \left|x\right|, \left|x\right|, 1\right) \cdot \left|x\right|\right) \cdot 1\\
                                                                              
                                                                              \mathbf{else}:\\
                                                                              \;\;\;\;\mathsf{fma}\left(\left(y \cdot y\right) \cdot \left|x\right|, 0.16666666666666666, \left|x\right|\right)\\
                                                                              
                                                                              
                                                                              \end{array}
                                                                              
                                                                              Derivation
                                                                              1. Split input into 2 regimes
                                                                              2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 0.035000000000000003

                                                                                1. Initial program 100.0%

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

                                                                                  \[\leadsto \sin x \cdot 1 \]
                                                                                3. Step-by-step derivation
                                                                                  1. Applied rewrites50.4%

                                                                                    \[\leadsto \sin x \cdot 1 \]
                                                                                  2. Taylor expanded in x around 0

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

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

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

                                                                                      if 0.035000000000000003 < (*.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 \frac{1}{2} \cdot \frac{x \cdot \left(e^{y} - \frac{1}{e^{y}}\right)}{y} \]
                                                                                      3. Step-by-step derivation
                                                                                        1. Applied rewrites40.7%

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

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

                                                                                            \[\leadsto x + 0.16666666666666666 \cdot \left(x \cdot {y}^{2}\right) \]
                                                                                          2. Applied rewrites48.1%

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

                                                                                        Alternative 10: 48.1% accurate, 4.6× speedup?

                                                                                        \[\mathsf{fma}\left(\left(y \cdot y\right) \cdot x, 0.16666666666666666, x\right) \]
                                                                                        (FPCore (x y)
                                                                                          :precision binary64
                                                                                          :pre TRUE
                                                                                          (fma (* (* y y) x) 0.16666666666666666 x))
                                                                                        double code(double x, double y) {
                                                                                        	return fma(((y * y) * x), 0.16666666666666666, x);
                                                                                        }
                                                                                        
                                                                                        function code(x, y)
                                                                                        	return fma(Float64(Float64(y * y) * x), 0.16666666666666666, x)
                                                                                        end
                                                                                        
                                                                                        code[x_, y_] := N[(N[(N[(y * y), $MachinePrecision] * x), $MachinePrecision] * 0.16666666666666666 + x), $MachinePrecision]
                                                                                        
                                                                                        f(x, y):
                                                                                        	x in [-inf, +inf],
                                                                                        	y in [-inf, +inf]
                                                                                        code: THEORY
                                                                                        BEGIN
                                                                                        f(x, y: real): real =
                                                                                        	(((y * y) * x) * (1666666666666666574148081281236954964697360992431640625e-55)) + x
                                                                                        END code
                                                                                        \mathsf{fma}\left(\left(y \cdot y\right) \cdot x, 0.16666666666666666, x\right)
                                                                                        
                                                                                        Derivation
                                                                                        1. Initial program 100.0%

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

                                                                                          \[\leadsto \frac{1}{2} \cdot \frac{x \cdot \left(e^{y} - \frac{1}{e^{y}}\right)}{y} \]
                                                                                        3. Step-by-step derivation
                                                                                          1. Applied rewrites40.7%

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

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

                                                                                              \[\leadsto x + 0.16666666666666666 \cdot \left(x \cdot {y}^{2}\right) \]
                                                                                            2. Applied rewrites48.1%

                                                                                              \[\leadsto \mathsf{fma}\left(\left(y \cdot y\right) \cdot x, 0.16666666666666666, x\right) \]
                                                                                            3. Add Preprocessing

                                                                                            Alternative 11: 26.6% accurate, 7.9× speedup?

                                                                                            \[\left(x \cdot 1\right) \cdot 1 \]
                                                                                            (FPCore (x y)
                                                                                              :precision binary64
                                                                                              :pre TRUE
                                                                                              (* (* x 1.0) 1.0))
                                                                                            double code(double x, double y) {
                                                                                            	return (x * 1.0) * 1.0;
                                                                                            }
                                                                                            
                                                                                            real(8) function code(x, y)
                                                                                            use fmin_fmax_functions
                                                                                                real(8), intent (in) :: x
                                                                                                real(8), intent (in) :: y
                                                                                                code = (x * 1.0d0) * 1.0d0
                                                                                            end function
                                                                                            
                                                                                            public static double code(double x, double y) {
                                                                                            	return (x * 1.0) * 1.0;
                                                                                            }
                                                                                            
                                                                                            def code(x, y):
                                                                                            	return (x * 1.0) * 1.0
                                                                                            
                                                                                            function code(x, y)
                                                                                            	return Float64(Float64(x * 1.0) * 1.0)
                                                                                            end
                                                                                            
                                                                                            function tmp = code(x, y)
                                                                                            	tmp = (x * 1.0) * 1.0;
                                                                                            end
                                                                                            
                                                                                            code[x_, y_] := N[(N[(x * 1.0), $MachinePrecision] * 1.0), $MachinePrecision]
                                                                                            
                                                                                            f(x, y):
                                                                                            	x in [-inf, +inf],
                                                                                            	y in [-inf, +inf]
                                                                                            code: THEORY
                                                                                            BEGIN
                                                                                            f(x, y: real): real =
                                                                                            	(x * (1)) * (1)
                                                                                            END code
                                                                                            \left(x \cdot 1\right) \cdot 1
                                                                                            
                                                                                            Derivation
                                                                                            1. Initial program 100.0%

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

                                                                                              \[\leadsto \sin x \cdot 1 \]
                                                                                            3. Step-by-step derivation
                                                                                              1. Applied rewrites50.4%

                                                                                                \[\leadsto \sin x \cdot 1 \]
                                                                                              2. Taylor expanded in x around 0

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

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

                                                                                                  \[\leadsto \left(x \cdot 1\right) \cdot 1 \]
                                                                                                3. Step-by-step derivation
                                                                                                  1. Applied rewrites26.6%

                                                                                                    \[\leadsto \left(x \cdot 1\right) \cdot 1 \]
                                                                                                  2. Add Preprocessing

                                                                                                  Reproduce

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