Linear.Quaternion:$ctanh from linear-1.19.1.3

Percentage Accurate: 96.2% → 99.2%
Time: 10.0s
Alternatives: 11
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 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.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: 99.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.9 \cdot 10^{+45} \lor \neg \left(z \leq 5 \cdot 10^{-102}\right):\\ \;\;\;\;\frac{\sin y}{y} \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \frac{z}{\sin y}}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -4.9e+45) (not (<= z 5e-102)))
   (* (/ (sin y) y) (/ x z))
   (/ x (* y (/ z (sin y))))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -4.9e+45) || !(z <= 5e-102)) {
		tmp = (sin(y) / y) * (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 ((z <= (-4.9d+45)) .or. (.not. (z <= 5d-102))) then
        tmp = (sin(y) / y) * (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 ((z <= -4.9e+45) || !(z <= 5e-102)) {
		tmp = (Math.sin(y) / y) * (x / z);
	} else {
		tmp = x / (y * (z / Math.sin(y)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -4.9e+45) or not (z <= 5e-102):
		tmp = (math.sin(y) / y) * (x / z)
	else:
		tmp = x / (y * (z / math.sin(y)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -4.9e+45) || !(z <= 5e-102))
		tmp = Float64(Float64(sin(y) / y) * 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 ((z <= -4.9e+45) || ~((z <= 5e-102)))
		tmp = (sin(y) / y) * (x / z);
	else
		tmp = x / (y * (z / sin(y)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -4.9e+45], N[Not[LessEqual[z, 5e-102]], $MachinePrecision]], N[(N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(z / N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.9 \cdot 10^{+45} \lor \neg \left(z \leq 5 \cdot 10^{-102}\right):\\
\;\;\;\;\frac{\sin y}{y} \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.9000000000000002e45 or 5.00000000000000026e-102 < z

    1. Initial program 99.2%

      \[\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. *-commutative99.9%

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

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

    if -4.9000000000000002e45 < z < 5.00000000000000026e-102

    1. Initial program 90.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sin y \cdot \left(\frac{1}{y} \cdot \frac{x}{z}\right)} \]
    5. Applied egg-rr82.7%

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

        \[\leadsto \color{blue}{\left(\frac{1}{y} \cdot \frac{x}{z}\right) \cdot \sin y} \]
      2. *-commutative82.7%

        \[\leadsto \color{blue}{\left(\frac{x}{z} \cdot \frac{1}{y}\right)} \cdot \sin y \]
      3. associate-*l/81.4%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{\frac{z}{\sin y}}} \]
      6. associate-/l/99.6%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{\sin y} \cdot y}} \]
    7. Applied egg-rr99.6%

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

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

Alternative 2: 98.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+45} \lor \neg \left(z \leq 1.2 \cdot 10^{+20}\right):\\
\;\;\;\;\sin y \cdot \frac{\frac{x}{z}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.19999999999999975e45 or 1.2e20 < z

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

    if -6.19999999999999975e45 < z < 1.2e20

    1. Initial program 91.9%

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

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

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

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

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

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

Alternative 3: 98.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-144} \lor \neg \left(z \leq 2.6 \cdot 10^{-102}\right):\\
\;\;\;\;\frac{\sin y}{y} \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.4999999999999999e-144 or 2.59999999999999986e-102 < z

    1. Initial program 98.5%

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

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

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

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

    if -1.4999999999999999e-144 < z < 2.59999999999999986e-102

    1. Initial program 87.7%

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

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

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

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

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

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

Alternative 4: 77.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2.5 \cdot 10^{-11}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{\sin y}{z}}{y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y 2.5e-11) (/ x z) (* x (/ (/ (sin y) z) y))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= 2.5e-11) {
		tmp = x / z;
	} else {
		tmp = x * ((sin(y) / z) / 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 <= 2.5d-11) then
        tmp = x / z
    else
        tmp = x * ((sin(y) / z) / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= 2.5e-11) {
		tmp = x / z;
	} else {
		tmp = x * ((Math.sin(y) / z) / y);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= 2.5e-11:
		tmp = x / z
	else:
		tmp = x * ((math.sin(y) / z) / y)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= 2.5e-11)
		tmp = Float64(x / z);
	else
		tmp = Float64(x * Float64(Float64(sin(y) / z) / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= 2.5e-11)
		tmp = x / z;
	else
		tmp = x * ((sin(y) / z) / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, 2.5e-11], N[(x / z), $MachinePrecision], N[(x * N[(N[(N[Sin[y], $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 95.8%

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

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

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

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

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

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

    if 2.50000000000000009e-11 < y

    1. Initial program 93.9%

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

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

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

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

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

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

Alternative 5: 97.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sin y}{y}\\ \mathbf{if}\;x \leq 5.5 \cdot 10^{-71}:\\ \;\;\;\;\frac{x}{\frac{z}{t_0}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot t_0}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (/ (sin y) y)))
   (if (<= x 5.5e-71) (/ x (/ z t_0)) (/ (* x t_0) z))))
double code(double x, double y, double z) {
	double t_0 = sin(y) / y;
	double tmp;
	if (x <= 5.5e-71) {
		tmp = x / (z / t_0);
	} else {
		tmp = (x * 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 (x <= 5.5d-71) then
        tmp = x / (z / t_0)
    else
        tmp = (x * 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 (x <= 5.5e-71) {
		tmp = x / (z / t_0);
	} else {
		tmp = (x * t_0) / z;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.sin(y) / y
	tmp = 0
	if x <= 5.5e-71:
		tmp = x / (z / t_0)
	else:
		tmp = (x * t_0) / z
	return tmp
function code(x, y, z)
	t_0 = Float64(sin(y) / y)
	tmp = 0.0
	if (x <= 5.5e-71)
		tmp = Float64(x / Float64(z / t_0));
	else
		tmp = Float64(Float64(x * t_0) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = sin(y) / y;
	tmp = 0.0;
	if (x <= 5.5e-71)
		tmp = x / (z / t_0);
	else
		tmp = (x * 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[x, 5.5e-71], N[(x / N[(z / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(x * t$95$0), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 5.4999999999999997e-71

    1. Initial program 93.1%

      \[\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}}}} \]
    3. Simplified99.3%

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

    if 5.4999999999999997e-71 < x

    1. Initial program 99.6%

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

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

Alternative 6: 97.6% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 6.99999999999999973e-102

    1. Initial program 93.5%

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

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

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

    if 6.99999999999999973e-102 < z

    1. Initial program 98.7%

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

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

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

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

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

Alternative 7: 62.0% accurate, 9.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2.5 \cdot 10^{-11}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\frac{1}{z} \cdot \frac{x}{y}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y 2.5e-11) (/ x z) (* y (* (/ 1.0 z) (/ x y)))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= 2.5e-11) {
		tmp = x / z;
	} else {
		tmp = y * ((1.0 / z) * (x / 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 <= 2.5d-11) then
        tmp = x / z
    else
        tmp = y * ((1.0d0 / z) * (x / y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= 2.5e-11) {
		tmp = x / z;
	} else {
		tmp = y * ((1.0 / z) * (x / y));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= 2.5e-11:
		tmp = x / z
	else:
		tmp = y * ((1.0 / z) * (x / y))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= 2.5e-11)
		tmp = Float64(x / z);
	else
		tmp = Float64(y * Float64(Float64(1.0 / z) * Float64(x / y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= 2.5e-11)
		tmp = x / z;
	else
		tmp = y * ((1.0 / z) * (x / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, 2.5e-11], N[(x / z), $MachinePrecision], N[(y * N[(N[(1.0 / z), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 95.8%

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

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

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

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

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

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

    if 2.50000000000000009e-11 < y

    1. Initial program 93.9%

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{1}{z}} \]
    5. Step-by-step derivation
      1. *-un-lft-identity15.7%

        \[\leadsto \color{blue}{1 \cdot \left(x \cdot \frac{1}{z}\right)} \]
      2. *-inverses15.7%

        \[\leadsto \color{blue}{\frac{y}{y}} \cdot \left(x \cdot \frac{1}{z}\right) \]
      3. associate-*l/15.6%

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

        \[\leadsto \frac{y \cdot \color{blue}{\left(\frac{1}{z} \cdot x\right)}}{y} \]
      5. associate-*l*15.4%

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{y}{z}}{\frac{y}{x}}} \]
    7. Step-by-step derivation
      1. div-inv23.6%

        \[\leadsto \color{blue}{\frac{y}{z} \cdot \frac{1}{\frac{y}{x}}} \]
      2. div-inv23.6%

        \[\leadsto \color{blue}{\left(y \cdot \frac{1}{z}\right)} \cdot \frac{1}{\frac{y}{x}} \]
      3. clear-num22.5%

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

        \[\leadsto \color{blue}{y \cdot \left(\frac{1}{z} \cdot \frac{x}{y}\right)} \]
    8. Applied egg-rr36.0%

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

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

Alternative 8: 60.2% accurate, 11.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{+21}:\\
\;\;\;\;\frac{x}{z}\\

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


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

    1. Initial program 95.9%

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

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

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

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

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

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

    if 1e21 < y

    1. Initial program 93.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 62.1% accurate, 11.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2.5 \cdot 10^{-11}:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z \cdot \frac{y}{x}}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y 2.5e-11) (/ x z) (/ y (* z (/ y x)))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= 2.5e-11) {
		tmp = x / z;
	} else {
		tmp = y / (z * (y / x));
	}
	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.5d-11) then
        tmp = x / z
    else
        tmp = y / (z * (y / x))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= 2.5e-11) {
		tmp = x / z;
	} else {
		tmp = y / (z * (y / x));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= 2.5e-11:
		tmp = x / z
	else:
		tmp = y / (z * (y / x))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= 2.5e-11)
		tmp = Float64(x / z);
	else
		tmp = Float64(y / Float64(z * Float64(y / x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= 2.5e-11)
		tmp = x / z;
	else
		tmp = y / (z * (y / x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, 2.5e-11], N[(x / z), $MachinePrecision], N[(y / N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 95.8%

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

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

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

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

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

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

    if 2.50000000000000009e-11 < y

    1. Initial program 93.9%

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{1}{z}} \]
    5. Step-by-step derivation
      1. *-un-lft-identity15.7%

        \[\leadsto \color{blue}{1 \cdot \left(x \cdot \frac{1}{z}\right)} \]
      2. *-inverses15.7%

        \[\leadsto \color{blue}{\frac{y}{y}} \cdot \left(x \cdot \frac{1}{z}\right) \]
      3. un-div-inv15.7%

        \[\leadsto \frac{y}{y} \cdot \color{blue}{\frac{x}{z}} \]
      4. times-frac23.8%

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

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

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

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

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

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

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

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

Alternative 10: 58.3% accurate, 21.4× speedup?

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\sin y \cdot x}}{y \cdot z} \]
    4. frac-times95.8%

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

      \[\leadsto \frac{\sin y}{y} \cdot \color{blue}{\frac{1}{\frac{z}{x}}} \]
    6. un-div-inv95.9%

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

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

    \[\leadsto \frac{\color{blue}{1}}{\frac{z}{x}} \]
  7. Final simplification54.2%

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

Alternative 11: 58.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 95.2%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{x}{z}} \]
  5. Final simplification54.2%

    \[\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 2023320 
(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))