Linear.Quaternion:$ctanh from linear-1.19.1.3

Percentage Accurate: 96.3% → 95.5%
Time: 6.8s
Alternatives: 8
Speedup: N/A×

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 8 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.3% 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, 1.0× speedup?

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

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


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

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

    if 2e-8 < y

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

Alternative 2: 95.5% accurate, 1.0× speedup?

\[\begin{array}{l} y = |y|\\ \\ \frac{x}{\frac{y}{\sin y} \cdot z} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y z) :precision binary64 (/ x (* (/ y (sin y)) z)))
y = abs(y);
double code(double x, double y, double z) {
	return x / ((y / sin(y)) * z);
}
NOTE: y should be positive before calling this function
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x / ((y / sin(y)) * z)
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
	return x / ((y / Math.sin(y)) * z);
}
y = abs(y)
def code(x, y, z):
	return x / ((y / math.sin(y)) * z)
y = abs(y)
function code(x, y, z)
	return Float64(x / Float64(Float64(y / sin(y)) * z))
end
y = abs(y)
function tmp = code(x, y, z)
	tmp = x / ((y / sin(y)) * z);
end
NOTE: y should be positive before calling this function
code[x_, y_, z_] := N[(x / N[(N[(y / N[Sin[y], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y = |y|\\
\\
\frac{x}{\frac{y}{\sin y} \cdot z}
\end{array}
Derivation
  1. Initial program 95.3%

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

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

    \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}} \]
  4. Step-by-step derivation
    1. clear-num97.8%

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

      \[\leadsto \frac{x}{\color{blue}{\frac{1}{\frac{\sin y}{y}} \cdot z}} \]
    3. clear-num98.0%

      \[\leadsto \frac{x}{\color{blue}{\frac{y}{\sin y}} \cdot z} \]
  5. Applied egg-rr98.0%

    \[\leadsto \frac{x}{\color{blue}{\frac{y}{\sin y} \cdot z}} \]
  6. Final simplification98.0%

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

Alternative 3: 65.4% accurate, 9.7× speedup?

\[\begin{array}{l} y = |y|\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 0.0255:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{6}{z}}{y \cdot y}\\ \end{array} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y z)
 :precision binary64
 (if (<= y 0.0255) (/ x z) (* x (/ (/ 6.0 z) (* y y)))))
y = abs(y);
double code(double x, double y, double z) {
	double tmp;
	if (y <= 0.0255) {
		tmp = x / z;
	} else {
		tmp = x * ((6.0 / z) / (y * y));
	}
	return tmp;
}
NOTE: y should be positive before calling this function
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.0255d0) then
        tmp = x / z
    else
        tmp = x * ((6.0d0 / z) / (y * y))
    end if
    code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= 0.0255) {
		tmp = x / z;
	} else {
		tmp = x * ((6.0 / z) / (y * y));
	}
	return tmp;
}
y = abs(y)
def code(x, y, z):
	tmp = 0
	if y <= 0.0255:
		tmp = x / z
	else:
		tmp = x * ((6.0 / z) / (y * y))
	return tmp
y = abs(y)
function code(x, y, z)
	tmp = 0.0
	if (y <= 0.0255)
		tmp = Float64(x / z);
	else
		tmp = Float64(x * Float64(Float64(6.0 / z) / Float64(y * y)));
	end
	return tmp
end
y = abs(y)
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= 0.0255)
		tmp = x / z;
	else
		tmp = x * ((6.0 / z) / (y * y));
	end
	tmp_2 = tmp;
end
NOTE: y should be positive before calling this function
code[x_, y_, z_] := If[LessEqual[y, 0.0255], N[(x / z), $MachinePrecision], N[(x * N[(N[(6.0 / z), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.0255:\\
\;\;\;\;\frac{x}{z}\\

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


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

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

    if 0.0254999999999999984 < y

    1. Initial program 92.4%

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

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}} \]
    4. Step-by-step derivation
      1. clear-num96.9%

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

        \[\leadsto \frac{x}{\color{blue}{\frac{1}{\frac{\sin y}{y}} \cdot z}} \]
      3. clear-num97.0%

        \[\leadsto \frac{x}{\color{blue}{\frac{y}{\sin y}} \cdot z} \]
    5. Applied egg-rr97.0%

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

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

        \[\leadsto \frac{x}{\left(1 + \color{blue}{{y}^{2} \cdot 0.16666666666666666}\right) \cdot z} \]
      2. unpow232.0%

        \[\leadsto \frac{x}{\left(1 + \color{blue}{\left(y \cdot y\right)} \cdot 0.16666666666666666\right) \cdot z} \]
    8. Simplified32.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{6}{z}}{y \cdot y}} \]
    14. Simplified32.0%

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

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

Alternative 4: 65.4% accurate, 9.7× speedup?

\[\begin{array}{l} y = |y|\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 0.0255:\\ \;\;\;\;\frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{6}{y \cdot z}\\ \end{array} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y z)
 :precision binary64
 (if (<= y 0.0255) (/ x z) (* (/ x y) (/ 6.0 (* y z)))))
y = abs(y);
double code(double x, double y, double z) {
	double tmp;
	if (y <= 0.0255) {
		tmp = x / z;
	} else {
		tmp = (x / y) * (6.0 / (y * z));
	}
	return tmp;
}
NOTE: y should be positive before calling this function
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.0255d0) then
        tmp = x / z
    else
        tmp = (x / y) * (6.0d0 / (y * z))
    end if
    code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= 0.0255) {
		tmp = x / z;
	} else {
		tmp = (x / y) * (6.0 / (y * z));
	}
	return tmp;
}
y = abs(y)
def code(x, y, z):
	tmp = 0
	if y <= 0.0255:
		tmp = x / z
	else:
		tmp = (x / y) * (6.0 / (y * z))
	return tmp
y = abs(y)
function code(x, y, z)
	tmp = 0.0
	if (y <= 0.0255)
		tmp = Float64(x / z);
	else
		tmp = Float64(Float64(x / y) * Float64(6.0 / Float64(y * z)));
	end
	return tmp
end
y = abs(y)
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= 0.0255)
		tmp = x / z;
	else
		tmp = (x / y) * (6.0 / (y * z));
	end
	tmp_2 = tmp;
end
NOTE: y should be positive before calling this function
code[x_, y_, z_] := If[LessEqual[y, 0.0255], N[(x / z), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(6.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.0255:\\
\;\;\;\;\frac{x}{z}\\

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


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

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

    if 0.0254999999999999984 < y

    1. Initial program 92.4%

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

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}} \]
    4. Step-by-step derivation
      1. clear-num96.9%

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

        \[\leadsto \frac{x}{\color{blue}{\frac{1}{\frac{\sin y}{y}} \cdot z}} \]
      3. clear-num97.0%

        \[\leadsto \frac{x}{\color{blue}{\frac{y}{\sin y}} \cdot z} \]
    5. Applied egg-rr97.0%

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

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

        \[\leadsto \frac{x}{\left(1 + \color{blue}{{y}^{2} \cdot 0.16666666666666666}\right) \cdot z} \]
      2. unpow232.0%

        \[\leadsto \frac{x}{\left(1 + \color{blue}{\left(y \cdot y\right)} \cdot 0.16666666666666666\right) \cdot z} \]
    8. Simplified32.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 65.7% accurate, 9.7× speedup?

\[\begin{array}{l} y = |y|\\ \\ \frac{x}{z \cdot \left(1 + \left(y \cdot y\right) \cdot 0.16666666666666666\right)} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y z)
 :precision binary64
 (/ x (* z (+ 1.0 (* (* y y) 0.16666666666666666)))))
y = abs(y);
double code(double x, double y, double z) {
	return x / (z * (1.0 + ((y * y) * 0.16666666666666666)));
}
NOTE: y should be positive before calling this function
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 * (1.0d0 + ((y * y) * 0.16666666666666666d0)))
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
	return x / (z * (1.0 + ((y * y) * 0.16666666666666666)));
}
y = abs(y)
def code(x, y, z):
	return x / (z * (1.0 + ((y * y) * 0.16666666666666666)))
y = abs(y)
function code(x, y, z)
	return Float64(x / Float64(z * Float64(1.0 + Float64(Float64(y * y) * 0.16666666666666666))))
end
y = abs(y)
function tmp = code(x, y, z)
	tmp = x / (z * (1.0 + ((y * y) * 0.16666666666666666)));
end
NOTE: y should be positive before calling this function
code[x_, y_, z_] := N[(x / N[(z * N[(1.0 + N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y = |y|\\
\\
\frac{x}{z \cdot \left(1 + \left(y \cdot y\right) \cdot 0.16666666666666666\right)}
\end{array}
Derivation
  1. Initial program 95.3%

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

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

    \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}} \]
  4. Step-by-step derivation
    1. clear-num97.8%

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

      \[\leadsto \frac{x}{\color{blue}{\frac{1}{\frac{\sin y}{y}} \cdot z}} \]
    3. clear-num98.0%

      \[\leadsto \frac{x}{\color{blue}{\frac{y}{\sin y}} \cdot z} \]
  5. Applied egg-rr98.0%

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

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

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

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

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

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

Alternative 6: 65.4% accurate, 9.7× speedup?

\[\begin{array}{l} y = |y|\\ \\ \frac{x}{z \cdot \left(1 + y \cdot \left(y \cdot -0.16666666666666666\right)\right)} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y z)
 :precision binary64
 (/ x (* z (+ 1.0 (* y (* y -0.16666666666666666))))))
y = abs(y);
double code(double x, double y, double z) {
	return x / (z * (1.0 + (y * (y * -0.16666666666666666))));
}
NOTE: y should be positive before calling this function
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 * (1.0d0 + (y * (y * (-0.16666666666666666d0)))))
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
	return x / (z * (1.0 + (y * (y * -0.16666666666666666))));
}
y = abs(y)
def code(x, y, z):
	return x / (z * (1.0 + (y * (y * -0.16666666666666666))))
y = abs(y)
function code(x, y, z)
	return Float64(x / Float64(z * Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666)))))
end
y = abs(y)
function tmp = code(x, y, z)
	tmp = x / (z * (1.0 + (y * (y * -0.16666666666666666))));
end
NOTE: y should be positive before calling this function
code[x_, y_, z_] := N[(x / N[(z * N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y = |y|\\
\\
\frac{x}{z \cdot \left(1 + y \cdot \left(y \cdot -0.16666666666666666\right)\right)}
\end{array}
Derivation
  1. Initial program 95.3%

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

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

    \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}} \]
  4. Step-by-step derivation
    1. clear-num97.8%

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

      \[\leadsto \frac{x}{\color{blue}{\frac{1}{\frac{\sin y}{y}} \cdot z}} \]
    3. clear-num98.0%

      \[\leadsto \frac{x}{\color{blue}{\frac{y}{\sin y}} \cdot z} \]
  5. Applied egg-rr98.0%

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

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

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

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

    \[\leadsto \frac{x}{\color{blue}{\left(1 + \left(y \cdot y\right) \cdot 0.16666666666666666\right)} \cdot z} \]
  9. Step-by-step derivation
    1. expm1-log1p-u67.5%

      \[\leadsto \frac{x}{\left(1 + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)}\right) \cdot z} \]
    2. expm1-udef67.5%

      \[\leadsto \frac{x}{\left(1 + \color{blue}{\left(e^{\mathsf{log1p}\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)} - 1\right)}\right) \cdot z} \]
    3. log1p-udef67.5%

      \[\leadsto \frac{x}{\left(1 + \left(e^{\color{blue}{\log \left(1 + \left(y \cdot y\right) \cdot 0.16666666666666666\right)}} - 1\right)\right) \cdot z} \]
    4. add-exp-log67.5%

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

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

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

      \[\leadsto \frac{x}{\left(1 + \left(\left(\color{blue}{\sqrt{\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)}} + 1\right) - 1\right)\right) \cdot z} \]
    8. swap-sqr67.5%

      \[\leadsto \frac{x}{\left(1 + \left(\left(\sqrt{\color{blue}{\left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \left(0.16666666666666666 \cdot 0.16666666666666666\right)}} + 1\right) - 1\right)\right) \cdot z} \]
    9. metadata-eval67.5%

      \[\leadsto \frac{x}{\left(1 + \left(\left(\sqrt{\left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \color{blue}{0.027777777777777776}} + 1\right) - 1\right)\right) \cdot z} \]
    10. metadata-eval67.5%

      \[\leadsto \frac{x}{\left(1 + \left(\left(\sqrt{\left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \color{blue}{\left(-0.16666666666666666 \cdot -0.16666666666666666\right)}} + 1\right) - 1\right)\right) \cdot z} \]
    11. swap-sqr67.5%

      \[\leadsto \frac{x}{\left(1 + \left(\left(\sqrt{\color{blue}{\left(\left(y \cdot y\right) \cdot -0.16666666666666666\right) \cdot \left(\left(y \cdot y\right) \cdot -0.16666666666666666\right)}} + 1\right) - 1\right)\right) \cdot z} \]
    12. associate-*r*67.5%

      \[\leadsto \frac{x}{\left(1 + \left(\left(\sqrt{\color{blue}{\left(y \cdot \left(y \cdot -0.16666666666666666\right)\right)} \cdot \left(\left(y \cdot y\right) \cdot -0.16666666666666666\right)} + 1\right) - 1\right)\right) \cdot z} \]
    13. associate-*r*67.5%

      \[\leadsto \frac{x}{\left(1 + \left(\left(\sqrt{\left(y \cdot \left(y \cdot -0.16666666666666666\right)\right) \cdot \color{blue}{\left(y \cdot \left(y \cdot -0.16666666666666666\right)\right)}} + 1\right) - 1\right)\right) \cdot z} \]
    14. sqrt-unprod25.0%

      \[\leadsto \frac{x}{\left(1 + \left(\left(\color{blue}{\sqrt{y \cdot \left(y \cdot -0.16666666666666666\right)} \cdot \sqrt{y \cdot \left(y \cdot -0.16666666666666666\right)}} + 1\right) - 1\right)\right) \cdot z} \]
    15. add-sqr-sqrt67.8%

      \[\leadsto \frac{x}{\left(1 + \left(\left(\color{blue}{y \cdot \left(y \cdot -0.16666666666666666\right)} + 1\right) - 1\right)\right) \cdot z} \]
    16. fma-def67.8%

      \[\leadsto \frac{x}{\left(1 + \left(\color{blue}{\mathsf{fma}\left(y, y \cdot -0.16666666666666666, 1\right)} - 1\right)\right) \cdot z} \]
  10. Applied egg-rr67.8%

    \[\leadsto \frac{x}{\left(1 + \color{blue}{\left(\mathsf{fma}\left(y, y \cdot -0.16666666666666666, 1\right) - 1\right)}\right) \cdot z} \]
  11. Step-by-step derivation
    1. fma-udef67.8%

      \[\leadsto \frac{x}{\left(1 + \left(\color{blue}{\left(y \cdot \left(y \cdot -0.16666666666666666\right) + 1\right)} - 1\right)\right) \cdot z} \]
    2. associate--l+67.8%

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

      \[\leadsto \frac{x}{\left(1 + \left(y \cdot \left(y \cdot -0.16666666666666666\right) + \color{blue}{0}\right)\right) \cdot z} \]
  12. Simplified67.8%

    \[\leadsto \frac{x}{\left(1 + \color{blue}{\left(y \cdot \left(y \cdot -0.16666666666666666\right) + 0\right)}\right) \cdot z} \]
  13. Final simplification67.8%

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

Alternative 7: 57.5% accurate, 21.4× speedup?

\[\begin{array}{l} y = |y|\\ \\ \frac{1}{\frac{z}{x}} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y z) :precision binary64 (/ 1.0 (/ z x)))
y = abs(y);
double code(double x, double y, double z) {
	return 1.0 / (z / x);
}
NOTE: y should be positive before calling this function
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
y = Math.abs(y);
public static double code(double x, double y, double z) {
	return 1.0 / (z / x);
}
y = abs(y)
def code(x, y, z):
	return 1.0 / (z / x)
y = abs(y)
function code(x, y, z)
	return Float64(1.0 / Float64(z / x))
end
y = abs(y)
function tmp = code(x, y, z)
	tmp = 1.0 / (z / x);
end
NOTE: y should be positive before calling this function
code[x_, y_, z_] := N[(1.0 / N[(z / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y = |y|\\
\\
\frac{1}{\frac{z}{x}}
\end{array}
Derivation
  1. Initial program 95.3%

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

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

    \[\leadsto \color{blue}{\frac{x}{\frac{z}{\frac{\sin y}{y}}}} \]
  4. Step-by-step derivation
    1. clear-num96.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 \cdot x}{z}} \]
    2. *-un-lft-identity59.0%

      \[\leadsto \frac{\color{blue}{x}}{z} \]
    3. clear-num59.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \]
  8. Applied egg-rr59.1%

    \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \]
  9. Final simplification59.1%

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

Alternative 8: 57.7% accurate, 35.7× speedup?

\[\begin{array}{l} y = |y|\\ \\ \frac{x}{z} \end{array} \]
NOTE: y should be positive before calling this function
(FPCore (x y z) :precision binary64 (/ x z))
y = abs(y);
double code(double x, double y, double z) {
	return x / z;
}
NOTE: y should be positive before calling this function
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
y = Math.abs(y);
public static double code(double x, double y, double z) {
	return x / z;
}
y = abs(y)
def code(x, y, z):
	return x / z
y = abs(y)
function code(x, y, z)
	return Float64(x / z)
end
y = abs(y)
function tmp = code(x, y, z)
	tmp = x / z;
end
NOTE: y should be positive before calling this function
code[x_, y_, z_] := N[(x / z), $MachinePrecision]
\begin{array}{l}
y = |y|\\
\\
\frac{x}{z}
\end{array}
Derivation
  1. Initial program 95.3%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{x}{z}} \]
  5. Final simplification59.0%

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