Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 85.0% → 97.8%
Time: 9.3s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 85.0% accurate, 1.0× speedup?

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

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

Alternative 1: 97.8% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 99.3%

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

    if 2e297 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z)

    1. Initial program 59.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 82.4% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.00000000000000012e-53 or 9.20000000000000035e-26 < x

    1. Initial program 75.9%

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

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

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

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

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

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

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

    if -4.00000000000000012e-53 < x < 9.20000000000000035e-26

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 85.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-66} \lor \neg \left(y \leq 9.5 \cdot 10^{-306}\right):\\
\;\;\;\;\cosh x \cdot \frac{\frac{y}{z}}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.2499999999999999e-66 or 9.5e-306 < y

    1. Initial program 90.3%

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

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

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

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

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

    if -1.2499999999999999e-66 < y < 9.5e-306

    1. Initial program 63.9%

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

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

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

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

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

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

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

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

Alternative 4: 98.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-94} \lor \neg \left(z \leq 3.1 \cdot 10^{-136}\right):\\
\;\;\;\;\frac{y}{\frac{x}{\frac{\cosh x}{z}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.9999999999999998e-94 or 3.1e-136 < z

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

    if -3.9999999999999998e-94 < z < 3.1e-136

    1. Initial program 83.6%

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

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

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

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

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

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

Alternative 5: 69.3% accurate, 4.3× speedup?

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

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

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

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

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


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

    1. Initial program 64.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.5 \cdot \frac{y}{\frac{z}{x}} + \color{blue}{\frac{y}{z \cdot x}} \]
      2. +-commutative34.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y \cdot \left(x \cdot \left(z \cdot 0.5\right) + \frac{z}{x}\right)}{\color{blue}{\frac{x}{\frac{x}{{z}^{2}}}}} \]
      6. unpow261.4%

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

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

    if -1.54999999999999995e155 < x < -900

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{y}{x}}{z} + \color{blue}{\frac{0.5}{\frac{z}{x \cdot y}}} \]
      8. frac-add45.2%

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

        \[\leadsto \frac{\frac{y}{x} \cdot \frac{z}{\color{blue}{y \cdot x}} + z \cdot 0.5}{z \cdot \frac{z}{x \cdot y}} \]
      10. *-commutative45.2%

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

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

    if -900 < x < 1.32000000000000007e159

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.32000000000000007e159 < x

    1. Initial program 63.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.5 \cdot \frac{y}{\frac{z}{x}} + \color{blue}{\frac{y}{z \cdot x}} \]
      2. +-commutative47.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.55 \cdot 10^{+155}:\\ \;\;\;\;\frac{y \cdot \left(x \cdot \left(z \cdot 0.5\right) + \frac{z}{x}\right)}{\frac{x}{\frac{x}{z \cdot z}}}\\ \mathbf{elif}\;x \leq -900:\\ \;\;\;\;\frac{z \cdot 0.5 + \frac{y}{x} \cdot \frac{z}{x \cdot y}}{z \cdot \frac{z}{x \cdot y}}\\ \mathbf{elif}\;x \leq 1.32 \cdot 10^{+159}:\\ \;\;\;\;\frac{\frac{y}{x}}{z} + 0.5 \cdot \left(y \cdot \frac{x}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5 \cdot \left(y \cdot \left(x \cdot z\right)\right)}{x \cdot \left(z \cdot \frac{z}{x}\right)}\\ \end{array} \]

Alternative 6: 69.1% accurate, 5.1× speedup?

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

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

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

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


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

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(x \cdot \left(z \cdot 0.5\right) + \frac{z}{x}\right)}{x \cdot \left(z \cdot \frac{z}{x}\right)}} \]
    11. Step-by-step derivation
      1. expm1-log1p-u44.1%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y \cdot \left(x \cdot \left(z \cdot 0.5\right) + \frac{z}{x}\right)}{\color{blue}{\frac{x}{\frac{x}{{z}^{2}}}}} \]
      6. unpow247.2%

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

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

    if -7.6e18 < x < 4.3e157

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.3e157 < x

    1. Initial program 63.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.5 \cdot \frac{y}{\frac{z}{x}} + \color{blue}{\frac{y}{z \cdot x}} \]
      2. +-commutative47.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 68.9% accurate, 5.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.1e18 or 9.4e156 < x

    1. Initial program 72.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.5 \cdot \frac{y}{\frac{z}{x}} + \color{blue}{\frac{y}{z \cdot x}} \]
      2. +-commutative36.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e18 < x < 9.4e156

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 67.3% accurate, 7.1× speedup?

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

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

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


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

    1. Initial program 93.5%

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

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

    if -4.0000000000000001e85 < y

    1. Initial program 83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 65.7% accurate, 8.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 5000000000000:\\
\;\;\;\;\frac{\frac{y}{x} + 0.5 \cdot \left(x \cdot y\right)}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 5e12

    1. Initial program 90.3%

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

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

    if 5e12 < x

    1. Initial program 68.3%

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

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

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

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

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

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

Alternative 10: 61.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 \left(x \cdot \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{x}}{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(x * Float64(y / z)));
	else
		tmp = Float64(Float64(y / 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[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 74.8%

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

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

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

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

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

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

    if -1.3999999999999999 < x < 1.3999999999999999

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{z}} \]
    6. Simplified96.0%

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

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

Alternative 11: 65.1% accurate, 9.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.4 \lor \neg \left(x \leq 1.4\right):\\ \;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{x}}{z}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -1.4) (not (<= x 1.4))) (* 0.5 (* y (/ x z))) (/ (/ y x) z)))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -1.4) || !(x <= 1.4)) {
		tmp = 0.5 * (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 ((x <= (-1.4d0)) .or. (.not. (x <= 1.4d0))) then
        tmp = 0.5d0 * (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 ((x <= -1.4) || !(x <= 1.4)) {
		tmp = 0.5 * (y * (x / 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 * (y * (x / 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(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 ((x <= -1.4) || ~((x <= 1.4)))
		tmp = 0.5 * (y * (x / 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[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 74.8%

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

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

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

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

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

    if -1.3999999999999999 < x < 1.3999999999999999

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{z}} \]
    6. Simplified96.0%

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

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

Alternative 12: 65.5% accurate, 9.6× speedup?

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

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

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

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


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

    1. Initial program 79.1%

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

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

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

    if -1.3999999999999999 < x < 1.3999999999999999

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{z}} \]
    6. Simplified96.0%

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

    if 1.3999999999999999 < x

    1. Initial program 70.3%

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

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

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

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

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

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

Alternative 13: 54.1% accurate, 15.2× speedup?

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

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

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


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

    1. Initial program 79.8%

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

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

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

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

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

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

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

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

    if -4.99999999999999991e66 < z

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 48.9% 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.2%

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

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

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

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

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

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

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

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

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

Alternative 15: 48.3% accurate, 21.4× speedup?

\[\begin{array}{l} \\ \frac{\frac{y}{x}}{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(Float64(y / x) / z)
end
function tmp = code(x, y, z)
	tmp = (y / x) / z;
end
code[x_, y_, z_] := N[(N[(y / x), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer target: 96.4% 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 2023196 
(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))