Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 85.1% → 97.6%
Time: 11.2s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 85.1% 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.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 89.1%

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

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

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

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

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

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

    if -4.9999999999999996e-41 < y

    1. Initial program 81.7%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Step-by-step derivation
      1. expm1-log1p-u44.1%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 84.5% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x \leq -3 \cdot 10^{-25} \lor \neg \left(x \leq 1.2 \cdot 10^{-101}\right):\\
\;\;\;\;\frac{\cosh x}{z} \cdot \frac{y}{x}\\

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


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

    1. Initial program 63.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. Step-by-step derivation
      1. associate-*l/70.7%

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

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

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

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

    if -6.80000000000000035e134 < x < -2.9999999999999998e-25 or 1.2e-101 < x

    1. Initial program 87.7%

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

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

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

    if -2.9999999999999998e-25 < x < 1.2e-101

    1. Initial program 86.7%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.8 \cdot 10^{+134}:\\ \;\;\;\;\frac{\frac{y \cdot \frac{\frac{z}{y}}{x}}{x} + z \cdot 0.5}{z \cdot \frac{z}{y \cdot x}}\\ \mathbf{elif}\;x \leq -3 \cdot 10^{-25} \lor \neg \left(x \leq 1.2 \cdot 10^{-101}\right):\\ \;\;\;\;\frac{\cosh x}{z} \cdot \frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{z}\right) + \frac{y}{x \cdot z}\\ \end{array} \]

Alternative 3: 85.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+136} \lor \neg \left(z \leq 9.6 \cdot 10^{+238}\right):\\
\;\;\;\;\frac{\cosh x}{z} \cdot \frac{y}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.3999999999999999e136 or 9.6e238 < z

    1. Initial program 86.5%

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

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

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

    if -4.3999999999999999e136 < z < 9.6e238

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 96.9% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

    if -1.06e30 < y

    1. Initial program 83.3%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Step-by-step derivation
      1. expm1-log1p-u43.4%

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

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

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

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

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

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

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

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

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

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

Alternative 5: 68.6% accurate, 3.7× speedup?

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

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

\mathbf{elif}\;x \leq 1.3 \cdot 10^{-242}:\\
\;\;\;\;\frac{y}{x \cdot z} + \frac{0.5}{t_0}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.24999999999999999e88 or 5.6000000000000003e222 < x

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. Step-by-step derivation
      1. associate-*l/70.8%

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

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

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

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

    if -1.24999999999999999e88 < x < 1.30000000000000009e-242

    1. Initial program 91.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{0.5}{\color{blue}{\frac{\frac{z}{y}}{x}}} + \frac{y}{x \cdot z} \]
    12. Simplified84.0%

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

    if 1.30000000000000009e-242 < x < 490

    1. Initial program 90.7%

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

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

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

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

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

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

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

    if 490 < x < 5.6000000000000003e222

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{+88}:\\ \;\;\;\;\frac{\frac{y \cdot \frac{\frac{z}{y}}{x}}{x} + z \cdot 0.5}{z \cdot \frac{z}{y \cdot x}}\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{-242}:\\ \;\;\;\;\frac{y}{x \cdot z} + \frac{0.5}{\frac{\frac{z}{y}}{x}}\\ \mathbf{elif}\;x \leq 490:\\ \;\;\;\;\frac{\frac{y}{z}}{x}\\ \mathbf{elif}\;x \leq 5.6 \cdot 10^{+222}:\\ \;\;\;\;\frac{\left(x \cdot z\right) \cdot \left(x \cdot \left(y \cdot 0.5\right)\right) + y \cdot z}{z \cdot \left(x \cdot z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y \cdot \frac{\frac{z}{y}}{x}}{x} + z \cdot 0.5}{z \cdot \frac{z}{y \cdot x}}\\ \end{array} \]

Alternative 6: 66.1% accurate, 4.2× speedup?

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

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

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

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

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


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

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.99999999999999979e90 < x < 3.3e-251

    1. Initial program 91.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{0.5}{\color{blue}{\frac{\frac{z}{y}}{x}}} + \frac{y}{x \cdot z} \]
    12. Simplified84.0%

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

    if 3.3e-251 < x < 17

    1. Initial program 90.7%

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

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

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

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

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

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

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

    if 17 < x

    1. Initial program 77.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3 \cdot 10^{+90}:\\ \;\;\;\;\frac{z \cdot 0.5 + \frac{y}{x} \cdot \frac{z}{y \cdot x}}{z \cdot \frac{z}{y \cdot x}}\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{-251}:\\ \;\;\;\;\frac{y}{x \cdot z} + \frac{0.5}{\frac{\frac{z}{y}}{x}}\\ \mathbf{elif}\;x \leq 17:\\ \;\;\;\;\frac{\frac{y}{z}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x \cdot z\right) \cdot \left(x \cdot \left(y \cdot 0.5\right)\right) + y \cdot z}{z \cdot \left(x \cdot z\right)}\\ \end{array} \]

Alternative 7: 64.8% accurate, 4.6× speedup?

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

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

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

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


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

    1. Initial program 84.9%

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

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

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

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

    if 6.20000000000000006e-245 < x < 370

    1. Initial program 90.7%

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

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

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

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

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

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

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

    if 370 < x

    1. Initial program 77.9%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 69.3% accurate, 6.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.7 \cdot 10^{+82} \lor \neg \left(z \leq 3 \cdot 10^{-45}\right):\\
\;\;\;\;\frac{y}{x \cdot z} + 0.5 \cdot \frac{y \cdot x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.7e82 or 3.00000000000000011e-45 < z

    1. Initial program 75.6%

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

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

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

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

    if -4.7e82 < z < 3.00000000000000011e-45

    1. Initial program 90.9%

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

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

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

Alternative 9: 65.5% accurate, 8.1× speedup?

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

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

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

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

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


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

    1. Initial program 78.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.44999999999999996 < x < 5.20000000000000013e-248

    1. Initial program 88.7%

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

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

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

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

    if 5.20000000000000013e-248 < x < 1.44999999999999996

    1. Initial program 90.7%

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

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

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

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

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

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

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

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

Alternative 10: 65.7% accurate, 8.1× speedup?

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

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

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

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

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


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

    1. Initial program 78.9%

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

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

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

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

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

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

    if -1.44999999999999996 < x < 9.99999999999999943e-253

    1. Initial program 88.7%

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

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

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

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

    if 9.99999999999999943e-253 < x < 1.44999999999999996

    1. Initial program 90.7%

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

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

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

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

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

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

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

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

Alternative 11: 65.9% accurate, 8.2× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 12: 65.6% accurate, 9.7× speedup?

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

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

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

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

    \[\leadsto \color{blue}{\frac{y \cdot \left(0.5 \cdot x + \frac{1}{x}\right)}{z}} \]
  4. Final simplification68.7%

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

Alternative 13: 65.7% accurate, 9.7× speedup?

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

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

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

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

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

Alternative 14: 57.3% accurate, 11.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+26} \lor \neg \left(y \leq 1.9 \cdot 10^{-64}\right):\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.00000000000000038e26 or 1.9000000000000001e-64 < y

    1. Initial program 90.6%

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

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

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

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

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

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

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

    if -8.00000000000000038e26 < y < 1.9000000000000001e-64

    1. Initial program 76.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{+26} \lor \neg \left(y \leq 1.9 \cdot 10^{-64}\right):\\ \;\;\;\;\frac{\frac{y}{z}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{x}}{z}\\ \end{array} \]

Alternative 15: 51.0% accurate, 15.2× speedup?

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

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

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


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

    1. Initial program 89.7%

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

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

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

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

    if -2.8999999999999999e-60 < y

    1. Initial program 81.2%

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

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

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

Alternative 16: 49.7% accurate, 21.4× speedup?

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

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

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

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

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

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

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

Developer target: 96.9% 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 2023308 
(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))