Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 84.6% → 96.0%
Time: 9.9s
Alternatives: 16
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 16 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.6% 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{\frac{\cosh x}{x} \cdot 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(Float64(cosh(x) / x) * y) / z)
end
function tmp = code(x, y, z)
	tmp = ((cosh(x) / x) * y) / z;
end
code[x_, y_, z_] := N[(N[(N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \cosh x \cdot \frac{y}{x}\\ \mathbf{if}\;t_0 \leq \infty:\\ \;\;\;\;\frac{t_0}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{\cosh x}{x \cdot z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* (cosh x) (/ y x))))
   (if (<= t_0 INFINITY) (/ t_0 z) (* y (/ (cosh x) (* x z))))))
double code(double x, double y, double z) {
	double t_0 = cosh(x) * (y / x);
	double tmp;
	if (t_0 <= ((double) INFINITY)) {
		tmp = t_0 / z;
	} else {
		tmp = y * (cosh(x) / (x * z));
	}
	return tmp;
}
public static double code(double x, double y, double z) {
	double t_0 = Math.cosh(x) * (y / x);
	double tmp;
	if (t_0 <= Double.POSITIVE_INFINITY) {
		tmp = t_0 / z;
	} else {
		tmp = y * (Math.cosh(x) / (x * z));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.cosh(x) * (y / x)
	tmp = 0
	if t_0 <= math.inf:
		tmp = t_0 / z
	else:
		tmp = y * (math.cosh(x) / (x * z))
	return tmp
function code(x, y, z)
	t_0 = Float64(cosh(x) * Float64(y / x))
	tmp = 0.0
	if (t_0 <= Inf)
		tmp = Float64(t_0 / z);
	else
		tmp = Float64(y * Float64(cosh(x) / Float64(x * z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = cosh(x) * (y / x);
	tmp = 0.0;
	if (t_0 <= Inf)
		tmp = t_0 / z;
	else
		tmp = y * (cosh(x) / (x * z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], N[(t$95$0 / z), $MachinePrecision], N[(y * N[(N[Cosh[x], $MachinePrecision] / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \cosh x \cdot \frac{y}{x}\\
\mathbf{if}\;t_0 \leq \infty:\\
\;\;\;\;\frac{t_0}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (cosh.f64 x) (/.f64 y x)) < +inf.0

    1. Initial program 95.2%

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

    if +inf.0 < (*.f64 (cosh.f64 x) (/.f64 y x))

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

Alternative 3: 83.5% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;z \leq -1.2 \cdot 10^{-40} \lor \neg \left(z \leq 9.5 \cdot 10^{-17}\right):\\
\;\;\;\;y \cdot \frac{\cosh x}{x \cdot z}\\

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


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

    1. Initial program 80.3%

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

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

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

        \[\leadsto 0.5 \cdot \color{blue}{\frac{y}{\frac{z}{x}}} + \frac{y}{z \cdot x} \]
      3. *-commutative37.9%

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

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

        \[\leadsto \color{blue}{\frac{y}{x \cdot z} + 0.5 \cdot \frac{y}{\frac{z}{x}}} \]
      2. *-commutative37.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1 \cdot \left(x \cdot \left(y \cdot \left(z \cdot 0.5\right)\right)\right)}{\color{blue}{\left(x \cdot \frac{z}{x}\right) \cdot z}} \]
      3. times-frac61.4%

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

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

    if -1.6e174 < z < -1.19999999999999996e-40 or 9.50000000000000029e-17 < z

    1. Initial program 76.4%

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

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

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

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

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

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

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

    if -1.19999999999999996e-40 < z < 9.50000000000000029e-17

    1. Initial program 87.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+174}:\\ \;\;\;\;\frac{1}{x \cdot \frac{z}{x}} \cdot \frac{x \cdot \left(y \cdot \left(z \cdot 0.5\right)\right)}{z}\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-40} \lor \neg \left(z \leq 9.5 \cdot 10^{-17}\right):\\ \;\;\;\;y \cdot \frac{\cosh x}{x \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\cosh x \cdot \frac{\frac{y}{z}}{x}\\ \end{array} \]

Alternative 4: 86.9% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq 1.1 \cdot 10^{-14}:\\
\;\;\;\;\cosh x \cdot \frac{\frac{y}{z}}{x}\\

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


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

    1. Initial program 82.3%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Step-by-step derivation
      1. *-commutative82.3%

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

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

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

    if -9.99999999999999958e27 < z < 1.1e-14

    1. Initial program 87.8%

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

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

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

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

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

    if 1.1e-14 < z

    1. Initial program 69.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+28}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{\cosh x}{z}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-14}:\\ \;\;\;\;\cosh x \cdot \frac{\frac{y}{z}}{x}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{\cosh x}{x \cdot z}\\ \end{array} \]

Alternative 5: 83.5% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 6: 70.9% accurate, 4.6× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{1}{x \cdot \frac{z}{x}} \cdot \frac{x \cdot \left(y \cdot \left(z \cdot 0.5\right)\right)}{z}\\
\mathbf{if}\;x \leq -1300000:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;x \leq 2.95 \cdot 10^{+193}:\\
\;\;\;\;\frac{x \cdot y}{\frac{z}{x}} \cdot \frac{z \cdot 0.5}{x \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.3e6 or 2.9499999999999999e193 < x

    1. Initial program 65.8%

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

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

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

        \[\leadsto 0.5 \cdot \color{blue}{\frac{y}{\frac{z}{x}}} + \frac{y}{z \cdot x} \]
      3. *-commutative40.7%

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

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

        \[\leadsto \color{blue}{\frac{y}{x \cdot z} + 0.5 \cdot \frac{y}{\frac{z}{x}}} \]
      2. *-commutative40.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1 \cdot \left(x \cdot \left(y \cdot \left(z \cdot 0.5\right)\right)\right)}{\color{blue}{\left(x \cdot \frac{z}{x}\right) \cdot z}} \]
      3. times-frac58.8%

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

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

    if -1.3e6 < x < 1.3999999999999999

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

    if 1.3999999999999999 < x < 2.9499999999999999e193

    1. Initial program 79.5%

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

      \[\leadsto \color{blue}{\frac{y}{z \cdot x} + 0.5 \cdot \frac{y \cdot x}{z}} \]
    3. Step-by-step derivation
      1. +-commutative17.4%

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

        \[\leadsto 0.5 \cdot \color{blue}{\frac{y}{\frac{z}{x}}} + \frac{y}{z \cdot x} \]
      3. *-commutative28.0%

        \[\leadsto 0.5 \cdot \frac{y}{\frac{z}{x}} + \frac{y}{\color{blue}{x \cdot z}} \]
    4. Simplified28.0%

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

        \[\leadsto \color{blue}{\frac{y}{x \cdot z} + 0.5 \cdot \frac{y}{\frac{z}{x}}} \]
      2. *-commutative28.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 70.0% accurate, 5.6× speedup?

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

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

\mathbf{elif}\;y \leq 1.25 \cdot 10^{-261}:\\
\;\;\;\;t_0 + y \cdot \frac{0.5}{\frac{z}{x}}\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.99999999999999991e37 or 5.00000000000000018e-11 < y

    1. Initial program 90.8%

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

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

    if -1.99999999999999991e37 < y < 1.24999999999999995e-261

    1. Initial program 78.2%

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

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

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

        \[\leadsto 0.5 \cdot \color{blue}{\frac{y}{\frac{z}{x}}} + \frac{y}{z \cdot x} \]
      3. *-commutative64.1%

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

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

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

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

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

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

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

    if 1.24999999999999995e-261 < y < 5.00000000000000018e-11

    1. Initial program 72.5%

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

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

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

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

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

Alternative 8: 68.5% accurate, 5.6× speedup?

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

    1. Initial program 70.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(x \cdot y\right) \cdot \left(z \cdot 0.5\right)}{\color{blue}{\frac{z}{x} \cdot \left(x \cdot z\right)}} \]
      5. times-frac44.0%

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

        \[\leadsto \frac{x \cdot y}{\frac{z}{x}} \cdot \frac{z \cdot 0.5}{\color{blue}{z \cdot x}} \]
    13. Applied egg-rr44.0%

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

    if -1.3999999999999999 < x < 1.3999999999999999

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 68.7% accurate, 5.6× speedup?

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

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

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

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


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

    1. Initial program 69.0%

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

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

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

        \[\leadsto 0.5 \cdot \color{blue}{\frac{y}{\frac{z}{x}}} + \frac{y}{z \cdot x} \]
      3. *-commutative38.6%

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

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

        \[\leadsto \color{blue}{\frac{y}{x \cdot z} + 0.5 \cdot \frac{y}{\frac{z}{x}}} \]
      2. *-commutative38.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(x \cdot y\right) \cdot \left(z \cdot 0.5\right)}{\color{blue}{\frac{z}{x} \cdot \left(x \cdot z\right)}} \]
      5. times-frac47.6%

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

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

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

    if -1.3999999999999999 < x < 225

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

    if 225 < x

    1. Initial program 72.9%

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

      \[\leadsto \color{blue}{\frac{y}{z \cdot x} + 0.5 \cdot \frac{y \cdot x}{z}} \]
    3. Step-by-step derivation
      1. +-commutative28.6%

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

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

        \[\leadsto 0.5 \cdot \frac{y}{\frac{z}{x}} + \frac{y}{\color{blue}{x \cdot z}} \]
    4. Simplified33.2%

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

        \[\leadsto \color{blue}{\frac{0.5 \cdot y}{\frac{z}{x}}} + \frac{y}{x \cdot z} \]
      2. *-commutative31.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 63.8% accurate, 7.1× speedup?

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

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

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


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

    1. Initial program 83.5%

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

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

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

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

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

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

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

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

    if 7.70000000000000018e-295 < y

    1. Initial program 81.5%

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

      \[\leadsto \color{blue}{\frac{y}{z \cdot x} + 0.5 \cdot \frac{y \cdot x}{z}} \]
    3. Step-by-step derivation
      1. +-commutative61.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{-0.5 \cdot x - \frac{1}{x}}{\frac{z}{y}}} \]
      3. *-commutative66.2%

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

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

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

Alternative 11: 63.9% accurate, 7.1× speedup?

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

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

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


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

    1. Initial program 83.5%

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

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

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

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

        \[\leadsto 0.5 \cdot \frac{y}{\frac{z}{x}} + \frac{y}{\color{blue}{x \cdot z}} \]
    4. Simplified69.2%

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

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

        \[\leadsto \color{blue}{\frac{0.5}{\frac{\frac{z}{x}}{y}}} + \frac{y}{x \cdot z} \]
    6. Applied egg-rr69.2%

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

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

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

    if 3.0999999999999999e-290 < y

    1. Initial program 81.5%

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

      \[\leadsto \color{blue}{\frac{y}{z \cdot x} + 0.5 \cdot \frac{y \cdot x}{z}} \]
    3. Step-by-step derivation
      1. +-commutative61.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{-0.5 \cdot x - \frac{1}{x}}{\frac{z}{y}}} \]
      3. *-commutative66.2%

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

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

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

Alternative 12: 66.0% accurate, 9.6× speedup?

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

    1. Initial program 70.9%

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < x < 1.3999999999999999

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 65.9% accurate, 9.7× speedup?

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

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

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

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

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

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

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

Alternative 14: 53.1% accurate, 11.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+21} \lor \neg \left(z \leq 1.85 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{y}{x \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.8e21 or 1.85000000000000003e-19 < z

    1. Initial program 76.3%

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

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

    if -1.8e21 < z < 1.85000000000000003e-19

    1. Initial program 87.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+21} \lor \neg \left(z \leq 1.85 \cdot 10^{-19}\right):\\ \;\;\;\;\frac{y}{x \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{x}}{z}\\ \end{array} \]

Alternative 15: 55.4% accurate, 15.2× speedup?

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

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

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


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

    1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

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

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

    if 6.9999999999999997e-18 < z

    1. Initial program 69.6%

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

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

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

Alternative 16: 49.5% 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 82.5%

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

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

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

Developer target: 97.0% 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 2023257 
(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))