Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 84.4% → 99.8%
Time: 14.7s
Alternatives: 16
Speedup: 1.0×

Specification

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

\\
\frac{\cosh x \cdot \frac{y}{x}}{z}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 84.4% accurate, 1.0× speedup?

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

\\
\frac{\cosh x \cdot \frac{y}{x}}{z}
\end{array}

Alternative 1: 99.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\cosh x \cdot \frac{y}{x}}{z}\\ \mathbf{if}\;t_0 \leq -\infty:\\ \;\;\;\;y \cdot \frac{\frac{\cosh x}{z}}{x}\\ \mathbf{elif}\;t_0 \leq 10^{+302}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z \cdot \frac{x}{\cosh x}}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (/ (* (cosh x) (/ y x)) z)))
   (if (<= t_0 (- INFINITY))
     (* y (/ (/ (cosh x) z) x))
     (if (<= t_0 1e+302) t_0 (/ y (* z (/ x (cosh x))))))))
double code(double x, double y, double z) {
	double t_0 = (cosh(x) * (y / x)) / z;
	double tmp;
	if (t_0 <= -((double) INFINITY)) {
		tmp = y * ((cosh(x) / z) / x);
	} else if (t_0 <= 1e+302) {
		tmp = t_0;
	} else {
		tmp = y / (z * (x / cosh(x)));
	}
	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 = y * ((Math.cosh(x) / z) / x);
	} else if (t_0 <= 1e+302) {
		tmp = t_0;
	} else {
		tmp = y / (z * (x / Math.cosh(x)));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (math.cosh(x) * (y / x)) / z
	tmp = 0
	if t_0 <= -math.inf:
		tmp = y * ((math.cosh(x) / z) / x)
	elif t_0 <= 1e+302:
		tmp = t_0
	else:
		tmp = y / (z * (x / math.cosh(x)))
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(cosh(x) * Float64(y / x)) / z)
	tmp = 0.0
	if (t_0 <= Float64(-Inf))
		tmp = Float64(y * Float64(Float64(cosh(x) / z) / x));
	elseif (t_0 <= 1e+302)
		tmp = t_0;
	else
		tmp = Float64(y / Float64(z * Float64(x / cosh(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 <= -Inf)
		tmp = y * ((cosh(x) / z) / x);
	elseif (t_0 <= 1e+302)
		tmp = t_0;
	else
		tmp = y / (z * (x / cosh(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, (-Infinity)], N[(y * N[(N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+302], t$95$0, N[(y / N[(z * N[(x / N[Cosh[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t_0 \leq 10^{+302}:\\
\;\;\;\;t_0\\

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


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

    1. Initial program 93.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\cosh x}{z} \cdot \frac{y}{x}} \]
      4. expm1-log1p-u0.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\cosh x}{z} \cdot \frac{y}{x}\right)\right)} \]
      5. expm1-udef0.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\cosh x}{z} \cdot \frac{y}{x}\right)} - 1} \]
      6. frac-times0.0%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{\cosh x \cdot y}{z \cdot x}}\right)} - 1 \]
      7. *-commutative0.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 1.0000000000000001e302

    1. Initial program 99.6%

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

    if 1.0000000000000001e302 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z)

    1. Initial program 64.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\cosh x}{z} \cdot \frac{y}{x}} \]
      4. expm1-log1p-u64.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\cosh x}{z} \cdot \frac{y}{x}\right)\right)} \]
      5. expm1-udef64.3%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\cosh x}{z} \cdot \frac{y}{x}\right)} - 1} \]
      6. frac-times72.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{\cosh x \cdot y}{z \cdot x}}\right)} - 1 \]
      7. *-commutative72.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{-121} \lor \neg \left(y \leq -3.2 \cdot 10^{-223}\right):\\
\;\;\;\;y \cdot \frac{\frac{\cosh x}{z}}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.19999999999999967e-121 or -3.2000000000000001e-223 < y

    1. Initial program 84.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\cosh x}{z} \cdot \frac{y}{x}\right)\right)} \]
      5. expm1-udef34.5%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\cosh x}{z} \cdot \frac{y}{x}\right)} - 1} \]
      6. frac-times36.0%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{\cosh x \cdot y}{z \cdot x}}\right)} - 1 \]
      7. *-commutative36.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.19999999999999967e-121 < y < -3.2000000000000001e-223

    1. Initial program 100.0%

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

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

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

Alternative 3: 93.9% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.10000000000000003e38 or -3.2000000000000001e-227 < y

    1. Initial program 82.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\cosh x}{z} \cdot \frac{y}{x}} \]
      4. expm1-log1p-u47.7%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\cosh x}{z} \cdot \frac{y}{x}\right)} - 1} \]
      6. frac-times36.2%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{\cosh x \cdot y}{z \cdot x}}\right)} - 1 \]
      7. *-commutative36.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.10000000000000003e38 < y < -3.2000000000000001e-227

    1. Initial program 98.1%

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

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

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

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

Alternative 4: 83.6% accurate, 1.0× speedup?

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

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


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

    1. Initial program 77.6%

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

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

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

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

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

    if -7.3000000000000002e254 < z

    1. Initial program 86.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\cosh x}{z} \cdot \frac{y}{x}} \]
      4. expm1-log1p-u51.5%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\cosh x}{z} \cdot \frac{y}{x}\right)} - 1} \]
      6. frac-times36.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{\cosh x \cdot y}{z \cdot x}}\right)} - 1 \]
      7. *-commutative36.9%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{x} \cdot \frac{\cosh x}{z}} \]
      6. *-rgt-identity86.3%

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

        \[\leadsto \color{blue}{\left(y \cdot \frac{1}{x}\right)} \cdot \frac{\cosh x}{z} \]
      8. associate-*r*94.3%

        \[\leadsto \color{blue}{y \cdot \left(\frac{1}{x} \cdot \frac{\cosh x}{z}\right)} \]
      9. associate-*r/94.4%

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

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

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

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

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

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

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

Alternative 5: 96.3% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\cosh x}{z} \cdot \frac{y}{x}} \]
    4. expm1-log1p-u50.1%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\cosh x}{z} \cdot \frac{y}{x}\right)\right)} \]
    5. expm1-udef34.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\cosh x}{z} \cdot \frac{y}{x}\right)} - 1} \]
    6. frac-times35.5%

      \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{\cosh x \cdot y}{z \cdot x}}\right)} - 1 \]
    7. *-commutative35.5%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{x}{\frac{\cosh x}{z}}}} \]
    2. un-div-inv95.6%

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

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

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

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

Alternative 6: 69.7% accurate, 3.3× speedup?

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

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

\mathbf{elif}\;x \leq -5 \cdot 10^{-264}:\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\

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

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


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

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.00880000000000000053 < x < -5.0000000000000001e-264

    1. Initial program 91.1%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot y}{z}}}{x} \]
      3. *-un-lft-identity94.0%

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

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

    if -5.0000000000000001e-264 < x < 110

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

    if 110 < x

    1. Initial program 69.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{x \cdot z}{y}, \color{blue}{-\frac{z}{x \cdot y}}\right)}{\left(-\frac{z}{x \cdot y}\right) \cdot \frac{x}{\frac{y}{z}}} \]
      4. fma-neg28.1%

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

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

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

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

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

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

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

        \[\leadsto \frac{z \cdot \left(\frac{x}{y} \cdot -0.5\right) - \frac{\frac{z}{x}}{y}}{\frac{\color{blue}{x \cdot \left(-\frac{z}{x \cdot y}\right)}}{\frac{y}{z}}} \]
      12. distribute-rgt-neg-out42.7%

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

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

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

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

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

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

Alternative 7: 70.3% accurate, 4.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.7e93 or 1.15e42 < z

    1. Initial program 80.9%

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

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

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

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

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

    if -1.7e93 < z < 2.20000000000000002e-68

    1. Initial program 88.2%

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

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

    if 2.20000000000000002e-68 < z < 1.15e42

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+93}:\\ \;\;\;\;0.5 \cdot \frac{x \cdot y}{z} + \frac{y}{x \cdot z}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-68}:\\ \;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+42}:\\ \;\;\;\;\frac{z \cdot \left(y + y \cdot \left(0.5 \cdot \left(x \cdot x\right)\right)\right)}{x \cdot \left(z \cdot z\right)}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{x \cdot y}{z} + \frac{y}{x \cdot z}\\ \end{array} \]

Alternative 8: 65.3% accurate, 6.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{-54} \lor \neg \left(z \leq 5.7 \cdot 10^{-291}\right):\\
\;\;\;\;\frac{y}{x \cdot z} + 0.5 \cdot \left(y \cdot \frac{x}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.5999999999999998e-54 or 5.70000000000000034e-291 < z

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

    if -4.5999999999999998e-54 < z < 5.70000000000000034e-291

    1. Initial program 92.3%

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

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

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

Alternative 9: 67.1% accurate, 6.2× speedup?

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

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

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

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


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

    1. Initial program 80.2%

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

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

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

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

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

    if -1.7e93 < z < 2.3500000000000001e-290

    1. Initial program 89.1%

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

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

    if 2.3500000000000001e-290 < z

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

Alternative 10: 65.4% accurate, 7.1× speedup?

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

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

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


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

    1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

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

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

    if -6.2000000000000004e92 < z

    1. Initial program 87.0%

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

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

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

Alternative 11: 65.3% accurate, 8.2× speedup?

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

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

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


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

    1. Initial program 72.5%

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

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

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

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

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

    if -4.6999999999999999e195 < z

    1. Initial program 87.6%

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

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

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

Alternative 12: 61.3% 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}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x \cdot z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -1.4) (not (<= x 1.4))) (* 0.5 (/ x (/ z y))) (/ y (* x z))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.4) || !(x <= 1.4)) {
		tmp = 0.5 * (x / (z / y));
	} else {
		tmp = y / (x * z);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((x <= (-1.4d0)) .or. (.not. (x <= 1.4d0))) then
        tmp = 0.5d0 * (x / (z / y))
    else
        tmp = y / (x * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.4) || !(x <= 1.4)) {
		tmp = 0.5 * (x / (z / y));
	} else {
		tmp = y / (x * z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -1.4) or not (x <= 1.4):
		tmp = 0.5 * (x / (z / y))
	else:
		tmp = y / (x * z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -1.4) || !(x <= 1.4))
		tmp = Float64(0.5 * Float64(x / Float64(z / y)));
	else
		tmp = Float64(y / Float64(x * z));
	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 / (z / y));
	else
		tmp = y / (x * z);
	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[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $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}{\frac{z}{y}}\\

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


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

    1. Initial program 79.4%

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{z} + \frac{y}{x \cdot z}} \]
    5. Taylor expanded in x around inf 38.1%

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

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

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

    if -1.3999999999999999 < x < 1.3999999999999999

    1. Initial program 90.3%

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

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

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

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

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

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

Alternative 13: 65.5% 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{y}{x \cdot z}\\ \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 (* x z))))
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 / (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)) .or. (.not. (x <= 1.4d0))) then
        tmp = 0.5d0 * ((x * y) / z)
    else
        tmp = y / (x * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.4) || !(x <= 1.4)) {
		tmp = 0.5 * ((x * y) / z);
	} else {
		tmp = y / (x * z);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -1.4) or not (x <= 1.4):
		tmp = 0.5 * ((x * y) / z)
	else:
		tmp = y / (x * z)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -1.4) || !(x <= 1.4))
		tmp = Float64(0.5 * Float64(Float64(x * y) / z));
	else
		tmp = Float64(y / Float64(x * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((x <= -1.4) || ~((x <= 1.4)))
		tmp = 0.5 * ((x * y) / z);
	else
		tmp = y / (x * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.4], N[Not[LessEqual[x, 1.4]], $MachinePrecision]], N[(0.5 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 79.4%

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{z} + \frac{y}{x \cdot z}} \]
    5. Taylor expanded in x around inf 38.1%

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

    if -1.3999999999999999 < x < 1.3999999999999999

    1. Initial program 90.3%

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

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

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

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

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

    \[\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{y}{x \cdot z}\\ \end{array} \]

Alternative 14: 56.3% accurate, 11.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+37} \lor \neg \left(y \leq 3.6 \cdot 10^{-67}\right):\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.19999999999999995e37 or 3.59999999999999999e-67 < y

    1. Initial program 89.3%

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

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

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

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

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

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

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

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

    if -7.19999999999999995e37 < y < 3.59999999999999999e-67

    1. Initial program 81.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+37} \lor \neg \left(y \leq 3.6 \cdot 10^{-67}\right):\\ \;\;\;\;\frac{\frac{y}{z}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{x}}{z}\\ \end{array} \]

Alternative 15: 50.2% accurate, 15.2× speedup?

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

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

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


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

    1. Initial program 87.2%

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

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

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

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

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

    if -1.8999999999999999e-41 < y

    1. Initial program 85.0%

      \[\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-/r*75.8%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{z}} \]
    6. Simplified59.2%

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

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

Alternative 16: 48.8% 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 85.7%

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

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

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

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

    \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
  5. Final simplification56.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 2023279 
(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))