Linear.Quaternion:$ctanh from linear-1.19.1.3

Percentage Accurate: 96.1% → 97.5%
Time: 10.0s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 96.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x \cdot \frac{\sin y}{y}}{z} \end{array} \]
(FPCore (x y z) :precision binary64 (/ (* x (/ (sin y) y)) z))
double code(double x, double y, double z) {
	return (x * (sin(y) / y)) / z;
}
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: 97.5% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

    if -2e-264 < (*.f64 x (/.f64 (sin.f64 y) y))

    1. Initial program 92.6%

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

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

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

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

Alternative 2: 97.5% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 99.8%

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

    if -2e-264 < (*.f64 x (/.f64 (sin.f64 y) y))

    1. Initial program 92.6%

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

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

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

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

Alternative 3: 74.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4 \cdot 10^{-5}:\\
\;\;\;\;\frac{x}{\frac{z}{1 + -0.16666666666666666 \cdot \left(y \cdot y\right)}}\\

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


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

    1. Initial program 98.2%

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

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

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

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

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

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

    if 2.4000000000000001e-5 < y

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

Alternative 4: 97.5% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.99999999999999946e48

    1. Initial program 99.9%

      \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
    2. Step-by-step derivation
      1. *-commutative99.9%

        \[\leadsto \frac{\color{blue}{\frac{\sin y}{y} \cdot x}}{z} \]
      2. associate-*r/99.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 -9.99999999999999946e48 < z

    1. Initial program 94.3%

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

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

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

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

Alternative 5: 95.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\sin y}{y} \cdot \frac{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(sin(y) / y) * Float64(x / z))
end
function tmp = code(x, y, z)
	tmp = (sin(y) / y) * (x / z);
end
code[x_, y_, z_] := N[(N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\frac{x \cdot \frac{\sin y}{y}}{z} \]
  2. Step-by-step derivation
    1. *-commutative95.5%

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

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

    \[\leadsto \color{blue}{\frac{\sin y}{y} \cdot \frac{x}{z}} \]
  4. Final simplification95.7%

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

Alternative 6: 59.0% accurate, 8.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.3 \cdot 10^{+14}:\\
\;\;\;\;\frac{x}{\frac{z}{1 + -0.16666666666666666 \cdot \left(y \cdot y\right)}}\\

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


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

    1. Initial program 98.2%

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

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

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

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

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

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

    if 5.3e14 < y

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 6 \cdot \color{blue}{\frac{1}{\frac{z \cdot \left(y \cdot y\right)}{x}}} \]
      2. un-div-inv30.8%

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

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

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

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

Alternative 7: 59.0% accurate, 8.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.4 \cdot 10^{+14}:\\
\;\;\;\;\frac{x \cdot \left(1 + -0.16666666666666666 \cdot \left(y \cdot y\right)\right)}{z}\\

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


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

    1. Initial program 98.2%

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

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

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

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

    if 5.4e14 < y

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 6 \cdot \color{blue}{\frac{1}{\frac{z \cdot \left(y \cdot y\right)}{x}}} \]
      2. un-div-inv30.8%

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

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

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

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

Alternative 8: 61.9% accurate, 9.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2.45:\\ \;\;\;\;\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 2.45) (/ x z) (* 6.0 (/ x (* z (* y y))))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= 2.45) {
		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 <= 2.45d0) 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 <= 2.45) {
		tmp = x / z;
	} else {
		tmp = 6.0 * (x / (z * (y * y)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= 2.45:
		tmp = x / z
	else:
		tmp = 6.0 * (x / (z * (y * y)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= 2.45)
		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 <= 2.45)
		tmp = x / z;
	else
		tmp = 6.0 * (x / (z * (y * y)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, 2.45], 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 2.45:\\
\;\;\;\;\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 2 regimes
  2. if y < 2.4500000000000002

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

    if 2.4500000000000002 < y

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 61.9% accurate, 9.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.45:\\
\;\;\;\;\frac{x}{z}\\

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


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

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

    if 2.4500000000000002 < y

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{6 \cdot \frac{x}{z \cdot \left(y \cdot y\right)}} \]
    10. Step-by-step derivation
      1. clear-num31.0%

        \[\leadsto 6 \cdot \color{blue}{\frac{1}{\frac{z \cdot \left(y \cdot y\right)}{x}}} \]
      2. un-div-inv31.0%

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

        \[\leadsto \frac{6}{\frac{\color{blue}{\left(z \cdot y\right) \cdot y}}{x}} \]
    11. Applied egg-rr31.0%

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

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

Alternative 10: 65.7% accurate, 9.7× speedup?

\[\begin{array}{l} \\ \frac{\frac{x}{1 + y \cdot \left(y \cdot 0.16666666666666666\right)}}{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(y * Float64(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[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 59.3% accurate, 11.8× speedup?

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

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

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


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

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

    if 2.00000000000000012e136 < y

    1. Initial program 86.8%

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{x}{\frac{y}{\sin y}}}}{z} \]
    4. Step-by-step derivation
      1. div-inv86.5%

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

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

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

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

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

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

Alternative 12: 58.0% 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.5%

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

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

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

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

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

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

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

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

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