Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 84.7% → 97.2%
Time: 8.0s
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: 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: 97.2% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 97.8%

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

    if 3.99999999999999979e49 < (*.f64 (cosh.f64 x) (/.f64 y x))

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 87.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 50.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.4999999999999995e167 < x

    1. Initial program 89.0%

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

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

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

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

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

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

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

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

Alternative 3: 96.3% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 68.7% accurate, 5.1× speedup?

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

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

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

\mathbf{elif}\;x \leq 2.8 \cdot 10^{+127}:\\
\;\;\;\;\frac{y \cdot 0.5}{x} \cdot \frac{x \cdot z}{z \cdot \frac{z}{x}}\\

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


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

    1. Initial program 65.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2e40 < x < 125000

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

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

    if 125000 < x < 2.8000000000000002e127

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot 0.5}}{x} \cdot \frac{z \cdot x}{z \cdot \frac{z}{x}} \]
    13. Applied egg-rr60.5%

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

    if 2.8000000000000002e127 < x

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{+40}:\\ \;\;\;\;\frac{\left(y \cdot \left(x \cdot z\right)\right) \cdot 0.5}{z \cdot z}\\ \mathbf{elif}\;x \leq 125000:\\ \;\;\;\;y \cdot \left(0.5 \cdot \frac{x}{z} + \frac{\frac{1}{x}}{z}\right)\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{+127}:\\ \;\;\;\;\frac{y \cdot 0.5}{x} \cdot \frac{x \cdot z}{z \cdot \frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{x \cdot z} \cdot \frac{y \cdot \left(x \cdot z\right)}{\frac{z}{x}}\\ \end{array} \]

Alternative 5: 74.7% accurate, 5.6× speedup?

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

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

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


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

    1. Initial program 75.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.3999999999999999e39 < x < 125000

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 78.2% accurate, 5.6× speedup?

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

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

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


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

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.15e7 < x < 125000

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 67.9% accurate, 5.6× speedup?

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

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

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

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


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

    1. Initial program 65.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.3999999999999999e39 < x < 1.2e121

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

    if 1.2e121 < x

    1. Initial program 71.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{+39}:\\ \;\;\;\;\frac{\left(y \cdot \left(x \cdot z\right)\right) \cdot 0.5}{z \cdot z}\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{+121}:\\ \;\;\;\;y \cdot \left(0.5 \cdot \frac{x}{z} + \frac{\frac{1}{x}}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{x \cdot z} \cdot \frac{y \cdot \left(x \cdot z\right)}{\frac{z}{x}}\\ \end{array} \]

Alternative 8: 68.7% accurate, 7.1× speedup?

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

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

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


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

    1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{0.5 \cdot \left(y \cdot \left(z \cdot x\right)\right)}{\color{blue}{{z}^{2}}} \]
    13. Step-by-step derivation
      1. unpow254.0%

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

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

    if -960 < x < 125000

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

Alternative 9: 67.6% accurate, 7.1× speedup?

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

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

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


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

    1. Initial program 65.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.1999999999999997e39 < x

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 67.0% accurate, 9.6× speedup?

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

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

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


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

    1. Initial program 76.2%

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

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

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

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

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

    if -1.44999999999999996 < x < 1.3999999999999999

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

Alternative 11: 67.1% accurate, 9.6× speedup?

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

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

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

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


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

    1. Initial program 68.0%

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

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

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

    if -1.44999999999999996 < x < 1.3999999999999999

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

    if 1.3999999999999999 < x

    1. Initial program 81.8%

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

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

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

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

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

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

Alternative 12: 57.8% accurate, 11.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-65} \lor \neg \left(y \leq 5.5 \cdot 10^{-21}\right):\\
\;\;\;\;\frac{\frac{y}{z}}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.99999999999999923e-66 or 5.49999999999999977e-21 < y

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999923e-66 < y < 5.49999999999999977e-21

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 52.0% accurate, 15.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.2 \cdot 10^{-64}:\\
\;\;\;\;\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 z < 4.20000000000000023e-64

    1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

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

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

    if 4.20000000000000023e-64 < z

    1. Initial program 76.2%

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

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

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

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

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

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

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

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

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

Alternative 14: 50.3% 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.4%

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

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

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

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

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

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

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

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

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

Developer target: 97.2% 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 2023262 
(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))