Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 85.3% → 99.8%
Time: 8.7s
Alternatives: 14
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 14 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.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (cosh.f64 x) (/.f64 y x)) < -5.00000000000000016e285 or 9.9999999999999992e248 < (*.f64 (cosh.f64 x) (/.f64 y x))

    1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000016e285 < (*.f64 (cosh.f64 x) (/.f64 y x)) < 9.9999999999999992e248

    1. Initial program 99.9%

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

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

Alternative 2: 98.6% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2e-99 or 3.00000000000000012e-135 < z

    1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2e-99 < z < 3.00000000000000012e-135

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.6% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.5000000000000005e86 or 2e9 < y

    1. Initial program 85.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.5000000000000005e86 < y < 2e9

    1. Initial program 74.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 95.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 66.6% accurate, 5.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -195000 or 2.10000000000000013e-38 < x

    1. Initial program 67.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -195000 < x < 2.10000000000000013e-38

    1. Initial program 89.4%

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

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

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

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

        \[\leadsto \frac{\color{blue}{1 \cdot y}}{x \cdot z} \]
      2. times-frac90.0%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{y}{z}}}{x} \]
    8. Applied egg-rr90.2%

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

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

Alternative 6: 65.5% accurate, 8.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 62.3% accurate, 9.6× speedup?

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

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

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


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

    1. Initial program 68.1%

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

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

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

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

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

    if -350 < x < 1.44999999999999996

    1. Initial program 88.8%

      \[\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 91.8%

      \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
    5. Step-by-step derivation
      1. *-un-lft-identity91.8%

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

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

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

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

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

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

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

Alternative 8: 62.4% accurate, 9.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -350 \lor \neg \left(x \leq 1.42\right):\\ \;\;\;\;x \cdot \left(y \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 -350.0) (not (<= x 1.42))) (* x (* y (/ 0.5 z))) (/ (/ y z) x)))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -350.0) || !(x <= 1.42)) {
		tmp = x * (y * (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 <= (-350.0d0)) .or. (.not. (x <= 1.42d0))) then
        tmp = x * (y * (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 <= -350.0) || !(x <= 1.42)) {
		tmp = x * (y * (0.5 / z));
	} else {
		tmp = (y / z) / x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -350.0) or not (x <= 1.42):
		tmp = x * (y * (0.5 / z))
	else:
		tmp = (y / z) / x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -350.0) || !(x <= 1.42))
		tmp = Float64(x * Float64(y * 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 <= -350.0) || ~((x <= 1.42)))
		tmp = x * (y * (0.5 / z));
	else
		tmp = (y / z) / x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -350.0], N[Not[LessEqual[x, 1.42]], $MachinePrecision]], N[(x * N[(y * N[(0.5 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -350 \lor \neg \left(x \leq 1.42\right):\\
\;\;\;\;x \cdot \left(y \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 < -350 or 1.4199999999999999 < x

    1. Initial program 68.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -350 < x < 1.4199999999999999

    1. Initial program 88.8%

      \[\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 91.8%

      \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
    5. Step-by-step derivation
      1. *-un-lft-identity91.8%

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

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

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

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

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

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

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

Alternative 9: 65.7% accurate, 9.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -350 \lor \neg \left(x \leq 1.42\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 -350.0) (not (<= x 1.42))) (* y (* x (/ 0.5 z))) (/ (/ y z) x)))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -350.0) || !(x <= 1.42)) {
		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 <= (-350.0d0)) .or. (.not. (x <= 1.42d0))) 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 <= -350.0) || !(x <= 1.42)) {
		tmp = y * (x * (0.5 / z));
	} else {
		tmp = (y / z) / x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -350.0) or not (x <= 1.42):
		tmp = y * (x * (0.5 / z))
	else:
		tmp = (y / z) / x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -350.0) || !(x <= 1.42))
		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 <= -350.0) || ~((x <= 1.42)))
		tmp = y * (x * (0.5 / z));
	else
		tmp = (y / z) / x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -350.0], N[Not[LessEqual[x, 1.42]], $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 -350 \lor \neg \left(x \leq 1.42\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 < -350 or 1.4199999999999999 < x

    1. Initial program 68.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -350 < x < 1.4199999999999999

    1. Initial program 88.8%

      \[\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 91.8%

      \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
    5. Step-by-step derivation
      1. *-un-lft-identity91.8%

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

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

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

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

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

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

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

Alternative 10: 62.4% accurate, 9.6× speedup?

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

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

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

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


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

    1. Initial program 64.8%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.5}{\frac{z}{y}} \cdot x} \]
      3. metadata-eval23.7%

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

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

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

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

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

    if -350 < x < 1.4199999999999999

    1. Initial program 88.8%

      \[\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 91.8%

      \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
    5. Step-by-step derivation
      1. *-un-lft-identity91.8%

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

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

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

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

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

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

    if 1.4199999999999999 < x

    1. Initial program 70.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 65.9% accurate, 9.6× speedup?

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

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

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

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


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

    1. Initial program 64.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -350 < x < 1.4199999999999999

    1. Initial program 88.8%

      \[\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 91.8%

      \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
    5. Step-by-step derivation
      1. *-un-lft-identity91.8%

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

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

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

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

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

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

    if 1.4199999999999999 < x

    1. Initial program 70.8%

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

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

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

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

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

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

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

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

Alternative 12: 52.7% accurate, 11.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+88} \lor \neg \left(y \leq 5 \cdot 10^{+20}\right):\\
\;\;\;\;\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 < -9.99999999999999959e87 or 5e20 < y

    1. Initial program 85.5%

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

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

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

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

    if -9.99999999999999959e87 < y < 5e20

    1. Initial program 74.8%

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

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

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

Alternative 13: 55.1% accurate, 15.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 10^{-78}:\\
\;\;\;\;\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 < 9.99999999999999999e-79

    1. Initial program 81.4%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{y}{z}}}{x} \]
    8. Applied egg-rr59.5%

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

    if 9.99999999999999999e-79 < z

    1. Initial program 74.2%

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

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

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

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

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

Alternative 14: 49.4% 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 79.2%

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

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

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

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

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

Developer target: 97.1% 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 2023318 
(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))