Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 84.7% → 98.2%
Time: 7.5s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 84.7% accurate, 1.0× speedup?

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

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

Alternative 1: 98.2% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 97.4%

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

    if 2.00000000000000008e192 < (*.f64 (cosh.f64 x) (/.f64 y x))

    1. Initial program 66.0%

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

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

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

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

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

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

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

Alternative 2: 90.9% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 84.1%

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

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

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

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

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

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

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

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

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

    if 3.3999999999999999e211 < z

    1. Initial program 95.1%

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

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

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

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

Alternative 3: 90.9% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 84.1%

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

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

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

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

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

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

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

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

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

    if 1.09999999999999998e212 < z

    1. Initial program 95.1%

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

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

Alternative 4: 90.0% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 65.7% accurate, 7.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+48} \lor \neg \left(x \leq 10^{+14}\right):\\
\;\;\;\;y \cdot \left(x \cdot \frac{0.5}{z}\right)\\

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


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

    1. Initial program 72.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot 0.5}{z} \cdot y} \]
      2. *-un-lft-identity37.2%

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

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

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

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

    if -1.5e48 < x < 1e14

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 67.2% accurate, 7.1× speedup?

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

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

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


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

    1. Initial program 80.3%

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

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

    if 2.30000000000000016e-183 < y

    1. Initial program 91.6%

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

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

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

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

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

Alternative 7: 61.8% accurate, 9.6× speedup?

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

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

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


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

    1. Initial program 75.2%

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot 0.5}{\color{blue}{1 \cdot \frac{z}{y}}} \]
      2. times-frac23.4%

        \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{0.5}{\frac{z}{y}}} \]
      3. /-rgt-identity23.4%

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

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

    if -1.3999999999999999 < x < 1.30000000000000004

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

Alternative 8: 65.6% accurate, 9.6× speedup?

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

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

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


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

    1. Initial program 75.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot 0.5}{z} \cdot y} \]
      2. *-un-lft-identity34.6%

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

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

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

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

    if -1.3999999999999999 < x < 1.30000000000000004

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

Alternative 9: 66.1% 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.9%

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

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

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

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

Alternative 10: 66.2% accurate, 9.7× speedup?

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

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

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

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

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

Alternative 11: 50.2% accurate, 15.2× speedup?

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

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

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


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

    1. Initial program 80.3%

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

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

    if 2.30000000000000016e-183 < y

    1. Initial program 91.6%

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

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

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

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

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

Alternative 12: 55.2% accurate, 15.2× speedup?

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

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

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


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

    1. Initial program 84.3%

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

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

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

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

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

    if 1.99999999999999989e34 < z

    1. Initial program 87.2%

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

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

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

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

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

Alternative 13: 49.2% 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.9%

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

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

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

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

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

Developer target: 96.8% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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