Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 84.8% → 97.2%
Time: 11.0s
Alternatives: 18
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 18 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: 97.2% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 85.1%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Step-by-step derivation
      1. expm1-log1p-u50.0%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\cosh x \cdot \frac{y}{x}\right)\right)}}{z} \]
      2. expm1-udef38.8%

        \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\cosh x \cdot \frac{y}{x}\right)} - 1}}{z} \]
    3. Applied egg-rr38.8%

      \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\cosh x \cdot \frac{y}{x}\right)} - 1}}{z} \]
    4. Step-by-step derivation
      1. expm1-def50.0%

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

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

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

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

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

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

    if 2.70000000000000011e113 < y

    1. Initial program 88.0%

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

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

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

        \[\leadsto \frac{\cosh x}{\color{blue}{\frac{z \cdot x}{y}}} \]
      4. *-commutative95.6%

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

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

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

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

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

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

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

Alternative 2: 86.3% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 85.1%

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

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

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

    if 2.2000000000000001e108 < y

    1. Initial program 88.0%

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

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

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

        \[\leadsto \frac{\cosh x}{\color{blue}{\frac{z \cdot x}{y}}} \]
      4. *-commutative95.6%

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

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

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

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

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

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

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

Alternative 3: 84.7% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 4: 71.3% accurate, 4.6× speedup?

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

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

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


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

    1. Initial program 79.4%

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.5 \cdot \left(x \cdot y\right)}{z}} + \frac{y}{x \cdot z} \]
      2. frac-add39.9%

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

        \[\leadsto \frac{\color{blue}{\left(\left(x \cdot y\right) \cdot 0.5\right)} \cdot \left(x \cdot z\right) + z \cdot y}{z \cdot \left(x \cdot z\right)} \]
      4. *-commutative39.9%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\left(y \cdot \left(x \cdot 0.5\right)\right) \cdot \left(x \cdot z\right) + z \cdot y}{z}}{x \cdot z}} \]
      2. div-inv47.0%

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

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

        \[\leadsto \frac{y \cdot \left(\left(x \cdot 0.5\right) \cdot \left(x \cdot z\right)\right) + \color{blue}{y \cdot z}}{z} \cdot \frac{1}{x \cdot z} \]
      5. distribute-lft-out55.5%

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

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

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

    if -560 < x < 380

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 70.8% accurate, 4.6× speedup?

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

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

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

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


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

    1. Initial program 79.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.5 \cdot \left(x \cdot y\right)}{z}} + \frac{y}{x \cdot z} \]
      2. clear-num47.1%

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

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

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

        \[\leadsto \frac{1}{\frac{z}{\color{blue}{y \cdot \left(x \cdot 0.5\right)}}} + \frac{y}{x \cdot z} \]
    6. Applied egg-rr47.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{z}{y \cdot \left(x \cdot 0.5\right)}}} + \frac{y}{x \cdot z} \]
    7. Step-by-step derivation
      1. +-commutative47.1%

        \[\leadsto \color{blue}{\frac{y}{x \cdot z} + \frac{1}{\frac{z}{y \cdot \left(x \cdot 0.5\right)}}} \]
      2. associate-/r*47.1%

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

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

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

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

        \[\leadsto \frac{\frac{y}{x}}{z} + \color{blue}{\frac{0.5}{\frac{z}{y \cdot x}}} \]
      7. frac-add54.4%

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

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

    if -2.70000000000000009e-7 < x < 370

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

    if 370 < x

    1. Initial program 79.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.5 \cdot \left(x \cdot y\right)}{z}} + \frac{y}{x \cdot z} \]
      2. frac-add41.7%

        \[\leadsto \color{blue}{\frac{\left(0.5 \cdot \left(x \cdot y\right)\right) \cdot \left(x \cdot z\right) + z \cdot y}{z \cdot \left(x \cdot z\right)}} \]
      3. *-commutative41.7%

        \[\leadsto \frac{\color{blue}{\left(\left(x \cdot y\right) \cdot 0.5\right)} \cdot \left(x \cdot z\right) + z \cdot y}{z \cdot \left(x \cdot z\right)} \]
      4. *-commutative41.7%

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

        \[\leadsto \frac{\color{blue}{\left(y \cdot \left(x \cdot 0.5\right)\right)} \cdot \left(x \cdot z\right) + z \cdot y}{z \cdot \left(x \cdot z\right)} \]
    6. Applied egg-rr41.7%

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

        \[\leadsto \color{blue}{\frac{\frac{\left(y \cdot \left(x \cdot 0.5\right)\right) \cdot \left(x \cdot z\right) + z \cdot y}{z}}{x \cdot z}} \]
      2. div-inv49.4%

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

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

        \[\leadsto \frac{y \cdot \left(\left(x \cdot 0.5\right) \cdot \left(x \cdot z\right)\right) + \color{blue}{y \cdot z}}{z} \cdot \frac{1}{x \cdot z} \]
      5. distribute-lft-out58.5%

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

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

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

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

Alternative 6: 68.9% accurate, 5.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.85 \cdot 10^{-74}:\\
\;\;\;\;\frac{\frac{y}{x} + \left(y \cdot x\right) \cdot 0.5}{z}\\

\mathbf{elif}\;z \leq 2.9 \cdot 10^{+62}:\\
\;\;\;\;\frac{y \cdot \left(z + x \cdot \left(0.5 \cdot \left(x \cdot z\right)\right)\right)}{z \cdot \left(x \cdot z\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < 2.85000000000000012e-74

    1. Initial program 88.1%

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

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

    if 2.85000000000000012e-74 < z < 2.89999999999999984e62

    1. Initial program 90.8%

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.5 \cdot \left(x \cdot y\right)}{z}} + \frac{y}{x \cdot z} \]
      2. frac-add64.8%

        \[\leadsto \color{blue}{\frac{\left(0.5 \cdot \left(x \cdot y\right)\right) \cdot \left(x \cdot z\right) + z \cdot y}{z \cdot \left(x \cdot z\right)}} \]
      3. *-commutative64.8%

        \[\leadsto \frac{\color{blue}{\left(\left(x \cdot y\right) \cdot 0.5\right)} \cdot \left(x \cdot z\right) + z \cdot y}{z \cdot \left(x \cdot z\right)} \]
      4. *-commutative64.8%

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

        \[\leadsto \frac{\color{blue}{\left(y \cdot \left(x \cdot 0.5\right)\right)} \cdot \left(x \cdot z\right) + z \cdot y}{z \cdot \left(x \cdot z\right)} \]
    6. Applied egg-rr64.8%

      \[\leadsto \color{blue}{\frac{\left(y \cdot \left(x \cdot 0.5\right)\right) \cdot \left(x \cdot z\right) + z \cdot y}{z \cdot \left(x \cdot z\right)}} \]
    7. Step-by-step derivation
      1. associate-*l*70.6%

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

        \[\leadsto \frac{y \cdot \left(\left(x \cdot 0.5\right) \cdot \left(x \cdot z\right)\right) + \color{blue}{y \cdot z}}{z \cdot \left(x \cdot z\right)} \]
      3. distribute-lft-out70.6%

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

        \[\leadsto \frac{y \cdot \left(\color{blue}{x \cdot \left(0.5 \cdot \left(x \cdot z\right)\right)} + z\right)}{z \cdot \left(x \cdot z\right)} \]
    8. Applied egg-rr70.6%

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

    if 2.89999999999999984e62 < z

    1. Initial program 72.5%

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

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

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

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

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

Alternative 7: 65.2% accurate, 5.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 7.2 \cdot 10^{-116}:\\
\;\;\;\;\frac{\frac{y}{x} + \left(y \cdot x\right) \cdot 0.5}{z}\\

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


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

    1. Initial program 88.0%

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

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

    if 7.19999999999999951e-116 < z

    1. Initial program 81.3%

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.5 \cdot \left(x \cdot y\right)}{z}} + \frac{y}{x \cdot z} \]
      2. clear-num59.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{0.5 \cdot \left(x \cdot y\right)}}} + \frac{y}{x \cdot z} \]
      3. *-commutative59.6%

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

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

        \[\leadsto \frac{1}{\frac{z}{\color{blue}{y \cdot \left(x \cdot 0.5\right)}}} + \frac{y}{x \cdot z} \]
    6. Applied egg-rr59.6%

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{z}}{x}} + \frac{1}{\frac{z}{y \cdot \left(x \cdot 0.5\right)}} \]
      3. frac-2neg58.6%

        \[\leadsto \color{blue}{\frac{-\frac{y}{z}}{-x}} + \frac{1}{\frac{z}{y \cdot \left(x \cdot 0.5\right)}} \]
      4. frac-2neg58.6%

        \[\leadsto \frac{-\frac{y}{z}}{-x} + \frac{1}{\color{blue}{\frac{-z}{-y \cdot \left(x \cdot 0.5\right)}}} \]
      5. clear-num58.6%

        \[\leadsto \frac{-\frac{y}{z}}{-x} + \color{blue}{\frac{-y \cdot \left(x \cdot 0.5\right)}{-z}} \]
      6. frac-add62.4%

        \[\leadsto \color{blue}{\frac{\left(-\frac{y}{z}\right) \cdot \left(-z\right) + \left(-x\right) \cdot \left(-y \cdot \left(x \cdot 0.5\right)\right)}{\left(-x\right) \cdot \left(-z\right)}} \]
      7. distribute-neg-frac62.4%

        \[\leadsto \frac{\color{blue}{\frac{-y}{z}} \cdot \left(-z\right) + \left(-x\right) \cdot \left(-y \cdot \left(x \cdot 0.5\right)\right)}{\left(-x\right) \cdot \left(-z\right)} \]
      8. associate-*r*62.4%

        \[\leadsto \frac{\frac{-y}{z} \cdot \left(-z\right) + \left(-x\right) \cdot \left(-\color{blue}{\left(y \cdot x\right) \cdot 0.5}\right)}{\left(-x\right) \cdot \left(-z\right)} \]
      9. distribute-rgt-neg-in62.4%

        \[\leadsto \frac{\frac{-y}{z} \cdot \left(-z\right) + \left(-x\right) \cdot \color{blue}{\left(\left(y \cdot x\right) \cdot \left(-0.5\right)\right)}}{\left(-x\right) \cdot \left(-z\right)} \]
      10. metadata-eval62.4%

        \[\leadsto \frac{\frac{-y}{z} \cdot \left(-z\right) + \left(-x\right) \cdot \left(\left(y \cdot x\right) \cdot \color{blue}{-0.5}\right)}{\left(-x\right) \cdot \left(-z\right)} \]
    8. Applied egg-rr62.4%

      \[\leadsto \color{blue}{\frac{\frac{-y}{z} \cdot \left(-z\right) + \left(-x\right) \cdot \left(\left(y \cdot x\right) \cdot -0.5\right)}{\left(-x\right) \cdot \left(-z\right)}} \]
    9. Step-by-step derivation
      1. *-commutative62.4%

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

        \[\leadsto \frac{\left(-z\right) \cdot \frac{-y}{z} + \color{blue}{\left(\left(y \cdot x\right) \cdot -0.5\right) \cdot \left(-x\right)}}{\left(-x\right) \cdot \left(-z\right)} \]
      3. distribute-rgt-neg-out62.4%

        \[\leadsto \frac{\left(-z\right) \cdot \frac{-y}{z} + \color{blue}{\left(-\left(\left(y \cdot x\right) \cdot -0.5\right) \cdot x\right)}}{\left(-x\right) \cdot \left(-z\right)} \]
      4. unsub-neg62.4%

        \[\leadsto \frac{\color{blue}{\left(-z\right) \cdot \frac{-y}{z} - \left(\left(y \cdot x\right) \cdot -0.5\right) \cdot x}}{\left(-x\right) \cdot \left(-z\right)} \]
      5. distribute-frac-neg62.4%

        \[\leadsto \frac{\left(-z\right) \cdot \color{blue}{\left(-\frac{y}{z}\right)} - \left(\left(y \cdot x\right) \cdot -0.5\right) \cdot x}{\left(-x\right) \cdot \left(-z\right)} \]
      6. distribute-rgt-neg-in62.4%

        \[\leadsto \frac{\color{blue}{\left(-\left(-z\right) \cdot \frac{y}{z}\right)} - \left(\left(y \cdot x\right) \cdot -0.5\right) \cdot x}{\left(-x\right) \cdot \left(-z\right)} \]
      7. distribute-lft-neg-out62.4%

        \[\leadsto \frac{\left(-\color{blue}{\left(-z \cdot \frac{y}{z}\right)}\right) - \left(\left(y \cdot x\right) \cdot -0.5\right) \cdot x}{\left(-x\right) \cdot \left(-z\right)} \]
      8. remove-double-neg62.4%

        \[\leadsto \frac{\color{blue}{z \cdot \frac{y}{z}} - \left(\left(y \cdot x\right) \cdot -0.5\right) \cdot x}{\left(-x\right) \cdot \left(-z\right)} \]
      9. *-commutative62.4%

        \[\leadsto \frac{z \cdot \frac{y}{z} - \color{blue}{x \cdot \left(\left(y \cdot x\right) \cdot -0.5\right)}}{\left(-x\right) \cdot \left(-z\right)} \]
      10. associate-*l*62.4%

        \[\leadsto \frac{z \cdot \frac{y}{z} - x \cdot \color{blue}{\left(y \cdot \left(x \cdot -0.5\right)\right)}}{\left(-x\right) \cdot \left(-z\right)} \]
      11. distribute-lft-neg-out62.4%

        \[\leadsto \frac{z \cdot \frac{y}{z} - x \cdot \left(y \cdot \left(x \cdot -0.5\right)\right)}{\color{blue}{-x \cdot \left(-z\right)}} \]
      12. distribute-rgt-neg-out62.4%

        \[\leadsto \frac{z \cdot \frac{y}{z} - x \cdot \left(y \cdot \left(x \cdot -0.5\right)\right)}{-\color{blue}{\left(-x \cdot z\right)}} \]
      13. remove-double-neg62.4%

        \[\leadsto \frac{z \cdot \frac{y}{z} - x \cdot \left(y \cdot \left(x \cdot -0.5\right)\right)}{\color{blue}{x \cdot z}} \]
    10. Simplified62.4%

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

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

Alternative 8: 66.2% accurate, 7.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 6.8 \cdot 10^{+152}:\\
\;\;\;\;\frac{\frac{y}{x} + \left(y \cdot x\right) \cdot 0.5}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 6.80000000000000041e152

    1. Initial program 88.4%

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

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

    if 6.80000000000000041e152 < z

    1. Initial program 66.5%

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{z} + \frac{y}{x \cdot z}} \]
    5. Step-by-step derivation
      1. div-inv60.0%

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

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

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

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

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

Alternative 9: 66.3% accurate, 7.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.2 \cdot 10^{-191}:\\
\;\;\;\;\frac{\frac{y}{x} + \left(y \cdot x\right) \cdot 0.5}{z}\\

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


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

    1. Initial program 87.8%

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

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

    if 1.2e-191 < z

    1. Initial program 82.5%

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

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

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

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

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

        \[\leadsto 0.5 \cdot \color{blue}{\left(\frac{x}{z} \cdot y\right)} + \frac{y}{x \cdot z} \]
    6. Applied egg-rr61.5%

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

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

Alternative 10: 68.2% accurate, 7.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{+32}:\\
\;\;\;\;\frac{\frac{y}{x} + \left(y \cdot x\right) \cdot 0.5}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 2.00000000000000011e32

    1. Initial program 88.6%

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

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

    if 2.00000000000000011e32 < z

    1. Initial program 74.7%

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

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

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

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

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

Alternative 11: 65.9% accurate, 8.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.45 \cdot 10^{+153}:\\
\;\;\;\;\frac{y \cdot \left(x \cdot 0.5 + \frac{1}{x}\right)}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.45000000000000001e153

    1. Initial program 88.4%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Step-by-step derivation
      1. expm1-log1p-u51.4%

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

        \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\cosh x \cdot \frac{y}{x}\right)} - 1}}{z} \]
    3. Applied egg-rr41.5%

      \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\cosh x \cdot \frac{y}{x}\right)} - 1}}{z} \]
    4. Step-by-step derivation
      1. expm1-def51.4%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\cosh x \cdot \frac{y}{x}\right)\right)}}{z} \]
      2. expm1-log1p88.4%

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

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

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

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

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

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

    if 1.45000000000000001e153 < z

    1. Initial program 66.5%

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

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

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

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

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

Alternative 12: 66.0% accurate, 8.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.65 \cdot 10^{+151}:\\
\;\;\;\;\frac{\frac{y}{x} + \left(y \cdot x\right) \cdot 0.5}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.65000000000000012e151

    1. Initial program 88.4%

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

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

    if 1.65000000000000012e151 < z

    1. Initial program 66.5%

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

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

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

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

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

Alternative 13: 62.4% accurate, 9.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.4 \lor \neg \left(x \leq 1.45\right):\\ \;\;\;\;x \cdot \left(0.5 \cdot \frac{y}{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.45))) (* x (* 0.5 (/ y z))) (/ (/ y z) x)))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.4) || !(x <= 1.45)) {
		tmp = x * (0.5 * (y / 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.45d0))) then
        tmp = x * (0.5d0 * (y / 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.45)) {
		tmp = x * (0.5 * (y / z));
	} else {
		tmp = (y / z) / x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -1.4) or not (x <= 1.45):
		tmp = x * (0.5 * (y / z))
	else:
		tmp = (y / z) / x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -1.4) || !(x <= 1.45))
		tmp = Float64(x * Float64(0.5 * Float64(y / 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.45)))
		tmp = x * (0.5 * (y / 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.45]], $MachinePrecision]], N[(x * N[(0.5 * N[(y / 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.45\right):\\
\;\;\;\;x \cdot \left(0.5 \cdot \frac{y}{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.44999999999999996 < x

    1. Initial program 79.5%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Step-by-step derivation
      1. expm1-log1p-u36.2%

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

        \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\cosh x \cdot \frac{y}{x}\right)} - 1}}{z} \]
    3. Applied egg-rr35.5%

      \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\cosh x \cdot \frac{y}{x}\right)} - 1}}{z} \]
    4. Step-by-step derivation
      1. expm1-def36.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{0.5 \cdot y}{z}} \]
      9. *-commutative34.0%

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

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

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

    if -1.3999999999999999 < x < 1.44999999999999996

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 66.3% accurate, 9.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.4 \lor \neg \left(x \leq 1.45\right):\\ \;\;\;\;y \cdot \left(0.5 \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.45))) (* y (* 0.5 (/ x z))) (/ (/ y z) x)))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.4) || !(x <= 1.45)) {
		tmp = y * (0.5 * (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.45d0))) then
        tmp = y * (0.5d0 * (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.45)) {
		tmp = y * (0.5 * (x / z));
	} else {
		tmp = (y / z) / x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -1.4) or not (x <= 1.45):
		tmp = y * (0.5 * (x / z))
	else:
		tmp = (y / z) / x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -1.4) || !(x <= 1.45))
		tmp = Float64(y * Float64(0.5 * 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.45)))
		tmp = y * (0.5 * (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.45]], $MachinePrecision]], N[(y * N[(0.5 * 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.45\right):\\
\;\;\;\;y \cdot \left(0.5 \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.44999999999999996 < x

    1. Initial program 79.5%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Step-by-step derivation
      1. expm1-log1p-u36.2%

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

        \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\cosh x \cdot \frac{y}{x}\right)} - 1}}{z} \]
    3. Applied egg-rr35.5%

      \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\cosh x \cdot \frac{y}{x}\right)} - 1}}{z} \]
    4. Step-by-step derivation
      1. expm1-def36.2%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.5 \cdot \left(x \cdot y\right)}{z}} \]
      2. associate-*r*42.3%

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

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

        \[\leadsto \color{blue}{\left(0.5 \cdot \frac{x}{z}\right)} \cdot y \]
      5. *-commutative39.3%

        \[\leadsto \color{blue}{y \cdot \left(0.5 \cdot \frac{x}{z}\right)} \]
    9. Simplified39.3%

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

    if -1.3999999999999999 < x < 1.44999999999999996

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 66.3% accurate, 9.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.4 \lor \neg \left(x \leq 1.45\right):\\ \;\;\;\;\frac{\left(y \cdot x\right) \cdot 0.5}{z}\\ \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.45))) (/ (* (* y x) 0.5) z) (/ (/ y z) x)))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.4) || !(x <= 1.45)) {
		tmp = ((y * x) * 0.5) / 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.45d0))) then
        tmp = ((y * x) * 0.5d0) / 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.45)) {
		tmp = ((y * x) * 0.5) / z;
	} else {
		tmp = (y / z) / x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -1.4) or not (x <= 1.45):
		tmp = ((y * x) * 0.5) / z
	else:
		tmp = (y / z) / x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -1.4) || !(x <= 1.45))
		tmp = Float64(Float64(Float64(y * x) * 0.5) / 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.45)))
		tmp = ((y * x) * 0.5) / 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.45]], $MachinePrecision]], N[(N[(N[(y * x), $MachinePrecision] * 0.5), $MachinePrecision] / z), $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.45\right):\\
\;\;\;\;\frac{\left(y \cdot x\right) \cdot 0.5}{z}\\

\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.44999999999999996 < x

    1. Initial program 79.5%

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

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

      \[\leadsto \frac{\color{blue}{0.5 \cdot \left(x \cdot y\right)}}{z} \]
    4. Step-by-step derivation
      1. *-commutative42.3%

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

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

    if -1.3999999999999999 < x < 1.44999999999999996

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 51.6% accurate, 15.2× speedup?

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

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

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


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

    1. Initial program 81.9%

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

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

    if 2.9500000000000001e-124 < y

    1. Initial program 91.9%

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

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

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

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

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

Alternative 17: 56.1% accurate, 15.2× speedup?

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

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

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


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

    1. Initial program 83.3%

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

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

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

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

    if -2e4 < z

    1. Initial program 86.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 50.2% 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 85.7%

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

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

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

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

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

Developer target: 97.2% 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 2023332 
(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))