Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 84.9% → 97.4%
Time: 7.1s
Alternatives: 12
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 12 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 84.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: 97.4% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 2.00000000000000006e-139

    1. Initial program 97.4%

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

    if 2.00000000000000006e-139 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z)

    1. Initial program 79.4%

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

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

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

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

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

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

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

Alternative 2: 88.6% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 95.5%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 3: 84.9% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 9.1999999999999996e-282 or 1.20000000000000005e-91 < x

    1. Initial program 88.0%

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

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

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

    if 9.1999999999999996e-282 < x < 1.20000000000000005e-91

    1. Initial program 86.3%

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

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

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

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

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

Alternative 4: 83.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-153} \lor \neg \left(y \leq 9 \cdot 10^{-248}\right):\\
\;\;\;\;\frac{y}{x} \cdot \frac{\cosh x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.00000000000000004e-153 or 8.9999999999999992e-248 < y

    1. Initial program 92.4%

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

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

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

    if -1.00000000000000004e-153 < y < 8.9999999999999992e-248

    1. Initial program 60.4%

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

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

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

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

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

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

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

Alternative 5: 70.2% accurate, 5.6× speedup?

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

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

\mathbf{elif}\;y \leq 7.5 \cdot 10^{-244}:\\
\;\;\;\;\frac{-y}{\frac{z}{x \cdot -0.5 + \frac{-1}{x}}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.8000000000000001e-58 or 9.99999999999999967e78 < y

    1. Initial program 92.0%

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

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

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

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

    if -2.8000000000000001e-58 < y < 7.5000000000000003e-244

    1. Initial program 69.3%

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

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

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

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

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

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

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

    if 7.5000000000000003e-244 < y < 9.99999999999999967e78

    1. Initial program 95.4%

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

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

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

Alternative 6: 70.2% accurate, 5.6× speedup?

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

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

\mathbf{elif}\;y \leq 6.8 \cdot 10^{-250}:\\
\;\;\;\;t_0 + 0.5 \cdot \frac{\frac{x}{z}}{\frac{1}{y}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.60000000000000013e92 or 5.99999999999999964e78 < y

    1. Initial program 90.0%

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

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

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

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

    if -1.60000000000000013e92 < y < 6.79999999999999987e-250

    1. Initial program 78.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.79999999999999987e-250 < y < 5.99999999999999964e78

    1. Initial program 95.4%

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

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

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

Alternative 7: 66.2% accurate, 8.2× speedup?

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

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

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

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


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

    1. Initial program 86.9%

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

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

    if 1.85e-283 < x < 1.3999999999999999

    1. Initial program 89.1%

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

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

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

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

    if 1.3999999999999999 < x

    1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 66.0% accurate, 8.9× speedup?

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-\frac{y}{\frac{z}{x \cdot -0.5 - \frac{1}{x}}}} \]
  6. Final simplification71.6%

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

Alternative 9: 62.1% accurate, 9.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -750 \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 -750.0) (not (<= x 1.4))) (* 0.5 (* x (/ y z))) (/ (/ y z) x)))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -750.0) || !(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 <= (-750.0d0)) .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 <= -750.0) || !(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 <= -750.0) 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 <= -750.0) || !(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 <= -750.0) || ~((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, -750.0], 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 -750 \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 < -750 or 1.3999999999999999 < x

    1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

    if -750 < x < 1.3999999999999999

    1. Initial program 92.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -750 \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: 65.9% accurate, 9.6× speedup?

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

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

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


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

    1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

    if -750 < x < 1.3999999999999999

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

Alternative 11: 54.9% accurate, 15.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-31}:\\
\;\;\;\;\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 < -2.99999999999999981e-31

    1. Initial program 87.9%

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

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

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

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

    if -2.99999999999999981e-31 < z

    1. Initial program 87.6%

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

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

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

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

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

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

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

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

Alternative 12: 49.7% 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 87.7%

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

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

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

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

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

Developer target: 97.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\frac{y}{z}}{x} \cdot \cosh x\\ \mathbf{if}\;y < -4.618902267687042 \cdot 10^{-52}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y < 1.038530535935153 \cdot 10^{-39}:\\ \;\;\;\;\frac{\frac{\cosh x \cdot y}{x}}{z}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* (/ (/ y z) x) (cosh x))))
   (if (< y -4.618902267687042e-52)
     t_0
     (if (< y 1.038530535935153e-39) (/ (/ (* (cosh x) y) x) z) t_0))))
double code(double x, double y, double z) {
	double t_0 = ((y / z) / x) * cosh(x);
	double tmp;
	if (y < -4.618902267687042e-52) {
		tmp = t_0;
	} else if (y < 1.038530535935153e-39) {
		tmp = ((cosh(x) * y) / x) / z;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = ((y / z) / x) * cosh(x)
    if (y < (-4.618902267687042d-52)) then
        tmp = t_0
    else if (y < 1.038530535935153d-39) then
        tmp = ((cosh(x) * y) / x) / z
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = ((y / z) / x) * Math.cosh(x);
	double tmp;
	if (y < -4.618902267687042e-52) {
		tmp = t_0;
	} else if (y < 1.038530535935153e-39) {
		tmp = ((Math.cosh(x) * y) / x) / z;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = ((y / z) / x) * math.cosh(x)
	tmp = 0
	if y < -4.618902267687042e-52:
		tmp = t_0
	elif y < 1.038530535935153e-39:
		tmp = ((math.cosh(x) * y) / x) / z
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(Float64(y / z) / x) * cosh(x))
	tmp = 0.0
	if (y < -4.618902267687042e-52)
		tmp = t_0;
	elseif (y < 1.038530535935153e-39)
		tmp = Float64(Float64(Float64(cosh(x) * y) / x) / z);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = ((y / z) / x) * cosh(x);
	tmp = 0.0;
	if (y < -4.618902267687042e-52)
		tmp = t_0;
	elseif (y < 1.038530535935153e-39)
		tmp = ((cosh(x) * y) / x) / z;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision] * N[Cosh[x], $MachinePrecision]), $MachinePrecision]}, If[Less[y, -4.618902267687042e-52], t$95$0, If[Less[y, 1.038530535935153e-39], N[(N[(N[(N[Cosh[x], $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision] / z), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\frac{y}{z}}{x} \cdot \cosh x\\
\mathbf{if}\;y < -4.618902267687042 \cdot 10^{-52}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y < 1.038530535935153 \cdot 10^{-39}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{x}}{z}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023309 
(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))