Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 83.9% → 99.2%
Time: 9.1s
Alternatives: 11
Speedup: 0.3×

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 11 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: 83.9% 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.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \cosh x \cdot \frac{y}{x}\\ \mathbf{if}\;t_0 \leq -4 \cdot 10^{+266} \lor \neg \left(t_0 \leq 10^{+117}\right):\\ \;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* (cosh x) (/ y x))))
   (if (or (<= t_0 -4e+266) (not (<= t_0 1e+117)))
     (/ (/ (* (cosh x) y) z) x)
     (/ (+ (/ y x) (* 0.5 (* x y))) z))))
double code(double x, double y, double z) {
	double t_0 = cosh(x) * (y / x);
	double tmp;
	if ((t_0 <= -4e+266) || !(t_0 <= 1e+117)) {
		tmp = ((cosh(x) * y) / z) / x;
	} else {
		tmp = ((y / x) + (0.5 * (x * y))) / z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = cosh(x) * (y / x)
    if ((t_0 <= (-4d+266)) .or. (.not. (t_0 <= 1d+117))) then
        tmp = ((cosh(x) * y) / z) / x
    else
        tmp = ((y / x) + (0.5d0 * (x * y))) / z
    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 <= -4e+266) || !(t_0 <= 1e+117)) {
		tmp = ((Math.cosh(x) * y) / z) / x;
	} else {
		tmp = ((y / x) + (0.5 * (x * y))) / z;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.cosh(x) * (y / x)
	tmp = 0
	if (t_0 <= -4e+266) or not (t_0 <= 1e+117):
		tmp = ((math.cosh(x) * y) / z) / x
	else:
		tmp = ((y / x) + (0.5 * (x * y))) / z
	return tmp
function code(x, y, z)
	t_0 = Float64(cosh(x) * Float64(y / x))
	tmp = 0.0
	if ((t_0 <= -4e+266) || !(t_0 <= 1e+117))
		tmp = Float64(Float64(Float64(cosh(x) * y) / z) / x);
	else
		tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = cosh(x) * (y / x);
	tmp = 0.0;
	if ((t_0 <= -4e+266) || ~((t_0 <= 1e+117)))
		tmp = ((cosh(x) * y) / z) / x;
	else
		tmp = ((y / x) + (0.5 * (x * y))) / 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[Or[LessEqual[t$95$0, -4e+266], N[Not[LessEqual[t$95$0, 1e+117]], $MachinePrecision]], N[(N[(N[(N[Cosh[x], $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \cosh x \cdot \frac{y}{x}\\
\mathbf{if}\;t_0 \leq -4 \cdot 10^{+266} \lor \neg \left(t_0 \leq 10^{+117}\right):\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (cosh.f64 x) (/.f64 y x)) < -4.0000000000000001e266 or 1.00000000000000005e117 < (*.f64 (cosh.f64 x) (/.f64 y x))

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

    if -4.0000000000000001e266 < (*.f64 (cosh.f64 x) (/.f64 y x)) < 1.00000000000000005e117

    1. Initial program 99.9%

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

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

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

Alternative 2: 93.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \cosh x \cdot \frac{y}{x}\\ \mathbf{if}\;t_0 \leq -4 \cdot 10^{+266} \lor \neg \left(t_0 \leq 10^{+295}\right):\\ \;\;\;\;\frac{\cosh x}{x} \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* (cosh x) (/ y x))))
   (if (or (<= t_0 -4e+266) (not (<= t_0 1e+295)))
     (* (/ (cosh x) x) (/ y z))
     (/ (+ (/ y x) (* 0.5 (* x y))) z))))
double code(double x, double y, double z) {
	double t_0 = cosh(x) * (y / x);
	double tmp;
	if ((t_0 <= -4e+266) || !(t_0 <= 1e+295)) {
		tmp = (cosh(x) / x) * (y / z);
	} else {
		tmp = ((y / x) + (0.5 * (x * y))) / z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = cosh(x) * (y / x)
    if ((t_0 <= (-4d+266)) .or. (.not. (t_0 <= 1d+295))) then
        tmp = (cosh(x) / x) * (y / z)
    else
        tmp = ((y / x) + (0.5d0 * (x * y))) / z
    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 <= -4e+266) || !(t_0 <= 1e+295)) {
		tmp = (Math.cosh(x) / x) * (y / z);
	} else {
		tmp = ((y / x) + (0.5 * (x * y))) / z;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.cosh(x) * (y / x)
	tmp = 0
	if (t_0 <= -4e+266) or not (t_0 <= 1e+295):
		tmp = (math.cosh(x) / x) * (y / z)
	else:
		tmp = ((y / x) + (0.5 * (x * y))) / z
	return tmp
function code(x, y, z)
	t_0 = Float64(cosh(x) * Float64(y / x))
	tmp = 0.0
	if ((t_0 <= -4e+266) || !(t_0 <= 1e+295))
		tmp = Float64(Float64(cosh(x) / x) * Float64(y / z));
	else
		tmp = Float64(Float64(Float64(y / x) + Float64(0.5 * Float64(x * y))) / z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = cosh(x) * (y / x);
	tmp = 0.0;
	if ((t_0 <= -4e+266) || ~((t_0 <= 1e+295)))
		tmp = (cosh(x) / x) * (y / z);
	else
		tmp = ((y / x) + (0.5 * (x * y))) / 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[Or[LessEqual[t$95$0, -4e+266], N[Not[LessEqual[t$95$0, 1e+295]], $MachinePrecision]], N[(N[(N[Cosh[x], $MachinePrecision] / x), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / x), $MachinePrecision] + N[(0.5 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \cosh x \cdot \frac{y}{x}\\
\mathbf{if}\;t_0 \leq -4 \cdot 10^{+266} \lor \neg \left(t_0 \leq 10^{+295}\right):\\
\;\;\;\;\frac{\cosh x}{x} \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (cosh.f64 x) (/.f64 y x)) < -4.0000000000000001e266 or 9.9999999999999998e294 < (*.f64 (cosh.f64 x) (/.f64 y x))

    1. Initial program 76.3%

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

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

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

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

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

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

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

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

    if -4.0000000000000001e266 < (*.f64 (cosh.f64 x) (/.f64 y x)) < 9.9999999999999998e294

    1. Initial program 99.9%

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

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

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

Alternative 3: 79.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.22 \cdot 10^{+242} \lor \neg \left(x \leq 9 \cdot 10^{+223}\right):\\
\;\;\;\;0.5 \cdot \frac{x \cdot y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.2199999999999999e242 or 9e223 < x

    1. Initial program 70.7%

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

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

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

    if -1.2199999999999999e242 < x < 9e223

    1. Initial program 86.3%

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

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

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

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

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

Alternative 4: 65.6% accurate, 7.6× speedup?

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

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

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


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

    1. Initial program 79.2%

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

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

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

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

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

        \[\leadsto -\frac{y}{\frac{z}{\color{blue}{x \cdot -0.5} - \frac{1}{x}}} \]
    5. Simplified65.9%

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

    if 2e11 < y

    1. Initial program 97.1%

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

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

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

Alternative 5: 65.8% accurate, 8.2× speedup?

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

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

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

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


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

    1. Initial program 84.5%

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

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

    if -6.1999999999999996e-72 < x < 1.3999999999999999

    1. Initial program 90.0%

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

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

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

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

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

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

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

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

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

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

    if 1.3999999999999999 < x

    1. Initial program 72.3%

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{z}} \]
    4. Step-by-step derivation
      1. expm1-log1p-u23.2%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(0.5 \cdot \frac{x \cdot y}{z}\right)} - 1} \]
      3. associate-*r/23.1%

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{0.5 \cdot \color{blue}{\left(y \cdot x\right)}}{z}\right)} - 1 \]
      5. associate-*r*23.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 61.9% accurate, 9.6× speedup?

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

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

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


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

    1. Initial program 77.3%

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

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

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

        \[\leadsto 0.5 \cdot \frac{x \cdot y}{\color{blue}{1 \cdot z}} \]
      2. times-frac32.0%

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

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

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

    if -1.44999999999999996 < x < 1.3999999999999999

    1. Initial program 90.3%

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

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

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

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

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

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

Alternative 7: 66.1% accurate, 9.6× speedup?

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

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

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


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

    1. Initial program 77.3%

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

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

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

    if -1.44999999999999996 < x < 1.3999999999999999

    1. Initial program 90.3%

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

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

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

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

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

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

Alternative 8: 66.1% accurate, 9.6× speedup?

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

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

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

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


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

    1. Initial program 82.5%

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

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

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

    if -1.44999999999999996 < x < 1.3999999999999999

    1. Initial program 90.3%

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

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

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

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

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

    if 1.3999999999999999 < x

    1. Initial program 72.3%

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{z}} \]
    4. Step-by-step derivation
      1. expm1-log1p-u23.2%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(0.5 \cdot \frac{x \cdot y}{z}\right)} - 1} \]
      3. associate-*r/23.1%

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{0.5 \cdot \color{blue}{\left(y \cdot x\right)}}{z}\right)} - 1 \]
      5. associate-*r*23.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 65.7% accurate, 9.6× speedup?

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

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

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

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


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

    1. Initial program 82.5%

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

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

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

    if -1.44999999999999996 < x < 1.3999999999999999

    1. Initial program 90.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{x \cdot z} \cdot y} \]
      3. *-commutative96.6%

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

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

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

    if 1.3999999999999999 < x

    1. Initial program 72.3%

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{z}} \]
    4. Step-by-step derivation
      1. expm1-log1p-u23.2%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(0.5 \cdot \frac{x \cdot y}{z}\right)} - 1} \]
      3. associate-*r/23.1%

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{0.5 \cdot \color{blue}{\left(y \cdot x\right)}}{z}\right)} - 1 \]
      5. associate-*r*23.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 55.1% accurate, 15.2× speedup?

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

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

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


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

    1. Initial program 84.8%

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

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

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

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

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

    if -1.9000000000000001e30 < z

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 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 83.8%

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

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

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

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

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

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

Developer target: 97.3% 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 2023285 
(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))