Linear.Quaternion:$ctanh from linear-1.19.1.3

Percentage Accurate: 96.2% → 95.5%
Time: 9.2s
Alternatives: 17
Speedup: 1.0×

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;
}
real(8) function code(x, y, z)
    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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 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.2% 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;
}
real(8) function code(x, y, z)
    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: 95.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sin y}{y}\\ \mathbf{if}\;t_0 \leq 10^{-227}:\\ \;\;\;\;\frac{t_0 \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{1}{\frac{t_0}{z}}}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (/ (sin y) y)))
   (if (<= t_0 1e-227) (/ (* t_0 x) z) (/ x (/ 1.0 (/ t_0 z))))))
double code(double x, double y, double z) {
	double t_0 = sin(y) / y;
	double tmp;
	if (t_0 <= 1e-227) {
		tmp = (t_0 * x) / z;
	} else {
		tmp = x / (1.0 / (t_0 / z));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sin(y) / y
    if (t_0 <= 1d-227) then
        tmp = (t_0 * x) / z
    else
        tmp = x / (1.0d0 / (t_0 / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = Math.sin(y) / y;
	double tmp;
	if (t_0 <= 1e-227) {
		tmp = (t_0 * x) / z;
	} else {
		tmp = x / (1.0 / (t_0 / z));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.sin(y) / y
	tmp = 0
	if t_0 <= 1e-227:
		tmp = (t_0 * x) / z
	else:
		tmp = x / (1.0 / (t_0 / z))
	return tmp
function code(x, y, z)
	t_0 = Float64(sin(y) / y)
	tmp = 0.0
	if (t_0 <= 1e-227)
		tmp = Float64(Float64(t_0 * x) / z);
	else
		tmp = Float64(x / Float64(1.0 / Float64(t_0 / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = sin(y) / y;
	tmp = 0.0;
	if (t_0 <= 1e-227)
		tmp = (t_0 * x) / z;
	else
		tmp = x / (1.0 / (t_0 / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-227], N[(N[(t$95$0 * x), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(1.0 / N[(t$95$0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sin y}{y}\\
\mathbf{if}\;t_0 \leq 10^{-227}:\\
\;\;\;\;\frac{t_0 \cdot x}{z}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{1}{\frac{t_0}{z}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (sin.f64 y) y) < 9.99999999999999945e-228

    1. Initial program 99.0%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]

    if 9.99999999999999945e-228 < (/.f64 (sin.f64 y) y)

    1. Initial program 96.6%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-/l*99.3%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}} \]
      2. associate-/r/84.3%

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{\sin y} \cdot y}} \]
    4. Step-by-step derivation
      1. associate-/r/99.3%

        \[\leadsto \frac{x}{\color{blue}{\frac{z}{\frac{\sin y}{y}}}} \]
      2. clear-num99.1%

        \[\leadsto \frac{x}{\color{blue}{\frac{1}{\frac{\frac{\sin y}{y}}{z}}}} \]
    5. Applied egg-rr99.1%

      \[\leadsto \frac{x}{\color{blue}{\frac{1}{\frac{\frac{\sin y}{y}}{z}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sin y}{y} \leq 10^{-227}:\\ \;\;\;\;\frac{\frac{\sin y}{y} \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{1}{\frac{\frac{\sin y}{y}}{z}}}\\ \end{array} \]

Alternative 2: 95.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.00152 \lor \neg \left(y \leq 2.55 \cdot 10^{-11}\right):\\ \;\;\;\;\sin y \cdot \frac{x}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -0.00152) (not (<= y 2.55e-11)))
   (* (sin y) (/ x (* y z)))
   (/ x z)))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -0.00152) || !(y <= 2.55e-11)) {
		tmp = sin(y) * (x / (y * z));
	} else {
		tmp = x / z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((y <= (-0.00152d0)) .or. (.not. (y <= 2.55d-11))) then
        tmp = sin(y) * (x / (y * z))
    else
        tmp = x / z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -0.00152) || !(y <= 2.55e-11)) {
		tmp = Math.sin(y) * (x / (y * z));
	} else {
		tmp = x / z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -0.00152) or not (y <= 2.55e-11):
		tmp = math.sin(y) * (x / (y * z))
	else:
		tmp = x / z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -0.00152) || !(y <= 2.55e-11))
		tmp = Float64(sin(y) * Float64(x / Float64(y * z)));
	else
		tmp = Float64(x / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -0.00152) || ~((y <= 2.55e-11)))
		tmp = sin(y) * (x / (y * z));
	else
		tmp = x / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.00152], N[Not[LessEqual[y, 2.55e-11]], $MachinePrecision]], N[(N[Sin[y], $MachinePrecision] * N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00152 \lor \neg \left(y \leq 2.55 \cdot 10^{-11}\right):\\
\;\;\;\;\sin y \cdot \frac{x}{y \cdot z}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -0.0015200000000000001 or 2.54999999999999992e-11 < y

    1. Initial program 95.2%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*l/92.7%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\sin y}{y}} \]
      2. times-frac92.4%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative92.4%

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

        \[\leadsto \color{blue}{\sin y \cdot \frac{x}{z \cdot y}} \]
      5. *-commutative92.5%

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

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

    if -0.0015200000000000001 < y < 2.54999999999999992e-11

    1. Initial program 100.0%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*l/100.0%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\sin y}{y}} \]
      2. times-frac78.8%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative78.8%

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

        \[\leadsto \color{blue}{\sin y \cdot \frac{x}{z \cdot y}} \]
      5. *-commutative76.4%

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

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

      \[\leadsto \color{blue}{\frac{x}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.00152 \lor \neg \left(y \leq 2.55 \cdot 10^{-11}\right):\\ \;\;\;\;\sin y \cdot \frac{x}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z}\\ \end{array} \]

Alternative 3: 95.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.00152:\\ \;\;\;\;\frac{\sin y}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;y \leq 2.55 \cdot 10^{-11}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\sin y \cdot \frac{x}{y \cdot z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -0.00152)
   (* (/ (sin y) z) (/ x y))
   (if (<= y 2.55e-11) (/ x z) (* (sin y) (/ x (* y z))))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -0.00152) {
		tmp = (sin(y) / z) * (x / y);
	} else if (y <= 2.55e-11) {
		tmp = x / z;
	} else {
		tmp = sin(y) * (x / (y * z));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-0.00152d0)) then
        tmp = (sin(y) / z) * (x / y)
    else if (y <= 2.55d-11) then
        tmp = x / z
    else
        tmp = sin(y) * (x / (y * z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -0.00152) {
		tmp = (Math.sin(y) / z) * (x / y);
	} else if (y <= 2.55e-11) {
		tmp = x / z;
	} else {
		tmp = Math.sin(y) * (x / (y * z));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -0.00152:
		tmp = (math.sin(y) / z) * (x / y)
	elif y <= 2.55e-11:
		tmp = x / z
	else:
		tmp = math.sin(y) * (x / (y * z))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -0.00152)
		tmp = Float64(Float64(sin(y) / z) * Float64(x / y));
	elseif (y <= 2.55e-11)
		tmp = Float64(x / z);
	else
		tmp = Float64(sin(y) * Float64(x / Float64(y * z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -0.00152)
		tmp = (sin(y) / z) * (x / y);
	elseif (y <= 2.55e-11)
		tmp = x / z;
	else
		tmp = sin(y) * (x / (y * z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -0.00152], N[(N[(N[Sin[y], $MachinePrecision] / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.55e-11], N[(x / z), $MachinePrecision], N[(N[Sin[y], $MachinePrecision] * N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00152:\\
\;\;\;\;\frac{\sin y}{z} \cdot \frac{x}{y}\\

\mathbf{elif}\;y \leq 2.55 \cdot 10^{-11}:\\
\;\;\;\;\frac{x}{z}\\

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


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

    1. Initial program 95.9%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*r/95.8%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot \sin y}{y}}}{z} \]
      2. associate-/l/90.8%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative90.8%

        \[\leadsto \frac{\color{blue}{\sin y \cdot x}}{z \cdot y} \]
      4. times-frac96.0%

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

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

    if -0.0015200000000000001 < y < 2.54999999999999992e-11

    1. Initial program 100.0%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*l/100.0%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\sin y}{y}} \]
      2. times-frac78.8%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative78.8%

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

        \[\leadsto \color{blue}{\sin y \cdot \frac{x}{z \cdot y}} \]
      5. *-commutative76.4%

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

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

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

    if 2.54999999999999992e-11 < y

    1. Initial program 94.2%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*l/94.6%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\sin y}{y}} \]
      2. times-frac94.5%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative94.5%

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

        \[\leadsto \color{blue}{\sin y \cdot \frac{x}{z \cdot y}} \]
      5. *-commutative94.7%

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

      \[\leadsto \color{blue}{\sin y \cdot \frac{x}{y \cdot z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification97.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.00152:\\ \;\;\;\;\frac{\sin y}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;y \leq 2.55 \cdot 10^{-11}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\sin y \cdot \frac{x}{y \cdot z}\\ \end{array} \]

Alternative 4: 95.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.00152:\\ \;\;\;\;\frac{\sin y}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-17}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \frac{z}{\sin y}}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -0.00152)
   (* (/ (sin y) z) (/ x y))
   (if (<= y 3e-17) (/ x z) (/ x (* y (/ z (sin y)))))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -0.00152) {
		tmp = (sin(y) / z) * (x / y);
	} else if (y <= 3e-17) {
		tmp = x / z;
	} else {
		tmp = x / (y * (z / sin(y)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-0.00152d0)) then
        tmp = (sin(y) / z) * (x / y)
    else if (y <= 3d-17) then
        tmp = x / z
    else
        tmp = x / (y * (z / sin(y)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -0.00152) {
		tmp = (Math.sin(y) / z) * (x / y);
	} else if (y <= 3e-17) {
		tmp = x / z;
	} else {
		tmp = x / (y * (z / Math.sin(y)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -0.00152:
		tmp = (math.sin(y) / z) * (x / y)
	elif y <= 3e-17:
		tmp = x / z
	else:
		tmp = x / (y * (z / math.sin(y)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -0.00152)
		tmp = Float64(Float64(sin(y) / z) * Float64(x / y));
	elseif (y <= 3e-17)
		tmp = Float64(x / z);
	else
		tmp = Float64(x / Float64(y * Float64(z / sin(y))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -0.00152)
		tmp = (sin(y) / z) * (x / y);
	elseif (y <= 3e-17)
		tmp = x / z;
	else
		tmp = x / (y * (z / sin(y)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -0.00152], N[(N[(N[Sin[y], $MachinePrecision] / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e-17], N[(x / z), $MachinePrecision], N[(x / N[(y * N[(z / N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00152:\\
\;\;\;\;\frac{\sin y}{z} \cdot \frac{x}{y}\\

\mathbf{elif}\;y \leq 3 \cdot 10^{-17}:\\
\;\;\;\;\frac{x}{z}\\

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


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

    1. Initial program 95.9%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*r/95.8%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot \sin y}{y}}}{z} \]
      2. associate-/l/90.8%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative90.8%

        \[\leadsto \frac{\color{blue}{\sin y \cdot x}}{z \cdot y} \]
      4. times-frac96.0%

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

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

    if -0.0015200000000000001 < y < 3.00000000000000006e-17

    1. Initial program 100.0%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*l/100.0%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\sin y}{y}} \]
      2. times-frac78.3%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative78.3%

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

        \[\leadsto \color{blue}{\sin y \cdot \frac{x}{z \cdot y}} \]
      5. *-commutative75.8%

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

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

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

    if 3.00000000000000006e-17 < y

    1. Initial program 94.5%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-/l*95.0%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}} \]
      2. associate-/r/95.0%

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{\sin y} \cdot y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification97.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.00152:\\ \;\;\;\;\frac{\sin y}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-17}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \frac{z}{\sin y}}\\ \end{array} \]

Alternative 5: 96.2% accurate, 1.0× speedup?

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

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

    \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
  2. Final simplification97.4%

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

Alternative 6: 65.5% accurate, 7.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.35:\\ \;\;\;\;\frac{x}{y \cdot z} \cdot \frac{6}{y}\\ \mathbf{elif}\;y \leq 1.06 \cdot 10^{+32}:\\ \;\;\;\;\frac{x \cdot \left(1 + \left(y \cdot y\right) \cdot -0.16666666666666666\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x \cdot \frac{6}{y}}{y}}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -2.35)
   (* (/ x (* y z)) (/ 6.0 y))
   (if (<= y 1.06e+32)
     (/ (* x (+ 1.0 (* (* y y) -0.16666666666666666))) z)
     (/ (/ (* x (/ 6.0 y)) y) z))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -2.35) {
		tmp = (x / (y * z)) * (6.0 / y);
	} else if (y <= 1.06e+32) {
		tmp = (x * (1.0 + ((y * y) * -0.16666666666666666))) / z;
	} else {
		tmp = ((x * (6.0 / y)) / y) / z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-2.35d0)) then
        tmp = (x / (y * z)) * (6.0d0 / y)
    else if (y <= 1.06d+32) then
        tmp = (x * (1.0d0 + ((y * y) * (-0.16666666666666666d0)))) / z
    else
        tmp = ((x * (6.0d0 / y)) / y) / z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -2.35) {
		tmp = (x / (y * z)) * (6.0 / y);
	} else if (y <= 1.06e+32) {
		tmp = (x * (1.0 + ((y * y) * -0.16666666666666666))) / z;
	} else {
		tmp = ((x * (6.0 / y)) / y) / z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -2.35:
		tmp = (x / (y * z)) * (6.0 / y)
	elif y <= 1.06e+32:
		tmp = (x * (1.0 + ((y * y) * -0.16666666666666666))) / z
	else:
		tmp = ((x * (6.0 / y)) / y) / z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -2.35)
		tmp = Float64(Float64(x / Float64(y * z)) * Float64(6.0 / y));
	elseif (y <= 1.06e+32)
		tmp = Float64(Float64(x * Float64(1.0 + Float64(Float64(y * y) * -0.16666666666666666))) / z);
	else
		tmp = Float64(Float64(Float64(x * Float64(6.0 / y)) / y) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -2.35)
		tmp = (x / (y * z)) * (6.0 / y);
	elseif (y <= 1.06e+32)
		tmp = (x * (1.0 + ((y * y) * -0.16666666666666666))) / z;
	else
		tmp = ((x * (6.0 / y)) / y) / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -2.35], N[(N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(6.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.06e+32], N[(N[(x * N[(1.0 + N[(N[(y * y), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(x * N[(6.0 / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.35:\\
\;\;\;\;\frac{x}{y \cdot z} \cdot \frac{6}{y}\\

\mathbf{elif}\;y \leq 1.06 \cdot 10^{+32}:\\
\;\;\;\;\frac{x \cdot \left(1 + \left(y \cdot y\right) \cdot -0.16666666666666666\right)}{z}\\

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


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

    1. Initial program 95.9%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-/l*90.9%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}} \]
      2. associate-/r/90.9%

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

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

      \[\leadsto \frac{x}{\color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot z\right) + \frac{z}{y}\right)} \cdot y} \]
    5. Taylor expanded in y around inf 31.7%

      \[\leadsto \color{blue}{6 \cdot \frac{x}{{y}^{2} \cdot z}} \]
    6. Step-by-step derivation
      1. *-commutative31.7%

        \[\leadsto \color{blue}{\frac{x}{{y}^{2} \cdot z} \cdot 6} \]
      2. associate-*l/31.7%

        \[\leadsto \color{blue}{\frac{x \cdot 6}{{y}^{2} \cdot z}} \]
      3. unpow231.7%

        \[\leadsto \frac{x \cdot 6}{\color{blue}{\left(y \cdot y\right)} \cdot z} \]
      4. associate-*l*31.6%

        \[\leadsto \frac{x \cdot 6}{\color{blue}{y \cdot \left(y \cdot z\right)}} \]
    7. Simplified31.6%

      \[\leadsto \color{blue}{\frac{x \cdot 6}{y \cdot \left(y \cdot z\right)}} \]
    8. Step-by-step derivation
      1. *-commutative31.6%

        \[\leadsto \frac{x \cdot 6}{\color{blue}{\left(y \cdot z\right) \cdot y}} \]
      2. times-frac32.8%

        \[\leadsto \color{blue}{\frac{x}{y \cdot z} \cdot \frac{6}{y}} \]
    9. Applied egg-rr32.8%

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

    if -2.35000000000000009 < y < 1.0600000000000001e32

    1. Initial program 100.0%

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

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

        \[\leadsto \frac{x \cdot \left(1 + -0.16666666666666666 \cdot \color{blue}{\left(y \cdot y\right)}\right)}{z} \]
    4. Simplified96.3%

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

    if 1.0600000000000001e32 < y

    1. Initial program 93.2%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-/l*93.8%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}} \]
      2. associate-/r/93.9%

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

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

      \[\leadsto \frac{x}{\color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot z\right) + \frac{z}{y}\right)} \cdot y} \]
    5. Taylor expanded in y around inf 29.9%

      \[\leadsto \color{blue}{6 \cdot \frac{x}{{y}^{2} \cdot z}} \]
    6. Step-by-step derivation
      1. *-commutative29.9%

        \[\leadsto 6 \cdot \frac{x}{\color{blue}{z \cdot {y}^{2}}} \]
      2. unpow229.9%

        \[\leadsto 6 \cdot \frac{x}{z \cdot \color{blue}{\left(y \cdot y\right)}} \]
    7. Simplified29.9%

      \[\leadsto \color{blue}{6 \cdot \frac{x}{z \cdot \left(y \cdot y\right)}} \]
    8. Step-by-step derivation
      1. associate-*r/29.9%

        \[\leadsto \color{blue}{\frac{6 \cdot x}{z \cdot \left(y \cdot y\right)}} \]
      2. *-commutative29.9%

        \[\leadsto \frac{\color{blue}{x \cdot 6}}{z \cdot \left(y \cdot y\right)} \]
      3. *-commutative29.9%

        \[\leadsto \frac{x \cdot 6}{\color{blue}{\left(y \cdot y\right) \cdot z}} \]
      4. associate-*r*30.0%

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

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot 6}{y}}{y}}{z}} \]
      7. *-un-lft-identity30.1%

        \[\leadsto \frac{\frac{\frac{x \cdot 6}{\color{blue}{1 \cdot y}}}{y}}{z} \]
      8. times-frac30.1%

        \[\leadsto \frac{\frac{\color{blue}{\frac{x}{1} \cdot \frac{6}{y}}}{y}}{z} \]
      9. /-rgt-identity30.1%

        \[\leadsto \frac{\frac{\color{blue}{x} \cdot \frac{6}{y}}{y}}{z} \]
    9. Applied egg-rr30.1%

      \[\leadsto \color{blue}{\frac{\frac{x \cdot \frac{6}{y}}{y}}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.35:\\ \;\;\;\;\frac{x}{y \cdot z} \cdot \frac{6}{y}\\ \mathbf{elif}\;y \leq 1.06 \cdot 10^{+32}:\\ \;\;\;\;\frac{x \cdot \left(1 + \left(y \cdot y\right) \cdot -0.16666666666666666\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x \cdot \frac{6}{y}}{y}}{z}\\ \end{array} \]

Alternative 7: 65.7% accurate, 8.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.4 \lor \neg \left(y \leq 2.4\right):\\ \;\;\;\;\frac{x}{y \cdot z} \cdot \frac{6}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -2.4) (not (<= y 2.4))) (* (/ x (* y z)) (/ 6.0 y)) (/ x z)))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -2.4) || !(y <= 2.4)) {
		tmp = (x / (y * z)) * (6.0 / y);
	} else {
		tmp = x / z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((y <= (-2.4d0)) .or. (.not. (y <= 2.4d0))) then
        tmp = (x / (y * z)) * (6.0d0 / y)
    else
        tmp = x / z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -2.4) || !(y <= 2.4)) {
		tmp = (x / (y * z)) * (6.0 / y);
	} else {
		tmp = x / z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -2.4) or not (y <= 2.4):
		tmp = (x / (y * z)) * (6.0 / y)
	else:
		tmp = x / z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -2.4) || !(y <= 2.4))
		tmp = Float64(Float64(x / Float64(y * z)) * Float64(6.0 / y));
	else
		tmp = Float64(x / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -2.4) || ~((y <= 2.4)))
		tmp = (x / (y * z)) * (6.0 / y);
	else
		tmp = x / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.4], N[Not[LessEqual[y, 2.4]], $MachinePrecision]], N[(N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(6.0 / y), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \lor \neg \left(y \leq 2.4\right):\\
\;\;\;\;\frac{x}{y \cdot z} \cdot \frac{6}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\


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

    1. Initial program 95.1%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-/l*92.3%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}} \]
      2. associate-/r/92.3%

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

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

      \[\leadsto \frac{x}{\color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot z\right) + \frac{z}{y}\right)} \cdot y} \]
    5. Taylor expanded in y around inf 30.0%

      \[\leadsto \color{blue}{6 \cdot \frac{x}{{y}^{2} \cdot z}} \]
    6. Step-by-step derivation
      1. *-commutative30.0%

        \[\leadsto \color{blue}{\frac{x}{{y}^{2} \cdot z} \cdot 6} \]
      2. associate-*l/30.0%

        \[\leadsto \color{blue}{\frac{x \cdot 6}{{y}^{2} \cdot z}} \]
      3. unpow230.0%

        \[\leadsto \frac{x \cdot 6}{\color{blue}{\left(y \cdot y\right)} \cdot z} \]
      4. associate-*l*29.9%

        \[\leadsto \frac{x \cdot 6}{\color{blue}{y \cdot \left(y \cdot z\right)}} \]
    7. Simplified29.9%

      \[\leadsto \color{blue}{\frac{x \cdot 6}{y \cdot \left(y \cdot z\right)}} \]
    8. Step-by-step derivation
      1. *-commutative29.9%

        \[\leadsto \frac{x \cdot 6}{\color{blue}{\left(y \cdot z\right) \cdot y}} \]
      2. times-frac30.6%

        \[\leadsto \color{blue}{\frac{x}{y \cdot z} \cdot \frac{6}{y}} \]
    9. Applied egg-rr30.6%

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

    if -2.39999999999999991 < y < 2.39999999999999991

    1. Initial program 100.0%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*l/100.0%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\sin y}{y}} \]
      2. times-frac79.4%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative79.4%

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

        \[\leadsto \color{blue}{\sin y \cdot \frac{x}{z \cdot y}} \]
      5. *-commutative77.1%

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

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

      \[\leadsto \color{blue}{\frac{x}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification63.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4 \lor \neg \left(y \leq 2.4\right):\\ \;\;\;\;\frac{x}{y \cdot z} \cdot \frac{6}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z}\\ \end{array} \]

Alternative 8: 65.2% accurate, 8.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2000000:\\ \;\;\;\;\frac{y}{\frac{y \cdot z}{x}}\\ \mathbf{elif}\;y \leq 1.46 \cdot 10^{+51}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{x}{z \cdot \left(y \cdot y\right)}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -2000000.0)
   (/ y (/ (* y z) x))
   (if (<= y 1.46e+51) (/ x z) (* 6.0 (/ x (* z (* y y)))))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -2000000.0) {
		tmp = y / ((y * z) / x);
	} else if (y <= 1.46e+51) {
		tmp = x / z;
	} else {
		tmp = 6.0 * (x / (z * (y * y)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-2000000.0d0)) then
        tmp = y / ((y * z) / x)
    else if (y <= 1.46d+51) then
        tmp = x / z
    else
        tmp = 6.0d0 * (x / (z * (y * y)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -2000000.0) {
		tmp = y / ((y * z) / x);
	} else if (y <= 1.46e+51) {
		tmp = x / z;
	} else {
		tmp = 6.0 * (x / (z * (y * y)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -2000000.0:
		tmp = y / ((y * z) / x)
	elif y <= 1.46e+51:
		tmp = x / z
	else:
		tmp = 6.0 * (x / (z * (y * y)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -2000000.0)
		tmp = Float64(y / Float64(Float64(y * z) / x));
	elseif (y <= 1.46e+51)
		tmp = Float64(x / z);
	else
		tmp = Float64(6.0 * Float64(x / Float64(z * Float64(y * y))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -2000000.0)
		tmp = y / ((y * z) / x);
	elseif (y <= 1.46e+51)
		tmp = x / z;
	else
		tmp = 6.0 * (x / (z * (y * y)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -2000000.0], N[(y / N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.46e+51], N[(x / z), $MachinePrecision], N[(6.0 * N[(x / N[(z * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2000000:\\
\;\;\;\;\frac{y}{\frac{y \cdot z}{x}}\\

\mathbf{elif}\;y \leq 1.46 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{z}\\

\mathbf{else}:\\
\;\;\;\;6 \cdot \frac{x}{z \cdot \left(y \cdot y\right)}\\


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

    1. Initial program 95.8%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*r/95.7%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot \sin y}{y}}}{z} \]
      2. associate-/l/90.6%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative90.6%

        \[\leadsto \frac{\color{blue}{\sin y \cdot x}}{z \cdot y} \]
      4. times-frac95.9%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{z \cdot y}} \]
      2. *-commutative18.6%

        \[\leadsto \frac{y \cdot x}{\color{blue}{y \cdot z}} \]
      3. associate-/l*33.1%

        \[\leadsto \color{blue}{\frac{y}{\frac{y \cdot z}{x}}} \]
    6. Applied egg-rr33.1%

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

    if -2e6 < y < 1.4600000000000001e51

    1. Initial program 100.0%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*l/99.9%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\sin y}{y}} \]
      2. times-frac81.3%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative81.3%

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

        \[\leadsto \color{blue}{\sin y \cdot \frac{x}{z \cdot y}} \]
      5. *-commutative79.2%

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

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

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

    if 1.4600000000000001e51 < y

    1. Initial program 92.3%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-/l*93.0%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}} \]
      2. associate-/r/93.0%

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

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

      \[\leadsto \frac{x}{\color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot z\right) + \frac{z}{y}\right)} \cdot y} \]
    5. Taylor expanded in y around inf 31.3%

      \[\leadsto \color{blue}{6 \cdot \frac{x}{{y}^{2} \cdot z}} \]
    6. Step-by-step derivation
      1. *-commutative31.3%

        \[\leadsto 6 \cdot \frac{x}{\color{blue}{z \cdot {y}^{2}}} \]
      2. unpow231.3%

        \[\leadsto 6 \cdot \frac{x}{z \cdot \color{blue}{\left(y \cdot y\right)}} \]
    7. Simplified31.3%

      \[\leadsto \color{blue}{6 \cdot \frac{x}{z \cdot \left(y \cdot y\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2000000:\\ \;\;\;\;\frac{y}{\frac{y \cdot z}{x}}\\ \mathbf{elif}\;y \leq 1.46 \cdot 10^{+51}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{x}{z \cdot \left(y \cdot y\right)}\\ \end{array} \]

Alternative 9: 65.3% accurate, 8.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -100000:\\ \;\;\;\;\frac{y}{\frac{y \cdot z}{x}}\\ \mathbf{elif}\;y \leq 2.4:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{\frac{x}{y}}{y \cdot z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -100000.0)
   (/ y (/ (* y z) x))
   (if (<= y 2.4) (/ x z) (* 6.0 (/ (/ x y) (* y z))))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -100000.0) {
		tmp = y / ((y * z) / x);
	} else if (y <= 2.4) {
		tmp = x / z;
	} else {
		tmp = 6.0 * ((x / y) / (y * z));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-100000.0d0)) then
        tmp = y / ((y * z) / x)
    else if (y <= 2.4d0) then
        tmp = x / z
    else
        tmp = 6.0d0 * ((x / y) / (y * z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -100000.0) {
		tmp = y / ((y * z) / x);
	} else if (y <= 2.4) {
		tmp = x / z;
	} else {
		tmp = 6.0 * ((x / y) / (y * z));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -100000.0:
		tmp = y / ((y * z) / x)
	elif y <= 2.4:
		tmp = x / z
	else:
		tmp = 6.0 * ((x / y) / (y * z))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -100000.0)
		tmp = Float64(y / Float64(Float64(y * z) / x));
	elseif (y <= 2.4)
		tmp = Float64(x / z);
	else
		tmp = Float64(6.0 * Float64(Float64(x / y) / Float64(y * z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -100000.0)
		tmp = y / ((y * z) / x);
	elseif (y <= 2.4)
		tmp = x / z;
	else
		tmp = 6.0 * ((x / y) / (y * z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -100000.0], N[(y / N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4], N[(x / z), $MachinePrecision], N[(6.0 * N[(N[(x / y), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -100000:\\
\;\;\;\;\frac{y}{\frac{y \cdot z}{x}}\\

\mathbf{elif}\;y \leq 2.4:\\
\;\;\;\;\frac{x}{z}\\

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


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

    1. Initial program 95.8%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*r/95.7%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot \sin y}{y}}}{z} \]
      2. associate-/l/90.6%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative90.6%

        \[\leadsto \frac{\color{blue}{\sin y \cdot x}}{z \cdot y} \]
      4. times-frac95.9%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{z \cdot y}} \]
      2. *-commutative18.6%

        \[\leadsto \frac{y \cdot x}{\color{blue}{y \cdot z}} \]
      3. associate-/l*33.1%

        \[\leadsto \color{blue}{\frac{y}{\frac{y \cdot z}{x}}} \]
    6. Applied egg-rr33.1%

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

    if -1e5 < y < 2.39999999999999991

    1. Initial program 100.0%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*l/100.0%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\sin y}{y}} \]
      2. times-frac79.7%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative79.7%

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

        \[\leadsto \color{blue}{\sin y \cdot \frac{x}{z \cdot y}} \]
      5. *-commutative77.5%

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

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

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

    if 2.39999999999999991 < y

    1. Initial program 93.8%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-/l*94.4%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}} \]
      2. associate-/r/94.4%

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

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

      \[\leadsto \frac{x}{\color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot z\right) + \frac{z}{y}\right)} \cdot y} \]
    5. Taylor expanded in y around inf 27.4%

      \[\leadsto \color{blue}{6 \cdot \frac{x}{{y}^{2} \cdot z}} \]
    6. Step-by-step derivation
      1. *-commutative27.4%

        \[\leadsto 6 \cdot \frac{x}{\color{blue}{z \cdot {y}^{2}}} \]
      2. unpow227.4%

        \[\leadsto 6 \cdot \frac{x}{z \cdot \color{blue}{\left(y \cdot y\right)}} \]
    7. Simplified27.4%

      \[\leadsto \color{blue}{6 \cdot \frac{x}{z \cdot \left(y \cdot y\right)}} \]
    8. Taylor expanded in x around 0 27.4%

      \[\leadsto 6 \cdot \color{blue}{\frac{x}{{y}^{2} \cdot z}} \]
    9. Step-by-step derivation
      1. rem-square-sqrt13.0%

        \[\leadsto 6 \cdot \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{{y}^{2} \cdot z} \]
      2. unpow213.0%

        \[\leadsto 6 \cdot \frac{\sqrt{x} \cdot \sqrt{x}}{\color{blue}{\left(y \cdot y\right)} \cdot z} \]
      3. times-frac13.0%

        \[\leadsto 6 \cdot \color{blue}{\left(\frac{\sqrt{x}}{y \cdot y} \cdot \frac{\sqrt{x}}{z}\right)} \]
      4. associate-/r*13.1%

        \[\leadsto 6 \cdot \left(\color{blue}{\frac{\frac{\sqrt{x}}{y}}{y}} \cdot \frac{\sqrt{x}}{z}\right) \]
      5. times-frac13.1%

        \[\leadsto 6 \cdot \color{blue}{\frac{\frac{\sqrt{x}}{y} \cdot \sqrt{x}}{y \cdot z}} \]
      6. associate-*l/13.1%

        \[\leadsto 6 \cdot \frac{\color{blue}{\frac{\sqrt{x} \cdot \sqrt{x}}{y}}}{y \cdot z} \]
      7. rem-square-sqrt27.5%

        \[\leadsto 6 \cdot \frac{\frac{\color{blue}{x}}{y}}{y \cdot z} \]
    10. Simplified27.5%

      \[\leadsto 6 \cdot \color{blue}{\frac{\frac{x}{y}}{y \cdot z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -100000:\\ \;\;\;\;\frac{y}{\frac{y \cdot z}{x}}\\ \mathbf{elif}\;y \leq 2.4:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;6 \cdot \frac{\frac{x}{y}}{y \cdot z}\\ \end{array} \]

Alternative 10: 65.3% accurate, 8.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2000000:\\ \;\;\;\;\frac{y}{\frac{y \cdot z}{x}}\\ \mathbf{elif}\;y \leq 2.4:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{6}{y}}{y \cdot z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -2000000.0)
   (/ y (/ (* y z) x))
   (if (<= y 2.4) (/ x z) (* x (/ (/ 6.0 y) (* y z))))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -2000000.0) {
		tmp = y / ((y * z) / x);
	} else if (y <= 2.4) {
		tmp = x / z;
	} else {
		tmp = x * ((6.0 / y) / (y * z));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-2000000.0d0)) then
        tmp = y / ((y * z) / x)
    else if (y <= 2.4d0) then
        tmp = x / z
    else
        tmp = x * ((6.0d0 / y) / (y * z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -2000000.0) {
		tmp = y / ((y * z) / x);
	} else if (y <= 2.4) {
		tmp = x / z;
	} else {
		tmp = x * ((6.0 / y) / (y * z));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -2000000.0:
		tmp = y / ((y * z) / x)
	elif y <= 2.4:
		tmp = x / z
	else:
		tmp = x * ((6.0 / y) / (y * z))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -2000000.0)
		tmp = Float64(y / Float64(Float64(y * z) / x));
	elseif (y <= 2.4)
		tmp = Float64(x / z);
	else
		tmp = Float64(x * Float64(Float64(6.0 / y) / Float64(y * z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -2000000.0)
		tmp = y / ((y * z) / x);
	elseif (y <= 2.4)
		tmp = x / z;
	else
		tmp = x * ((6.0 / y) / (y * z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -2000000.0], N[(y / N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4], N[(x / z), $MachinePrecision], N[(x * N[(N[(6.0 / y), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2000000:\\
\;\;\;\;\frac{y}{\frac{y \cdot z}{x}}\\

\mathbf{elif}\;y \leq 2.4:\\
\;\;\;\;\frac{x}{z}\\

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


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

    1. Initial program 95.8%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*r/95.7%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot \sin y}{y}}}{z} \]
      2. associate-/l/90.6%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative90.6%

        \[\leadsto \frac{\color{blue}{\sin y \cdot x}}{z \cdot y} \]
      4. times-frac95.9%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{z \cdot y}} \]
      2. *-commutative18.6%

        \[\leadsto \frac{y \cdot x}{\color{blue}{y \cdot z}} \]
      3. associate-/l*33.1%

        \[\leadsto \color{blue}{\frac{y}{\frac{y \cdot z}{x}}} \]
    6. Applied egg-rr33.1%

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

    if -2e6 < y < 2.39999999999999991

    1. Initial program 100.0%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*l/100.0%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\sin y}{y}} \]
      2. times-frac79.7%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative79.7%

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

        \[\leadsto \color{blue}{\sin y \cdot \frac{x}{z \cdot y}} \]
      5. *-commutative77.5%

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

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

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

    if 2.39999999999999991 < y

    1. Initial program 93.8%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-/l*94.4%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}} \]
      2. associate-/r/94.4%

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

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

      \[\leadsto \frac{x}{\color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot z\right) + \frac{z}{y}\right)} \cdot y} \]
    5. Taylor expanded in y around inf 27.4%

      \[\leadsto \color{blue}{6 \cdot \frac{x}{{y}^{2} \cdot z}} \]
    6. Step-by-step derivation
      1. *-commutative27.4%

        \[\leadsto 6 \cdot \frac{x}{\color{blue}{z \cdot {y}^{2}}} \]
      2. unpow227.4%

        \[\leadsto 6 \cdot \frac{x}{z \cdot \color{blue}{\left(y \cdot y\right)}} \]
    7. Simplified27.4%

      \[\leadsto \color{blue}{6 \cdot \frac{x}{z \cdot \left(y \cdot y\right)}} \]
    8. Taylor expanded in x around 0 27.4%

      \[\leadsto \color{blue}{6 \cdot \frac{x}{{y}^{2} \cdot z}} \]
    9. Step-by-step derivation
      1. associate-*r/27.4%

        \[\leadsto \color{blue}{\frac{6 \cdot x}{{y}^{2} \cdot z}} \]
      2. *-commutative27.4%

        \[\leadsto \frac{\color{blue}{x \cdot 6}}{{y}^{2} \cdot z} \]
      3. unpow227.4%

        \[\leadsto \frac{x \cdot 6}{\color{blue}{\left(y \cdot y\right)} \cdot z} \]
      4. associate-*r*27.4%

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

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{6}{y}}{y \cdot z}} \]
    10. Simplified27.5%

      \[\leadsto \color{blue}{x \cdot \frac{\frac{6}{y}}{y \cdot z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2000000:\\ \;\;\;\;\frac{y}{\frac{y \cdot z}{x}}\\ \mathbf{elif}\;y \leq 2.4:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{6}{y}}{y \cdot z}\\ \end{array} \]

Alternative 11: 65.4% accurate, 8.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.4:\\ \;\;\;\;\frac{x}{y \cdot z} \cdot \frac{6}{y}\\ \mathbf{elif}\;y \leq 2.4:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x \cdot \frac{6}{y}}{y}}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -2.4)
   (* (/ x (* y z)) (/ 6.0 y))
   (if (<= y 2.4) (/ x z) (/ (/ (* x (/ 6.0 y)) y) z))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -2.4) {
		tmp = (x / (y * z)) * (6.0 / y);
	} else if (y <= 2.4) {
		tmp = x / z;
	} else {
		tmp = ((x * (6.0 / y)) / y) / z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-2.4d0)) then
        tmp = (x / (y * z)) * (6.0d0 / y)
    else if (y <= 2.4d0) then
        tmp = x / z
    else
        tmp = ((x * (6.0d0 / y)) / y) / z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -2.4) {
		tmp = (x / (y * z)) * (6.0 / y);
	} else if (y <= 2.4) {
		tmp = x / z;
	} else {
		tmp = ((x * (6.0 / y)) / y) / z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -2.4:
		tmp = (x / (y * z)) * (6.0 / y)
	elif y <= 2.4:
		tmp = x / z
	else:
		tmp = ((x * (6.0 / y)) / y) / z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -2.4)
		tmp = Float64(Float64(x / Float64(y * z)) * Float64(6.0 / y));
	elseif (y <= 2.4)
		tmp = Float64(x / z);
	else
		tmp = Float64(Float64(Float64(x * Float64(6.0 / y)) / y) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -2.4)
		tmp = (x / (y * z)) * (6.0 / y);
	elseif (y <= 2.4)
		tmp = x / z;
	else
		tmp = ((x * (6.0 / y)) / y) / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -2.4], N[(N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(6.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4], N[(x / z), $MachinePrecision], N[(N[(N[(x * N[(6.0 / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4:\\
\;\;\;\;\frac{x}{y \cdot z} \cdot \frac{6}{y}\\

\mathbf{elif}\;y \leq 2.4:\\
\;\;\;\;\frac{x}{z}\\

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


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

    1. Initial program 95.9%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-/l*90.9%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}} \]
      2. associate-/r/90.9%

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

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

      \[\leadsto \frac{x}{\color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot z\right) + \frac{z}{y}\right)} \cdot y} \]
    5. Taylor expanded in y around inf 31.7%

      \[\leadsto \color{blue}{6 \cdot \frac{x}{{y}^{2} \cdot z}} \]
    6. Step-by-step derivation
      1. *-commutative31.7%

        \[\leadsto \color{blue}{\frac{x}{{y}^{2} \cdot z} \cdot 6} \]
      2. associate-*l/31.7%

        \[\leadsto \color{blue}{\frac{x \cdot 6}{{y}^{2} \cdot z}} \]
      3. unpow231.7%

        \[\leadsto \frac{x \cdot 6}{\color{blue}{\left(y \cdot y\right)} \cdot z} \]
      4. associate-*l*31.6%

        \[\leadsto \frac{x \cdot 6}{\color{blue}{y \cdot \left(y \cdot z\right)}} \]
    7. Simplified31.6%

      \[\leadsto \color{blue}{\frac{x \cdot 6}{y \cdot \left(y \cdot z\right)}} \]
    8. Step-by-step derivation
      1. *-commutative31.6%

        \[\leadsto \frac{x \cdot 6}{\color{blue}{\left(y \cdot z\right) \cdot y}} \]
      2. times-frac32.8%

        \[\leadsto \color{blue}{\frac{x}{y \cdot z} \cdot \frac{6}{y}} \]
    9. Applied egg-rr32.8%

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

    if -2.39999999999999991 < y < 2.39999999999999991

    1. Initial program 100.0%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*l/100.0%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\sin y}{y}} \]
      2. times-frac79.4%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative79.4%

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

        \[\leadsto \color{blue}{\sin y \cdot \frac{x}{z \cdot y}} \]
      5. *-commutative77.1%

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

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

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

    if 2.39999999999999991 < y

    1. Initial program 93.8%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-/l*94.4%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}} \]
      2. associate-/r/94.4%

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

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

      \[\leadsto \frac{x}{\color{blue}{\left(0.16666666666666666 \cdot \left(y \cdot z\right) + \frac{z}{y}\right)} \cdot y} \]
    5. Taylor expanded in y around inf 27.4%

      \[\leadsto \color{blue}{6 \cdot \frac{x}{{y}^{2} \cdot z}} \]
    6. Step-by-step derivation
      1. *-commutative27.4%

        \[\leadsto 6 \cdot \frac{x}{\color{blue}{z \cdot {y}^{2}}} \]
      2. unpow227.4%

        \[\leadsto 6 \cdot \frac{x}{z \cdot \color{blue}{\left(y \cdot y\right)}} \]
    7. Simplified27.4%

      \[\leadsto \color{blue}{6 \cdot \frac{x}{z \cdot \left(y \cdot y\right)}} \]
    8. Step-by-step derivation
      1. associate-*r/27.4%

        \[\leadsto \color{blue}{\frac{6 \cdot x}{z \cdot \left(y \cdot y\right)}} \]
      2. *-commutative27.4%

        \[\leadsto \frac{\color{blue}{x \cdot 6}}{z \cdot \left(y \cdot y\right)} \]
      3. *-commutative27.4%

        \[\leadsto \frac{x \cdot 6}{\color{blue}{\left(y \cdot y\right) \cdot z}} \]
      4. associate-*r*27.4%

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

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot 6}{y}}{y}}{z}} \]
      7. *-un-lft-identity27.5%

        \[\leadsto \frac{\frac{\frac{x \cdot 6}{\color{blue}{1 \cdot y}}}{y}}{z} \]
      8. times-frac27.5%

        \[\leadsto \frac{\frac{\color{blue}{\frac{x}{1} \cdot \frac{6}{y}}}{y}}{z} \]
      9. /-rgt-identity27.5%

        \[\leadsto \frac{\frac{\color{blue}{x} \cdot \frac{6}{y}}{y}}{z} \]
    9. Applied egg-rr27.5%

      \[\leadsto \color{blue}{\frac{\frac{x \cdot \frac{6}{y}}{y}}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4:\\ \;\;\;\;\frac{x}{y \cdot z} \cdot \frac{6}{y}\\ \mathbf{elif}\;y \leq 2.4:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x \cdot \frac{6}{y}}{y}}{z}\\ \end{array} \]

Alternative 12: 65.3% accurate, 9.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -100000 \lor \neg \left(y \leq 4.3 \cdot 10^{-44}\right):\\ \;\;\;\;\frac{y}{z \cdot \frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -100000.0) (not (<= y 4.3e-44))) (/ y (* z (/ y x))) (/ x z)))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -100000.0) || !(y <= 4.3e-44)) {
		tmp = y / (z * (y / x));
	} else {
		tmp = x / z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((y <= (-100000.0d0)) .or. (.not. (y <= 4.3d-44))) then
        tmp = y / (z * (y / x))
    else
        tmp = x / z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -100000.0) || !(y <= 4.3e-44)) {
		tmp = y / (z * (y / x));
	} else {
		tmp = x / z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -100000.0) or not (y <= 4.3e-44):
		tmp = y / (z * (y / x))
	else:
		tmp = x / z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -100000.0) || !(y <= 4.3e-44))
		tmp = Float64(y / Float64(z * Float64(y / x)));
	else
		tmp = Float64(x / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -100000.0) || ~((y <= 4.3e-44)))
		tmp = y / (z * (y / x));
	else
		tmp = x / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -100000.0], N[Not[LessEqual[y, 4.3e-44]], $MachinePrecision]], N[(y / N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -100000 \lor \neg \left(y \leq 4.3 \cdot 10^{-44}\right):\\
\;\;\;\;\frac{y}{z \cdot \frac{y}{x}}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1e5 or 4.30000000000000013e-44 < y

    1. Initial program 95.5%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*r/95.6%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot \sin y}{y}}}{z} \]
      2. associate-/l/92.9%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative92.9%

        \[\leadsto \frac{\color{blue}{\sin y \cdot x}}{z \cdot y} \]
      4. times-frac95.6%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{y}{z}} \]
      2. clear-num30.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{y}{x}}} \cdot \frac{y}{z} \]
      3. frac-times37.3%

        \[\leadsto \color{blue}{\frac{1 \cdot y}{\frac{y}{x} \cdot z}} \]
      4. *-un-lft-identity37.3%

        \[\leadsto \frac{\color{blue}{y}}{\frac{y}{x} \cdot z} \]
    6. Applied egg-rr37.3%

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

    if -1e5 < y < 4.30000000000000013e-44

    1. Initial program 100.0%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*l/100.0%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\sin y}{y}} \]
      2. times-frac76.7%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative76.7%

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

        \[\leadsto \color{blue}{\sin y \cdot \frac{x}{z \cdot y}} \]
      5. *-commutative74.0%

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

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

      \[\leadsto \color{blue}{\frac{x}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification63.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -100000 \lor \neg \left(y \leq 4.3 \cdot 10^{-44}\right):\\ \;\;\;\;\frac{y}{z \cdot \frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z}\\ \end{array} \]

Alternative 13: 65.3% accurate, 9.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -100000 \lor \neg \left(y \leq 10^{+51}\right):\\ \;\;\;\;\frac{y}{\frac{y \cdot z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -100000.0) (not (<= y 1e+51))) (/ y (/ (* y z) x)) (/ x z)))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -100000.0) || !(y <= 1e+51)) {
		tmp = y / ((y * z) / x);
	} else {
		tmp = x / z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((y <= (-100000.0d0)) .or. (.not. (y <= 1d+51))) then
        tmp = y / ((y * z) / x)
    else
        tmp = x / z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -100000.0) || !(y <= 1e+51)) {
		tmp = y / ((y * z) / x);
	} else {
		tmp = x / z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -100000.0) or not (y <= 1e+51):
		tmp = y / ((y * z) / x)
	else:
		tmp = x / z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -100000.0) || !(y <= 1e+51))
		tmp = Float64(y / Float64(Float64(y * z) / x));
	else
		tmp = Float64(x / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -100000.0) || ~((y <= 1e+51)))
		tmp = y / ((y * z) / x);
	else
		tmp = x / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -100000.0], N[Not[LessEqual[y, 1e+51]], $MachinePrecision]], N[(y / N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -100000 \lor \neg \left(y \leq 10^{+51}\right):\\
\;\;\;\;\frac{y}{\frac{y \cdot z}{x}}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1e5 or 1e51 < y

    1. Initial program 94.5%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*r/94.6%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot \sin y}{y}}}{z} \]
      2. associate-/l/91.4%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative91.4%

        \[\leadsto \frac{\color{blue}{\sin y \cdot x}}{z \cdot y} \]
      4. times-frac94.6%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{z \cdot y}} \]
      2. *-commutative17.3%

        \[\leadsto \frac{y \cdot x}{\color{blue}{y \cdot z}} \]
      3. associate-/l*32.2%

        \[\leadsto \color{blue}{\frac{y}{\frac{y \cdot z}{x}}} \]
    6. Applied egg-rr32.2%

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

    if -1e5 < y < 1e51

    1. Initial program 100.0%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*l/99.9%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\sin y}{y}} \]
      2. times-frac81.3%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative81.3%

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

        \[\leadsto \color{blue}{\sin y \cdot \frac{x}{z \cdot y}} \]
      5. *-commutative79.2%

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

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

      \[\leadsto \color{blue}{\frac{x}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification63.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -100000 \lor \neg \left(y \leq 10^{+51}\right):\\ \;\;\;\;\frac{y}{\frac{y \cdot z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z}\\ \end{array} \]

Alternative 14: 59.0% accurate, 9.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.4 \cdot 10^{-83}:\\ \;\;\;\;\frac{x}{\frac{y \cdot z}{y}}\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-148}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -1.4e-83)
   (/ x (/ (* y z) y))
   (if (<= x 1.6e-148) (* (/ x y) (/ y z)) (/ x z))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -1.4e-83) {
		tmp = x / ((y * z) / y);
	} else if (x <= 1.6e-148) {
		tmp = (x / y) * (y / z);
	} else {
		tmp = x / z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-1.4d-83)) then
        tmp = x / ((y * z) / y)
    else if (x <= 1.6d-148) then
        tmp = (x / y) * (y / z)
    else
        tmp = x / z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -1.4e-83) {
		tmp = x / ((y * z) / y);
	} else if (x <= 1.6e-148) {
		tmp = (x / y) * (y / z);
	} else {
		tmp = x / z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -1.4e-83:
		tmp = x / ((y * z) / y)
	elif x <= 1.6e-148:
		tmp = (x / y) * (y / z)
	else:
		tmp = x / z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -1.4e-83)
		tmp = Float64(x / Float64(Float64(y * z) / y));
	elseif (x <= 1.6e-148)
		tmp = Float64(Float64(x / y) * Float64(y / z));
	else
		tmp = Float64(x / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -1.4e-83)
		tmp = x / ((y * z) / y);
	elseif (x <= 1.6e-148)
		tmp = (x / y) * (y / z);
	else
		tmp = x / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -1.4e-83], N[(x / N[(N[(y * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e-148], N[(N[(x / y), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{-83}:\\
\;\;\;\;\frac{x}{\frac{y \cdot z}{y}}\\

\mathbf{elif}\;x \leq 1.6 \cdot 10^{-148}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{y}{z}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.4e-83

    1. Initial program 99.7%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-/l*95.0%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}} \]
      2. associate-/r/88.0%

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

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

      \[\leadsto \frac{x}{\color{blue}{\frac{z}{y}} \cdot y} \]
    5. Step-by-step derivation
      1. associate-*l/47.9%

        \[\leadsto \frac{x}{\color{blue}{\frac{z \cdot y}{y}}} \]
      2. *-commutative47.9%

        \[\leadsto \frac{x}{\frac{\color{blue}{y \cdot z}}{y}} \]
    6. Applied egg-rr47.9%

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

    if -1.4e-83 < x < 1.59999999999999997e-148

    1. Initial program 91.6%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*r/71.9%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot \sin y}{y}}}{z} \]
      2. associate-/l/79.7%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative79.7%

        \[\leadsto \frac{\color{blue}{\sin y \cdot x}}{z \cdot y} \]
      4. times-frac91.1%

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

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

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

    if 1.59999999999999997e-148 < x

    1. Initial program 99.1%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*l/94.6%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\sin y}{y}} \]
      2. times-frac84.5%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative84.5%

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

        \[\leadsto \color{blue}{\sin y \cdot \frac{x}{z \cdot y}} \]
      5. *-commutative81.2%

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

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

      \[\leadsto \color{blue}{\frac{x}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification60.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.4 \cdot 10^{-83}:\\ \;\;\;\;\frac{x}{\frac{y \cdot z}{y}}\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-148}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z}\\ \end{array} \]

Alternative 15: 65.4% accurate, 9.7× speedup?

\[\begin{array}{l} \\ \frac{\frac{x}{1 + \left(y \cdot y\right) \cdot 0.16666666666666666}}{z} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (/ (/ x (+ 1.0 (* (* y y) 0.16666666666666666))) z))
double code(double x, double y, double z) {
	return (x / (1.0 + ((y * y) * 0.16666666666666666))) / z;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x / (1.0d0 + ((y * y) * 0.16666666666666666d0))) / z
end function
public static double code(double x, double y, double z) {
	return (x / (1.0 + ((y * y) * 0.16666666666666666))) / z;
}
def code(x, y, z):
	return (x / (1.0 + ((y * y) * 0.16666666666666666))) / z
function code(x, y, z)
	return Float64(Float64(x / Float64(1.0 + Float64(Float64(y * y) * 0.16666666666666666))) / z)
end
function tmp = code(x, y, z)
	tmp = (x / (1.0 + ((y * y) * 0.16666666666666666))) / z;
end
code[x_, y_, z_] := N[(N[(x / N[(1.0 + N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{x}{1 + \left(y \cdot y\right) \cdot 0.16666666666666666}}{z}
\end{array}
Derivation
  1. Initial program 97.4%

    \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
  2. Step-by-step derivation
    1. clear-num97.4%

      \[\leadsto \frac{x \cdot \color{blue}{\frac{1}{\frac{y}{\sin y}}}}{z} \]
    2. un-div-inv97.4%

      \[\leadsto \frac{\color{blue}{\frac{x}{\frac{y}{\sin y}}}}{z} \]
  3. Applied egg-rr97.4%

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

    \[\leadsto \frac{\frac{x}{\color{blue}{1 + 0.16666666666666666 \cdot {y}^{2}}}}{z} \]
  5. Step-by-step derivation
    1. *-commutative63.5%

      \[\leadsto \frac{\frac{x}{1 + \color{blue}{{y}^{2} \cdot 0.16666666666666666}}}{z} \]
    2. unpow263.5%

      \[\leadsto \frac{\frac{x}{1 + \color{blue}{\left(y \cdot y\right)} \cdot 0.16666666666666666}}{z} \]
  6. Simplified63.5%

    \[\leadsto \frac{\frac{x}{\color{blue}{1 + \left(y \cdot y\right) \cdot 0.16666666666666666}}}{z} \]
  7. Final simplification63.5%

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

Alternative 16: 58.7% accurate, 11.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{+113}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -3e+113) (* (/ x y) (/ y z)) (/ x z)))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -3e+113) {
		tmp = (x / y) * (y / z);
	} else {
		tmp = x / z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-3d+113)) then
        tmp = (x / y) * (y / z)
    else
        tmp = x / z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -3e+113) {
		tmp = (x / y) * (y / z);
	} else {
		tmp = x / z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -3e+113:
		tmp = (x / y) * (y / z)
	else:
		tmp = x / z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -3e+113)
		tmp = Float64(Float64(x / y) * Float64(y / z));
	else
		tmp = Float64(x / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -3e+113)
		tmp = (x / y) * (y / z);
	else
		tmp = x / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -3e+113], N[(N[(x / y), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(x / z), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+113}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{y}{z}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{z}\\


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

    1. Initial program 94.0%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*r/94.0%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot \sin y}{y}}}{z} \]
      2. associate-/l/90.0%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative90.0%

        \[\leadsto \frac{\color{blue}{\sin y \cdot x}}{z \cdot y} \]
      4. times-frac94.2%

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

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

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

    if -3e113 < y

    1. Initial program 98.3%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. associate-*l/98.0%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\sin y}{y}} \]
      2. times-frac85.0%

        \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
      3. *-commutative85.0%

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

        \[\leadsto \color{blue}{\sin y \cdot \frac{x}{z \cdot y}} \]
      5. *-commutative83.6%

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

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

      \[\leadsto \color{blue}{\frac{x}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{+113}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z}\\ \end{array} \]

Alternative 17: 57.5% accurate, 35.7× speedup?

\[\begin{array}{l} \\ \frac{x}{z} \end{array} \]
(FPCore (x y z) :precision binary64 (/ x z))
double code(double x, double y, double z) {
	return x / z;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x / z
end function
public static double code(double x, double y, double z) {
	return x / z;
}
def code(x, y, z):
	return x / z
function code(x, y, z)
	return Float64(x / z)
end
function tmp = code(x, y, z)
	tmp = x / z;
end
code[x_, y_, z_] := N[(x / z), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{z}
\end{array}
Derivation
  1. Initial program 97.4%

    \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
  2. Step-by-step derivation
    1. associate-*l/96.1%

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{\sin y}{y}} \]
    2. times-frac86.0%

      \[\leadsto \color{blue}{\frac{x \cdot \sin y}{z \cdot y}} \]
    3. *-commutative86.0%

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

      \[\leadsto \color{blue}{\sin y \cdot \frac{x}{z \cdot y}} \]
    5. *-commutative84.9%

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

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

    \[\leadsto \color{blue}{\frac{x}{z}} \]
  5. Final simplification55.4%

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

Developer target: 99.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{y}{\sin y}\\ t_1 := \frac{x \cdot \frac{1}{t_0}}{z}\\ \mathbf{if}\;z < -4.2173720203427147 \cdot 10^{-29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\ \;\;\;\;\frac{x}{z \cdot t_0}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (/ y (sin y))) (t_1 (/ (* x (/ 1.0 t_0)) z)))
   (if (< z -4.2173720203427147e-29)
     t_1
     (if (< z 4.446702369113811e+64) (/ x (* z t_0)) t_1))))
double code(double x, double y, double z) {
	double t_0 = y / sin(y);
	double t_1 = (x * (1.0 / t_0)) / z;
	double tmp;
	if (z < -4.2173720203427147e-29) {
		tmp = t_1;
	} else if (z < 4.446702369113811e+64) {
		tmp = x / (z * t_0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = y / sin(y)
    t_1 = (x * (1.0d0 / t_0)) / z
    if (z < (-4.2173720203427147d-29)) then
        tmp = t_1
    else if (z < 4.446702369113811d+64) then
        tmp = x / (z * t_0)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y / Math.sin(y);
	double t_1 = (x * (1.0 / t_0)) / z;
	double tmp;
	if (z < -4.2173720203427147e-29) {
		tmp = t_1;
	} else if (z < 4.446702369113811e+64) {
		tmp = x / (z * t_0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y / math.sin(y)
	t_1 = (x * (1.0 / t_0)) / z
	tmp = 0
	if z < -4.2173720203427147e-29:
		tmp = t_1
	elif z < 4.446702369113811e+64:
		tmp = x / (z * t_0)
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(y / sin(y))
	t_1 = Float64(Float64(x * Float64(1.0 / t_0)) / z)
	tmp = 0.0
	if (z < -4.2173720203427147e-29)
		tmp = t_1;
	elseif (z < 4.446702369113811e+64)
		tmp = Float64(x / Float64(z * t_0));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y / sin(y);
	t_1 = (x * (1.0 / t_0)) / z;
	tmp = 0.0;
	if (z < -4.2173720203427147e-29)
		tmp = t_1;
	elseif (z < 4.446702369113811e+64)
		tmp = x / (z * t_0);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y / N[Sin[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[Less[z, -4.2173720203427147e-29], t$95$1, If[Less[z, 4.446702369113811e+64], N[(x / N[(z * t$95$0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{y}{\sin y}\\
t_1 := \frac{x \cdot \frac{1}{t_0}}{z}\\
\mathbf{if}\;z < -4.2173720203427147 \cdot 10^{-29}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\
\;\;\;\;\frac{x}{z \cdot t_0}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}

Reproduce

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

  :herbie-target
  (if (< z -4.2173720203427147e-29) (/ (* x (/ 1.0 (/ y (sin y)))) z) (if (< z 4.446702369113811e+64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1.0 (/ y (sin y)))) z)))

  (/ (* x (/ (sin y) y)) z))