Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 84.7% → 99.3%
Time: 8.4s
Alternatives: 15
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 15 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.7% 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: 99.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 2 \cdot 10^{+125}:\\
\;\;\;\;\frac{y \cdot t_0}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4e6

    1. Initial program 88.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{y}} \cdot \frac{\cosh x}{x}} \]
      3. clear-num99.9%

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

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

    if -4e6 < y < 1.9999999999999998e125

    1. Initial program 80.7%

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999998e125 < y

    1. Initial program 87.9%

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

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

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

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

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

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

Alternative 2: 93.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \cosh x \cdot \frac{y}{x}\\ \mathbf{if}\;t_0 \leq 2 \cdot 10^{+223}:\\ \;\;\;\;\frac{t_0}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot \frac{\cosh x}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* (cosh x) (/ y x))))
   (if (<= t_0 2e+223) (/ t_0 z) (* (/ y z) (/ (cosh x) x)))))
double code(double x, double y, double z) {
	double t_0 = cosh(x) * (y / x);
	double tmp;
	if (t_0 <= 2e+223) {
		tmp = t_0 / z;
	} else {
		tmp = (y / z) * (cosh(x) / x);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = cosh(x) * (y / x)
    if (t_0 <= 2d+223) then
        tmp = t_0 / z
    else
        tmp = (y / z) * (cosh(x) / x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = Math.cosh(x) * (y / x);
	double tmp;
	if (t_0 <= 2e+223) {
		tmp = t_0 / z;
	} else {
		tmp = (y / z) * (Math.cosh(x) / x);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.cosh(x) * (y / x)
	tmp = 0
	if t_0 <= 2e+223:
		tmp = t_0 / z
	else:
		tmp = (y / z) * (math.cosh(x) / x)
	return tmp
function code(x, y, z)
	t_0 = Float64(cosh(x) * Float64(y / x))
	tmp = 0.0
	if (t_0 <= 2e+223)
		tmp = Float64(t_0 / z);
	else
		tmp = Float64(Float64(y / z) * Float64(cosh(x) / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = cosh(x) * (y / x);
	tmp = 0.0;
	if (t_0 <= 2e+223)
		tmp = t_0 / z;
	else
		tmp = (y / z) * (cosh(x) / x);
	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, 2e+223], N[(t$95$0 / z), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


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

    1. Initial program 96.7%

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

    if 2.00000000000000009e223 < (*.f64 (cosh.f64 x) (/.f64 y x))

    1. Initial program 64.6%

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

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

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

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

        \[\leadsto \frac{\color{blue}{1 \cdot \cosh x}}{\frac{z}{y} \cdot x} \]
      2. times-frac89.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{y}} \cdot \frac{\cosh x}{x}} \]
      3. clear-num90.9%

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

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

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

Alternative 3: 89.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_0 := \cosh x \cdot \frac{\frac{y}{z}}{x}\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{+51}:\\
\;\;\;\;t_0\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.8999999999999999e51 or 2.0499999999999999e-76 < y

    1. Initial program 90.3%

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

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

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

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

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

    if -1.8999999999999999e51 < y < -1.3499999999999999e-142

    1. Initial program 95.3%

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

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

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

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

    if -1.3499999999999999e-142 < y < 2.0499999999999999e-76

    1. Initial program 65.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.9 \cdot 10^{+51}:\\ \;\;\;\;\cosh x \cdot \frac{\frac{y}{z}}{x}\\ \mathbf{elif}\;y \leq -1.35 \cdot 10^{-142}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{\cosh x}{z}\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{-76}:\\ \;\;\;\;y \cdot \frac{\cosh x}{z \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\cosh x \cdot \frac{\frac{y}{z}}{x}\\ \end{array} \]

Alternative 4: 87.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-53} \lor \neg \left(y \leq 2 \cdot 10^{-76}\right):\\
\;\;\;\;\cosh x \cdot \frac{\frac{y}{z}}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.00000000000000006e-53 or 1.99999999999999985e-76 < y

    1. Initial program 91.9%

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

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

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

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

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

    if -2.00000000000000006e-53 < y < 1.99999999999999985e-76

    1. Initial program 70.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{-53} \lor \neg \left(y \leq 2 \cdot 10^{-76}\right):\\ \;\;\;\;\cosh x \cdot \frac{\frac{y}{z}}{x}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{\cosh x}{z \cdot x}\\ \end{array} \]

Alternative 5: 83.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ y \cdot \frac{\cosh x}{z \cdot x} \end{array} \]
(FPCore (x y z) :precision binary64 (* y (/ (cosh x) (* z x))))
double code(double x, double y, double z) {
	return y * (cosh(x) / (z * x));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = y * (cosh(x) / (z * x))
end function
public static double code(double x, double y, double z) {
	return y * (Math.cosh(x) / (z * x));
}
def code(x, y, z):
	return y * (math.cosh(x) / (z * x))
function code(x, y, z)
	return Float64(y * Float64(cosh(x) / Float64(z * x)))
end
function tmp = code(x, y, z)
	tmp = y * (cosh(x) / (z * x));
end
code[x_, y_, z_] := N[(y * N[(N[Cosh[x], $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

Alternative 6: 90.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{y}{z} \cdot \frac{\cosh x}{x} \end{array} \]
(FPCore (x y z) :precision binary64 (* (/ y z) (/ (cosh x) x)))
double code(double x, double y, double z) {
	return (y / z) * (cosh(x) / x);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (y / z) * (cosh(x) / x)
end function
public static double code(double x, double y, double z) {
	return (y / z) * (Math.cosh(x) / x);
}
def code(x, y, z):
	return (y / z) * (math.cosh(x) / x)
function code(x, y, z)
	return Float64(Float64(y / z) * Float64(cosh(x) / x))
end
function tmp = code(x, y, z)
	tmp = (y / z) * (cosh(x) / x);
end
code[x_, y_, z_] := N[(N[(y / z), $MachinePrecision] * N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

Alternative 7: 68.7% accurate, 6.2× speedup?

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

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

\mathbf{elif}\;x \leq 2.75 \cdot 10^{+169}:\\
\;\;\;\;y \cdot \frac{x \cdot 0.5 + \frac{1}{x}}{z}\\

\mathbf{elif}\;x \leq 1.95 \cdot 10^{+241}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.0000000000000002e91 or 2.74999999999999986e169 < x < 1.95000000000000013e241

    1. Initial program 80.6%

      \[\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.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.5}{\frac{z}{{x}^{2}}}} \cdot \frac{y}{x} \]
      3. unpow273.4%

        \[\leadsto \frac{0.5}{\frac{z}{\color{blue}{x \cdot x}}} \cdot \frac{y}{x} \]
    12. Simplified73.4%

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

    if -5.0000000000000002e91 < x < 2.74999999999999986e169

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

    if 1.95000000000000013e241 < x

    1. Initial program 46.7%

      \[\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/66.7%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{+91}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{0.5}{\frac{z}{x \cdot x}}\\ \mathbf{elif}\;x \leq 2.75 \cdot 10^{+169}:\\ \;\;\;\;y \cdot \frac{x \cdot 0.5 + \frac{1}{x}}{z}\\ \mathbf{elif}\;x \leq 1.95 \cdot 10^{+241}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{0.5}{\frac{z}{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y}{\frac{z}{x}}\\ \end{array} \]

Alternative 8: 69.7% accurate, 6.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+183} \lor \neg \left(z \leq 3.2 \cdot 10^{+104}\right):\\
\;\;\;\;\frac{y}{x} \cdot \frac{1 + 0.5 \cdot \left(x \cdot x\right)}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.5000000000000003e183 or 3.2e104 < z

    1. Initial program 77.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 + 0.5 \cdot {x}^{2}}{z} \cdot \frac{y}{x}} \]
      2. unpow259.7%

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

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

    if -9.5000000000000003e183 < z < 3.2e104

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{+183} \lor \neg \left(z \leq 3.2 \cdot 10^{+104}\right):\\ \;\;\;\;\frac{y}{x} \cdot \frac{1 + 0.5 \cdot \left(x \cdot x\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{1 + x \cdot \left(x \cdot 0.5\right)}{z \cdot x}\\ \end{array} \]

Alternative 9: 68.3% accurate, 7.1× speedup?

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

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

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


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

    1. Initial program 83.2%

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

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

    if -1.9e183 < z

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 61.7% accurate, 9.6× speedup?

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

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

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


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

    1. Initial program 79.4%

      \[\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/74.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < x < 1.4199999999999999

    1. Initial program 89.1%

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

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

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

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

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

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

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

Alternative 11: 65.1% accurate, 9.6× speedup?

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

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

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


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

    1. Initial program 79.4%

      \[\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/74.8%

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

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

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

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

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

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

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

        \[\leadsto 0.5 \cdot \color{blue}{\frac{y}{\frac{z}{x}}} \]
    7. Simplified42.8%

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

    if -1.3999999999999999 < x < 1.4199999999999999

    1. Initial program 89.1%

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

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

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

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

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

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

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

Alternative 12: 65.2% accurate, 9.6× speedup?

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

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

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

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


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

    1. Initial program 83.8%

      \[\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/73.5%

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < x < 1.4199999999999999

    1. Initial program 89.1%

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

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

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

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

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

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

    if 1.4199999999999999 < x

    1. Initial program 74.6%

      \[\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/76.2%

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

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

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

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

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

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

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

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

Alternative 13: 65.5% accurate, 9.7× speedup?

\[\begin{array}{l} \\ y \cdot \frac{x \cdot 0.5 + \frac{1}{x}}{z} \end{array} \]
(FPCore (x y z) :precision binary64 (* y (/ (+ (* x 0.5) (/ 1.0 x)) z)))
double code(double x, double y, double z) {
	return y * (((x * 0.5) + (1.0 / x)) / z);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = y * (((x * 0.5d0) + (1.0d0 / x)) / z)
end function
public static double code(double x, double y, double z) {
	return y * (((x * 0.5) + (1.0 / x)) / z);
}
def code(x, y, z):
	return y * (((x * 0.5) + (1.0 / x)) / z)
function code(x, y, z)
	return Float64(y * Float64(Float64(Float64(x * 0.5) + Float64(1.0 / x)) / z))
end
function tmp = code(x, y, z)
	tmp = y * (((x * 0.5) + (1.0 / x)) / z);
end
code[x_, y_, z_] := N[(y * N[(N[(N[(x * 0.5), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 56.9% accurate, 11.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-21} \lor \neg \left(z \leq 6.5 \cdot 10^{-25}\right):\\
\;\;\;\;\frac{y}{z \cdot x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.99999999999999973e-21 or 6.5e-25 < z

    1. Initial program 80.1%

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

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

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

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

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

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

    if -4.99999999999999973e-21 < z < 6.5e-25

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 49.4% accurate, 21.4× speedup?

\[\begin{array}{l} \\ \frac{y}{z \cdot x} \end{array} \]
(FPCore (x y z) :precision binary64 (/ y (* z x)))
double code(double x, double y, double z) {
	return y / (z * x);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = y / (z * x)
end function
public static double code(double x, double y, double z) {
	return y / (z * x);
}
def code(x, y, z):
	return y / (z * x)
function code(x, y, z)
	return Float64(y / Float64(z * x))
end
function tmp = code(x, y, z)
	tmp = y / (z * x);
end
code[x_, y_, z_] := N[(y / N[(z * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

Developer target: 97.1% 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 2023240 
(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))