Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 85.7% → 95.9%
Time: 8.0s
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: 85.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: 95.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.5% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 95.5%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

Alternative 3: 83.9% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.20000000000000007e-86 or 9.99999999999999996e-71 < x

    1. Initial program 76.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/78.0%

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

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

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

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

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

    if -1.20000000000000007e-86 < x < 9.99999999999999996e-71

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 84.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.4 \cdot 10^{-181} \lor \neg \left(z \leq 3.8 \cdot 10^{+163}\right):\\
\;\;\;\;\cosh x \cdot \frac{\frac{y}{z}}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 2.4000000000000001e-181 or 3.80000000000000008e163 < z

    1. Initial program 83.5%

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

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

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

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

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

    if 2.4000000000000001e-181 < z < 3.80000000000000008e163

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

Alternative 5: 68.8% accurate, 5.6× speedup?

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

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

\mathbf{elif}\;y \leq 2000000:\\
\;\;\;\;t_0 + \frac{1}{\frac{\frac{z}{x}}{y \cdot 0.5}}\\

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


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

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000001e41 < y < 2e6

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e6 < y

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 67.8% accurate, 6.2× speedup?

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

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

\mathbf{elif}\;y \leq 1.15 \cdot 10^{-116}:\\
\;\;\;\;\frac{\frac{y}{x}}{z} + 0.5 \cdot \frac{y}{\frac{z}{x}}\\

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


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

    1. Initial program 90.9%

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

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

    if -5.9999999999999996e132 < y < 1.15000000000000001e-116

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.15000000000000001e-116 < y

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

Alternative 7: 68.4% accurate, 6.2× speedup?

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

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

\mathbf{elif}\;y \leq 400000:\\
\;\;\;\;\frac{\frac{y}{x}}{z} + 0.5 \cdot \frac{y}{\frac{z}{x}}\\

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


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

    1. Initial program 91.3%

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

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

    if -5.9000000000000001e119 < y < 4e5

    1. Initial program 75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4e5 < y

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 66.0% accurate, 7.1× speedup?

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

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

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


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

    1. Initial program 86.4%

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

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

    if 1.09999999999999999e-181 < z

    1. Initial program 74.7%

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

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

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

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

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

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

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

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

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

Alternative 9: 61.9% accurate, 9.6× speedup?

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

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

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


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

    1. Initial program 72.3%

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

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

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

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

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

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

    if -1.3999999999999999 < x < 1.3999999999999999

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 66.0% accurate, 9.6× speedup?

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

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

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


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

    1. Initial program 72.3%

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

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

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

    if -1.3999999999999999 < x < 1.3999999999999999

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 65.9% accurate, 9.6× speedup?

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

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

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

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


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

    1. Initial program 72.5%

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

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

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

    if -1.3999999999999999 < x < 1.3999999999999999

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

    if 1.3999999999999999 < x

    1. Initial program 72.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 66.0% accurate, 9.7× speedup?

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

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

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

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

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

Alternative 13: 50.8% accurate, 15.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.0245:\\
\;\;\;\;\frac{\frac{y}{x}}{z}\\

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


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

    1. Initial program 84.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{z}} \]
    6. Simplified52.1%

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

    if 0.024500000000000001 < z

    1. Initial program 72.3%

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

        \[\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 48.3%

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

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

Alternative 14: 49.0% accurate, 21.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 52.8% accurate, 21.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 96.8% 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 2023200 
(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))