Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 84.8% → 96.0%
Time: 10.3s
Alternatives: 12
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{\cosh x \cdot \frac{y}{x}}{z} \end{array} \]
(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
double code(double x, double y, double z) {
	return (cosh(x) * (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 = (cosh(x) * (y / x)) / z
end function
public static double code(double x, double y, double z) {
	return (Math.cosh(x) * (y / x)) / z;
}
def code(x, y, z):
	return (math.cosh(x) * (y / x)) / z
function code(x, y, z)
	return Float64(Float64(cosh(x) * Float64(y / x)) / z)
end
function tmp = code(x, y, z)
	tmp = (cosh(x) * (y / x)) / z;
end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}

\\
\frac{\cosh x \cdot \frac{y}{x}}{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: 84.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\cosh x \cdot \frac{y}{x}}{z} \end{array} \]
(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
double code(double x, double y, double z) {
	return (cosh(x) * (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 = (cosh(x) * (y / x)) / z
end function
public static double code(double x, double y, double z) {
	return (Math.cosh(x) * (y / x)) / z;
}
def code(x, y, z):
	return (math.cosh(x) * (y / x)) / z
function code(x, y, z)
	return Float64(Float64(cosh(x) * Float64(y / x)) / z)
end
function tmp = code(x, y, z)
	tmp = (cosh(x) * (y / x)) / z;
end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 96.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{y \cdot \frac{\cosh x}{z}}{x} \end{array} \]
(FPCore (x y z) :precision binary64 (/ (* y (/ (cosh x) z)) x))
double code(double x, double y, double z) {
	return (y * (cosh(x) / 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 = (y * (cosh(x) / z)) / x
end function
public static double code(double x, double y, double z) {
	return (y * (Math.cosh(x) / z)) / x;
}
def code(x, y, z):
	return (y * (math.cosh(x) / z)) / x
function code(x, y, z)
	return Float64(Float64(y * Float64(cosh(x) / z)) / x)
end
function tmp = code(x, y, z)
	tmp = (y * (cosh(x) / z)) / x;
end
code[x_, y_, z_] := N[(N[(y * N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{y \cdot \cosh x}}{x \cdot z} \]
    3. frac-times87.5%

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

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

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

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

Alternative 2: 78.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-157} \lor \neg \left(z \leq 2.4 \cdot 10^{-246}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.14999999999999994e-157 or 2.3999999999999998e-246 < z

    1. Initial program 88.5%

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

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

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

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

    if -1.14999999999999994e-157 < z < 2.3999999999999998e-246

    1. Initial program 83.1%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{z}} + 0.5 \cdot \frac{y \cdot x}{z} \]
      2. +-commutative80.3%

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

        \[\leadsto 0.5 \cdot \color{blue}{\frac{y}{\frac{z}{x}}} + \frac{\frac{y}{x}}{z} \]
    6. Simplified99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{-157} \lor \neg \left(z \leq 2.4 \cdot 10^{-246}\right):\\ \;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y}{\frac{z}{x}} + \frac{\frac{y}{x}}{z}\\ \end{array} \]

Alternative 3: 90.7% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 84.3%

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

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

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

    if -1.3000000000000001e106 < z

    1. Initial program 88.1%

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

        \[\leadsto \color{blue}{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}} \]
    3. Simplified82.5%

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

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

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

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

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

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

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

Alternative 4: 90.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\cosh x}{x} \cdot \frac{y}{z} \end{array} \]
(FPCore (x y z) :precision binary64 (* (/ (cosh x) x) (/ y z)))
double code(double x, double y, double z) {
	return (cosh(x) / x) * (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 = (cosh(x) / x) * (y / z)
end function
public static double code(double x, double y, double z) {
	return (Math.cosh(x) / x) * (y / z);
}
def code(x, y, z):
	return (math.cosh(x) / x) * (y / z)
function code(x, y, z)
	return Float64(Float64(cosh(x) / x) * Float64(y / z))
end
function tmp = code(x, y, z)
	tmp = (cosh(x) / x) * (y / z);
end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\cosh x}{x} \cdot \frac{y}{z}} \]
  5. Applied egg-rr92.1%

    \[\leadsto \color{blue}{\frac{\cosh x}{x} \cdot \frac{y}{z}} \]
  6. Final simplification92.1%

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

Alternative 5: 67.1% accurate, 7.1× speedup?

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

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

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


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

    1. Initial program 85.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{z}} + 0.5 \cdot \frac{y \cdot x}{z} \]
      2. +-commutative62.3%

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

        \[\leadsto 0.5 \cdot \color{blue}{\frac{y}{\frac{z}{x}}} + \frac{\frac{y}{x}}{z} \]
    6. Simplified67.1%

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

    if 4.9999999999999999e-17 < y

    1. Initial program 95.4%

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

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

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

Alternative 6: 67.1% accurate, 7.1× speedup?

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

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

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


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

    1. Initial program 85.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{z}} + 0.5 \cdot \frac{y \cdot x}{z} \]
      2. +-commutative62.1%

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

        \[\leadsto 0.5 \cdot \color{blue}{\frac{y}{\frac{z}{x}}} + \frac{\frac{y}{x}}{z} \]
    6. Simplified66.9%

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

    if 2.00000000000000014e-17 < y

    1. Initial program 95.5%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{z}} + 0.5 \cdot \frac{y \cdot x}{z} \]
      2. +-commutative72.3%

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

        \[\leadsto 0.5 \cdot \color{blue}{\frac{y}{\frac{z}{x}}} + \frac{\frac{y}{x}}{z} \]
    6. Simplified64.8%

      \[\leadsto \color{blue}{0.5 \cdot \frac{y}{\frac{z}{x}} + \frac{\frac{y}{x}}{z}} \]
    7. Step-by-step derivation
      1. clear-num64.8%

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

        \[\leadsto \color{blue}{\frac{0.5}{\frac{\frac{z}{x}}{y}}} + \frac{\frac{y}{x}}{z} \]
      3. associate-/l/72.3%

        \[\leadsto \frac{0.5}{\color{blue}{\frac{z}{y \cdot x}}} + \frac{\frac{y}{x}}{z} \]
    8. Applied egg-rr72.3%

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

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

Alternative 7: 65.6% accurate, 9.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.3999999999999999 or 1.4199999999999999 < x

    1. Initial program 81.4%

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

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

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

        \[\leadsto 0.5 \cdot \color{blue}{\left(y \cdot \frac{x}{z}\right)} \]
    5. Simplified44.1%

      \[\leadsto \color{blue}{0.5 \cdot \left(y \cdot \frac{x}{z}\right)} \]

    if -1.3999999999999999 < x < 1.4199999999999999

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 65.5% accurate, 9.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.4 \lor \neg \left(x \leq 1.42\right):\\ \;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot \frac{1}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -1.4) (not (<= x 1.42)))
   (* 0.5 (* y (/ x z)))
   (* (/ y z) (/ 1.0 x))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.4) || !(x <= 1.42)) {
		tmp = 0.5 * (y * (x / z));
	} else {
		tmp = (y / z) * (1.0 / 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 ((x <= (-1.4d0)) .or. (.not. (x <= 1.42d0))) then
        tmp = 0.5d0 * (y * (x / z))
    else
        tmp = (y / z) * (1.0d0 / x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.4) || !(x <= 1.42)) {
		tmp = 0.5 * (y * (x / z));
	} else {
		tmp = (y / z) * (1.0 / x);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -1.4) or not (x <= 1.42):
		tmp = 0.5 * (y * (x / z))
	else:
		tmp = (y / z) * (1.0 / x)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -1.4) || !(x <= 1.42))
		tmp = Float64(0.5 * Float64(y * Float64(x / z)));
	else
		tmp = Float64(Float64(y / z) * Float64(1.0 / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((x <= -1.4) || ~((x <= 1.42)))
		tmp = 0.5 * (y * (x / z));
	else
		tmp = (y / z) * (1.0 / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.4], N[Not[LessEqual[x, 1.42]], $MachinePrecision]], N[(0.5 * N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.3999999999999999 or 1.4199999999999999 < x

    1. Initial program 81.4%

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

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

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

        \[\leadsto 0.5 \cdot \color{blue}{\left(y \cdot \frac{x}{z}\right)} \]
    5. Simplified44.1%

      \[\leadsto \color{blue}{0.5 \cdot \left(y \cdot \frac{x}{z}\right)} \]

    if -1.3999999999999999 < x < 1.4199999999999999

    1. Initial program 95.5%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{z}}{x}} \]
      2. div-inv96.9%

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

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

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

Alternative 9: 65.8% accurate, 9.7× speedup?

\[\begin{array}{l} \\ \frac{\frac{y}{x} + 0.5 \cdot \left(y \cdot x\right)}{z} \end{array} \]
(FPCore (x y z) :precision binary64 (/ (+ (/ y x) (* 0.5 (* y x))) z))
double code(double x, double y, double z) {
	return ((y / x) + (0.5 * (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 = ((y / x) + (0.5d0 * (y * x))) / z
end function
public static double code(double x, double y, double z) {
	return ((y / x) + (0.5 * (y * x))) / z;
}
def code(x, y, z):
	return ((y / x) + (0.5 * (y * x))) / z
function code(x, y, z)
	return Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(y * x))) / z)
end
function tmp = code(x, y, z)
	tmp = ((y / x) + (0.5 * (y * x))) / z;
end
code[x_, y_, z_] := N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}

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

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

    \[\leadsto \frac{\color{blue}{\frac{y}{x} + 0.5 \cdot \left(y \cdot x\right)}}{z} \]
  3. Final simplification64.5%

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

Alternative 10: 48.9% accurate, 21.4× speedup?

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

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

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

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

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

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

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

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

Alternative 11: 48.5% accurate, 21.4× speedup?

\[\begin{array}{l} \\ \frac{\frac{y}{x}}{z} \end{array} \]
(FPCore (x y z) :precision binary64 (/ (/ y x) z))
double code(double x, double y, double z) {
	return (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 = (y / x) / z
end function
public static double code(double x, double y, double z) {
	return (y / x) / z;
}
def code(x, y, z):
	return (y / x) / z
function code(x, y, z)
	return Float64(Float64(y / x) / z)
end
function tmp = code(x, y, z)
	tmp = (y / x) / z;
end
code[x_, y_, z_] := N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{z}} \]
  6. Simplified45.9%

    \[\leadsto \color{blue}{\frac{\frac{y}{x}}{z}} \]
  7. Final simplification45.9%

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

Alternative 12: 53.0% accurate, 21.4× speedup?

\[\begin{array}{l} \\ \frac{\frac{y}{z}}{x} \end{array} \]
(FPCore (x y z) :precision binary64 (/ (/ y z) x))
double code(double x, double y, double z) {
	return (y / 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 = (y / z) / x
end function
public static double code(double x, double y, double z) {
	return (y / z) / x;
}
def code(x, y, z):
	return (y / z) / x
function code(x, y, z)
	return Float64(Float64(y / z) / x)
end
function tmp = code(x, y, z)
	tmp = (y / z) / x;
end
code[x_, y_, z_] := N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{y \cdot \cosh x}}{x \cdot z} \]
    3. frac-times87.5%

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

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

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

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

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

Developer target: 96.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{\frac{y}{z}}{x} \cdot \cosh x\\
\mathbf{if}\;y < -4.618902267687042 \cdot 10^{-52}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y < 1.038530535935153 \cdot 10^{-39}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{x}}{z}\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}

Reproduce

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

  :herbie-target
  (if (< y -4.618902267687042e-52) (* (/ (/ y z) x) (cosh x)) (if (< y 1.038530535935153e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))

  (/ (* (cosh x) (/ y x)) z))