Linear.Quaternion:$ctanh from linear-1.19.1.3

Percentage Accurate: 96.1% → 97.7%
Time: 3.6s
Alternatives: 11
Speedup: 0.5×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 96.1% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 97.7% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ \begin{array}{l} t_0 := \frac{x\_m \cdot \frac{\sin y}{y}}{z\_m}\\ z\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\frac{\sin y}{z\_m \cdot y} \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array}\right) \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x_s x_m y z_m)
 :precision binary64
 (let* ((t_0 (/ (* x_m (/ (sin y) y)) z_m)))
   (* z_s (* x_s (if (<= t_0 0.0) (* (/ (sin y) (* z_m y)) x_m) t_0)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m) {
	double t_0 = (x_m * (sin(y) / y)) / z_m;
	double tmp;
	if (t_0 <= 0.0) {
		tmp = (sin(y) / (z_m * y)) * x_m;
	} else {
		tmp = t_0;
	}
	return z_s * (x_s * tmp);
}
x\_m =     private
x\_s =     private
z\_m =     private
z\_s =     private
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(z_s, x_s, x_m, y, z_m)
use fmin_fmax_functions
    real(8), intent (in) :: z_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (x_m * (sin(y) / y)) / z_m
    if (t_0 <= 0.0d0) then
        tmp = (sin(y) / (z_m * y)) * x_m
    else
        tmp = t_0
    end if
    code = z_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m) {
	double t_0 = (x_m * (Math.sin(y) / y)) / z_m;
	double tmp;
	if (t_0 <= 0.0) {
		tmp = (Math.sin(y) / (z_m * y)) * x_m;
	} else {
		tmp = t_0;
	}
	return z_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, x_s, x_m, y, z_m):
	t_0 = (x_m * (math.sin(y) / y)) / z_m
	tmp = 0
	if t_0 <= 0.0:
		tmp = (math.sin(y) / (z_m * y)) * x_m
	else:
		tmp = t_0
	return z_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, x_s, x_m, y, z_m)
	t_0 = Float64(Float64(x_m * Float64(sin(y) / y)) / z_m)
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(Float64(sin(y) / Float64(z_m * y)) * x_m);
	else
		tmp = t_0;
	end
	return Float64(z_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, x_s, x_m, y, z_m)
	t_0 = (x_m * (sin(y) / y)) / z_m;
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = (sin(y) / (z_m * y)) * x_m;
	else
		tmp = t_0;
	end
	tmp_2 = z_s * (x_s * tmp);
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_] := Block[{t$95$0 = N[(N[(x$95$m * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]}, N[(z$95$s * N[(x$95$s * If[LessEqual[t$95$0, 0.0], N[(N[(N[Sin[y], $MachinePrecision] / N[(z$95$m * y), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], t$95$0]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
\begin{array}{l}
t_0 := \frac{x\_m \cdot \frac{\sin y}{y}}{z\_m}\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{\sin y}{z\_m \cdot y} \cdot x\_m\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}\right)
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 x (/.f64 (sin.f64 y) y)) z) < -0.0

    1. Initial program 90.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sin y}{\color{blue}{z \cdot y}} \cdot x \]
      12. lower-*.f6494.6

        \[\leadsto \frac{\sin y}{\color{blue}{z \cdot y}} \cdot x \]
    3. Applied rewrites94.6%

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

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

    1. Initial program 99.7%

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

Alternative 2: 77.7% accurate, 0.9× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq 7.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{x\_m}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin y}{z\_m} \cdot \frac{x\_m}{y}\\ \end{array}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s x_s x_m y z_m)
 :precision binary64
 (* z_s (* x_s (if (<= y 7.8e-11) (/ x_m z_m) (* (/ (sin y) z_m) (/ x_m y))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double x_s, double x_m, double y, double z_m) {
	double tmp;
	if (y <= 7.8e-11) {
		tmp = x_m / z_m;
	} else {
		tmp = (sin(y) / z_m) * (x_m / y);
	}
	return z_s * (x_s * tmp);
}
x\_m =     private
x\_s =     private
z\_m =     private
z\_s =     private
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(z_s, x_s, x_m, y, z_m)
use fmin_fmax_functions
    real(8), intent (in) :: z_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (y <= 7.8d-11) then
        tmp = x_m / z_m
    else
        tmp = (sin(y) / z_m) * (x_m / y)
    end if
    code = z_s * (x_s * tmp)
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double x_s, double x_m, double y, double z_m) {
	double tmp;
	if (y <= 7.8e-11) {
		tmp = x_m / z_m;
	} else {
		tmp = (Math.sin(y) / z_m) * (x_m / y);
	}
	return z_s * (x_s * tmp);
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, x_s, x_m, y, z_m):
	tmp = 0
	if y <= 7.8e-11:
		tmp = x_m / z_m
	else:
		tmp = (math.sin(y) / z_m) * (x_m / y)
	return z_s * (x_s * tmp)
x\_m = abs(x)
x\_s = copysign(1.0, x)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, x_s, x_m, y, z_m)
	tmp = 0.0
	if (y <= 7.8e-11)
		tmp = Float64(x_m / z_m);
	else
		tmp = Float64(Float64(sin(y) / z_m) * Float64(x_m / y));
	end
	return Float64(z_s * Float64(x_s * tmp))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, x_s, x_m, y, z_m)
	tmp = 0.0;
	if (y <= 7.8e-11)
		tmp = x_m / z_m;
	else
		tmp = (sin(y) / z_m) * (x_m / y);
	end
	tmp_2 = z_s * (x_s * tmp);
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_] := N[(z$95$s * N[(x$95$s * If[LessEqual[y, 7.8e-11], N[(x$95$m / z$95$m), $MachinePrecision], N[(N[(N[Sin[y], $MachinePrecision] / z$95$m), $MachinePrecision] * N[(x$95$m / y), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq 7.8 \cdot 10^{-11}:\\
\;\;\;\;\frac{x\_m}{z\_m}\\

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


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 7.80000000000000021e-11

    1. Initial program 97.5%

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

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

        \[\leadsto \frac{\color{blue}{x}}{z} \]

      if 7.80000000000000021e-11 < y

      1. Initial program 92.3%

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{x \cdot \sin y}{y \cdot z}} \]
        7. times-fracN/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{\sin y}}{z} \cdot \frac{x}{y} \]
        12. lower-/.f6492.3

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

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

    Alternative 3: 77.6% accurate, 0.9× speedup?

    \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq 7.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{x\_m}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin y}{z\_m \cdot y} \cdot x\_m\\ \end{array}\right) \end{array} \]
    x\_m = (fabs.f64 x)
    x\_s = (copysign.f64 #s(literal 1 binary64) x)
    z\_m = (fabs.f64 z)
    z\_s = (copysign.f64 #s(literal 1 binary64) z)
    (FPCore (z_s x_s x_m y z_m)
     :precision binary64
     (* z_s (* x_s (if (<= y 7.8e-11) (/ x_m z_m) (* (/ (sin y) (* z_m y)) x_m)))))
    x\_m = fabs(x);
    x\_s = copysign(1.0, x);
    z\_m = fabs(z);
    z\_s = copysign(1.0, z);
    double code(double z_s, double x_s, double x_m, double y, double z_m) {
    	double tmp;
    	if (y <= 7.8e-11) {
    		tmp = x_m / z_m;
    	} else {
    		tmp = (sin(y) / (z_m * y)) * x_m;
    	}
    	return z_s * (x_s * tmp);
    }
    
    x\_m =     private
    x\_s =     private
    z\_m =     private
    z\_s =     private
    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(z_s, x_s, x_m, y, z_m)
    use fmin_fmax_functions
        real(8), intent (in) :: z_s
        real(8), intent (in) :: x_s
        real(8), intent (in) :: x_m
        real(8), intent (in) :: y
        real(8), intent (in) :: z_m
        real(8) :: tmp
        if (y <= 7.8d-11) then
            tmp = x_m / z_m
        else
            tmp = (sin(y) / (z_m * y)) * x_m
        end if
        code = z_s * (x_s * tmp)
    end function
    
    x\_m = Math.abs(x);
    x\_s = Math.copySign(1.0, x);
    z\_m = Math.abs(z);
    z\_s = Math.copySign(1.0, z);
    public static double code(double z_s, double x_s, double x_m, double y, double z_m) {
    	double tmp;
    	if (y <= 7.8e-11) {
    		tmp = x_m / z_m;
    	} else {
    		tmp = (Math.sin(y) / (z_m * y)) * x_m;
    	}
    	return z_s * (x_s * tmp);
    }
    
    x\_m = math.fabs(x)
    x\_s = math.copysign(1.0, x)
    z\_m = math.fabs(z)
    z\_s = math.copysign(1.0, z)
    def code(z_s, x_s, x_m, y, z_m):
    	tmp = 0
    	if y <= 7.8e-11:
    		tmp = x_m / z_m
    	else:
    		tmp = (math.sin(y) / (z_m * y)) * x_m
    	return z_s * (x_s * tmp)
    
    x\_m = abs(x)
    x\_s = copysign(1.0, x)
    z\_m = abs(z)
    z\_s = copysign(1.0, z)
    function code(z_s, x_s, x_m, y, z_m)
    	tmp = 0.0
    	if (y <= 7.8e-11)
    		tmp = Float64(x_m / z_m);
    	else
    		tmp = Float64(Float64(sin(y) / Float64(z_m * y)) * x_m);
    	end
    	return Float64(z_s * Float64(x_s * tmp))
    end
    
    x\_m = abs(x);
    x\_s = sign(x) * abs(1.0);
    z\_m = abs(z);
    z\_s = sign(z) * abs(1.0);
    function tmp_2 = code(z_s, x_s, x_m, y, z_m)
    	tmp = 0.0;
    	if (y <= 7.8e-11)
    		tmp = x_m / z_m;
    	else
    		tmp = (sin(y) / (z_m * y)) * x_m;
    	end
    	tmp_2 = z_s * (x_s * tmp);
    end
    
    x\_m = N[Abs[x], $MachinePrecision]
    x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    z\_m = N[Abs[z], $MachinePrecision]
    z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_] := N[(z$95$s * N[(x$95$s * If[LessEqual[y, 7.8e-11], N[(x$95$m / z$95$m), $MachinePrecision], N[(N[(N[Sin[y], $MachinePrecision] / N[(z$95$m * y), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    x\_m = \left|x\right|
    \\
    x\_s = \mathsf{copysign}\left(1, x\right)
    \\
    z\_m = \left|z\right|
    \\
    z\_s = \mathsf{copysign}\left(1, z\right)
    
    \\
    z\_s \cdot \left(x\_s \cdot \begin{array}{l}
    \mathbf{if}\;y \leq 7.8 \cdot 10^{-11}:\\
    \;\;\;\;\frac{x\_m}{z\_m}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\sin y}{z\_m \cdot y} \cdot x\_m\\
    
    
    \end{array}\right)
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 7.80000000000000021e-11

      1. Initial program 97.5%

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

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

          \[\leadsto \frac{\color{blue}{x}}{z} \]

        if 7.80000000000000021e-11 < y

        1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\sin y}{\color{blue}{z \cdot y}} \cdot x \]
          12. lower-*.f6492.0

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

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

      Alternative 4: 77.6% accurate, 0.9× speedup?

      \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq 10^{-17}:\\ \;\;\;\;\frac{x\_m}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;\sin y \cdot \frac{x\_m}{z\_m \cdot y}\\ \end{array}\right) \end{array} \]
      x\_m = (fabs.f64 x)
      x\_s = (copysign.f64 #s(literal 1 binary64) x)
      z\_m = (fabs.f64 z)
      z\_s = (copysign.f64 #s(literal 1 binary64) z)
      (FPCore (z_s x_s x_m y z_m)
       :precision binary64
       (* z_s (* x_s (if (<= y 1e-17) (/ x_m z_m) (* (sin y) (/ x_m (* z_m y)))))))
      x\_m = fabs(x);
      x\_s = copysign(1.0, x);
      z\_m = fabs(z);
      z\_s = copysign(1.0, z);
      double code(double z_s, double x_s, double x_m, double y, double z_m) {
      	double tmp;
      	if (y <= 1e-17) {
      		tmp = x_m / z_m;
      	} else {
      		tmp = sin(y) * (x_m / (z_m * y));
      	}
      	return z_s * (x_s * tmp);
      }
      
      x\_m =     private
      x\_s =     private
      z\_m =     private
      z\_s =     private
      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(z_s, x_s, x_m, y, z_m)
      use fmin_fmax_functions
          real(8), intent (in) :: z_s
          real(8), intent (in) :: x_s
          real(8), intent (in) :: x_m
          real(8), intent (in) :: y
          real(8), intent (in) :: z_m
          real(8) :: tmp
          if (y <= 1d-17) then
              tmp = x_m / z_m
          else
              tmp = sin(y) * (x_m / (z_m * y))
          end if
          code = z_s * (x_s * tmp)
      end function
      
      x\_m = Math.abs(x);
      x\_s = Math.copySign(1.0, x);
      z\_m = Math.abs(z);
      z\_s = Math.copySign(1.0, z);
      public static double code(double z_s, double x_s, double x_m, double y, double z_m) {
      	double tmp;
      	if (y <= 1e-17) {
      		tmp = x_m / z_m;
      	} else {
      		tmp = Math.sin(y) * (x_m / (z_m * y));
      	}
      	return z_s * (x_s * tmp);
      }
      
      x\_m = math.fabs(x)
      x\_s = math.copysign(1.0, x)
      z\_m = math.fabs(z)
      z\_s = math.copysign(1.0, z)
      def code(z_s, x_s, x_m, y, z_m):
      	tmp = 0
      	if y <= 1e-17:
      		tmp = x_m / z_m
      	else:
      		tmp = math.sin(y) * (x_m / (z_m * y))
      	return z_s * (x_s * tmp)
      
      x\_m = abs(x)
      x\_s = copysign(1.0, x)
      z\_m = abs(z)
      z\_s = copysign(1.0, z)
      function code(z_s, x_s, x_m, y, z_m)
      	tmp = 0.0
      	if (y <= 1e-17)
      		tmp = Float64(x_m / z_m);
      	else
      		tmp = Float64(sin(y) * Float64(x_m / Float64(z_m * y)));
      	end
      	return Float64(z_s * Float64(x_s * tmp))
      end
      
      x\_m = abs(x);
      x\_s = sign(x) * abs(1.0);
      z\_m = abs(z);
      z\_s = sign(z) * abs(1.0);
      function tmp_2 = code(z_s, x_s, x_m, y, z_m)
      	tmp = 0.0;
      	if (y <= 1e-17)
      		tmp = x_m / z_m;
      	else
      		tmp = sin(y) * (x_m / (z_m * y));
      	end
      	tmp_2 = z_s * (x_s * tmp);
      end
      
      x\_m = N[Abs[x], $MachinePrecision]
      x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
      z\_m = N[Abs[z], $MachinePrecision]
      z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
      code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_] := N[(z$95$s * N[(x$95$s * If[LessEqual[y, 1e-17], N[(x$95$m / z$95$m), $MachinePrecision], N[(N[Sin[y], $MachinePrecision] * N[(x$95$m / N[(z$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      x\_m = \left|x\right|
      \\
      x\_s = \mathsf{copysign}\left(1, x\right)
      \\
      z\_m = \left|z\right|
      \\
      z\_s = \mathsf{copysign}\left(1, z\right)
      
      \\
      z\_s \cdot \left(x\_s \cdot \begin{array}{l}
      \mathbf{if}\;y \leq 10^{-17}:\\
      \;\;\;\;\frac{x\_m}{z\_m}\\
      
      \mathbf{else}:\\
      \;\;\;\;\sin y \cdot \frac{x\_m}{z\_m \cdot y}\\
      
      
      \end{array}\right)
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < 1.00000000000000007e-17

        1. Initial program 97.5%

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

          \[\leadsto \frac{\color{blue}{x}}{z} \]
        3. Step-by-step derivation
          1. Applied rewrites72.3%

            \[\leadsto \frac{\color{blue}{x}}{z} \]

          if 1.00000000000000007e-17 < y

          1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \sin y \cdot \frac{x}{\color{blue}{z \cdot y}} \]
            13. lower-*.f6492.1

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

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

        Alternative 5: 66.3% accurate, 1.6× speedup?

        \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z\_m \leq 8.6 \cdot 10^{-128}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(y \cdot y\right) \cdot x\_m, -0.16666666666666666, x\_m\right)}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-y}{\mathsf{fma}\left(-0.16666666666666666 \cdot y, y, -1\right)}}{z\_m \cdot y} \cdot x\_m\\ \end{array}\right) \end{array} \]
        x\_m = (fabs.f64 x)
        x\_s = (copysign.f64 #s(literal 1 binary64) x)
        z\_m = (fabs.f64 z)
        z\_s = (copysign.f64 #s(literal 1 binary64) z)
        (FPCore (z_s x_s x_m y z_m)
         :precision binary64
         (*
          z_s
          (*
           x_s
           (if (<= z_m 8.6e-128)
             (/ (fma (* (* y y) x_m) -0.16666666666666666 x_m) z_m)
             (*
              (/ (/ (- y) (fma (* -0.16666666666666666 y) y -1.0)) (* z_m y))
              x_m)))))
        x\_m = fabs(x);
        x\_s = copysign(1.0, x);
        z\_m = fabs(z);
        z\_s = copysign(1.0, z);
        double code(double z_s, double x_s, double x_m, double y, double z_m) {
        	double tmp;
        	if (z_m <= 8.6e-128) {
        		tmp = fma(((y * y) * x_m), -0.16666666666666666, x_m) / z_m;
        	} else {
        		tmp = ((-y / fma((-0.16666666666666666 * y), y, -1.0)) / (z_m * y)) * x_m;
        	}
        	return z_s * (x_s * tmp);
        }
        
        x\_m = abs(x)
        x\_s = copysign(1.0, x)
        z\_m = abs(z)
        z\_s = copysign(1.0, z)
        function code(z_s, x_s, x_m, y, z_m)
        	tmp = 0.0
        	if (z_m <= 8.6e-128)
        		tmp = Float64(fma(Float64(Float64(y * y) * x_m), -0.16666666666666666, x_m) / z_m);
        	else
        		tmp = Float64(Float64(Float64(Float64(-y) / fma(Float64(-0.16666666666666666 * y), y, -1.0)) / Float64(z_m * y)) * x_m);
        	end
        	return Float64(z_s * Float64(x_s * tmp))
        end
        
        x\_m = N[Abs[x], $MachinePrecision]
        x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
        z\_m = N[Abs[z], $MachinePrecision]
        z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
        code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_] := N[(z$95$s * N[(x$95$s * If[LessEqual[z$95$m, 8.6e-128], N[(N[(N[(N[(y * y), $MachinePrecision] * x$95$m), $MachinePrecision] * -0.16666666666666666 + x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision], N[(N[(N[((-y) / N[(N[(-0.16666666666666666 * y), $MachinePrecision] * y + -1.0), $MachinePrecision]), $MachinePrecision] / N[(z$95$m * y), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        x\_m = \left|x\right|
        \\
        x\_s = \mathsf{copysign}\left(1, x\right)
        \\
        z\_m = \left|z\right|
        \\
        z\_s = \mathsf{copysign}\left(1, z\right)
        
        \\
        z\_s \cdot \left(x\_s \cdot \begin{array}{l}
        \mathbf{if}\;z\_m \leq 8.6 \cdot 10^{-128}:\\
        \;\;\;\;\frac{\mathsf{fma}\left(\left(y \cdot y\right) \cdot x\_m, -0.16666666666666666, x\_m\right)}{z\_m}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\frac{-y}{\mathsf{fma}\left(-0.16666666666666666 \cdot y, y, -1\right)}}{z\_m \cdot y} \cdot x\_m\\
        
        
        \end{array}\right)
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < 8.59999999999999988e-128

          1. Initial program 89.7%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\mathsf{fma}\left(\left(y \cdot y\right) \cdot x, -0.16666666666666666, x\right)}{z} \]
          4. Applied rewrites53.6%

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

          if 8.59999999999999988e-128 < z

          1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\sin y}{\color{blue}{z \cdot y}} \cdot x \]
            12. lower-*.f6491.9

              \[\leadsto \frac{\sin y}{\color{blue}{z \cdot y}} \cdot x \]
          3. Applied rewrites91.9%

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

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

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

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

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

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

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

              \[\leadsto \frac{\mathsf{fma}\left(y \cdot y, \frac{-1}{6}, 1\right) \cdot y}{z \cdot y} \cdot x \]
            7. lift-*.f6450.7

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\frac{y \cdot \left(\left(\left(y \cdot y\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1\right)}{\color{blue}{\left(y \cdot y\right) \cdot \frac{-1}{6} - 1}}}{z \cdot y} \cdot x \]
          8. Applied rewrites49.4%

            \[\leadsto \frac{\frac{y \cdot \mathsf{fma}\left(0.027777777777777776, \left(\left(y \cdot y\right) \cdot y\right) \cdot y, -1\right)}{\color{blue}{\mathsf{fma}\left(-0.16666666666666666 \cdot y, y, -1\right)}}}{z \cdot y} \cdot x \]
          9. Taylor expanded in y around 0

            \[\leadsto \frac{\frac{-1 \cdot y}{\mathsf{fma}\left(\color{blue}{\frac{-1}{6} \cdot y}, y, -1\right)}}{z \cdot y} \cdot x \]
          10. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \frac{\frac{\mathsf{neg}\left(y\right)}{\mathsf{fma}\left(\frac{-1}{6} \cdot \color{blue}{y}, y, -1\right)}}{z \cdot y} \cdot x \]
            2. lower-neg.f6469.2

              \[\leadsto \frac{\frac{-y}{\mathsf{fma}\left(-0.16666666666666666 \cdot \color{blue}{y}, y, -1\right)}}{z \cdot y} \cdot x \]
          11. Applied rewrites69.2%

            \[\leadsto \frac{\frac{-y}{\mathsf{fma}\left(\color{blue}{-0.16666666666666666 \cdot y}, y, -1\right)}}{z \cdot y} \cdot x \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 6: 66.3% accurate, 0.8× speedup?

        \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{\sin y}{y} \leq 0.04:\\ \;\;\;\;y \cdot \frac{\frac{x\_m}{y}}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m \cdot \mathsf{fma}\left(y \cdot y, -0.16666666666666666, 1\right)}{z\_m}\\ \end{array}\right) \end{array} \]
        x\_m = (fabs.f64 x)
        x\_s = (copysign.f64 #s(literal 1 binary64) x)
        z\_m = (fabs.f64 z)
        z\_s = (copysign.f64 #s(literal 1 binary64) z)
        (FPCore (z_s x_s x_m y z_m)
         :precision binary64
         (*
          z_s
          (*
           x_s
           (if (<= (/ (sin y) y) 0.04)
             (* y (/ (/ x_m y) z_m))
             (/ (* x_m (fma (* y y) -0.16666666666666666 1.0)) z_m)))))
        x\_m = fabs(x);
        x\_s = copysign(1.0, x);
        z\_m = fabs(z);
        z\_s = copysign(1.0, z);
        double code(double z_s, double x_s, double x_m, double y, double z_m) {
        	double tmp;
        	if ((sin(y) / y) <= 0.04) {
        		tmp = y * ((x_m / y) / z_m);
        	} else {
        		tmp = (x_m * fma((y * y), -0.16666666666666666, 1.0)) / z_m;
        	}
        	return z_s * (x_s * tmp);
        }
        
        x\_m = abs(x)
        x\_s = copysign(1.0, x)
        z\_m = abs(z)
        z\_s = copysign(1.0, z)
        function code(z_s, x_s, x_m, y, z_m)
        	tmp = 0.0
        	if (Float64(sin(y) / y) <= 0.04)
        		tmp = Float64(y * Float64(Float64(x_m / y) / z_m));
        	else
        		tmp = Float64(Float64(x_m * fma(Float64(y * y), -0.16666666666666666, 1.0)) / z_m);
        	end
        	return Float64(z_s * Float64(x_s * tmp))
        end
        
        x\_m = N[Abs[x], $MachinePrecision]
        x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
        z\_m = N[Abs[z], $MachinePrecision]
        z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
        code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_] := N[(z$95$s * N[(x$95$s * If[LessEqual[N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision], 0.04], N[(y * N[(N[(x$95$m / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m * N[(N[(y * y), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        x\_m = \left|x\right|
        \\
        x\_s = \mathsf{copysign}\left(1, x\right)
        \\
        z\_m = \left|z\right|
        \\
        z\_s = \mathsf{copysign}\left(1, z\right)
        
        \\
        z\_s \cdot \left(x\_s \cdot \begin{array}{l}
        \mathbf{if}\;\frac{\sin y}{y} \leq 0.04:\\
        \;\;\;\;y \cdot \frac{\frac{x\_m}{y}}{z\_m}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{x\_m \cdot \mathsf{fma}\left(y \cdot y, -0.16666666666666666, 1\right)}{z\_m}\\
        
        
        \end{array}\right)
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 (sin.f64 y) y) < 0.0400000000000000008

          1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \sin y \cdot \frac{x}{\color{blue}{z \cdot y}} \]
            13. lower-*.f6491.4

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

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

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

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

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

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

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

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

                \[\leadsto y \cdot \color{blue}{\frac{\frac{x}{y}}{z}} \]
              6. lift-/.f6433.2

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

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

            if 0.0400000000000000008 < (/.f64 (sin.f64 y) y)

            1. Initial program 100.0%

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

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

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

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

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

                \[\leadsto \frac{x \cdot \mathsf{fma}\left(y \cdot y, \frac{-1}{6}, 1\right)}{z} \]
              5. lower-*.f6499.6

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

              \[\leadsto \frac{x \cdot \color{blue}{\mathsf{fma}\left(y \cdot y, -0.16666666666666666, 1\right)}}{z} \]
          6. Recombined 2 regimes into one program.
          7. Add Preprocessing

          Alternative 7: 66.1% accurate, 0.8× speedup?

          \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{\sin y}{y} \leq 0.04:\\ \;\;\;\;y \cdot \frac{\frac{x\_m}{y}}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(y \cdot y\right) \cdot x\_m, -0.16666666666666666, x\_m\right)}{z\_m}\\ \end{array}\right) \end{array} \]
          x\_m = (fabs.f64 x)
          x\_s = (copysign.f64 #s(literal 1 binary64) x)
          z\_m = (fabs.f64 z)
          z\_s = (copysign.f64 #s(literal 1 binary64) z)
          (FPCore (z_s x_s x_m y z_m)
           :precision binary64
           (*
            z_s
            (*
             x_s
             (if (<= (/ (sin y) y) 0.04)
               (* y (/ (/ x_m y) z_m))
               (/ (fma (* (* y y) x_m) -0.16666666666666666 x_m) z_m)))))
          x\_m = fabs(x);
          x\_s = copysign(1.0, x);
          z\_m = fabs(z);
          z\_s = copysign(1.0, z);
          double code(double z_s, double x_s, double x_m, double y, double z_m) {
          	double tmp;
          	if ((sin(y) / y) <= 0.04) {
          		tmp = y * ((x_m / y) / z_m);
          	} else {
          		tmp = fma(((y * y) * x_m), -0.16666666666666666, x_m) / z_m;
          	}
          	return z_s * (x_s * tmp);
          }
          
          x\_m = abs(x)
          x\_s = copysign(1.0, x)
          z\_m = abs(z)
          z\_s = copysign(1.0, z)
          function code(z_s, x_s, x_m, y, z_m)
          	tmp = 0.0
          	if (Float64(sin(y) / y) <= 0.04)
          		tmp = Float64(y * Float64(Float64(x_m / y) / z_m));
          	else
          		tmp = Float64(fma(Float64(Float64(y * y) * x_m), -0.16666666666666666, x_m) / z_m);
          	end
          	return Float64(z_s * Float64(x_s * tmp))
          end
          
          x\_m = N[Abs[x], $MachinePrecision]
          x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
          z\_m = N[Abs[z], $MachinePrecision]
          z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
          code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_] := N[(z$95$s * N[(x$95$s * If[LessEqual[N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision], 0.04], N[(y * N[(N[(x$95$m / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y * y), $MachinePrecision] * x$95$m), $MachinePrecision] * -0.16666666666666666 + x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          x\_m = \left|x\right|
          \\
          x\_s = \mathsf{copysign}\left(1, x\right)
          \\
          z\_m = \left|z\right|
          \\
          z\_s = \mathsf{copysign}\left(1, z\right)
          
          \\
          z\_s \cdot \left(x\_s \cdot \begin{array}{l}
          \mathbf{if}\;\frac{\sin y}{y} \leq 0.04:\\
          \;\;\;\;y \cdot \frac{\frac{x\_m}{y}}{z\_m}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\mathsf{fma}\left(\left(y \cdot y\right) \cdot x\_m, -0.16666666666666666, x\_m\right)}{z\_m}\\
          
          
          \end{array}\right)
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (/.f64 (sin.f64 y) y) < 0.0400000000000000008

            1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \sin y \cdot \frac{x}{\color{blue}{z \cdot y}} \]
              13. lower-*.f6491.4

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

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

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

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

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

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

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

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

                  \[\leadsto y \cdot \color{blue}{\frac{\frac{x}{y}}{z}} \]
                6. lift-/.f6433.2

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

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

              if 0.0400000000000000008 < (/.f64 (sin.f64 y) y)

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\mathsf{fma}\left(\left(y \cdot y\right) \cdot x, -0.16666666666666666, x\right)}{z} \]
              4. Applied rewrites99.6%

                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(y \cdot y\right) \cdot x, -0.16666666666666666, x\right)}}{z} \]
            6. Recombined 2 regimes into one program.
            7. Add Preprocessing

            Alternative 8: 66.1% accurate, 0.8× speedup?

            \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{\sin y}{y} \leq 0.04:\\ \;\;\;\;y \cdot \frac{\frac{x\_m}{y}}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y \cdot y, -0.16666666666666666, 1\right)}{z\_m} \cdot x\_m\\ \end{array}\right) \end{array} \]
            x\_m = (fabs.f64 x)
            x\_s = (copysign.f64 #s(literal 1 binary64) x)
            z\_m = (fabs.f64 z)
            z\_s = (copysign.f64 #s(literal 1 binary64) z)
            (FPCore (z_s x_s x_m y z_m)
             :precision binary64
             (*
              z_s
              (*
               x_s
               (if (<= (/ (sin y) y) 0.04)
                 (* y (/ (/ x_m y) z_m))
                 (* (/ (fma (* y y) -0.16666666666666666 1.0) z_m) x_m)))))
            x\_m = fabs(x);
            x\_s = copysign(1.0, x);
            z\_m = fabs(z);
            z\_s = copysign(1.0, z);
            double code(double z_s, double x_s, double x_m, double y, double z_m) {
            	double tmp;
            	if ((sin(y) / y) <= 0.04) {
            		tmp = y * ((x_m / y) / z_m);
            	} else {
            		tmp = (fma((y * y), -0.16666666666666666, 1.0) / z_m) * x_m;
            	}
            	return z_s * (x_s * tmp);
            }
            
            x\_m = abs(x)
            x\_s = copysign(1.0, x)
            z\_m = abs(z)
            z\_s = copysign(1.0, z)
            function code(z_s, x_s, x_m, y, z_m)
            	tmp = 0.0
            	if (Float64(sin(y) / y) <= 0.04)
            		tmp = Float64(y * Float64(Float64(x_m / y) / z_m));
            	else
            		tmp = Float64(Float64(fma(Float64(y * y), -0.16666666666666666, 1.0) / z_m) * x_m);
            	end
            	return Float64(z_s * Float64(x_s * tmp))
            end
            
            x\_m = N[Abs[x], $MachinePrecision]
            x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
            z\_m = N[Abs[z], $MachinePrecision]
            z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
            code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_] := N[(z$95$s * N[(x$95$s * If[LessEqual[N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision], 0.04], N[(y * N[(N[(x$95$m / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y * y), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision] / z$95$m), $MachinePrecision] * x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            x\_m = \left|x\right|
            \\
            x\_s = \mathsf{copysign}\left(1, x\right)
            \\
            z\_m = \left|z\right|
            \\
            z\_s = \mathsf{copysign}\left(1, z\right)
            
            \\
            z\_s \cdot \left(x\_s \cdot \begin{array}{l}
            \mathbf{if}\;\frac{\sin y}{y} \leq 0.04:\\
            \;\;\;\;y \cdot \frac{\frac{x\_m}{y}}{z\_m}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{\mathsf{fma}\left(y \cdot y, -0.16666666666666666, 1\right)}{z\_m} \cdot x\_m\\
            
            
            \end{array}\right)
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (/.f64 (sin.f64 y) y) < 0.0400000000000000008

              1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \sin y \cdot \frac{x}{\color{blue}{z \cdot y}} \]
                13. lower-*.f6491.4

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

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

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

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

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

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

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

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

                    \[\leadsto y \cdot \color{blue}{\frac{\frac{x}{y}}{z}} \]
                  6. lift-/.f6433.2

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

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

                if 0.0400000000000000008 < (/.f64 (sin.f64 y) y)

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{\sin y}{\color{blue}{z \cdot y}} \cdot x \]
                  12. lower-*.f6485.1

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

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

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

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

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

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

                    \[\leadsto \frac{1 + \frac{-1}{6} \cdot {y}^{2}}{\color{blue}{z}} \cdot x \]
                  5. +-commutativeN/A

                    \[\leadsto \frac{\frac{-1}{6} \cdot {y}^{2} + 1}{z} \cdot x \]
                  6. *-commutativeN/A

                    \[\leadsto \frac{{y}^{2} \cdot \frac{-1}{6} + 1}{z} \cdot x \]
                  7. lower-fma.f64N/A

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

                    \[\leadsto \frac{\mathsf{fma}\left(y \cdot y, \frac{-1}{6}, 1\right)}{z} \cdot x \]
                  9. lift-*.f6499.3

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

                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y \cdot y, -0.16666666666666666, 1\right)}{z}} \cdot x \]
              6. Recombined 2 regimes into one program.
              7. Add Preprocessing

              Alternative 9: 66.0% accurate, 0.9× speedup?

              \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{\sin y}{y} \leq 5 \cdot 10^{-10}:\\ \;\;\;\;y \cdot \frac{\frac{x\_m}{y}}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z\_m}\\ \end{array}\right) \end{array} \]
              x\_m = (fabs.f64 x)
              x\_s = (copysign.f64 #s(literal 1 binary64) x)
              z\_m = (fabs.f64 z)
              z\_s = (copysign.f64 #s(literal 1 binary64) z)
              (FPCore (z_s x_s x_m y z_m)
               :precision binary64
               (*
                z_s
                (* x_s (if (<= (/ (sin y) y) 5e-10) (* y (/ (/ x_m y) z_m)) (/ x_m z_m)))))
              x\_m = fabs(x);
              x\_s = copysign(1.0, x);
              z\_m = fabs(z);
              z\_s = copysign(1.0, z);
              double code(double z_s, double x_s, double x_m, double y, double z_m) {
              	double tmp;
              	if ((sin(y) / y) <= 5e-10) {
              		tmp = y * ((x_m / y) / z_m);
              	} else {
              		tmp = x_m / z_m;
              	}
              	return z_s * (x_s * tmp);
              }
              
              x\_m =     private
              x\_s =     private
              z\_m =     private
              z\_s =     private
              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(z_s, x_s, x_m, y, z_m)
              use fmin_fmax_functions
                  real(8), intent (in) :: z_s
                  real(8), intent (in) :: x_s
                  real(8), intent (in) :: x_m
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z_m
                  real(8) :: tmp
                  if ((sin(y) / y) <= 5d-10) then
                      tmp = y * ((x_m / y) / z_m)
                  else
                      tmp = x_m / z_m
                  end if
                  code = z_s * (x_s * tmp)
              end function
              
              x\_m = Math.abs(x);
              x\_s = Math.copySign(1.0, x);
              z\_m = Math.abs(z);
              z\_s = Math.copySign(1.0, z);
              public static double code(double z_s, double x_s, double x_m, double y, double z_m) {
              	double tmp;
              	if ((Math.sin(y) / y) <= 5e-10) {
              		tmp = y * ((x_m / y) / z_m);
              	} else {
              		tmp = x_m / z_m;
              	}
              	return z_s * (x_s * tmp);
              }
              
              x\_m = math.fabs(x)
              x\_s = math.copysign(1.0, x)
              z\_m = math.fabs(z)
              z\_s = math.copysign(1.0, z)
              def code(z_s, x_s, x_m, y, z_m):
              	tmp = 0
              	if (math.sin(y) / y) <= 5e-10:
              		tmp = y * ((x_m / y) / z_m)
              	else:
              		tmp = x_m / z_m
              	return z_s * (x_s * tmp)
              
              x\_m = abs(x)
              x\_s = copysign(1.0, x)
              z\_m = abs(z)
              z\_s = copysign(1.0, z)
              function code(z_s, x_s, x_m, y, z_m)
              	tmp = 0.0
              	if (Float64(sin(y) / y) <= 5e-10)
              		tmp = Float64(y * Float64(Float64(x_m / y) / z_m));
              	else
              		tmp = Float64(x_m / z_m);
              	end
              	return Float64(z_s * Float64(x_s * tmp))
              end
              
              x\_m = abs(x);
              x\_s = sign(x) * abs(1.0);
              z\_m = abs(z);
              z\_s = sign(z) * abs(1.0);
              function tmp_2 = code(z_s, x_s, x_m, y, z_m)
              	tmp = 0.0;
              	if ((sin(y) / y) <= 5e-10)
              		tmp = y * ((x_m / y) / z_m);
              	else
              		tmp = x_m / z_m;
              	end
              	tmp_2 = z_s * (x_s * tmp);
              end
              
              x\_m = N[Abs[x], $MachinePrecision]
              x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
              z\_m = N[Abs[z], $MachinePrecision]
              z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
              code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_] := N[(z$95$s * N[(x$95$s * If[LessEqual[N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision], 5e-10], N[(y * N[(N[(x$95$m / y), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(x$95$m / z$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
              
              \begin{array}{l}
              x\_m = \left|x\right|
              \\
              x\_s = \mathsf{copysign}\left(1, x\right)
              \\
              z\_m = \left|z\right|
              \\
              z\_s = \mathsf{copysign}\left(1, z\right)
              
              \\
              z\_s \cdot \left(x\_s \cdot \begin{array}{l}
              \mathbf{if}\;\frac{\sin y}{y} \leq 5 \cdot 10^{-10}:\\
              \;\;\;\;y \cdot \frac{\frac{x\_m}{y}}{z\_m}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{x\_m}{z\_m}\\
              
              
              \end{array}\right)
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (/.f64 (sin.f64 y) y) < 5.00000000000000031e-10

                1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \sin y \cdot \frac{x}{\color{blue}{z \cdot y}} \]
                  13. lower-*.f6491.3

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

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

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

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

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

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

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

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

                      \[\leadsto y \cdot \color{blue}{\frac{\frac{x}{y}}{z}} \]
                    6. lift-/.f6433.2

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

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

                  if 5.00000000000000031e-10 < (/.f64 (sin.f64 y) y)

                  1. Initial program 100.0%

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

                    \[\leadsto \frac{\color{blue}{x}}{z} \]
                  3. Step-by-step derivation
                    1. Applied rewrites98.3%

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

                  Alternative 10: 64.6% accurate, 0.9× speedup?

                  \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{\sin y}{y} \leq 0.999999:\\ \;\;\;\;y \cdot \frac{x\_m}{z\_m \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z\_m}\\ \end{array}\right) \end{array} \]
                  x\_m = (fabs.f64 x)
                  x\_s = (copysign.f64 #s(literal 1 binary64) x)
                  z\_m = (fabs.f64 z)
                  z\_s = (copysign.f64 #s(literal 1 binary64) z)
                  (FPCore (z_s x_s x_m y z_m)
                   :precision binary64
                   (*
                    z_s
                    (*
                     x_s
                     (if (<= (/ (sin y) y) 0.999999) (* y (/ x_m (* z_m y))) (/ x_m z_m)))))
                  x\_m = fabs(x);
                  x\_s = copysign(1.0, x);
                  z\_m = fabs(z);
                  z\_s = copysign(1.0, z);
                  double code(double z_s, double x_s, double x_m, double y, double z_m) {
                  	double tmp;
                  	if ((sin(y) / y) <= 0.999999) {
                  		tmp = y * (x_m / (z_m * y));
                  	} else {
                  		tmp = x_m / z_m;
                  	}
                  	return z_s * (x_s * tmp);
                  }
                  
                  x\_m =     private
                  x\_s =     private
                  z\_m =     private
                  z\_s =     private
                  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(z_s, x_s, x_m, y, z_m)
                  use fmin_fmax_functions
                      real(8), intent (in) :: z_s
                      real(8), intent (in) :: x_s
                      real(8), intent (in) :: x_m
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z_m
                      real(8) :: tmp
                      if ((sin(y) / y) <= 0.999999d0) then
                          tmp = y * (x_m / (z_m * y))
                      else
                          tmp = x_m / z_m
                      end if
                      code = z_s * (x_s * tmp)
                  end function
                  
                  x\_m = Math.abs(x);
                  x\_s = Math.copySign(1.0, x);
                  z\_m = Math.abs(z);
                  z\_s = Math.copySign(1.0, z);
                  public static double code(double z_s, double x_s, double x_m, double y, double z_m) {
                  	double tmp;
                  	if ((Math.sin(y) / y) <= 0.999999) {
                  		tmp = y * (x_m / (z_m * y));
                  	} else {
                  		tmp = x_m / z_m;
                  	}
                  	return z_s * (x_s * tmp);
                  }
                  
                  x\_m = math.fabs(x)
                  x\_s = math.copysign(1.0, x)
                  z\_m = math.fabs(z)
                  z\_s = math.copysign(1.0, z)
                  def code(z_s, x_s, x_m, y, z_m):
                  	tmp = 0
                  	if (math.sin(y) / y) <= 0.999999:
                  		tmp = y * (x_m / (z_m * y))
                  	else:
                  		tmp = x_m / z_m
                  	return z_s * (x_s * tmp)
                  
                  x\_m = abs(x)
                  x\_s = copysign(1.0, x)
                  z\_m = abs(z)
                  z\_s = copysign(1.0, z)
                  function code(z_s, x_s, x_m, y, z_m)
                  	tmp = 0.0
                  	if (Float64(sin(y) / y) <= 0.999999)
                  		tmp = Float64(y * Float64(x_m / Float64(z_m * y)));
                  	else
                  		tmp = Float64(x_m / z_m);
                  	end
                  	return Float64(z_s * Float64(x_s * tmp))
                  end
                  
                  x\_m = abs(x);
                  x\_s = sign(x) * abs(1.0);
                  z\_m = abs(z);
                  z\_s = sign(z) * abs(1.0);
                  function tmp_2 = code(z_s, x_s, x_m, y, z_m)
                  	tmp = 0.0;
                  	if ((sin(y) / y) <= 0.999999)
                  		tmp = y * (x_m / (z_m * y));
                  	else
                  		tmp = x_m / z_m;
                  	end
                  	tmp_2 = z_s * (x_s * tmp);
                  end
                  
                  x\_m = N[Abs[x], $MachinePrecision]
                  x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                  z\_m = N[Abs[z], $MachinePrecision]
                  z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                  code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_] := N[(z$95$s * N[(x$95$s * If[LessEqual[N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision], 0.999999], N[(y * N[(x$95$m / N[(z$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m / z$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
                  
                  \begin{array}{l}
                  x\_m = \left|x\right|
                  \\
                  x\_s = \mathsf{copysign}\left(1, x\right)
                  \\
                  z\_m = \left|z\right|
                  \\
                  z\_s = \mathsf{copysign}\left(1, z\right)
                  
                  \\
                  z\_s \cdot \left(x\_s \cdot \begin{array}{l}
                  \mathbf{if}\;\frac{\sin y}{y} \leq 0.999999:\\
                  \;\;\;\;y \cdot \frac{x\_m}{z\_m \cdot y}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{x\_m}{z\_m}\\
                  
                  
                  \end{array}\right)
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (/.f64 (sin.f64 y) y) < 0.999998999999999971

                    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \sin y \cdot \frac{x}{\color{blue}{z \cdot y}} \]
                      13. lower-*.f6491.5

                        \[\leadsto \sin y \cdot \frac{x}{\color{blue}{z \cdot y}} \]
                    3. Applied rewrites91.5%

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

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

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

                      if 0.999998999999999971 < (/.f64 (sin.f64 y) y)

                      1. Initial program 100.0%

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

                        \[\leadsto \frac{\color{blue}{x}}{z} \]
                      3. Step-by-step derivation
                        1. Applied rewrites99.7%

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

                      Alternative 11: 58.8% accurate, 9.7× speedup?

                      \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(x\_s \cdot \frac{x\_m}{z\_m}\right) \end{array} \]
                      x\_m = (fabs.f64 x)
                      x\_s = (copysign.f64 #s(literal 1 binary64) x)
                      z\_m = (fabs.f64 z)
                      z\_s = (copysign.f64 #s(literal 1 binary64) z)
                      (FPCore (z_s x_s x_m y z_m) :precision binary64 (* z_s (* x_s (/ x_m z_m))))
                      x\_m = fabs(x);
                      x\_s = copysign(1.0, x);
                      z\_m = fabs(z);
                      z\_s = copysign(1.0, z);
                      double code(double z_s, double x_s, double x_m, double y, double z_m) {
                      	return z_s * (x_s * (x_m / z_m));
                      }
                      
                      x\_m =     private
                      x\_s =     private
                      z\_m =     private
                      z\_s =     private
                      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(z_s, x_s, x_m, y, z_m)
                      use fmin_fmax_functions
                          real(8), intent (in) :: z_s
                          real(8), intent (in) :: x_s
                          real(8), intent (in) :: x_m
                          real(8), intent (in) :: y
                          real(8), intent (in) :: z_m
                          code = z_s * (x_s * (x_m / z_m))
                      end function
                      
                      x\_m = Math.abs(x);
                      x\_s = Math.copySign(1.0, x);
                      z\_m = Math.abs(z);
                      z\_s = Math.copySign(1.0, z);
                      public static double code(double z_s, double x_s, double x_m, double y, double z_m) {
                      	return z_s * (x_s * (x_m / z_m));
                      }
                      
                      x\_m = math.fabs(x)
                      x\_s = math.copysign(1.0, x)
                      z\_m = math.fabs(z)
                      z\_s = math.copysign(1.0, z)
                      def code(z_s, x_s, x_m, y, z_m):
                      	return z_s * (x_s * (x_m / z_m))
                      
                      x\_m = abs(x)
                      x\_s = copysign(1.0, x)
                      z\_m = abs(z)
                      z\_s = copysign(1.0, z)
                      function code(z_s, x_s, x_m, y, z_m)
                      	return Float64(z_s * Float64(x_s * Float64(x_m / z_m)))
                      end
                      
                      x\_m = abs(x);
                      x\_s = sign(x) * abs(1.0);
                      z\_m = abs(z);
                      z\_s = sign(z) * abs(1.0);
                      function tmp = code(z_s, x_s, x_m, y, z_m)
                      	tmp = z_s * (x_s * (x_m / z_m));
                      end
                      
                      x\_m = N[Abs[x], $MachinePrecision]
                      x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                      z\_m = N[Abs[z], $MachinePrecision]
                      z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                      code[z$95$s_, x$95$s_, x$95$m_, y_, z$95$m_] := N[(z$95$s * N[(x$95$s * N[(x$95$m / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                      
                      \begin{array}{l}
                      x\_m = \left|x\right|
                      \\
                      x\_s = \mathsf{copysign}\left(1, x\right)
                      \\
                      z\_m = \left|z\right|
                      \\
                      z\_s = \mathsf{copysign}\left(1, z\right)
                      
                      \\
                      z\_s \cdot \left(x\_s \cdot \frac{x\_m}{z\_m}\right)
                      \end{array}
                      
                      Derivation
                      1. Initial program 96.1%

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

                        \[\leadsto \frac{\color{blue}{x}}{z} \]
                      3. Step-by-step derivation
                        1. Applied rewrites58.8%

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

                        Reproduce

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