Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 84.4% → 99.8%
Time: 12.9s
Alternatives: 19
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 19 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.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 0.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (cosh.f64 x) (/.f64 y x)) < -9.9999999999999994e303 or 5.0000000000000002e206 < (*.f64 (cosh.f64 x) (/.f64 y x))

    1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

    if -9.9999999999999994e303 < (*.f64 (cosh.f64 x) (/.f64 y x)) < 5.0000000000000002e206

    1. Initial program 99.7%

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

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

Alternative 2: 79.4% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 88.1%

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

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

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

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

    if 3.0999999999999998e222 < x

    1. Initial program 52.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{0.5 \cdot z - \color{blue}{\frac{-1 \cdot z}{{x}^{2}}}}{\frac{{z}^{2}}{y \cdot x}} \]
      3. neg-mul-130.5%

        \[\leadsto \frac{0.5 \cdot z - \frac{\color{blue}{-z}}{{x}^{2}}}{\frac{{z}^{2}}{y \cdot x}} \]
      4. unpow230.5%

        \[\leadsto \frac{0.5 \cdot z - \frac{-z}{\color{blue}{x \cdot x}}}{\frac{{z}^{2}}{y \cdot x}} \]
      5. unpow230.5%

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

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

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

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

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

Alternative 3: 84.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 81.1%

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

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

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

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

    if -8.19999999999999983e125 < y

    1. Initial program 86.7%

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

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

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

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

Alternative 4: 85.7% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 83.7%

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

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

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

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

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

    if -6.90000000000000005e39 < y

    1. Initial program 86.4%

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

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

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

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

Alternative 5: 96.2% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 68.6% accurate, 6.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.6 \cdot 10^{-58} \lor \neg \left(z \leq 5 \cdot 10^{-17}\right):\\
\;\;\;\;y \cdot \left(0.5 \cdot \frac{x}{z} - \frac{-1}{x \cdot z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.6000000000000002e-58 or 4.9999999999999999e-17 < z

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

    if -9.6000000000000002e-58 < z < 4.9999999999999999e-17

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 73.3% accurate, 6.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-37} \lor \neg \left(y \leq 5 \cdot 10^{-30}\right):\\
\;\;\;\;\frac{y}{x \cdot z} + 0.5 \cdot \frac{x \cdot y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.00000000000000007e-37 or 4.99999999999999972e-30 < y

    1. Initial program 89.9%

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

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

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

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

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

    if -1.00000000000000007e-37 < y < 4.99999999999999972e-30

    1. Initial program 80.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 65.6% accurate, 7.1× speedup?

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

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

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

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


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

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < x < 175

    1. Initial program 90.5%

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

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

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

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

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

    if 175 < x

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 65.6% accurate, 7.1× speedup?

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

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

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

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


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

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

    if -1.2200000000000001e-175 < x < 195

    1. Initial program 88.1%

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

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

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

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

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

    if 195 < x

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 65.6% accurate, 7.1× speedup?

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

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

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

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


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

    1. Initial program 92.2%

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

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

    if -1e-175 < x < 150

    1. Initial program 88.1%

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

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

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

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

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

    if 150 < x

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 65.2% accurate, 7.1× speedup?

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

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

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


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

    1. Initial program 87.4%

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

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

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

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

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

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

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

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

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

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

    if -2.4000000000000002e-43 < y

    1. Initial program 85.0%

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

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

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

Alternative 12: 67.1% accurate, 7.1× speedup?

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

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

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


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

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{\color{blue}{x \cdot -0.5} - \frac{1}{x}}{\frac{z}{y}} \]
    10. Simplified78.0%

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

    if -1.00000000000000008e-5 < y

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 65.3% accurate, 8.2× speedup?

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

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

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


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

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{\color{blue}{x \cdot -0.5} - \frac{1}{x}}{\frac{z}{y}} \]
    10. Simplified78.0%

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

    if -6.0000000000000002e-6 < y

    1. Initial program 85.9%

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

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

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

Alternative 14: 61.4% accurate, 9.6× speedup?

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

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

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


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

    1. Initial program 79.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < x < 1.3999999999999999

    1. Initial program 90.3%

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

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

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

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

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

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

Alternative 15: 65.5% accurate, 9.6× speedup?

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

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

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


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

    1. Initial program 79.4%

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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < x < 1.3999999999999999

    1. Initial program 90.3%

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

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

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

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

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

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

Alternative 16: 65.4% accurate, 9.6× speedup?

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

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

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


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

    1. Initial program 79.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < x < 1.3999999999999999

    1. Initial program 90.3%

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

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

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

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

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

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

Alternative 17: 56.3% accurate, 11.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.54 \cdot 10^{+38} \lor \neg \left(y \leq 2.3 \cdot 10^{-67}\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 -1.54e+38) (not (<= y 2.3e-67))) (/ (/ y z) x) (/ (/ y x) z)))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -1.54e+38) || !(y <= 2.3e-67)) {
		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 <= (-1.54d+38)) .or. (.not. (y <= 2.3d-67))) 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 <= -1.54e+38) || !(y <= 2.3e-67)) {
		tmp = (y / z) / x;
	} else {
		tmp = (y / x) / z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -1.54e+38) or not (y <= 2.3e-67):
		tmp = (y / z) / x
	else:
		tmp = (y / x) / z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -1.54e+38) || !(y <= 2.3e-67))
		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 <= -1.54e+38) || ~((y <= 2.3e-67)))
		tmp = (y / z) / x;
	else
		tmp = (y / x) / z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.54e+38], N[Not[LessEqual[y, 2.3e-67]], $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.54 \cdot 10^{+38} \lor \neg \left(y \leq 2.3 \cdot 10^{-67}\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 < -1.54000000000000004e38 or 2.3e-67 < y

    1. Initial program 89.3%

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

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

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

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

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

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

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

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

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

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

    if -1.54000000000000004e38 < y < 2.3e-67

    1. Initial program 81.9%

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

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

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

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

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

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

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

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

Alternative 18: 50.2% accurate, 15.2× speedup?

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

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

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


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

    1. Initial program 87.2%

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

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

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

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

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

    if -1.8500000000000001e-41 < y

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

Alternative 19: 48.8% accurate, 21.4× speedup?

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

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

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

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

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

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

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

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

Developer target: 97.0% 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 2023279 
(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))