math.cos on complex, imaginary part

Percentage Accurate: 65.5% → 99.9%
Time: 8.8s
Alternatives: 19
Speedup: 2.5×

Specification

?
\[\begin{array}{l} \\ \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \end{array} \]
(FPCore (re im)
 :precision binary64
 (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))
double code(double re, double im) {
	return (0.5 * sin(re)) * (exp(-im) - exp(im));
}
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(re, im)
use fmin_fmax_functions
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = (0.5d0 * sin(re)) * (exp(-im) - exp(im))
end function
public static double code(double re, double im) {
	return (0.5 * Math.sin(re)) * (Math.exp(-im) - Math.exp(im));
}
def code(re, im):
	return (0.5 * math.sin(re)) * (math.exp(-im) - math.exp(im))
function code(re, im)
	return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im)) - exp(im)))
end
function tmp = code(re, im)
	tmp = (0.5 * sin(re)) * (exp(-im) - exp(im));
end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)
\end{array}

Sampling outcomes in binary64 precision:

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 19 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: 65.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \end{array} \]
(FPCore (re im)
 :precision binary64
 (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))
double code(double re, double im) {
	return (0.5 * sin(re)) * (exp(-im) - exp(im));
}
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(re, im)
use fmin_fmax_functions
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = (0.5d0 * sin(re)) * (exp(-im) - exp(im))
end function
public static double code(double re, double im) {
	return (0.5 * Math.sin(re)) * (Math.exp(-im) - Math.exp(im));
}
def code(re, im):
	return (0.5 * math.sin(re)) * (math.exp(-im) - math.exp(im))
function code(re, im)
	return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im)) - exp(im)))
end
function tmp = code(re, im)
	tmp = (0.5 * sin(re)) * (exp(-im) - exp(im));
end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)
\end{array}

Alternative 1: 99.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \sinh \left(-im\right) \cdot \sin re \end{array} \]
(FPCore (re im) :precision binary64 (* (sinh (- im)) (sin re)))
double code(double re, double im) {
	return sinh(-im) * sin(re);
}
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(re, im)
use fmin_fmax_functions
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = sinh(-im) * sin(re)
end function
public static double code(double re, double im) {
	return Math.sinh(-im) * Math.sin(re);
}
def code(re, im):
	return math.sinh(-im) * math.sin(re)
function code(re, im)
	return Float64(sinh(Float64(-im)) * sin(re))
end
function tmp = code(re, im)
	tmp = sinh(-im) * sin(re);
end
code[re_, im_] := N[(N[Sinh[(-im)], $MachinePrecision] * N[Sin[re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\sinh \left(-im\right) \cdot \sin re
\end{array}
Derivation
  1. Initial program 64.1%

    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f64N/A

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

      \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \cdot \left(e^{-im} - e^{im}\right) \]
    3. associate-*l*N/A

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

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

      \[\leadsto \color{blue}{\left(\sin re \cdot \left(e^{-im} - e^{im}\right)\right) \cdot \frac{1}{2}} \]
  4. Applied rewrites99.9%

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

      \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right) \cdot \frac{1}{2}} \]
    2. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right)} \cdot \frac{1}{2} \]
    3. associate-*l*N/A

      \[\leadsto \color{blue}{\sin re \cdot \left(\left(2 \cdot \sinh \left(-im\right)\right) \cdot \frac{1}{2}\right)} \]
    4. lift-*.f64N/A

      \[\leadsto \sin re \cdot \left(\color{blue}{\left(2 \cdot \sinh \left(-im\right)\right)} \cdot \frac{1}{2}\right) \]
    5. *-commutativeN/A

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

      \[\leadsto \sin re \cdot \color{blue}{\left(\sinh \left(-im\right) \cdot \left(2 \cdot \frac{1}{2}\right)\right)} \]
    7. metadata-evalN/A

      \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{1}\right) \]
    8. metadata-evalN/A

      \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{\frac{2}{2}}\right) \]
    9. associate-/l*N/A

      \[\leadsto \sin re \cdot \color{blue}{\frac{\sinh \left(-im\right) \cdot 2}{2}} \]
    10. *-commutativeN/A

      \[\leadsto \sin re \cdot \frac{\color{blue}{2 \cdot \sinh \left(-im\right)}}{2} \]
    11. lift-sinh.f64N/A

      \[\leadsto \sin re \cdot \frac{2 \cdot \color{blue}{\sinh \left(-im\right)}}{2} \]
    12. sinh-undef-revN/A

      \[\leadsto \sin re \cdot \frac{\color{blue}{e^{-im} - e^{\mathsf{neg}\left(\left(-im\right)\right)}}}{2} \]
    13. sinh-defN/A

      \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
    14. lift-sinh.f64N/A

      \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
    15. *-commutativeN/A

      \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
    16. lower-*.f6499.9

      \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
  6. Applied rewrites99.9%

    \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
  7. Add Preprocessing

Alternative 2: 58.6% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\ \;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(-0.016666666666666666 \cdot \left(im \cdot im\right) - 0.3333333333333333, im \cdot im, -2\right) \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(0.004166666666666667 \cdot \left(re \cdot re\right) - 0.08333333333333333, re \cdot re, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0003968253968253968 \cdot \left(im \cdot im\right) - 0.016666666666666666, im \cdot im, -0.3333333333333333\right), im \cdot im, -2\right) \cdot im\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= (* 0.5 (sin re)) -0.01)
   (*
    (* (fma (* re re) -0.08333333333333333 0.5) re)
    (*
     (fma
      (- (* -0.016666666666666666 (* im im)) 0.3333333333333333)
      (* im im)
      -2.0)
     im))
   (*
    (*
     (fma
      (- (* 0.004166666666666667 (* re re)) 0.08333333333333333)
      (* re re)
      0.5)
     re)
    (*
     (fma
      (fma
       (- (* -0.0003968253968253968 (* im im)) 0.016666666666666666)
       (* im im)
       -0.3333333333333333)
      (* im im)
      -2.0)
     im))))
double code(double re, double im) {
	double tmp;
	if ((0.5 * sin(re)) <= -0.01) {
		tmp = (fma((re * re), -0.08333333333333333, 0.5) * re) * (fma(((-0.016666666666666666 * (im * im)) - 0.3333333333333333), (im * im), -2.0) * im);
	} else {
		tmp = (fma(((0.004166666666666667 * (re * re)) - 0.08333333333333333), (re * re), 0.5) * re) * (fma(fma(((-0.0003968253968253968 * (im * im)) - 0.016666666666666666), (im * im), -0.3333333333333333), (im * im), -2.0) * im);
	}
	return tmp;
}
function code(re, im)
	tmp = 0.0
	if (Float64(0.5 * sin(re)) <= -0.01)
		tmp = Float64(Float64(fma(Float64(re * re), -0.08333333333333333, 0.5) * re) * Float64(fma(Float64(Float64(-0.016666666666666666 * Float64(im * im)) - 0.3333333333333333), Float64(im * im), -2.0) * im));
	else
		tmp = Float64(Float64(fma(Float64(Float64(0.004166666666666667 * Float64(re * re)) - 0.08333333333333333), Float64(re * re), 0.5) * re) * Float64(fma(fma(Float64(Float64(-0.0003968253968253968 * Float64(im * im)) - 0.016666666666666666), Float64(im * im), -0.3333333333333333), Float64(im * im), -2.0) * im));
	end
	return tmp
end
code[re_, im_] := If[LessEqual[N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision], -0.01], N[(N[(N[(N[(re * re), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision] * re), $MachinePrecision] * N[(N[(N[(N[(-0.016666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] * N[(im * im), $MachinePrecision] + -2.0), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(0.004166666666666667 * N[(re * re), $MachinePrecision]), $MachinePrecision] - 0.08333333333333333), $MachinePrecision] * N[(re * re), $MachinePrecision] + 0.5), $MachinePrecision] * re), $MachinePrecision] * N[(N[(N[(N[(N[(-0.0003968253968253968 * N[(im * im), $MachinePrecision]), $MachinePrecision] - 0.016666666666666666), $MachinePrecision] * N[(im * im), $MachinePrecision] + -0.3333333333333333), $MachinePrecision] * N[(im * im), $MachinePrecision] + -2.0), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\
\;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(-0.016666666666666666 \cdot \left(im \cdot im\right) - 0.3333333333333333, im \cdot im, -2\right) \cdot im\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(0.004166666666666667 \cdot \left(re \cdot re\right) - 0.08333333333333333, re \cdot re, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0003968253968253968 \cdot \left(im \cdot im\right) - 0.016666666666666666, im \cdot im, -0.3333333333333333\right), im \cdot im, -2\right) \cdot im\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) < -0.0100000000000000002

    1. Initial program 55.1%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in im around 0

      \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) - 2\right)\right)} \]
    4. Step-by-step derivation
      1. Applied rewrites85.8%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(\mathsf{fma}\left(-0.016666666666666666 \cdot \left(im \cdot im\right) - 0.3333333333333333, im \cdot im, -2\right) \cdot im\right)} \]
      2. Taylor expanded in re around 0

        \[\leadsto \color{blue}{\left(re \cdot \left(\frac{1}{2} + \frac{-1}{12} \cdot {re}^{2}\right)\right)} \cdot \left(\mathsf{fma}\left(\frac{-1}{60} \cdot \left(im \cdot im\right) - \frac{1}{3}, im \cdot im, -2\right) \cdot im\right) \]
      3. Step-by-step derivation
        1. Applied rewrites25.2%

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

        if -0.0100000000000000002 < (*.f64 #s(literal 1/2 binary64) (sin.f64 re))

        1. Initial program 67.3%

          \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
        2. Add Preprocessing
        3. Taylor expanded in im around 0

          \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(\frac{-1}{3} \cdot {im}^{2} - 2\right)\right)} \]
        4. Step-by-step derivation
          1. Applied rewrites83.9%

            \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)} \]
          2. Taylor expanded in re around 0

            \[\leadsto \color{blue}{\left(re \cdot \left(\frac{1}{2} + {re}^{2} \cdot \left(\frac{1}{240} \cdot {re}^{2} - \frac{1}{12}\right)\right)\right)} \cdot \left(\mathsf{fma}\left(im \cdot im, \frac{-1}{3}, -2\right) \cdot im\right) \]
          3. Step-by-step derivation
            1. Applied rewrites60.6%

              \[\leadsto \color{blue}{\left(\mathsf{fma}\left(0.004166666666666667 \cdot \left(re \cdot re\right) - 0.08333333333333333, re \cdot re, 0.5\right) \cdot re\right)} \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right) \]
            2. Taylor expanded in im around 0

              \[\leadsto \left(\mathsf{fma}\left(\frac{1}{240} \cdot \left(re \cdot re\right) - \frac{1}{12}, re \cdot re, \frac{1}{2}\right) \cdot re\right) \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)\right)} \]
            3. Step-by-step derivation
              1. Applied rewrites66.2%

                \[\leadsto \left(\mathsf{fma}\left(0.004166666666666667 \cdot \left(re \cdot re\right) - 0.08333333333333333, re \cdot re, 0.5\right) \cdot re\right) \cdot \color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0003968253968253968 \cdot \left(im \cdot im\right) - 0.016666666666666666, im \cdot im, -0.3333333333333333\right), im \cdot im, -2\right) \cdot im\right)} \]
            4. Recombined 2 regimes into one program.
            5. Final simplification55.3%

              \[\leadsto \begin{array}{l} \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\ \;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(-0.016666666666666666 \cdot \left(im \cdot im\right) - 0.3333333333333333, im \cdot im, -2\right) \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(0.004166666666666667 \cdot \left(re \cdot re\right) - 0.08333333333333333, re \cdot re, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0003968253968253968 \cdot \left(im \cdot im\right) - 0.016666666666666666, im \cdot im, -0.3333333333333333\right), im \cdot im, -2\right) \cdot im\right)\\ \end{array} \]
            6. Add Preprocessing

            Alternative 3: 58.3% accurate, 2.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\ \;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(-0.016666666666666666 \cdot \left(im \cdot im\right) - 0.3333333333333333, im \cdot im, -2\right) \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0003968253968253968, im \cdot im, -0.016666666666666666\right), im \cdot im, -0.3333333333333333\right) \cdot im, im, -2\right) \cdot im\right)\right) \cdot 0.5\\ \end{array} \end{array} \]
            (FPCore (re im)
             :precision binary64
             (if (<= (* 0.5 (sin re)) -0.01)
               (*
                (* (fma (* re re) -0.08333333333333333 0.5) re)
                (*
                 (fma
                  (- (* -0.016666666666666666 (* im im)) 0.3333333333333333)
                  (* im im)
                  -2.0)
                 im))
               (*
                (*
                 re
                 (*
                  (fma
                   (*
                    (fma
                     (fma -0.0003968253968253968 (* im im) -0.016666666666666666)
                     (* im im)
                     -0.3333333333333333)
                    im)
                   im
                   -2.0)
                  im))
                0.5)))
            double code(double re, double im) {
            	double tmp;
            	if ((0.5 * sin(re)) <= -0.01) {
            		tmp = (fma((re * re), -0.08333333333333333, 0.5) * re) * (fma(((-0.016666666666666666 * (im * im)) - 0.3333333333333333), (im * im), -2.0) * im);
            	} else {
            		tmp = (re * (fma((fma(fma(-0.0003968253968253968, (im * im), -0.016666666666666666), (im * im), -0.3333333333333333) * im), im, -2.0) * im)) * 0.5;
            	}
            	return tmp;
            }
            
            function code(re, im)
            	tmp = 0.0
            	if (Float64(0.5 * sin(re)) <= -0.01)
            		tmp = Float64(Float64(fma(Float64(re * re), -0.08333333333333333, 0.5) * re) * Float64(fma(Float64(Float64(-0.016666666666666666 * Float64(im * im)) - 0.3333333333333333), Float64(im * im), -2.0) * im));
            	else
            		tmp = Float64(Float64(re * Float64(fma(Float64(fma(fma(-0.0003968253968253968, Float64(im * im), -0.016666666666666666), Float64(im * im), -0.3333333333333333) * im), im, -2.0) * im)) * 0.5);
            	end
            	return tmp
            end
            
            code[re_, im_] := If[LessEqual[N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision], -0.01], N[(N[(N[(N[(re * re), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision] * re), $MachinePrecision] * N[(N[(N[(N[(-0.016666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] * N[(im * im), $MachinePrecision] + -2.0), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(N[(N[(N[(N[(-0.0003968253968253968 * N[(im * im), $MachinePrecision] + -0.016666666666666666), $MachinePrecision] * N[(im * im), $MachinePrecision] + -0.3333333333333333), $MachinePrecision] * im), $MachinePrecision] * im + -2.0), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\
            \;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(-0.016666666666666666 \cdot \left(im \cdot im\right) - 0.3333333333333333, im \cdot im, -2\right) \cdot im\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(re \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0003968253968253968, im \cdot im, -0.016666666666666666\right), im \cdot im, -0.3333333333333333\right) \cdot im, im, -2\right) \cdot im\right)\right) \cdot 0.5\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) < -0.0100000000000000002

              1. Initial program 55.1%

                \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
              2. Add Preprocessing
              3. Taylor expanded in im around 0

                \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) - 2\right)\right)} \]
              4. Step-by-step derivation
                1. Applied rewrites85.8%

                  \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(\mathsf{fma}\left(-0.016666666666666666 \cdot \left(im \cdot im\right) - 0.3333333333333333, im \cdot im, -2\right) \cdot im\right)} \]
                2. Taylor expanded in re around 0

                  \[\leadsto \color{blue}{\left(re \cdot \left(\frac{1}{2} + \frac{-1}{12} \cdot {re}^{2}\right)\right)} \cdot \left(\mathsf{fma}\left(\frac{-1}{60} \cdot \left(im \cdot im\right) - \frac{1}{3}, im \cdot im, -2\right) \cdot im\right) \]
                3. Step-by-step derivation
                  1. Applied rewrites25.2%

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

                  if -0.0100000000000000002 < (*.f64 #s(literal 1/2 binary64) (sin.f64 re))

                  1. Initial program 67.3%

                    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. lift-*.f64N/A

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

                      \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \cdot \left(e^{-im} - e^{im}\right) \]
                    3. associate-*l*N/A

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

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

                      \[\leadsto \color{blue}{\left(\sin re \cdot \left(e^{-im} - e^{im}\right)\right) \cdot \frac{1}{2}} \]
                  4. Applied rewrites100.0%

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

                    \[\leadsto \left(\color{blue}{re} \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right) \cdot \frac{1}{2} \]
                  6. Step-by-step derivation
                    1. Applied rewrites70.1%

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

                      \[\leadsto \left(re \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)\right)}\right) \cdot \frac{1}{2} \]
                    3. Step-by-step derivation
                      1. Applied rewrites66.1%

                        \[\leadsto \left(re \cdot \color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0003968253968253968, im \cdot im, -0.016666666666666666\right), im \cdot im, -0.3333333333333333\right) \cdot im, im, -2\right) \cdot im\right)}\right) \cdot 0.5 \]
                    4. Recombined 2 regimes into one program.
                    5. Final simplification55.2%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\ \;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(-0.016666666666666666 \cdot \left(im \cdot im\right) - 0.3333333333333333, im \cdot im, -2\right) \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0003968253968253968, im \cdot im, -0.016666666666666666\right), im \cdot im, -0.3333333333333333\right) \cdot im, im, -2\right) \cdot im\right)\right) \cdot 0.5\\ \end{array} \]
                    6. Add Preprocessing

                    Alternative 4: 58.2% accurate, 2.0× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\ \;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0003968253968253968, im \cdot im, -0.016666666666666666\right), im \cdot im, -0.3333333333333333\right) \cdot im, im, -2\right) \cdot im\right)\right) \cdot 0.5\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (if (<= (* 0.5 (sin re)) -0.01)
                       (*
                        (* (fma (* re re) -0.08333333333333333 0.5) re)
                        (* (fma (* im im) -0.3333333333333333 -2.0) im))
                       (*
                        (*
                         re
                         (*
                          (fma
                           (*
                            (fma
                             (fma -0.0003968253968253968 (* im im) -0.016666666666666666)
                             (* im im)
                             -0.3333333333333333)
                            im)
                           im
                           -2.0)
                          im))
                        0.5)))
                    double code(double re, double im) {
                    	double tmp;
                    	if ((0.5 * sin(re)) <= -0.01) {
                    		tmp = (fma((re * re), -0.08333333333333333, 0.5) * re) * (fma((im * im), -0.3333333333333333, -2.0) * im);
                    	} else {
                    		tmp = (re * (fma((fma(fma(-0.0003968253968253968, (im * im), -0.016666666666666666), (im * im), -0.3333333333333333) * im), im, -2.0) * im)) * 0.5;
                    	}
                    	return tmp;
                    }
                    
                    function code(re, im)
                    	tmp = 0.0
                    	if (Float64(0.5 * sin(re)) <= -0.01)
                    		tmp = Float64(Float64(fma(Float64(re * re), -0.08333333333333333, 0.5) * re) * Float64(fma(Float64(im * im), -0.3333333333333333, -2.0) * im));
                    	else
                    		tmp = Float64(Float64(re * Float64(fma(Float64(fma(fma(-0.0003968253968253968, Float64(im * im), -0.016666666666666666), Float64(im * im), -0.3333333333333333) * im), im, -2.0) * im)) * 0.5);
                    	end
                    	return tmp
                    end
                    
                    code[re_, im_] := If[LessEqual[N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision], -0.01], N[(N[(N[(N[(re * re), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision] * re), $MachinePrecision] * N[(N[(N[(im * im), $MachinePrecision] * -0.3333333333333333 + -2.0), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(N[(N[(N[(N[(-0.0003968253968253968 * N[(im * im), $MachinePrecision] + -0.016666666666666666), $MachinePrecision] * N[(im * im), $MachinePrecision] + -0.3333333333333333), $MachinePrecision] * im), $MachinePrecision] * im + -2.0), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\
                    \;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(re \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0003968253968253968, im \cdot im, -0.016666666666666666\right), im \cdot im, -0.3333333333333333\right) \cdot im, im, -2\right) \cdot im\right)\right) \cdot 0.5\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) < -0.0100000000000000002

                      1. Initial program 55.1%

                        \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(\frac{-1}{3} \cdot {im}^{2} - 2\right)\right)} \]
                      4. Step-by-step derivation
                        1. Applied rewrites78.9%

                          \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)} \]
                        2. Taylor expanded in re around 0

                          \[\leadsto \color{blue}{\left(re \cdot \left(\frac{1}{2} + \frac{-1}{12} \cdot {re}^{2}\right)\right)} \cdot \left(\mathsf{fma}\left(im \cdot im, \frac{-1}{3}, -2\right) \cdot im\right) \]
                        3. Step-by-step derivation
                          1. Applied rewrites25.2%

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

                          if -0.0100000000000000002 < (*.f64 #s(literal 1/2 binary64) (sin.f64 re))

                          1. Initial program 67.3%

                            \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                          2. Add Preprocessing
                          3. Step-by-step derivation
                            1. lift-*.f64N/A

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

                              \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \cdot \left(e^{-im} - e^{im}\right) \]
                            3. associate-*l*N/A

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

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

                              \[\leadsto \color{blue}{\left(\sin re \cdot \left(e^{-im} - e^{im}\right)\right) \cdot \frac{1}{2}} \]
                          4. Applied rewrites100.0%

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

                            \[\leadsto \left(\color{blue}{re} \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right) \cdot \frac{1}{2} \]
                          6. Step-by-step derivation
                            1. Applied rewrites70.1%

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

                              \[\leadsto \left(re \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)\right)}\right) \cdot \frac{1}{2} \]
                            3. Step-by-step derivation
                              1. Applied rewrites66.1%

                                \[\leadsto \left(re \cdot \color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0003968253968253968, im \cdot im, -0.016666666666666666\right), im \cdot im, -0.3333333333333333\right) \cdot im, im, -2\right) \cdot im\right)}\right) \cdot 0.5 \]
                            4. Recombined 2 regimes into one program.
                            5. Final simplification55.2%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\ \;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0003968253968253968, im \cdot im, -0.016666666666666666\right), im \cdot im, -0.3333333333333333\right) \cdot im, im, -2\right) \cdot im\right)\right) \cdot 0.5\\ \end{array} \]
                            6. Add Preprocessing

                            Alternative 5: 79.3% accurate, 2.0× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 10^{-34}:\\ \;\;\;\;\sinh \left(-im\right) \cdot re\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(\left(-0.0001984126984126984 \cdot \left(im \cdot im\right) - 0.008333333333333333\right) \cdot im\right) \cdot im - 0.16666666666666666\right) \cdot im\right) \cdot im, im, -im\right) \cdot \sin re\\ \end{array} \end{array} \]
                            (FPCore (re im)
                             :precision binary64
                             (if (<= re 1e-34)
                               (* (sinh (- im)) re)
                               (*
                                (fma
                                 (*
                                  (*
                                   (-
                                    (*
                                     (* (- (* -0.0001984126984126984 (* im im)) 0.008333333333333333) im)
                                     im)
                                    0.16666666666666666)
                                   im)
                                  im)
                                 im
                                 (- im))
                                (sin re))))
                            double code(double re, double im) {
                            	double tmp;
                            	if (re <= 1e-34) {
                            		tmp = sinh(-im) * re;
                            	} else {
                            		tmp = fma((((((((-0.0001984126984126984 * (im * im)) - 0.008333333333333333) * im) * im) - 0.16666666666666666) * im) * im), im, -im) * sin(re);
                            	}
                            	return tmp;
                            }
                            
                            function code(re, im)
                            	tmp = 0.0
                            	if (re <= 1e-34)
                            		tmp = Float64(sinh(Float64(-im)) * re);
                            	else
                            		tmp = Float64(fma(Float64(Float64(Float64(Float64(Float64(Float64(Float64(-0.0001984126984126984 * Float64(im * im)) - 0.008333333333333333) * im) * im) - 0.16666666666666666) * im) * im), im, Float64(-im)) * sin(re));
                            	end
                            	return tmp
                            end
                            
                            code[re_, im_] := If[LessEqual[re, 1e-34], N[(N[Sinh[(-im)], $MachinePrecision] * re), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(N[(N[(-0.0001984126984126984 * N[(im * im), $MachinePrecision]), $MachinePrecision] - 0.008333333333333333), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision] - 0.16666666666666666), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision] * im + (-im)), $MachinePrecision] * N[Sin[re], $MachinePrecision]), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;re \leq 10^{-34}:\\
                            \;\;\;\;\sinh \left(-im\right) \cdot re\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\mathsf{fma}\left(\left(\left(\left(\left(-0.0001984126984126984 \cdot \left(im \cdot im\right) - 0.008333333333333333\right) \cdot im\right) \cdot im - 0.16666666666666666\right) \cdot im\right) \cdot im, im, -im\right) \cdot \sin re\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if re < 9.99999999999999928e-35

                              1. Initial program 67.5%

                                \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                              2. Add Preprocessing
                              3. Step-by-step derivation
                                1. lift-*.f64N/A

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

                                  \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \cdot \left(e^{-im} - e^{im}\right) \]
                                3. associate-*l*N/A

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

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

                                  \[\leadsto \color{blue}{\left(\sin re \cdot \left(e^{-im} - e^{im}\right)\right) \cdot \frac{1}{2}} \]
                              4. Applied rewrites99.9%

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

                                  \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right) \cdot \frac{1}{2}} \]
                                2. lift-*.f64N/A

                                  \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right)} \cdot \frac{1}{2} \]
                                3. associate-*l*N/A

                                  \[\leadsto \color{blue}{\sin re \cdot \left(\left(2 \cdot \sinh \left(-im\right)\right) \cdot \frac{1}{2}\right)} \]
                                4. lift-*.f64N/A

                                  \[\leadsto \sin re \cdot \left(\color{blue}{\left(2 \cdot \sinh \left(-im\right)\right)} \cdot \frac{1}{2}\right) \]
                                5. *-commutativeN/A

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

                                  \[\leadsto \sin re \cdot \color{blue}{\left(\sinh \left(-im\right) \cdot \left(2 \cdot \frac{1}{2}\right)\right)} \]
                                7. metadata-evalN/A

                                  \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{1}\right) \]
                                8. metadata-evalN/A

                                  \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{\frac{2}{2}}\right) \]
                                9. associate-/l*N/A

                                  \[\leadsto \sin re \cdot \color{blue}{\frac{\sinh \left(-im\right) \cdot 2}{2}} \]
                                10. *-commutativeN/A

                                  \[\leadsto \sin re \cdot \frac{\color{blue}{2 \cdot \sinh \left(-im\right)}}{2} \]
                                11. lift-sinh.f64N/A

                                  \[\leadsto \sin re \cdot \frac{2 \cdot \color{blue}{\sinh \left(-im\right)}}{2} \]
                                12. sinh-undef-revN/A

                                  \[\leadsto \sin re \cdot \frac{\color{blue}{e^{-im} - e^{\mathsf{neg}\left(\left(-im\right)\right)}}}{2} \]
                                13. sinh-defN/A

                                  \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                14. lift-sinh.f64N/A

                                  \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                15. *-commutativeN/A

                                  \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                16. lower-*.f6499.9

                                  \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                              6. Applied rewrites99.9%

                                \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                              7. Taylor expanded in re around 0

                                \[\leadsto \sinh \left(-im\right) \cdot \color{blue}{re} \]
                              8. Step-by-step derivation
                                1. Applied rewrites68.0%

                                  \[\leadsto \sinh \left(-im\right) \cdot \color{blue}{re} \]

                                if 9.99999999999999928e-35 < re

                                1. Initial program 55.2%

                                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                2. Add Preprocessing
                                3. Step-by-step derivation
                                  1. lift-*.f64N/A

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

                                    \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \cdot \left(e^{-im} - e^{im}\right) \]
                                  3. associate-*l*N/A

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

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

                                    \[\leadsto \color{blue}{\left(\sin re \cdot \left(e^{-im} - e^{im}\right)\right) \cdot \frac{1}{2}} \]
                                4. Applied rewrites99.9%

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

                                    \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right) \cdot \frac{1}{2}} \]
                                  2. lift-*.f64N/A

                                    \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right)} \cdot \frac{1}{2} \]
                                  3. associate-*l*N/A

                                    \[\leadsto \color{blue}{\sin re \cdot \left(\left(2 \cdot \sinh \left(-im\right)\right) \cdot \frac{1}{2}\right)} \]
                                  4. lift-*.f64N/A

                                    \[\leadsto \sin re \cdot \left(\color{blue}{\left(2 \cdot \sinh \left(-im\right)\right)} \cdot \frac{1}{2}\right) \]
                                  5. *-commutativeN/A

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

                                    \[\leadsto \sin re \cdot \color{blue}{\left(\sinh \left(-im\right) \cdot \left(2 \cdot \frac{1}{2}\right)\right)} \]
                                  7. metadata-evalN/A

                                    \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{1}\right) \]
                                  8. metadata-evalN/A

                                    \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{\frac{2}{2}}\right) \]
                                  9. associate-/l*N/A

                                    \[\leadsto \sin re \cdot \color{blue}{\frac{\sinh \left(-im\right) \cdot 2}{2}} \]
                                  10. *-commutativeN/A

                                    \[\leadsto \sin re \cdot \frac{\color{blue}{2 \cdot \sinh \left(-im\right)}}{2} \]
                                  11. lift-sinh.f64N/A

                                    \[\leadsto \sin re \cdot \frac{2 \cdot \color{blue}{\sinh \left(-im\right)}}{2} \]
                                  12. sinh-undef-revN/A

                                    \[\leadsto \sin re \cdot \frac{\color{blue}{e^{-im} - e^{\mathsf{neg}\left(\left(-im\right)\right)}}}{2} \]
                                  13. sinh-defN/A

                                    \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                  14. lift-sinh.f64N/A

                                    \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                  15. *-commutativeN/A

                                    \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                  16. lower-*.f6499.9

                                    \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                6. Applied rewrites99.9%

                                  \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                7. Taylor expanded in im around 0

                                  \[\leadsto \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{5040} \cdot {im}^{2} - \frac{1}{120}\right) - \frac{1}{6}\right) - 1\right)\right)} \cdot \sin re \]
                                8. Step-by-step derivation
                                  1. Applied rewrites94.5%

                                    \[\leadsto \color{blue}{\left(\mathsf{fma}\left(\left(\left(\left(im \cdot im\right) \cdot -0.0001984126984126984 - 0.008333333333333333\right) \cdot im\right) \cdot im - 0.16666666666666666, im \cdot im, -1\right) \cdot im\right)} \cdot \sin re \]
                                  2. Step-by-step derivation
                                    1. Applied rewrites94.5%

                                      \[\leadsto \mathsf{fma}\left(\left(\left(\left(\left(-0.0001984126984126984 \cdot \left(im \cdot im\right) - 0.008333333333333333\right) \cdot im\right) \cdot im - 0.16666666666666666\right) \cdot im\right) \cdot im, \color{blue}{im}, -1 \cdot im\right) \cdot \sin re \]
                                  3. Recombined 2 regimes into one program.
                                  4. Final simplification75.4%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 10^{-34}:\\ \;\;\;\;\sinh \left(-im\right) \cdot re\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(\left(-0.0001984126984126984 \cdot \left(im \cdot im\right) - 0.008333333333333333\right) \cdot im\right) \cdot im - 0.16666666666666666\right) \cdot im\right) \cdot im, im, -im\right) \cdot \sin re\\ \end{array} \]
                                  5. Add Preprocessing

                                  Alternative 6: 79.3% accurate, 2.1× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 10^{-34}:\\ \;\;\;\;\sinh \left(-im\right) \cdot re\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, -0.0001984126984126984, -0.008333333333333333\right), im \cdot im, -0.16666666666666666\right), -1\right) \cdot im\right) \cdot \sin re\\ \end{array} \end{array} \]
                                  (FPCore (re im)
                                   :precision binary64
                                   (if (<= re 1e-34)
                                     (* (sinh (- im)) re)
                                     (*
                                      (*
                                       (fma
                                        (* im im)
                                        (fma
                                         (fma (* im im) -0.0001984126984126984 -0.008333333333333333)
                                         (* im im)
                                         -0.16666666666666666)
                                        -1.0)
                                       im)
                                      (sin re))))
                                  double code(double re, double im) {
                                  	double tmp;
                                  	if (re <= 1e-34) {
                                  		tmp = sinh(-im) * re;
                                  	} else {
                                  		tmp = (fma((im * im), fma(fma((im * im), -0.0001984126984126984, -0.008333333333333333), (im * im), -0.16666666666666666), -1.0) * im) * sin(re);
                                  	}
                                  	return tmp;
                                  }
                                  
                                  function code(re, im)
                                  	tmp = 0.0
                                  	if (re <= 1e-34)
                                  		tmp = Float64(sinh(Float64(-im)) * re);
                                  	else
                                  		tmp = Float64(Float64(fma(Float64(im * im), fma(fma(Float64(im * im), -0.0001984126984126984, -0.008333333333333333), Float64(im * im), -0.16666666666666666), -1.0) * im) * sin(re));
                                  	end
                                  	return tmp
                                  end
                                  
                                  code[re_, im_] := If[LessEqual[re, 1e-34], N[(N[Sinh[(-im)], $MachinePrecision] * re), $MachinePrecision], N[(N[(N[(N[(im * im), $MachinePrecision] * N[(N[(N[(im * im), $MachinePrecision] * -0.0001984126984126984 + -0.008333333333333333), $MachinePrecision] * N[(im * im), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + -1.0), $MachinePrecision] * im), $MachinePrecision] * N[Sin[re], $MachinePrecision]), $MachinePrecision]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;re \leq 10^{-34}:\\
                                  \;\;\;\;\sinh \left(-im\right) \cdot re\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\left(\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, -0.0001984126984126984, -0.008333333333333333\right), im \cdot im, -0.16666666666666666\right), -1\right) \cdot im\right) \cdot \sin re\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if re < 9.99999999999999928e-35

                                    1. Initial program 67.5%

                                      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                    2. Add Preprocessing
                                    3. Step-by-step derivation
                                      1. lift-*.f64N/A

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

                                        \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \cdot \left(e^{-im} - e^{im}\right) \]
                                      3. associate-*l*N/A

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

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

                                        \[\leadsto \color{blue}{\left(\sin re \cdot \left(e^{-im} - e^{im}\right)\right) \cdot \frac{1}{2}} \]
                                    4. Applied rewrites99.9%

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

                                        \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right) \cdot \frac{1}{2}} \]
                                      2. lift-*.f64N/A

                                        \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right)} \cdot \frac{1}{2} \]
                                      3. associate-*l*N/A

                                        \[\leadsto \color{blue}{\sin re \cdot \left(\left(2 \cdot \sinh \left(-im\right)\right) \cdot \frac{1}{2}\right)} \]
                                      4. lift-*.f64N/A

                                        \[\leadsto \sin re \cdot \left(\color{blue}{\left(2 \cdot \sinh \left(-im\right)\right)} \cdot \frac{1}{2}\right) \]
                                      5. *-commutativeN/A

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

                                        \[\leadsto \sin re \cdot \color{blue}{\left(\sinh \left(-im\right) \cdot \left(2 \cdot \frac{1}{2}\right)\right)} \]
                                      7. metadata-evalN/A

                                        \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{1}\right) \]
                                      8. metadata-evalN/A

                                        \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{\frac{2}{2}}\right) \]
                                      9. associate-/l*N/A

                                        \[\leadsto \sin re \cdot \color{blue}{\frac{\sinh \left(-im\right) \cdot 2}{2}} \]
                                      10. *-commutativeN/A

                                        \[\leadsto \sin re \cdot \frac{\color{blue}{2 \cdot \sinh \left(-im\right)}}{2} \]
                                      11. lift-sinh.f64N/A

                                        \[\leadsto \sin re \cdot \frac{2 \cdot \color{blue}{\sinh \left(-im\right)}}{2} \]
                                      12. sinh-undef-revN/A

                                        \[\leadsto \sin re \cdot \frac{\color{blue}{e^{-im} - e^{\mathsf{neg}\left(\left(-im\right)\right)}}}{2} \]
                                      13. sinh-defN/A

                                        \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                      14. lift-sinh.f64N/A

                                        \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                      15. *-commutativeN/A

                                        \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                      16. lower-*.f6499.9

                                        \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                    6. Applied rewrites99.9%

                                      \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                    7. Taylor expanded in re around 0

                                      \[\leadsto \sinh \left(-im\right) \cdot \color{blue}{re} \]
                                    8. Step-by-step derivation
                                      1. Applied rewrites68.0%

                                        \[\leadsto \sinh \left(-im\right) \cdot \color{blue}{re} \]

                                      if 9.99999999999999928e-35 < re

                                      1. Initial program 55.2%

                                        \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                      2. Add Preprocessing
                                      3. Step-by-step derivation
                                        1. lift-*.f64N/A

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

                                          \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \cdot \left(e^{-im} - e^{im}\right) \]
                                        3. associate-*l*N/A

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

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

                                          \[\leadsto \color{blue}{\left(\sin re \cdot \left(e^{-im} - e^{im}\right)\right) \cdot \frac{1}{2}} \]
                                      4. Applied rewrites99.9%

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

                                          \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right) \cdot \frac{1}{2}} \]
                                        2. lift-*.f64N/A

                                          \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right)} \cdot \frac{1}{2} \]
                                        3. associate-*l*N/A

                                          \[\leadsto \color{blue}{\sin re \cdot \left(\left(2 \cdot \sinh \left(-im\right)\right) \cdot \frac{1}{2}\right)} \]
                                        4. lift-*.f64N/A

                                          \[\leadsto \sin re \cdot \left(\color{blue}{\left(2 \cdot \sinh \left(-im\right)\right)} \cdot \frac{1}{2}\right) \]
                                        5. *-commutativeN/A

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

                                          \[\leadsto \sin re \cdot \color{blue}{\left(\sinh \left(-im\right) \cdot \left(2 \cdot \frac{1}{2}\right)\right)} \]
                                        7. metadata-evalN/A

                                          \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{1}\right) \]
                                        8. metadata-evalN/A

                                          \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{\frac{2}{2}}\right) \]
                                        9. associate-/l*N/A

                                          \[\leadsto \sin re \cdot \color{blue}{\frac{\sinh \left(-im\right) \cdot 2}{2}} \]
                                        10. *-commutativeN/A

                                          \[\leadsto \sin re \cdot \frac{\color{blue}{2 \cdot \sinh \left(-im\right)}}{2} \]
                                        11. lift-sinh.f64N/A

                                          \[\leadsto \sin re \cdot \frac{2 \cdot \color{blue}{\sinh \left(-im\right)}}{2} \]
                                        12. sinh-undef-revN/A

                                          \[\leadsto \sin re \cdot \frac{\color{blue}{e^{-im} - e^{\mathsf{neg}\left(\left(-im\right)\right)}}}{2} \]
                                        13. sinh-defN/A

                                          \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                        14. lift-sinh.f64N/A

                                          \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                        15. *-commutativeN/A

                                          \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                        16. lower-*.f6499.9

                                          \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                      6. Applied rewrites99.9%

                                        \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                      7. Taylor expanded in im around 0

                                        \[\leadsto \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{5040} \cdot {im}^{2} - \frac{1}{120}\right) - \frac{1}{6}\right) - 1\right)\right)} \cdot \sin re \]
                                      8. Step-by-step derivation
                                        1. Applied rewrites94.5%

                                          \[\leadsto \color{blue}{\left(\mathsf{fma}\left(\left(\left(\left(im \cdot im\right) \cdot -0.0001984126984126984 - 0.008333333333333333\right) \cdot im\right) \cdot im - 0.16666666666666666, im \cdot im, -1\right) \cdot im\right)} \cdot \sin re \]
                                        2. Taylor expanded in im around 0

                                          \[\leadsto \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{5040} \cdot {im}^{2} - \frac{1}{120}\right) - \frac{1}{6}\right) - 1\right)\right)} \cdot \sin re \]
                                        3. Applied rewrites94.5%

                                          \[\leadsto \color{blue}{\left(\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, -0.0001984126984126984, -0.008333333333333333\right), im \cdot im, -0.16666666666666666\right), -1\right) \cdot im\right)} \cdot \sin re \]
                                      9. Recombined 2 regimes into one program.
                                      10. Add Preprocessing

                                      Alternative 7: 56.5% accurate, 2.1× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\ \;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(\mathsf{fma}\left(-0.016666666666666666 \cdot \left(im \cdot im\right), im \cdot im, -2\right) \cdot im\right)\right) \cdot 0.5\\ \end{array} \end{array} \]
                                      (FPCore (re im)
                                       :precision binary64
                                       (if (<= (* 0.5 (sin re)) -0.01)
                                         (*
                                          (* (fma (* re re) -0.08333333333333333 0.5) re)
                                          (* (fma (* im im) -0.3333333333333333 -2.0) im))
                                         (*
                                          (* re (* (fma (* -0.016666666666666666 (* im im)) (* im im) -2.0) im))
                                          0.5)))
                                      double code(double re, double im) {
                                      	double tmp;
                                      	if ((0.5 * sin(re)) <= -0.01) {
                                      		tmp = (fma((re * re), -0.08333333333333333, 0.5) * re) * (fma((im * im), -0.3333333333333333, -2.0) * im);
                                      	} else {
                                      		tmp = (re * (fma((-0.016666666666666666 * (im * im)), (im * im), -2.0) * im)) * 0.5;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      function code(re, im)
                                      	tmp = 0.0
                                      	if (Float64(0.5 * sin(re)) <= -0.01)
                                      		tmp = Float64(Float64(fma(Float64(re * re), -0.08333333333333333, 0.5) * re) * Float64(fma(Float64(im * im), -0.3333333333333333, -2.0) * im));
                                      	else
                                      		tmp = Float64(Float64(re * Float64(fma(Float64(-0.016666666666666666 * Float64(im * im)), Float64(im * im), -2.0) * im)) * 0.5);
                                      	end
                                      	return tmp
                                      end
                                      
                                      code[re_, im_] := If[LessEqual[N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision], -0.01], N[(N[(N[(N[(re * re), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision] * re), $MachinePrecision] * N[(N[(N[(im * im), $MachinePrecision] * -0.3333333333333333 + -2.0), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(N[(N[(-0.016666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(im * im), $MachinePrecision] + -2.0), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\
                                      \;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\left(re \cdot \left(\mathsf{fma}\left(-0.016666666666666666 \cdot \left(im \cdot im\right), im \cdot im, -2\right) \cdot im\right)\right) \cdot 0.5\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) < -0.0100000000000000002

                                        1. Initial program 55.1%

                                          \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                        2. Add Preprocessing
                                        3. Taylor expanded in im around 0

                                          \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(\frac{-1}{3} \cdot {im}^{2} - 2\right)\right)} \]
                                        4. Step-by-step derivation
                                          1. Applied rewrites78.9%

                                            \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)} \]
                                          2. Taylor expanded in re around 0

                                            \[\leadsto \color{blue}{\left(re \cdot \left(\frac{1}{2} + \frac{-1}{12} \cdot {re}^{2}\right)\right)} \cdot \left(\mathsf{fma}\left(im \cdot im, \frac{-1}{3}, -2\right) \cdot im\right) \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites25.2%

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

                                            if -0.0100000000000000002 < (*.f64 #s(literal 1/2 binary64) (sin.f64 re))

                                            1. Initial program 67.3%

                                              \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                            2. Add Preprocessing
                                            3. Step-by-step derivation
                                              1. lift-*.f64N/A

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

                                                \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \cdot \left(e^{-im} - e^{im}\right) \]
                                              3. associate-*l*N/A

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

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

                                                \[\leadsto \color{blue}{\left(\sin re \cdot \left(e^{-im} - e^{im}\right)\right) \cdot \frac{1}{2}} \]
                                            4. Applied rewrites100.0%

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

                                              \[\leadsto \left(\color{blue}{re} \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right) \cdot \frac{1}{2} \]
                                            6. Step-by-step derivation
                                              1. Applied rewrites70.1%

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

                                                \[\leadsto \left(re \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) - 2\right)\right)}\right) \cdot \frac{1}{2} \]
                                              3. Step-by-step derivation
                                                1. Applied rewrites64.5%

                                                  \[\leadsto \left(re \cdot \color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.016666666666666666, im \cdot im, -0.3333333333333333\right), im \cdot im, -2\right) \cdot im\right)}\right) \cdot 0.5 \]
                                                2. Taylor expanded in im around inf

                                                  \[\leadsto \left(re \cdot \left(\mathsf{fma}\left(\frac{-1}{60} \cdot {im}^{2}, im \cdot im, -2\right) \cdot im\right)\right) \cdot \frac{1}{2} \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites64.5%

                                                    \[\leadsto \left(re \cdot \left(\mathsf{fma}\left(-0.016666666666666666 \cdot \left(im \cdot im\right), im \cdot im, -2\right) \cdot im\right)\right) \cdot 0.5 \]
                                                4. Recombined 2 regimes into one program.
                                                5. Final simplification54.1%

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\ \;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(\mathsf{fma}\left(-0.016666666666666666 \cdot \left(im \cdot im\right), im \cdot im, -2\right) \cdot im\right)\right) \cdot 0.5\\ \end{array} \]
                                                6. Add Preprocessing

                                                Alternative 8: 55.8% accurate, 2.1× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\ \;\;\;\;\mathsf{fma}\left(\left(im \cdot re\right) \cdot re, 0.16666666666666666, -im\right) \cdot re\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(\mathsf{fma}\left(-0.016666666666666666 \cdot \left(im \cdot im\right), im \cdot im, -2\right) \cdot im\right)\right) \cdot 0.5\\ \end{array} \end{array} \]
                                                (FPCore (re im)
                                                 :precision binary64
                                                 (if (<= (* 0.5 (sin re)) -0.01)
                                                   (* (fma (* (* im re) re) 0.16666666666666666 (- im)) re)
                                                   (*
                                                    (* re (* (fma (* -0.016666666666666666 (* im im)) (* im im) -2.0) im))
                                                    0.5)))
                                                double code(double re, double im) {
                                                	double tmp;
                                                	if ((0.5 * sin(re)) <= -0.01) {
                                                		tmp = fma(((im * re) * re), 0.16666666666666666, -im) * re;
                                                	} else {
                                                		tmp = (re * (fma((-0.016666666666666666 * (im * im)), (im * im), -2.0) * im)) * 0.5;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                function code(re, im)
                                                	tmp = 0.0
                                                	if (Float64(0.5 * sin(re)) <= -0.01)
                                                		tmp = Float64(fma(Float64(Float64(im * re) * re), 0.16666666666666666, Float64(-im)) * re);
                                                	else
                                                		tmp = Float64(Float64(re * Float64(fma(Float64(-0.016666666666666666 * Float64(im * im)), Float64(im * im), -2.0) * im)) * 0.5);
                                                	end
                                                	return tmp
                                                end
                                                
                                                code[re_, im_] := If[LessEqual[N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision], -0.01], N[(N[(N[(N[(im * re), $MachinePrecision] * re), $MachinePrecision] * 0.16666666666666666 + (-im)), $MachinePrecision] * re), $MachinePrecision], N[(N[(re * N[(N[(N[(-0.016666666666666666 * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(im * im), $MachinePrecision] + -2.0), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\
                                                \;\;\;\;\mathsf{fma}\left(\left(im \cdot re\right) \cdot re, 0.16666666666666666, -im\right) \cdot re\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;\left(re \cdot \left(\mathsf{fma}\left(-0.016666666666666666 \cdot \left(im \cdot im\right), im \cdot im, -2\right) \cdot im\right)\right) \cdot 0.5\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 2 regimes
                                                2. if (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) < -0.0100000000000000002

                                                  1. Initial program 55.1%

                                                    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                  2. Add Preprocessing
                                                  3. Taylor expanded in im around 0

                                                    \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
                                                  4. Step-by-step derivation
                                                    1. Applied rewrites50.6%

                                                      \[\leadsto \color{blue}{\left(-\sin re\right) \cdot im} \]
                                                    2. Taylor expanded in re around 0

                                                      \[\leadsto re \cdot \color{blue}{\left(-1 \cdot im + \frac{1}{6} \cdot \left(im \cdot {re}^{2}\right)\right)} \]
                                                    3. Step-by-step derivation
                                                      1. Applied rewrites23.8%

                                                        \[\leadsto \mathsf{fma}\left(\left(im \cdot re\right) \cdot re, 0.16666666666666666, -im\right) \cdot \color{blue}{re} \]

                                                      if -0.0100000000000000002 < (*.f64 #s(literal 1/2 binary64) (sin.f64 re))

                                                      1. Initial program 67.3%

                                                        \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                      2. Add Preprocessing
                                                      3. Step-by-step derivation
                                                        1. lift-*.f64N/A

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

                                                          \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \cdot \left(e^{-im} - e^{im}\right) \]
                                                        3. associate-*l*N/A

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

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

                                                          \[\leadsto \color{blue}{\left(\sin re \cdot \left(e^{-im} - e^{im}\right)\right) \cdot \frac{1}{2}} \]
                                                      4. Applied rewrites100.0%

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

                                                        \[\leadsto \left(\color{blue}{re} \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right) \cdot \frac{1}{2} \]
                                                      6. Step-by-step derivation
                                                        1. Applied rewrites70.1%

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

                                                          \[\leadsto \left(re \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) - 2\right)\right)}\right) \cdot \frac{1}{2} \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites64.5%

                                                            \[\leadsto \left(re \cdot \color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.016666666666666666, im \cdot im, -0.3333333333333333\right), im \cdot im, -2\right) \cdot im\right)}\right) \cdot 0.5 \]
                                                          2. Taylor expanded in im around inf

                                                            \[\leadsto \left(re \cdot \left(\mathsf{fma}\left(\frac{-1}{60} \cdot {im}^{2}, im \cdot im, -2\right) \cdot im\right)\right) \cdot \frac{1}{2} \]
                                                          3. Step-by-step derivation
                                                            1. Applied rewrites64.5%

                                                              \[\leadsto \left(re \cdot \left(\mathsf{fma}\left(-0.016666666666666666 \cdot \left(im \cdot im\right), im \cdot im, -2\right) \cdot im\right)\right) \cdot 0.5 \]
                                                          4. Recombined 2 regimes into one program.
                                                          5. Add Preprocessing

                                                          Alternative 9: 95.4% accurate, 2.2× speedup?

                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq -3.2 \cdot 10^{+103} \lor \neg \left(im \leq -0.235 \lor \neg \left(im \leq 0.075 \lor \neg \left(im \leq 1.05 \cdot 10^{+103}\right)\right)\right):\\ \;\;\;\;\left(\mathsf{fma}\left(im \cdot im, -0.16666666666666666, -1\right) \cdot im\right) \cdot \sin re\\ \mathbf{else}:\\ \;\;\;\;\sinh \left(-im\right) \cdot re\\ \end{array} \end{array} \]
                                                          (FPCore (re im)
                                                           :precision binary64
                                                           (if (or (<= im -3.2e+103)
                                                                   (not
                                                                    (or (<= im -0.235)
                                                                        (not (or (<= im 0.075) (not (<= im 1.05e+103)))))))
                                                             (* (* (fma (* im im) -0.16666666666666666 -1.0) im) (sin re))
                                                             (* (sinh (- im)) re)))
                                                          double code(double re, double im) {
                                                          	double tmp;
                                                          	if ((im <= -3.2e+103) || !((im <= -0.235) || !((im <= 0.075) || !(im <= 1.05e+103)))) {
                                                          		tmp = (fma((im * im), -0.16666666666666666, -1.0) * im) * sin(re);
                                                          	} else {
                                                          		tmp = sinh(-im) * re;
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          function code(re, im)
                                                          	tmp = 0.0
                                                          	if ((im <= -3.2e+103) || !((im <= -0.235) || !((im <= 0.075) || !(im <= 1.05e+103))))
                                                          		tmp = Float64(Float64(fma(Float64(im * im), -0.16666666666666666, -1.0) * im) * sin(re));
                                                          	else
                                                          		tmp = Float64(sinh(Float64(-im)) * re);
                                                          	end
                                                          	return tmp
                                                          end
                                                          
                                                          code[re_, im_] := If[Or[LessEqual[im, -3.2e+103], N[Not[Or[LessEqual[im, -0.235], N[Not[Or[LessEqual[im, 0.075], N[Not[LessEqual[im, 1.05e+103]], $MachinePrecision]]], $MachinePrecision]]], $MachinePrecision]], N[(N[(N[(N[(im * im), $MachinePrecision] * -0.16666666666666666 + -1.0), $MachinePrecision] * im), $MachinePrecision] * N[Sin[re], $MachinePrecision]), $MachinePrecision], N[(N[Sinh[(-im)], $MachinePrecision] * re), $MachinePrecision]]
                                                          
                                                          \begin{array}{l}
                                                          
                                                          \\
                                                          \begin{array}{l}
                                                          \mathbf{if}\;im \leq -3.2 \cdot 10^{+103} \lor \neg \left(im \leq -0.235 \lor \neg \left(im \leq 0.075 \lor \neg \left(im \leq 1.05 \cdot 10^{+103}\right)\right)\right):\\
                                                          \;\;\;\;\left(\mathsf{fma}\left(im \cdot im, -0.16666666666666666, -1\right) \cdot im\right) \cdot \sin re\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;\sinh \left(-im\right) \cdot re\\
                                                          
                                                          
                                                          \end{array}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 2 regimes
                                                          2. if im < -3.19999999999999993e103 or -0.23499999999999999 < im < 0.0749999999999999972 or 1.0500000000000001e103 < im

                                                            1. Initial program 56.0%

                                                              \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                            2. Add Preprocessing
                                                            3. Step-by-step derivation
                                                              1. lift-*.f64N/A

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

                                                                \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \cdot \left(e^{-im} - e^{im}\right) \]
                                                              3. associate-*l*N/A

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

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

                                                                \[\leadsto \color{blue}{\left(\sin re \cdot \left(e^{-im} - e^{im}\right)\right) \cdot \frac{1}{2}} \]
                                                            4. Applied rewrites99.9%

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

                                                                \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right) \cdot \frac{1}{2}} \]
                                                              2. lift-*.f64N/A

                                                                \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right)} \cdot \frac{1}{2} \]
                                                              3. associate-*l*N/A

                                                                \[\leadsto \color{blue}{\sin re \cdot \left(\left(2 \cdot \sinh \left(-im\right)\right) \cdot \frac{1}{2}\right)} \]
                                                              4. lift-*.f64N/A

                                                                \[\leadsto \sin re \cdot \left(\color{blue}{\left(2 \cdot \sinh \left(-im\right)\right)} \cdot \frac{1}{2}\right) \]
                                                              5. *-commutativeN/A

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

                                                                \[\leadsto \sin re \cdot \color{blue}{\left(\sinh \left(-im\right) \cdot \left(2 \cdot \frac{1}{2}\right)\right)} \]
                                                              7. metadata-evalN/A

                                                                \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{1}\right) \]
                                                              8. metadata-evalN/A

                                                                \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{\frac{2}{2}}\right) \]
                                                              9. associate-/l*N/A

                                                                \[\leadsto \sin re \cdot \color{blue}{\frac{\sinh \left(-im\right) \cdot 2}{2}} \]
                                                              10. *-commutativeN/A

                                                                \[\leadsto \sin re \cdot \frac{\color{blue}{2 \cdot \sinh \left(-im\right)}}{2} \]
                                                              11. lift-sinh.f64N/A

                                                                \[\leadsto \sin re \cdot \frac{2 \cdot \color{blue}{\sinh \left(-im\right)}}{2} \]
                                                              12. sinh-undef-revN/A

                                                                \[\leadsto \sin re \cdot \frac{\color{blue}{e^{-im} - e^{\mathsf{neg}\left(\left(-im\right)\right)}}}{2} \]
                                                              13. sinh-defN/A

                                                                \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                                              14. lift-sinh.f64N/A

                                                                \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                                              15. *-commutativeN/A

                                                                \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                              16. lower-*.f6499.9

                                                                \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                            6. Applied rewrites99.9%

                                                              \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                            7. Taylor expanded in im around 0

                                                              \[\leadsto \color{blue}{\left(im \cdot \left(\frac{-1}{6} \cdot {im}^{2} - 1\right)\right)} \cdot \sin re \]
                                                            8. Step-by-step derivation
                                                              1. Applied rewrites99.6%

                                                                \[\leadsto \color{blue}{\left(\mathsf{fma}\left(im \cdot im, -0.16666666666666666, -1\right) \cdot im\right)} \cdot \sin re \]

                                                              if -3.19999999999999993e103 < im < -0.23499999999999999 or 0.0749999999999999972 < im < 1.0500000000000001e103

                                                              1. Initial program 100.0%

                                                                \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                              2. Add Preprocessing
                                                              3. Step-by-step derivation
                                                                1. lift-*.f64N/A

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

                                                                  \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \cdot \left(e^{-im} - e^{im}\right) \]
                                                                3. associate-*l*N/A

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

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

                                                                  \[\leadsto \color{blue}{\left(\sin re \cdot \left(e^{-im} - e^{im}\right)\right) \cdot \frac{1}{2}} \]
                                                              4. Applied rewrites100.0%

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

                                                                  \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right) \cdot \frac{1}{2}} \]
                                                                2. lift-*.f64N/A

                                                                  \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right)} \cdot \frac{1}{2} \]
                                                                3. associate-*l*N/A

                                                                  \[\leadsto \color{blue}{\sin re \cdot \left(\left(2 \cdot \sinh \left(-im\right)\right) \cdot \frac{1}{2}\right)} \]
                                                                4. lift-*.f64N/A

                                                                  \[\leadsto \sin re \cdot \left(\color{blue}{\left(2 \cdot \sinh \left(-im\right)\right)} \cdot \frac{1}{2}\right) \]
                                                                5. *-commutativeN/A

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

                                                                  \[\leadsto \sin re \cdot \color{blue}{\left(\sinh \left(-im\right) \cdot \left(2 \cdot \frac{1}{2}\right)\right)} \]
                                                                7. metadata-evalN/A

                                                                  \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{1}\right) \]
                                                                8. metadata-evalN/A

                                                                  \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{\frac{2}{2}}\right) \]
                                                                9. associate-/l*N/A

                                                                  \[\leadsto \sin re \cdot \color{blue}{\frac{\sinh \left(-im\right) \cdot 2}{2}} \]
                                                                10. *-commutativeN/A

                                                                  \[\leadsto \sin re \cdot \frac{\color{blue}{2 \cdot \sinh \left(-im\right)}}{2} \]
                                                                11. lift-sinh.f64N/A

                                                                  \[\leadsto \sin re \cdot \frac{2 \cdot \color{blue}{\sinh \left(-im\right)}}{2} \]
                                                                12. sinh-undef-revN/A

                                                                  \[\leadsto \sin re \cdot \frac{\color{blue}{e^{-im} - e^{\mathsf{neg}\left(\left(-im\right)\right)}}}{2} \]
                                                                13. sinh-defN/A

                                                                  \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                                                14. lift-sinh.f64N/A

                                                                  \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                                                15. *-commutativeN/A

                                                                  \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                                16. lower-*.f64100.0

                                                                  \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                              6. Applied rewrites100.0%

                                                                \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                              7. Taylor expanded in re around 0

                                                                \[\leadsto \sinh \left(-im\right) \cdot \color{blue}{re} \]
                                                              8. Step-by-step derivation
                                                                1. Applied rewrites78.7%

                                                                  \[\leadsto \sinh \left(-im\right) \cdot \color{blue}{re} \]
                                                              9. Recombined 2 regimes into one program.
                                                              10. Final simplification95.8%

                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -3.2 \cdot 10^{+103} \lor \neg \left(im \leq -0.235 \lor \neg \left(im \leq 0.075 \lor \neg \left(im \leq 1.05 \cdot 10^{+103}\right)\right)\right):\\ \;\;\;\;\left(\mathsf{fma}\left(im \cdot im, -0.16666666666666666, -1\right) \cdot im\right) \cdot \sin re\\ \mathbf{else}:\\ \;\;\;\;\sinh \left(-im\right) \cdot re\\ \end{array} \]
                                                              11. Add Preprocessing

                                                              Alternative 10: 78.6% accurate, 2.3× speedup?

                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 10^{-34}:\\ \;\;\;\;\sinh \left(-im\right) \cdot re\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, -0.008333333333333333, -0.16666666666666666\right), im \cdot im, -1\right) \cdot im\right) \cdot \sin re\\ \end{array} \end{array} \]
                                                              (FPCore (re im)
                                                               :precision binary64
                                                               (if (<= re 1e-34)
                                                                 (* (sinh (- im)) re)
                                                                 (*
                                                                  (*
                                                                   (fma
                                                                    (fma (* im im) -0.008333333333333333 -0.16666666666666666)
                                                                    (* im im)
                                                                    -1.0)
                                                                   im)
                                                                  (sin re))))
                                                              double code(double re, double im) {
                                                              	double tmp;
                                                              	if (re <= 1e-34) {
                                                              		tmp = sinh(-im) * re;
                                                              	} else {
                                                              		tmp = (fma(fma((im * im), -0.008333333333333333, -0.16666666666666666), (im * im), -1.0) * im) * sin(re);
                                                              	}
                                                              	return tmp;
                                                              }
                                                              
                                                              function code(re, im)
                                                              	tmp = 0.0
                                                              	if (re <= 1e-34)
                                                              		tmp = Float64(sinh(Float64(-im)) * re);
                                                              	else
                                                              		tmp = Float64(Float64(fma(fma(Float64(im * im), -0.008333333333333333, -0.16666666666666666), Float64(im * im), -1.0) * im) * sin(re));
                                                              	end
                                                              	return tmp
                                                              end
                                                              
                                                              code[re_, im_] := If[LessEqual[re, 1e-34], N[(N[Sinh[(-im)], $MachinePrecision] * re), $MachinePrecision], N[(N[(N[(N[(N[(im * im), $MachinePrecision] * -0.008333333333333333 + -0.16666666666666666), $MachinePrecision] * N[(im * im), $MachinePrecision] + -1.0), $MachinePrecision] * im), $MachinePrecision] * N[Sin[re], $MachinePrecision]), $MachinePrecision]]
                                                              
                                                              \begin{array}{l}
                                                              
                                                              \\
                                                              \begin{array}{l}
                                                              \mathbf{if}\;re \leq 10^{-34}:\\
                                                              \;\;\;\;\sinh \left(-im\right) \cdot re\\
                                                              
                                                              \mathbf{else}:\\
                                                              \;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, -0.008333333333333333, -0.16666666666666666\right), im \cdot im, -1\right) \cdot im\right) \cdot \sin re\\
                                                              
                                                              
                                                              \end{array}
                                                              \end{array}
                                                              
                                                              Derivation
                                                              1. Split input into 2 regimes
                                                              2. if re < 9.99999999999999928e-35

                                                                1. Initial program 67.5%

                                                                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                2. Add Preprocessing
                                                                3. Step-by-step derivation
                                                                  1. lift-*.f64N/A

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

                                                                    \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \cdot \left(e^{-im} - e^{im}\right) \]
                                                                  3. associate-*l*N/A

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

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

                                                                    \[\leadsto \color{blue}{\left(\sin re \cdot \left(e^{-im} - e^{im}\right)\right) \cdot \frac{1}{2}} \]
                                                                4. Applied rewrites99.9%

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

                                                                    \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right) \cdot \frac{1}{2}} \]
                                                                  2. lift-*.f64N/A

                                                                    \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right)} \cdot \frac{1}{2} \]
                                                                  3. associate-*l*N/A

                                                                    \[\leadsto \color{blue}{\sin re \cdot \left(\left(2 \cdot \sinh \left(-im\right)\right) \cdot \frac{1}{2}\right)} \]
                                                                  4. lift-*.f64N/A

                                                                    \[\leadsto \sin re \cdot \left(\color{blue}{\left(2 \cdot \sinh \left(-im\right)\right)} \cdot \frac{1}{2}\right) \]
                                                                  5. *-commutativeN/A

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

                                                                    \[\leadsto \sin re \cdot \color{blue}{\left(\sinh \left(-im\right) \cdot \left(2 \cdot \frac{1}{2}\right)\right)} \]
                                                                  7. metadata-evalN/A

                                                                    \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{1}\right) \]
                                                                  8. metadata-evalN/A

                                                                    \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{\frac{2}{2}}\right) \]
                                                                  9. associate-/l*N/A

                                                                    \[\leadsto \sin re \cdot \color{blue}{\frac{\sinh \left(-im\right) \cdot 2}{2}} \]
                                                                  10. *-commutativeN/A

                                                                    \[\leadsto \sin re \cdot \frac{\color{blue}{2 \cdot \sinh \left(-im\right)}}{2} \]
                                                                  11. lift-sinh.f64N/A

                                                                    \[\leadsto \sin re \cdot \frac{2 \cdot \color{blue}{\sinh \left(-im\right)}}{2} \]
                                                                  12. sinh-undef-revN/A

                                                                    \[\leadsto \sin re \cdot \frac{\color{blue}{e^{-im} - e^{\mathsf{neg}\left(\left(-im\right)\right)}}}{2} \]
                                                                  13. sinh-defN/A

                                                                    \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                                                  14. lift-sinh.f64N/A

                                                                    \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                                                  15. *-commutativeN/A

                                                                    \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                                  16. lower-*.f6499.9

                                                                    \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                                6. Applied rewrites99.9%

                                                                  \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                                7. Taylor expanded in re around 0

                                                                  \[\leadsto \sinh \left(-im\right) \cdot \color{blue}{re} \]
                                                                8. Step-by-step derivation
                                                                  1. Applied rewrites68.0%

                                                                    \[\leadsto \sinh \left(-im\right) \cdot \color{blue}{re} \]

                                                                  if 9.99999999999999928e-35 < re

                                                                  1. Initial program 55.2%

                                                                    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                  2. Add Preprocessing
                                                                  3. Step-by-step derivation
                                                                    1. lift-*.f64N/A

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

                                                                      \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \cdot \left(e^{-im} - e^{im}\right) \]
                                                                    3. associate-*l*N/A

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

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

                                                                      \[\leadsto \color{blue}{\left(\sin re \cdot \left(e^{-im} - e^{im}\right)\right) \cdot \frac{1}{2}} \]
                                                                  4. Applied rewrites99.9%

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

                                                                      \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right) \cdot \frac{1}{2}} \]
                                                                    2. lift-*.f64N/A

                                                                      \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right)} \cdot \frac{1}{2} \]
                                                                    3. associate-*l*N/A

                                                                      \[\leadsto \color{blue}{\sin re \cdot \left(\left(2 \cdot \sinh \left(-im\right)\right) \cdot \frac{1}{2}\right)} \]
                                                                    4. lift-*.f64N/A

                                                                      \[\leadsto \sin re \cdot \left(\color{blue}{\left(2 \cdot \sinh \left(-im\right)\right)} \cdot \frac{1}{2}\right) \]
                                                                    5. *-commutativeN/A

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

                                                                      \[\leadsto \sin re \cdot \color{blue}{\left(\sinh \left(-im\right) \cdot \left(2 \cdot \frac{1}{2}\right)\right)} \]
                                                                    7. metadata-evalN/A

                                                                      \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{1}\right) \]
                                                                    8. metadata-evalN/A

                                                                      \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{\frac{2}{2}}\right) \]
                                                                    9. associate-/l*N/A

                                                                      \[\leadsto \sin re \cdot \color{blue}{\frac{\sinh \left(-im\right) \cdot 2}{2}} \]
                                                                    10. *-commutativeN/A

                                                                      \[\leadsto \sin re \cdot \frac{\color{blue}{2 \cdot \sinh \left(-im\right)}}{2} \]
                                                                    11. lift-sinh.f64N/A

                                                                      \[\leadsto \sin re \cdot \frac{2 \cdot \color{blue}{\sinh \left(-im\right)}}{2} \]
                                                                    12. sinh-undef-revN/A

                                                                      \[\leadsto \sin re \cdot \frac{\color{blue}{e^{-im} - e^{\mathsf{neg}\left(\left(-im\right)\right)}}}{2} \]
                                                                    13. sinh-defN/A

                                                                      \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                                                    14. lift-sinh.f64N/A

                                                                      \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                                                    15. *-commutativeN/A

                                                                      \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                                    16. lower-*.f6499.9

                                                                      \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                                  6. Applied rewrites99.9%

                                                                    \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                                  7. Taylor expanded in im around 0

                                                                    \[\leadsto \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{5040} \cdot {im}^{2} - \frac{1}{120}\right) - \frac{1}{6}\right) - 1\right)\right)} \cdot \sin re \]
                                                                  8. Step-by-step derivation
                                                                    1. Applied rewrites94.5%

                                                                      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(\left(\left(\left(im \cdot im\right) \cdot -0.0001984126984126984 - 0.008333333333333333\right) \cdot im\right) \cdot im - 0.16666666666666666, im \cdot im, -1\right) \cdot im\right)} \cdot \sin re \]
                                                                    2. Taylor expanded in im around 0

                                                                      \[\leadsto \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left(\frac{-1}{120} \cdot {im}^{2} - \frac{1}{6}\right) - 1\right)\right)} \cdot \sin re \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites90.6%

                                                                        \[\leadsto \color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, -0.008333333333333333, -0.16666666666666666\right), im \cdot im, -1\right) \cdot im\right)} \cdot \sin re \]
                                                                    4. Recombined 2 regimes into one program.
                                                                    5. Add Preprocessing

                                                                    Alternative 11: 78.6% accurate, 2.3× speedup?

                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 10^{-34}:\\ \;\;\;\;\sinh \left(-im\right) \cdot re\\ \mathbf{else}:\\ \;\;\;\;\left(\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(-0.008333333333333333, im \cdot im, -0.16666666666666666\right), -1\right)\right) \cdot im\\ \end{array} \end{array} \]
                                                                    (FPCore (re im)
                                                                     :precision binary64
                                                                     (if (<= re 1e-34)
                                                                       (* (sinh (- im)) re)
                                                                       (*
                                                                        (*
                                                                         (sin re)
                                                                         (fma
                                                                          (* im im)
                                                                          (fma -0.008333333333333333 (* im im) -0.16666666666666666)
                                                                          -1.0))
                                                                        im)))
                                                                    double code(double re, double im) {
                                                                    	double tmp;
                                                                    	if (re <= 1e-34) {
                                                                    		tmp = sinh(-im) * re;
                                                                    	} else {
                                                                    		tmp = (sin(re) * fma((im * im), fma(-0.008333333333333333, (im * im), -0.16666666666666666), -1.0)) * im;
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    function code(re, im)
                                                                    	tmp = 0.0
                                                                    	if (re <= 1e-34)
                                                                    		tmp = Float64(sinh(Float64(-im)) * re);
                                                                    	else
                                                                    		tmp = Float64(Float64(sin(re) * fma(Float64(im * im), fma(-0.008333333333333333, Float64(im * im), -0.16666666666666666), -1.0)) * im);
                                                                    	end
                                                                    	return tmp
                                                                    end
                                                                    
                                                                    code[re_, im_] := If[LessEqual[re, 1e-34], N[(N[Sinh[(-im)], $MachinePrecision] * re), $MachinePrecision], N[(N[(N[Sin[re], $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(-0.008333333333333333 * N[(im * im), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] * im), $MachinePrecision]]
                                                                    
                                                                    \begin{array}{l}
                                                                    
                                                                    \\
                                                                    \begin{array}{l}
                                                                    \mathbf{if}\;re \leq 10^{-34}:\\
                                                                    \;\;\;\;\sinh \left(-im\right) \cdot re\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;\left(\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(-0.008333333333333333, im \cdot im, -0.16666666666666666\right), -1\right)\right) \cdot im\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 2 regimes
                                                                    2. if re < 9.99999999999999928e-35

                                                                      1. Initial program 67.5%

                                                                        \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                      2. Add Preprocessing
                                                                      3. Step-by-step derivation
                                                                        1. lift-*.f64N/A

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

                                                                          \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \cdot \left(e^{-im} - e^{im}\right) \]
                                                                        3. associate-*l*N/A

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

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

                                                                          \[\leadsto \color{blue}{\left(\sin re \cdot \left(e^{-im} - e^{im}\right)\right) \cdot \frac{1}{2}} \]
                                                                      4. Applied rewrites99.9%

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

                                                                          \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right) \cdot \frac{1}{2}} \]
                                                                        2. lift-*.f64N/A

                                                                          \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right)} \cdot \frac{1}{2} \]
                                                                        3. associate-*l*N/A

                                                                          \[\leadsto \color{blue}{\sin re \cdot \left(\left(2 \cdot \sinh \left(-im\right)\right) \cdot \frac{1}{2}\right)} \]
                                                                        4. lift-*.f64N/A

                                                                          \[\leadsto \sin re \cdot \left(\color{blue}{\left(2 \cdot \sinh \left(-im\right)\right)} \cdot \frac{1}{2}\right) \]
                                                                        5. *-commutativeN/A

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

                                                                          \[\leadsto \sin re \cdot \color{blue}{\left(\sinh \left(-im\right) \cdot \left(2 \cdot \frac{1}{2}\right)\right)} \]
                                                                        7. metadata-evalN/A

                                                                          \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{1}\right) \]
                                                                        8. metadata-evalN/A

                                                                          \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{\frac{2}{2}}\right) \]
                                                                        9. associate-/l*N/A

                                                                          \[\leadsto \sin re \cdot \color{blue}{\frac{\sinh \left(-im\right) \cdot 2}{2}} \]
                                                                        10. *-commutativeN/A

                                                                          \[\leadsto \sin re \cdot \frac{\color{blue}{2 \cdot \sinh \left(-im\right)}}{2} \]
                                                                        11. lift-sinh.f64N/A

                                                                          \[\leadsto \sin re \cdot \frac{2 \cdot \color{blue}{\sinh \left(-im\right)}}{2} \]
                                                                        12. sinh-undef-revN/A

                                                                          \[\leadsto \sin re \cdot \frac{\color{blue}{e^{-im} - e^{\mathsf{neg}\left(\left(-im\right)\right)}}}{2} \]
                                                                        13. sinh-defN/A

                                                                          \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                                                        14. lift-sinh.f64N/A

                                                                          \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                                                        15. *-commutativeN/A

                                                                          \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                                        16. lower-*.f6499.9

                                                                          \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                                      6. Applied rewrites99.9%

                                                                        \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                                      7. Taylor expanded in re around 0

                                                                        \[\leadsto \sinh \left(-im\right) \cdot \color{blue}{re} \]
                                                                      8. Step-by-step derivation
                                                                        1. Applied rewrites68.0%

                                                                          \[\leadsto \sinh \left(-im\right) \cdot \color{blue}{re} \]

                                                                        if 9.99999999999999928e-35 < re

                                                                        1. Initial program 55.2%

                                                                          \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                        2. Add Preprocessing
                                                                        3. Taylor expanded in im around 0

                                                                          \[\leadsto \color{blue}{im \cdot \left(-1 \cdot \sin re + {im}^{2} \cdot \left(\frac{-1}{6} \cdot \sin re + \frac{-1}{120} \cdot \left({im}^{2} \cdot \sin re\right)\right)\right)} \]
                                                                        4. Step-by-step derivation
                                                                          1. Applied rewrites90.6%

                                                                            \[\leadsto \color{blue}{\left(\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(-0.008333333333333333, im \cdot im, -0.16666666666666666\right), -1\right)\right) \cdot im} \]
                                                                        5. Recombined 2 regimes into one program.
                                                                        6. Add Preprocessing

                                                                        Alternative 12: 52.9% accurate, 2.3× speedup?

                                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\ \;\;\;\;\mathsf{fma}\left(\left(im \cdot re\right) \cdot re, 0.16666666666666666, -im\right) \cdot re\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot re\right) \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)\\ \end{array} \end{array} \]
                                                                        (FPCore (re im)
                                                                         :precision binary64
                                                                         (if (<= (* 0.5 (sin re)) -0.01)
                                                                           (* (fma (* (* im re) re) 0.16666666666666666 (- im)) re)
                                                                           (* (* 0.5 re) (* (fma (* im im) -0.3333333333333333 -2.0) im))))
                                                                        double code(double re, double im) {
                                                                        	double tmp;
                                                                        	if ((0.5 * sin(re)) <= -0.01) {
                                                                        		tmp = fma(((im * re) * re), 0.16666666666666666, -im) * re;
                                                                        	} else {
                                                                        		tmp = (0.5 * re) * (fma((im * im), -0.3333333333333333, -2.0) * im);
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        function code(re, im)
                                                                        	tmp = 0.0
                                                                        	if (Float64(0.5 * sin(re)) <= -0.01)
                                                                        		tmp = Float64(fma(Float64(Float64(im * re) * re), 0.16666666666666666, Float64(-im)) * re);
                                                                        	else
                                                                        		tmp = Float64(Float64(0.5 * re) * Float64(fma(Float64(im * im), -0.3333333333333333, -2.0) * im));
                                                                        	end
                                                                        	return tmp
                                                                        end
                                                                        
                                                                        code[re_, im_] := If[LessEqual[N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision], -0.01], N[(N[(N[(N[(im * re), $MachinePrecision] * re), $MachinePrecision] * 0.16666666666666666 + (-im)), $MachinePrecision] * re), $MachinePrecision], N[(N[(0.5 * re), $MachinePrecision] * N[(N[(N[(im * im), $MachinePrecision] * -0.3333333333333333 + -2.0), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision]]
                                                                        
                                                                        \begin{array}{l}
                                                                        
                                                                        \\
                                                                        \begin{array}{l}
                                                                        \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\
                                                                        \;\;\;\;\mathsf{fma}\left(\left(im \cdot re\right) \cdot re, 0.16666666666666666, -im\right) \cdot re\\
                                                                        
                                                                        \mathbf{else}:\\
                                                                        \;\;\;\;\left(0.5 \cdot re\right) \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)\\
                                                                        
                                                                        
                                                                        \end{array}
                                                                        \end{array}
                                                                        
                                                                        Derivation
                                                                        1. Split input into 2 regimes
                                                                        2. if (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) < -0.0100000000000000002

                                                                          1. Initial program 55.1%

                                                                            \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                          2. Add Preprocessing
                                                                          3. Taylor expanded in im around 0

                                                                            \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
                                                                          4. Step-by-step derivation
                                                                            1. Applied rewrites50.6%

                                                                              \[\leadsto \color{blue}{\left(-\sin re\right) \cdot im} \]
                                                                            2. Taylor expanded in re around 0

                                                                              \[\leadsto re \cdot \color{blue}{\left(-1 \cdot im + \frac{1}{6} \cdot \left(im \cdot {re}^{2}\right)\right)} \]
                                                                            3. Step-by-step derivation
                                                                              1. Applied rewrites23.8%

                                                                                \[\leadsto \mathsf{fma}\left(\left(im \cdot re\right) \cdot re, 0.16666666666666666, -im\right) \cdot \color{blue}{re} \]

                                                                              if -0.0100000000000000002 < (*.f64 #s(literal 1/2 binary64) (sin.f64 re))

                                                                              1. Initial program 67.3%

                                                                                \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                              2. Add Preprocessing
                                                                              3. Taylor expanded in im around 0

                                                                                \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(\frac{-1}{3} \cdot {im}^{2} - 2\right)\right)} \]
                                                                              4. Step-by-step derivation
                                                                                1. Applied rewrites83.9%

                                                                                  \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)} \]
                                                                                2. Taylor expanded in re around 0

                                                                                  \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{re}\right) \cdot \left(\mathsf{fma}\left(im \cdot im, \frac{-1}{3}, -2\right) \cdot im\right) \]
                                                                                3. Step-by-step derivation
                                                                                  1. Applied rewrites60.4%

                                                                                    \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right) \]
                                                                                4. Recombined 2 regimes into one program.
                                                                                5. Final simplification50.7%

                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\ \;\;\;\;\mathsf{fma}\left(\left(im \cdot re\right) \cdot re, 0.16666666666666666, -im\right) \cdot re\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot re\right) \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)\\ \end{array} \]
                                                                                6. Add Preprocessing

                                                                                Alternative 13: 34.6% accurate, 2.3× speedup?

                                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\ \;\;\;\;\mathsf{fma}\left(\left(im \cdot re\right) \cdot re, 0.16666666666666666, -im\right) \cdot re\\ \mathbf{else}:\\ \;\;\;\;\left(-re\right) \cdot im\\ \end{array} \end{array} \]
                                                                                (FPCore (re im)
                                                                                 :precision binary64
                                                                                 (if (<= (* 0.5 (sin re)) -0.01)
                                                                                   (* (fma (* (* im re) re) 0.16666666666666666 (- im)) re)
                                                                                   (* (- re) im)))
                                                                                double code(double re, double im) {
                                                                                	double tmp;
                                                                                	if ((0.5 * sin(re)) <= -0.01) {
                                                                                		tmp = fma(((im * re) * re), 0.16666666666666666, -im) * re;
                                                                                	} else {
                                                                                		tmp = -re * im;
                                                                                	}
                                                                                	return tmp;
                                                                                }
                                                                                
                                                                                function code(re, im)
                                                                                	tmp = 0.0
                                                                                	if (Float64(0.5 * sin(re)) <= -0.01)
                                                                                		tmp = Float64(fma(Float64(Float64(im * re) * re), 0.16666666666666666, Float64(-im)) * re);
                                                                                	else
                                                                                		tmp = Float64(Float64(-re) * im);
                                                                                	end
                                                                                	return tmp
                                                                                end
                                                                                
                                                                                code[re_, im_] := If[LessEqual[N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision], -0.01], N[(N[(N[(N[(im * re), $MachinePrecision] * re), $MachinePrecision] * 0.16666666666666666 + (-im)), $MachinePrecision] * re), $MachinePrecision], N[((-re) * im), $MachinePrecision]]
                                                                                
                                                                                \begin{array}{l}
                                                                                
                                                                                \\
                                                                                \begin{array}{l}
                                                                                \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\
                                                                                \;\;\;\;\mathsf{fma}\left(\left(im \cdot re\right) \cdot re, 0.16666666666666666, -im\right) \cdot re\\
                                                                                
                                                                                \mathbf{else}:\\
                                                                                \;\;\;\;\left(-re\right) \cdot im\\
                                                                                
                                                                                
                                                                                \end{array}
                                                                                \end{array}
                                                                                
                                                                                Derivation
                                                                                1. Split input into 2 regimes
                                                                                2. if (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) < -0.0100000000000000002

                                                                                  1. Initial program 55.1%

                                                                                    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                                  2. Add Preprocessing
                                                                                  3. Taylor expanded in im around 0

                                                                                    \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
                                                                                  4. Step-by-step derivation
                                                                                    1. Applied rewrites50.6%

                                                                                      \[\leadsto \color{blue}{\left(-\sin re\right) \cdot im} \]
                                                                                    2. Taylor expanded in re around 0

                                                                                      \[\leadsto re \cdot \color{blue}{\left(-1 \cdot im + \frac{1}{6} \cdot \left(im \cdot {re}^{2}\right)\right)} \]
                                                                                    3. Step-by-step derivation
                                                                                      1. Applied rewrites23.8%

                                                                                        \[\leadsto \mathsf{fma}\left(\left(im \cdot re\right) \cdot re, 0.16666666666666666, -im\right) \cdot \color{blue}{re} \]

                                                                                      if -0.0100000000000000002 < (*.f64 #s(literal 1/2 binary64) (sin.f64 re))

                                                                                      1. Initial program 67.3%

                                                                                        \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                                      2. Add Preprocessing
                                                                                      3. Taylor expanded in im around 0

                                                                                        \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. Applied rewrites50.6%

                                                                                          \[\leadsto \color{blue}{\left(-\sin re\right) \cdot im} \]
                                                                                        2. Taylor expanded in re around 0

                                                                                          \[\leadsto \left(-re\right) \cdot im \]
                                                                                        3. Step-by-step derivation
                                                                                          1. Applied rewrites35.9%

                                                                                            \[\leadsto \left(-re\right) \cdot im \]
                                                                                        4. Recombined 2 regimes into one program.
                                                                                        5. Add Preprocessing

                                                                                        Alternative 14: 34.6% accurate, 2.4× speedup?

                                                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\ \;\;\;\;\left(\mathsf{fma}\left(0.16666666666666666, re \cdot re, -1\right) \cdot re\right) \cdot im\\ \mathbf{else}:\\ \;\;\;\;\left(-re\right) \cdot im\\ \end{array} \end{array} \]
                                                                                        (FPCore (re im)
                                                                                         :precision binary64
                                                                                         (if (<= (* 0.5 (sin re)) -0.01)
                                                                                           (* (* (fma 0.16666666666666666 (* re re) -1.0) re) im)
                                                                                           (* (- re) im)))
                                                                                        double code(double re, double im) {
                                                                                        	double tmp;
                                                                                        	if ((0.5 * sin(re)) <= -0.01) {
                                                                                        		tmp = (fma(0.16666666666666666, (re * re), -1.0) * re) * im;
                                                                                        	} else {
                                                                                        		tmp = -re * im;
                                                                                        	}
                                                                                        	return tmp;
                                                                                        }
                                                                                        
                                                                                        function code(re, im)
                                                                                        	tmp = 0.0
                                                                                        	if (Float64(0.5 * sin(re)) <= -0.01)
                                                                                        		tmp = Float64(Float64(fma(0.16666666666666666, Float64(re * re), -1.0) * re) * im);
                                                                                        	else
                                                                                        		tmp = Float64(Float64(-re) * im);
                                                                                        	end
                                                                                        	return tmp
                                                                                        end
                                                                                        
                                                                                        code[re_, im_] := If[LessEqual[N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision], -0.01], N[(N[(N[(0.16666666666666666 * N[(re * re), $MachinePrecision] + -1.0), $MachinePrecision] * re), $MachinePrecision] * im), $MachinePrecision], N[((-re) * im), $MachinePrecision]]
                                                                                        
                                                                                        \begin{array}{l}
                                                                                        
                                                                                        \\
                                                                                        \begin{array}{l}
                                                                                        \mathbf{if}\;0.5 \cdot \sin re \leq -0.01:\\
                                                                                        \;\;\;\;\left(\mathsf{fma}\left(0.16666666666666666, re \cdot re, -1\right) \cdot re\right) \cdot im\\
                                                                                        
                                                                                        \mathbf{else}:\\
                                                                                        \;\;\;\;\left(-re\right) \cdot im\\
                                                                                        
                                                                                        
                                                                                        \end{array}
                                                                                        \end{array}
                                                                                        
                                                                                        Derivation
                                                                                        1. Split input into 2 regimes
                                                                                        2. if (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) < -0.0100000000000000002

                                                                                          1. Initial program 55.1%

                                                                                            \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                                          2. Add Preprocessing
                                                                                          3. Taylor expanded in im around 0

                                                                                            \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
                                                                                          4. Step-by-step derivation
                                                                                            1. Applied rewrites50.6%

                                                                                              \[\leadsto \color{blue}{\left(-\sin re\right) \cdot im} \]
                                                                                            2. Taylor expanded in re around 0

                                                                                              \[\leadsto \left(re \cdot \left(\frac{1}{6} \cdot {re}^{2} - 1\right)\right) \cdot im \]
                                                                                            3. Step-by-step derivation
                                                                                              1. Applied rewrites23.8%

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

                                                                                              if -0.0100000000000000002 < (*.f64 #s(literal 1/2 binary64) (sin.f64 re))

                                                                                              1. Initial program 67.3%

                                                                                                \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                                              2. Add Preprocessing
                                                                                              3. Taylor expanded in im around 0

                                                                                                \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
                                                                                              4. Step-by-step derivation
                                                                                                1. Applied rewrites50.6%

                                                                                                  \[\leadsto \color{blue}{\left(-\sin re\right) \cdot im} \]
                                                                                                2. Taylor expanded in re around 0

                                                                                                  \[\leadsto \left(-re\right) \cdot im \]
                                                                                                3. Step-by-step derivation
                                                                                                  1. Applied rewrites35.9%

                                                                                                    \[\leadsto \left(-re\right) \cdot im \]
                                                                                                4. Recombined 2 regimes into one program.
                                                                                                5. Add Preprocessing

                                                                                                Alternative 15: 34.6% accurate, 2.4× speedup?

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

                                                                                                  1. Initial program 55.1%

                                                                                                    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                                                  2. Add Preprocessing
                                                                                                  3. Taylor expanded in im around 0

                                                                                                    \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
                                                                                                  4. Step-by-step derivation
                                                                                                    1. Applied rewrites50.6%

                                                                                                      \[\leadsto \color{blue}{\left(-\sin re\right) \cdot im} \]
                                                                                                    2. Taylor expanded in re around 0

                                                                                                      \[\leadsto \left(re \cdot \left(\frac{1}{6} \cdot {re}^{2} - 1\right)\right) \cdot im \]
                                                                                                    3. Step-by-step derivation
                                                                                                      1. Applied rewrites23.8%

                                                                                                        \[\leadsto \left(\mathsf{fma}\left(0.16666666666666666, re \cdot re, -1\right) \cdot re\right) \cdot im \]
                                                                                                      2. Taylor expanded in re around inf

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

                                                                                                          \[\leadsto \left(\left(0.16666666666666666 \cdot \left(re \cdot re\right)\right) \cdot re\right) \cdot im \]

                                                                                                        if -0.0100000000000000002 < (*.f64 #s(literal 1/2 binary64) (sin.f64 re))

                                                                                                        1. Initial program 67.3%

                                                                                                          \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                                                        2. Add Preprocessing
                                                                                                        3. Taylor expanded in im around 0

                                                                                                          \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
                                                                                                        4. Step-by-step derivation
                                                                                                          1. Applied rewrites50.6%

                                                                                                            \[\leadsto \color{blue}{\left(-\sin re\right) \cdot im} \]
                                                                                                          2. Taylor expanded in re around 0

                                                                                                            \[\leadsto \left(-re\right) \cdot im \]
                                                                                                          3. Step-by-step derivation
                                                                                                            1. Applied rewrites35.9%

                                                                                                              \[\leadsto \left(-re\right) \cdot im \]
                                                                                                          4. Recombined 2 regimes into one program.
                                                                                                          5. Add Preprocessing

                                                                                                          Alternative 16: 76.8% accurate, 2.5× speedup?

                                                                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 2.3 \cdot 10^{-34}:\\ \;\;\;\;\sinh \left(-im\right) \cdot re\\ \mathbf{else}:\\ \;\;\;\;\left(\sin re \cdot im\right) \cdot \mathsf{fma}\left(-0.16666666666666666 \cdot im, im, -1\right)\\ \end{array} \end{array} \]
                                                                                                          (FPCore (re im)
                                                                                                           :precision binary64
                                                                                                           (if (<= re 2.3e-34)
                                                                                                             (* (sinh (- im)) re)
                                                                                                             (* (* (sin re) im) (fma (* -0.16666666666666666 im) im -1.0))))
                                                                                                          double code(double re, double im) {
                                                                                                          	double tmp;
                                                                                                          	if (re <= 2.3e-34) {
                                                                                                          		tmp = sinh(-im) * re;
                                                                                                          	} else {
                                                                                                          		tmp = (sin(re) * im) * fma((-0.16666666666666666 * im), im, -1.0);
                                                                                                          	}
                                                                                                          	return tmp;
                                                                                                          }
                                                                                                          
                                                                                                          function code(re, im)
                                                                                                          	tmp = 0.0
                                                                                                          	if (re <= 2.3e-34)
                                                                                                          		tmp = Float64(sinh(Float64(-im)) * re);
                                                                                                          	else
                                                                                                          		tmp = Float64(Float64(sin(re) * im) * fma(Float64(-0.16666666666666666 * im), im, -1.0));
                                                                                                          	end
                                                                                                          	return tmp
                                                                                                          end
                                                                                                          
                                                                                                          code[re_, im_] := If[LessEqual[re, 2.3e-34], N[(N[Sinh[(-im)], $MachinePrecision] * re), $MachinePrecision], N[(N[(N[Sin[re], $MachinePrecision] * im), $MachinePrecision] * N[(N[(-0.16666666666666666 * im), $MachinePrecision] * im + -1.0), $MachinePrecision]), $MachinePrecision]]
                                                                                                          
                                                                                                          \begin{array}{l}
                                                                                                          
                                                                                                          \\
                                                                                                          \begin{array}{l}
                                                                                                          \mathbf{if}\;re \leq 2.3 \cdot 10^{-34}:\\
                                                                                                          \;\;\;\;\sinh \left(-im\right) \cdot re\\
                                                                                                          
                                                                                                          \mathbf{else}:\\
                                                                                                          \;\;\;\;\left(\sin re \cdot im\right) \cdot \mathsf{fma}\left(-0.16666666666666666 \cdot im, im, -1\right)\\
                                                                                                          
                                                                                                          
                                                                                                          \end{array}
                                                                                                          \end{array}
                                                                                                          
                                                                                                          Derivation
                                                                                                          1. Split input into 2 regimes
                                                                                                          2. if re < 2.30000000000000011e-34

                                                                                                            1. Initial program 67.5%

                                                                                                              \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                                                            2. Add Preprocessing
                                                                                                            3. Step-by-step derivation
                                                                                                              1. lift-*.f64N/A

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

                                                                                                                \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \cdot \left(e^{-im} - e^{im}\right) \]
                                                                                                              3. associate-*l*N/A

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

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

                                                                                                                \[\leadsto \color{blue}{\left(\sin re \cdot \left(e^{-im} - e^{im}\right)\right) \cdot \frac{1}{2}} \]
                                                                                                            4. Applied rewrites99.9%

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

                                                                                                                \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right) \cdot \frac{1}{2}} \]
                                                                                                              2. lift-*.f64N/A

                                                                                                                \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right)} \cdot \frac{1}{2} \]
                                                                                                              3. associate-*l*N/A

                                                                                                                \[\leadsto \color{blue}{\sin re \cdot \left(\left(2 \cdot \sinh \left(-im\right)\right) \cdot \frac{1}{2}\right)} \]
                                                                                                              4. lift-*.f64N/A

                                                                                                                \[\leadsto \sin re \cdot \left(\color{blue}{\left(2 \cdot \sinh \left(-im\right)\right)} \cdot \frac{1}{2}\right) \]
                                                                                                              5. *-commutativeN/A

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

                                                                                                                \[\leadsto \sin re \cdot \color{blue}{\left(\sinh \left(-im\right) \cdot \left(2 \cdot \frac{1}{2}\right)\right)} \]
                                                                                                              7. metadata-evalN/A

                                                                                                                \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{1}\right) \]
                                                                                                              8. metadata-evalN/A

                                                                                                                \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{\frac{2}{2}}\right) \]
                                                                                                              9. associate-/l*N/A

                                                                                                                \[\leadsto \sin re \cdot \color{blue}{\frac{\sinh \left(-im\right) \cdot 2}{2}} \]
                                                                                                              10. *-commutativeN/A

                                                                                                                \[\leadsto \sin re \cdot \frac{\color{blue}{2 \cdot \sinh \left(-im\right)}}{2} \]
                                                                                                              11. lift-sinh.f64N/A

                                                                                                                \[\leadsto \sin re \cdot \frac{2 \cdot \color{blue}{\sinh \left(-im\right)}}{2} \]
                                                                                                              12. sinh-undef-revN/A

                                                                                                                \[\leadsto \sin re \cdot \frac{\color{blue}{e^{-im} - e^{\mathsf{neg}\left(\left(-im\right)\right)}}}{2} \]
                                                                                                              13. sinh-defN/A

                                                                                                                \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                                                                                              14. lift-sinh.f64N/A

                                                                                                                \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                                                                                              15. *-commutativeN/A

                                                                                                                \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                                                                              16. lower-*.f6499.9

                                                                                                                \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                                                                            6. Applied rewrites99.9%

                                                                                                              \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                                                                            7. Taylor expanded in re around 0

                                                                                                              \[\leadsto \sinh \left(-im\right) \cdot \color{blue}{re} \]
                                                                                                            8. Step-by-step derivation
                                                                                                              1. Applied rewrites68.0%

                                                                                                                \[\leadsto \sinh \left(-im\right) \cdot \color{blue}{re} \]

                                                                                                              if 2.30000000000000011e-34 < re

                                                                                                              1. Initial program 55.2%

                                                                                                                \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                                                              2. Add Preprocessing
                                                                                                              3. Taylor expanded in im around 0

                                                                                                                \[\leadsto \color{blue}{im \cdot \left(-1 \cdot \sin re + \frac{-1}{6} \cdot \left({im}^{2} \cdot \sin re\right)\right)} \]
                                                                                                              4. Step-by-step derivation
                                                                                                                1. Applied rewrites82.5%

                                                                                                                  \[\leadsto \color{blue}{\left(\sin re \cdot im\right) \cdot \mathsf{fma}\left(-0.16666666666666666 \cdot im, im, -1\right)} \]
                                                                                                              5. Recombined 2 regimes into one program.
                                                                                                              6. Add Preprocessing

                                                                                                              Alternative 17: 86.6% accurate, 2.5× speedup?

                                                                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq -1 \cdot 10^{+105}:\\ \;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)\\ \mathbf{elif}\;im \leq -0.235 \lor \neg \left(im \leq 0.00042\right):\\ \;\;\;\;\sinh \left(-im\right) \cdot re\\ \mathbf{else}:\\ \;\;\;\;\left(-\sin re\right) \cdot im\\ \end{array} \end{array} \]
                                                                                                              (FPCore (re im)
                                                                                                               :precision binary64
                                                                                                               (if (<= im -1e+105)
                                                                                                                 (*
                                                                                                                  (* (fma (* re re) -0.08333333333333333 0.5) re)
                                                                                                                  (* (fma (* im im) -0.3333333333333333 -2.0) im))
                                                                                                                 (if (or (<= im -0.235) (not (<= im 0.00042)))
                                                                                                                   (* (sinh (- im)) re)
                                                                                                                   (* (- (sin re)) im))))
                                                                                                              double code(double re, double im) {
                                                                                                              	double tmp;
                                                                                                              	if (im <= -1e+105) {
                                                                                                              		tmp = (fma((re * re), -0.08333333333333333, 0.5) * re) * (fma((im * im), -0.3333333333333333, -2.0) * im);
                                                                                                              	} else if ((im <= -0.235) || !(im <= 0.00042)) {
                                                                                                              		tmp = sinh(-im) * re;
                                                                                                              	} else {
                                                                                                              		tmp = -sin(re) * im;
                                                                                                              	}
                                                                                                              	return tmp;
                                                                                                              }
                                                                                                              
                                                                                                              function code(re, im)
                                                                                                              	tmp = 0.0
                                                                                                              	if (im <= -1e+105)
                                                                                                              		tmp = Float64(Float64(fma(Float64(re * re), -0.08333333333333333, 0.5) * re) * Float64(fma(Float64(im * im), -0.3333333333333333, -2.0) * im));
                                                                                                              	elseif ((im <= -0.235) || !(im <= 0.00042))
                                                                                                              		tmp = Float64(sinh(Float64(-im)) * re);
                                                                                                              	else
                                                                                                              		tmp = Float64(Float64(-sin(re)) * im);
                                                                                                              	end
                                                                                                              	return tmp
                                                                                                              end
                                                                                                              
                                                                                                              code[re_, im_] := If[LessEqual[im, -1e+105], N[(N[(N[(N[(re * re), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision] * re), $MachinePrecision] * N[(N[(N[(im * im), $MachinePrecision] * -0.3333333333333333 + -2.0), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[im, -0.235], N[Not[LessEqual[im, 0.00042]], $MachinePrecision]], N[(N[Sinh[(-im)], $MachinePrecision] * re), $MachinePrecision], N[((-N[Sin[re], $MachinePrecision]) * im), $MachinePrecision]]]
                                                                                                              
                                                                                                              \begin{array}{l}
                                                                                                              
                                                                                                              \\
                                                                                                              \begin{array}{l}
                                                                                                              \mathbf{if}\;im \leq -1 \cdot 10^{+105}:\\
                                                                                                              \;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)\\
                                                                                                              
                                                                                                              \mathbf{elif}\;im \leq -0.235 \lor \neg \left(im \leq 0.00042\right):\\
                                                                                                              \;\;\;\;\sinh \left(-im\right) \cdot re\\
                                                                                                              
                                                                                                              \mathbf{else}:\\
                                                                                                              \;\;\;\;\left(-\sin re\right) \cdot im\\
                                                                                                              
                                                                                                              
                                                                                                              \end{array}
                                                                                                              \end{array}
                                                                                                              
                                                                                                              Derivation
                                                                                                              1. Split input into 3 regimes
                                                                                                              2. if im < -9.9999999999999994e104

                                                                                                                1. Initial program 100.0%

                                                                                                                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                                                                2. Add Preprocessing
                                                                                                                3. Taylor expanded in im around 0

                                                                                                                  \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(\frac{-1}{3} \cdot {im}^{2} - 2\right)\right)} \]
                                                                                                                4. Step-by-step derivation
                                                                                                                  1. Applied rewrites100.0%

                                                                                                                    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)} \]
                                                                                                                  2. Taylor expanded in re around 0

                                                                                                                    \[\leadsto \color{blue}{\left(re \cdot \left(\frac{1}{2} + \frac{-1}{12} \cdot {re}^{2}\right)\right)} \cdot \left(\mathsf{fma}\left(im \cdot im, \frac{-1}{3}, -2\right) \cdot im\right) \]
                                                                                                                  3. Step-by-step derivation
                                                                                                                    1. Applied rewrites88.6%

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

                                                                                                                    if -9.9999999999999994e104 < im < -0.23499999999999999 or 4.2000000000000002e-4 < im

                                                                                                                    1. Initial program 100.0%

                                                                                                                      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                                                                    2. Add Preprocessing
                                                                                                                    3. Step-by-step derivation
                                                                                                                      1. lift-*.f64N/A

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

                                                                                                                        \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \cdot \left(e^{-im} - e^{im}\right) \]
                                                                                                                      3. associate-*l*N/A

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

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

                                                                                                                        \[\leadsto \color{blue}{\left(\sin re \cdot \left(e^{-im} - e^{im}\right)\right) \cdot \frac{1}{2}} \]
                                                                                                                    4. Applied rewrites100.0%

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

                                                                                                                        \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right) \cdot \frac{1}{2}} \]
                                                                                                                      2. lift-*.f64N/A

                                                                                                                        \[\leadsto \color{blue}{\left(\sin re \cdot \left(2 \cdot \sinh \left(-im\right)\right)\right)} \cdot \frac{1}{2} \]
                                                                                                                      3. associate-*l*N/A

                                                                                                                        \[\leadsto \color{blue}{\sin re \cdot \left(\left(2 \cdot \sinh \left(-im\right)\right) \cdot \frac{1}{2}\right)} \]
                                                                                                                      4. lift-*.f64N/A

                                                                                                                        \[\leadsto \sin re \cdot \left(\color{blue}{\left(2 \cdot \sinh \left(-im\right)\right)} \cdot \frac{1}{2}\right) \]
                                                                                                                      5. *-commutativeN/A

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

                                                                                                                        \[\leadsto \sin re \cdot \color{blue}{\left(\sinh \left(-im\right) \cdot \left(2 \cdot \frac{1}{2}\right)\right)} \]
                                                                                                                      7. metadata-evalN/A

                                                                                                                        \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{1}\right) \]
                                                                                                                      8. metadata-evalN/A

                                                                                                                        \[\leadsto \sin re \cdot \left(\sinh \left(-im\right) \cdot \color{blue}{\frac{2}{2}}\right) \]
                                                                                                                      9. associate-/l*N/A

                                                                                                                        \[\leadsto \sin re \cdot \color{blue}{\frac{\sinh \left(-im\right) \cdot 2}{2}} \]
                                                                                                                      10. *-commutativeN/A

                                                                                                                        \[\leadsto \sin re \cdot \frac{\color{blue}{2 \cdot \sinh \left(-im\right)}}{2} \]
                                                                                                                      11. lift-sinh.f64N/A

                                                                                                                        \[\leadsto \sin re \cdot \frac{2 \cdot \color{blue}{\sinh \left(-im\right)}}{2} \]
                                                                                                                      12. sinh-undef-revN/A

                                                                                                                        \[\leadsto \sin re \cdot \frac{\color{blue}{e^{-im} - e^{\mathsf{neg}\left(\left(-im\right)\right)}}}{2} \]
                                                                                                                      13. sinh-defN/A

                                                                                                                        \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                                                                                                      14. lift-sinh.f64N/A

                                                                                                                        \[\leadsto \sin re \cdot \color{blue}{\sinh \left(-im\right)} \]
                                                                                                                      15. *-commutativeN/A

                                                                                                                        \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                                                                                      16. lower-*.f64100.0

                                                                                                                        \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                                                                                    6. Applied rewrites100.0%

                                                                                                                      \[\leadsto \color{blue}{\sinh \left(-im\right) \cdot \sin re} \]
                                                                                                                    7. Taylor expanded in re around 0

                                                                                                                      \[\leadsto \sinh \left(-im\right) \cdot \color{blue}{re} \]
                                                                                                                    8. Step-by-step derivation
                                                                                                                      1. Applied rewrites78.1%

                                                                                                                        \[\leadsto \sinh \left(-im\right) \cdot \color{blue}{re} \]

                                                                                                                      if -0.23499999999999999 < im < 4.2000000000000002e-4

                                                                                                                      1. Initial program 26.4%

                                                                                                                        \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                                                                      2. Add Preprocessing
                                                                                                                      3. Taylor expanded in im around 0

                                                                                                                        \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
                                                                                                                      4. Step-by-step derivation
                                                                                                                        1. Applied rewrites99.1%

                                                                                                                          \[\leadsto \color{blue}{\left(-\sin re\right) \cdot im} \]
                                                                                                                      5. Recombined 3 regimes into one program.
                                                                                                                      6. Final simplification89.8%

                                                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -1 \cdot 10^{+105}:\\ \;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)\\ \mathbf{elif}\;im \leq -0.235 \lor \neg \left(im \leq 0.00042\right):\\ \;\;\;\;\sinh \left(-im\right) \cdot re\\ \mathbf{else}:\\ \;\;\;\;\left(-\sin re\right) \cdot im\\ \end{array} \]
                                                                                                                      7. Add Preprocessing

                                                                                                                      Alternative 18: 82.7% accurate, 2.5× speedup?

                                                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq -1 \cdot 10^{+105}:\\ \;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)\\ \mathbf{elif}\;im \leq -500 \lor \neg \left(im \leq 700\right):\\ \;\;\;\;\left(\mathsf{fma}\left(0.004166666666666667 \cdot \left(re \cdot re\right) - 0.08333333333333333, re \cdot re, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0003968253968253968 \cdot \left(im \cdot im\right) - 0.016666666666666666, im \cdot im, -0.3333333333333333\right), im \cdot im, -2\right) \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-\sin re\right) \cdot im\\ \end{array} \end{array} \]
                                                                                                                      (FPCore (re im)
                                                                                                                       :precision binary64
                                                                                                                       (if (<= im -1e+105)
                                                                                                                         (*
                                                                                                                          (* (fma (* re re) -0.08333333333333333 0.5) re)
                                                                                                                          (* (fma (* im im) -0.3333333333333333 -2.0) im))
                                                                                                                         (if (or (<= im -500.0) (not (<= im 700.0)))
                                                                                                                           (*
                                                                                                                            (*
                                                                                                                             (fma
                                                                                                                              (- (* 0.004166666666666667 (* re re)) 0.08333333333333333)
                                                                                                                              (* re re)
                                                                                                                              0.5)
                                                                                                                             re)
                                                                                                                            (*
                                                                                                                             (fma
                                                                                                                              (fma
                                                                                                                               (- (* -0.0003968253968253968 (* im im)) 0.016666666666666666)
                                                                                                                               (* im im)
                                                                                                                               -0.3333333333333333)
                                                                                                                              (* im im)
                                                                                                                              -2.0)
                                                                                                                             im))
                                                                                                                           (* (- (sin re)) im))))
                                                                                                                      double code(double re, double im) {
                                                                                                                      	double tmp;
                                                                                                                      	if (im <= -1e+105) {
                                                                                                                      		tmp = (fma((re * re), -0.08333333333333333, 0.5) * re) * (fma((im * im), -0.3333333333333333, -2.0) * im);
                                                                                                                      	} else if ((im <= -500.0) || !(im <= 700.0)) {
                                                                                                                      		tmp = (fma(((0.004166666666666667 * (re * re)) - 0.08333333333333333), (re * re), 0.5) * re) * (fma(fma(((-0.0003968253968253968 * (im * im)) - 0.016666666666666666), (im * im), -0.3333333333333333), (im * im), -2.0) * im);
                                                                                                                      	} else {
                                                                                                                      		tmp = -sin(re) * im;
                                                                                                                      	}
                                                                                                                      	return tmp;
                                                                                                                      }
                                                                                                                      
                                                                                                                      function code(re, im)
                                                                                                                      	tmp = 0.0
                                                                                                                      	if (im <= -1e+105)
                                                                                                                      		tmp = Float64(Float64(fma(Float64(re * re), -0.08333333333333333, 0.5) * re) * Float64(fma(Float64(im * im), -0.3333333333333333, -2.0) * im));
                                                                                                                      	elseif ((im <= -500.0) || !(im <= 700.0))
                                                                                                                      		tmp = Float64(Float64(fma(Float64(Float64(0.004166666666666667 * Float64(re * re)) - 0.08333333333333333), Float64(re * re), 0.5) * re) * Float64(fma(fma(Float64(Float64(-0.0003968253968253968 * Float64(im * im)) - 0.016666666666666666), Float64(im * im), -0.3333333333333333), Float64(im * im), -2.0) * im));
                                                                                                                      	else
                                                                                                                      		tmp = Float64(Float64(-sin(re)) * im);
                                                                                                                      	end
                                                                                                                      	return tmp
                                                                                                                      end
                                                                                                                      
                                                                                                                      code[re_, im_] := If[LessEqual[im, -1e+105], N[(N[(N[(N[(re * re), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision] * re), $MachinePrecision] * N[(N[(N[(im * im), $MachinePrecision] * -0.3333333333333333 + -2.0), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[im, -500.0], N[Not[LessEqual[im, 700.0]], $MachinePrecision]], N[(N[(N[(N[(N[(0.004166666666666667 * N[(re * re), $MachinePrecision]), $MachinePrecision] - 0.08333333333333333), $MachinePrecision] * N[(re * re), $MachinePrecision] + 0.5), $MachinePrecision] * re), $MachinePrecision] * N[(N[(N[(N[(N[(-0.0003968253968253968 * N[(im * im), $MachinePrecision]), $MachinePrecision] - 0.016666666666666666), $MachinePrecision] * N[(im * im), $MachinePrecision] + -0.3333333333333333), $MachinePrecision] * N[(im * im), $MachinePrecision] + -2.0), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision], N[((-N[Sin[re], $MachinePrecision]) * im), $MachinePrecision]]]
                                                                                                                      
                                                                                                                      \begin{array}{l}
                                                                                                                      
                                                                                                                      \\
                                                                                                                      \begin{array}{l}
                                                                                                                      \mathbf{if}\;im \leq -1 \cdot 10^{+105}:\\
                                                                                                                      \;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)\\
                                                                                                                      
                                                                                                                      \mathbf{elif}\;im \leq -500 \lor \neg \left(im \leq 700\right):\\
                                                                                                                      \;\;\;\;\left(\mathsf{fma}\left(0.004166666666666667 \cdot \left(re \cdot re\right) - 0.08333333333333333, re \cdot re, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0003968253968253968 \cdot \left(im \cdot im\right) - 0.016666666666666666, im \cdot im, -0.3333333333333333\right), im \cdot im, -2\right) \cdot im\right)\\
                                                                                                                      
                                                                                                                      \mathbf{else}:\\
                                                                                                                      \;\;\;\;\left(-\sin re\right) \cdot im\\
                                                                                                                      
                                                                                                                      
                                                                                                                      \end{array}
                                                                                                                      \end{array}
                                                                                                                      
                                                                                                                      Derivation
                                                                                                                      1. Split input into 3 regimes
                                                                                                                      2. if im < -9.9999999999999994e104

                                                                                                                        1. Initial program 100.0%

                                                                                                                          \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                                                                        2. Add Preprocessing
                                                                                                                        3. Taylor expanded in im around 0

                                                                                                                          \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(\frac{-1}{3} \cdot {im}^{2} - 2\right)\right)} \]
                                                                                                                        4. Step-by-step derivation
                                                                                                                          1. Applied rewrites100.0%

                                                                                                                            \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)} \]
                                                                                                                          2. Taylor expanded in re around 0

                                                                                                                            \[\leadsto \color{blue}{\left(re \cdot \left(\frac{1}{2} + \frac{-1}{12} \cdot {re}^{2}\right)\right)} \cdot \left(\mathsf{fma}\left(im \cdot im, \frac{-1}{3}, -2\right) \cdot im\right) \]
                                                                                                                          3. Step-by-step derivation
                                                                                                                            1. Applied rewrites88.6%

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

                                                                                                                            if -9.9999999999999994e104 < im < -500 or 700 < im

                                                                                                                            1. Initial program 100.0%

                                                                                                                              \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                                                                            2. Add Preprocessing
                                                                                                                            3. Taylor expanded in im around 0

                                                                                                                              \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(\frac{-1}{3} \cdot {im}^{2} - 2\right)\right)} \]
                                                                                                                            4. Step-by-step derivation
                                                                                                                              1. Applied rewrites54.3%

                                                                                                                                \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)} \]
                                                                                                                              2. Taylor expanded in re around 0

                                                                                                                                \[\leadsto \color{blue}{\left(re \cdot \left(\frac{1}{2} + {re}^{2} \cdot \left(\frac{1}{240} \cdot {re}^{2} - \frac{1}{12}\right)\right)\right)} \cdot \left(\mathsf{fma}\left(im \cdot im, \frac{-1}{3}, -2\right) \cdot im\right) \]
                                                                                                                              3. Step-by-step derivation
                                                                                                                                1. Applied rewrites58.1%

                                                                                                                                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(0.004166666666666667 \cdot \left(re \cdot re\right) - 0.08333333333333333, re \cdot re, 0.5\right) \cdot re\right)} \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right) \]
                                                                                                                                2. Taylor expanded in im around 0

                                                                                                                                  \[\leadsto \left(\mathsf{fma}\left(\frac{1}{240} \cdot \left(re \cdot re\right) - \frac{1}{12}, re \cdot re, \frac{1}{2}\right) \cdot re\right) \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)\right)} \]
                                                                                                                                3. Step-by-step derivation
                                                                                                                                  1. Applied rewrites69.1%

                                                                                                                                    \[\leadsto \left(\mathsf{fma}\left(0.004166666666666667 \cdot \left(re \cdot re\right) - 0.08333333333333333, re \cdot re, 0.5\right) \cdot re\right) \cdot \color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0003968253968253968 \cdot \left(im \cdot im\right) - 0.016666666666666666, im \cdot im, -0.3333333333333333\right), im \cdot im, -2\right) \cdot im\right)} \]

                                                                                                                                  if -500 < im < 700

                                                                                                                                  1. Initial program 26.4%

                                                                                                                                    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                                                                                  2. Add Preprocessing
                                                                                                                                  3. Taylor expanded in im around 0

                                                                                                                                    \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
                                                                                                                                  4. Step-by-step derivation
                                                                                                                                    1. Applied rewrites99.1%

                                                                                                                                      \[\leadsto \color{blue}{\left(-\sin re\right) \cdot im} \]
                                                                                                                                  5. Recombined 3 regimes into one program.
                                                                                                                                  6. Final simplification86.4%

                                                                                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -1 \cdot 10^{+105}:\\ \;\;\;\;\left(\mathsf{fma}\left(re \cdot re, -0.08333333333333333, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(im \cdot im, -0.3333333333333333, -2\right) \cdot im\right)\\ \mathbf{elif}\;im \leq -500 \lor \neg \left(im \leq 700\right):\\ \;\;\;\;\left(\mathsf{fma}\left(0.004166666666666667 \cdot \left(re \cdot re\right) - 0.08333333333333333, re \cdot re, 0.5\right) \cdot re\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0003968253968253968 \cdot \left(im \cdot im\right) - 0.016666666666666666, im \cdot im, -0.3333333333333333\right), im \cdot im, -2\right) \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-\sin re\right) \cdot im\\ \end{array} \]
                                                                                                                                  7. Add Preprocessing

                                                                                                                                  Alternative 19: 33.1% accurate, 39.5× speedup?

                                                                                                                                  \[\begin{array}{l} \\ \left(-re\right) \cdot im \end{array} \]
                                                                                                                                  (FPCore (re im) :precision binary64 (* (- re) im))
                                                                                                                                  double code(double re, double im) {
                                                                                                                                  	return -re * im;
                                                                                                                                  }
                                                                                                                                  
                                                                                                                                  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(re, im)
                                                                                                                                  use fmin_fmax_functions
                                                                                                                                      real(8), intent (in) :: re
                                                                                                                                      real(8), intent (in) :: im
                                                                                                                                      code = -re * im
                                                                                                                                  end function
                                                                                                                                  
                                                                                                                                  public static double code(double re, double im) {
                                                                                                                                  	return -re * im;
                                                                                                                                  }
                                                                                                                                  
                                                                                                                                  def code(re, im):
                                                                                                                                  	return -re * im
                                                                                                                                  
                                                                                                                                  function code(re, im)
                                                                                                                                  	return Float64(Float64(-re) * im)
                                                                                                                                  end
                                                                                                                                  
                                                                                                                                  function tmp = code(re, im)
                                                                                                                                  	tmp = -re * im;
                                                                                                                                  end
                                                                                                                                  
                                                                                                                                  code[re_, im_] := N[((-re) * im), $MachinePrecision]
                                                                                                                                  
                                                                                                                                  \begin{array}{l}
                                                                                                                                  
                                                                                                                                  \\
                                                                                                                                  \left(-re\right) \cdot im
                                                                                                                                  \end{array}
                                                                                                                                  
                                                                                                                                  Derivation
                                                                                                                                  1. Initial program 64.1%

                                                                                                                                    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
                                                                                                                                  2. Add Preprocessing
                                                                                                                                  3. Taylor expanded in im around 0

                                                                                                                                    \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
                                                                                                                                  4. Step-by-step derivation
                                                                                                                                    1. Applied rewrites50.6%

                                                                                                                                      \[\leadsto \color{blue}{\left(-\sin re\right) \cdot im} \]
                                                                                                                                    2. Taylor expanded in re around 0

                                                                                                                                      \[\leadsto \left(-re\right) \cdot im \]
                                                                                                                                    3. Step-by-step derivation
                                                                                                                                      1. Applied rewrites29.2%

                                                                                                                                        \[\leadsto \left(-re\right) \cdot im \]
                                                                                                                                      2. Add Preprocessing

                                                                                                                                      Developer Target 1: 99.7% accurate, 1.0× speedup?

                                                                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left|im\right| < 1:\\ \;\;\;\;-\sin re \cdot \left(\left(im + \left(\left(0.16666666666666666 \cdot im\right) \cdot im\right) \cdot im\right) + \left(\left(\left(\left(0.008333333333333333 \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)\\ \end{array} \end{array} \]
                                                                                                                                      (FPCore (re im)
                                                                                                                                       :precision binary64
                                                                                                                                       (if (< (fabs im) 1.0)
                                                                                                                                         (-
                                                                                                                                          (*
                                                                                                                                           (sin re)
                                                                                                                                           (+
                                                                                                                                            (+ im (* (* (* 0.16666666666666666 im) im) im))
                                                                                                                                            (* (* (* (* (* 0.008333333333333333 im) im) im) im) im))))
                                                                                                                                         (* (* 0.5 (sin re)) (- (exp (- im)) (exp im)))))
                                                                                                                                      double code(double re, double im) {
                                                                                                                                      	double tmp;
                                                                                                                                      	if (fabs(im) < 1.0) {
                                                                                                                                      		tmp = -(sin(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)));
                                                                                                                                      	} else {
                                                                                                                                      		tmp = (0.5 * sin(re)) * (exp(-im) - exp(im));
                                                                                                                                      	}
                                                                                                                                      	return tmp;
                                                                                                                                      }
                                                                                                                                      
                                                                                                                                      module fmin_fmax_functions
                                                                                                                                          implicit none
                                                                                                                                          private
                                                                                                                                          public fmax
                                                                                                                                          public fmin
                                                                                                                                      
                                                                                                                                          interface fmax
                                                                                                                                              module procedure fmax88
                                                                                                                                              module procedure fmax44
                                                                                                                                              module procedure fmax84
                                                                                                                                              module procedure fmax48
                                                                                                                                          end interface
                                                                                                                                          interface fmin
                                                                                                                                              module procedure fmin88
                                                                                                                                              module procedure fmin44
                                                                                                                                              module procedure fmin84
                                                                                                                                              module procedure fmin48
                                                                                                                                          end interface
                                                                                                                                      contains
                                                                                                                                          real(8) function fmax88(x, y) result (res)
                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                          end function
                                                                                                                                          real(4) function fmax44(x, y) result (res)
                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                          end function
                                                                                                                                          real(8) function fmax84(x, y) result(res)
                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                                                          end function
                                                                                                                                          real(8) function fmax48(x, y) result(res)
                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                                                          end function
                                                                                                                                          real(8) function fmin88(x, y) result (res)
                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                          end function
                                                                                                                                          real(4) function fmin44(x, y) result (res)
                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                          end function
                                                                                                                                          real(8) function fmin84(x, y) result(res)
                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                                                          end function
                                                                                                                                          real(8) function fmin48(x, y) result(res)
                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                                                          end function
                                                                                                                                      end module
                                                                                                                                      
                                                                                                                                      real(8) function code(re, im)
                                                                                                                                      use fmin_fmax_functions
                                                                                                                                          real(8), intent (in) :: re
                                                                                                                                          real(8), intent (in) :: im
                                                                                                                                          real(8) :: tmp
                                                                                                                                          if (abs(im) < 1.0d0) then
                                                                                                                                              tmp = -(sin(re) * ((im + (((0.16666666666666666d0 * im) * im) * im)) + (((((0.008333333333333333d0 * im) * im) * im) * im) * im)))
                                                                                                                                          else
                                                                                                                                              tmp = (0.5d0 * sin(re)) * (exp(-im) - exp(im))
                                                                                                                                          end if
                                                                                                                                          code = tmp
                                                                                                                                      end function
                                                                                                                                      
                                                                                                                                      public static double code(double re, double im) {
                                                                                                                                      	double tmp;
                                                                                                                                      	if (Math.abs(im) < 1.0) {
                                                                                                                                      		tmp = -(Math.sin(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)));
                                                                                                                                      	} else {
                                                                                                                                      		tmp = (0.5 * Math.sin(re)) * (Math.exp(-im) - Math.exp(im));
                                                                                                                                      	}
                                                                                                                                      	return tmp;
                                                                                                                                      }
                                                                                                                                      
                                                                                                                                      def code(re, im):
                                                                                                                                      	tmp = 0
                                                                                                                                      	if math.fabs(im) < 1.0:
                                                                                                                                      		tmp = -(math.sin(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)))
                                                                                                                                      	else:
                                                                                                                                      		tmp = (0.5 * math.sin(re)) * (math.exp(-im) - math.exp(im))
                                                                                                                                      	return tmp
                                                                                                                                      
                                                                                                                                      function code(re, im)
                                                                                                                                      	tmp = 0.0
                                                                                                                                      	if (abs(im) < 1.0)
                                                                                                                                      		tmp = Float64(-Float64(sin(re) * Float64(Float64(im + Float64(Float64(Float64(0.16666666666666666 * im) * im) * im)) + Float64(Float64(Float64(Float64(Float64(0.008333333333333333 * im) * im) * im) * im) * im))));
                                                                                                                                      	else
                                                                                                                                      		tmp = Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im)) - exp(im)));
                                                                                                                                      	end
                                                                                                                                      	return tmp
                                                                                                                                      end
                                                                                                                                      
                                                                                                                                      function tmp_2 = code(re, im)
                                                                                                                                      	tmp = 0.0;
                                                                                                                                      	if (abs(im) < 1.0)
                                                                                                                                      		tmp = -(sin(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)));
                                                                                                                                      	else
                                                                                                                                      		tmp = (0.5 * sin(re)) * (exp(-im) - exp(im));
                                                                                                                                      	end
                                                                                                                                      	tmp_2 = tmp;
                                                                                                                                      end
                                                                                                                                      
                                                                                                                                      code[re_, im_] := If[Less[N[Abs[im], $MachinePrecision], 1.0], (-N[(N[Sin[re], $MachinePrecision] * N[(N[(im + N[(N[(N[(0.16666666666666666 * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(0.008333333333333333 * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                                                                                                      
                                                                                                                                      \begin{array}{l}
                                                                                                                                      
                                                                                                                                      \\
                                                                                                                                      \begin{array}{l}
                                                                                                                                      \mathbf{if}\;\left|im\right| < 1:\\
                                                                                                                                      \;\;\;\;-\sin re \cdot \left(\left(im + \left(\left(0.16666666666666666 \cdot im\right) \cdot im\right) \cdot im\right) + \left(\left(\left(\left(0.008333333333333333 \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right)\\
                                                                                                                                      
                                                                                                                                      \mathbf{else}:\\
                                                                                                                                      \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)\\
                                                                                                                                      
                                                                                                                                      
                                                                                                                                      \end{array}
                                                                                                                                      \end{array}
                                                                                                                                      

                                                                                                                                      Reproduce

                                                                                                                                      ?
                                                                                                                                      herbie shell --seed 2025019 
                                                                                                                                      (FPCore (re im)
                                                                                                                                        :name "math.cos on complex, imaginary part"
                                                                                                                                        :precision binary64
                                                                                                                                      
                                                                                                                                        :alt
                                                                                                                                        (! :herbie-platform default (if (< (fabs im) 1) (- (* (sin re) (+ im (* 1/6 im im im) (* 1/120 im im im im im)))) (* (* 1/2 (sin re)) (- (exp (- im)) (exp im)))))
                                                                                                                                      
                                                                                                                                        (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))